diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-14 11:52:05 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-04-14 11:52:05 -0400 |
commit | 50ef37b96c11e76625067ae413dc54585ea22585 (patch) | |
tree | 73db9f19fe8d4b0d153711b0002948e13a8d5681 | |
parent | 5b06c853ad447636e31d105e95c48ae9abb6bfb5 (diff) |
slub: Fixes to per cpu stat output in sysfs
Only output per cpu stats if the kernel is build for SMP.
Use a capital "C" as a leading character for the processor number
(same as the numa statistics that also use a capital letter "N").
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
-rw-r--r-- | mm/slub.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3979,10 +3979,12 @@ static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si) | |||
3979 | 3979 | ||
3980 | len = sprintf(buf, "%lu", sum); | 3980 | len = sprintf(buf, "%lu", sum); |
3981 | 3981 | ||
3982 | #ifdef CONFIG_SMP | ||
3982 | for_each_online_cpu(cpu) { | 3983 | for_each_online_cpu(cpu) { |
3983 | if (data[cpu] && len < PAGE_SIZE - 20) | 3984 | if (data[cpu] && len < PAGE_SIZE - 20) |
3984 | len += sprintf(buf + len, " c%d=%u", cpu, data[cpu]); | 3985 | len += sprintf(buf + len, " C%d=%u", cpu, data[cpu]); |
3985 | } | 3986 | } |
3987 | #endif | ||
3986 | kfree(data); | 3988 | kfree(data); |
3987 | return len + sprintf(buf + len, "\n"); | 3989 | return len + sprintf(buf + len, "\n"); |
3988 | } | 3990 | } |