Commit 0c6856f702732d3cfc33eb59303e998ad6961de8
Committed by
Linus Torvalds
1 parent
57136ca6d5
Exists in
master
and in
4 other branches
[PATCH] oprofile: Fix unnecessary cleverness
nmi_create_files() in arch/i386/oprofile/nmi_int.c depends on model->num_counters (number of performance counters) being less than 10. While this is currently the case, it's too clever by half. Other archs aren't quite as clever: they assume 100. I suggest to normalize them all to 1000. Cc: Philippe Elie <phil.el@wanadoo.fr> Cc: John Levon <levon@movementarian.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 5 changed files with 6 additions and 6 deletions Side-by-side Diff
arch/alpha/oprofile/common.c
arch/i386/oprofile/nmi_int.c
| ... | ... | @@ -281,9 +281,9 @@ |
| 281 | 281 | |
| 282 | 282 | for (i = 0; i < model->num_counters; ++i) { |
| 283 | 283 | struct dentry * dir; |
| 284 | - char buf[2]; | |
| 284 | + char buf[4]; | |
| 285 | 285 | |
| 286 | - snprintf(buf, 2, "%d", i); | |
| 286 | + snprintf(buf, sizeof(buf), "%d", i); | |
| 287 | 287 | dir = oprofilefs_mkdir(sb, root, buf); |
| 288 | 288 | oprofilefs_create_ulong(sb, dir, "enabled", &counter_config[i].enabled); |
| 289 | 289 | oprofilefs_create_ulong(sb, dir, "event", &counter_config[i].event); |
arch/mips/oprofile/common.c
arch/powerpc/oprofile/common.c
arch/sh/oprofile/op_model_sh7750.c