SLUB: slabinfo fixes
Align the output of % with K/M/G of sizes. Check for empty NUMA information to avoid segfault on !NUMA. -r should work directly not only if we match a single slab without additional options. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ade3aff25f
commit
eefaca9c32
@ -242,6 +242,9 @@ void decode_numa_list(int *numa, char *t)
|
||||
|
||||
memset(numa, 0, MAX_NODES * sizeof(int));
|
||||
|
||||
if (!t)
|
||||
return;
|
||||
|
||||
while (*t == 'N') {
|
||||
t++;
|
||||
node = strtoul(t, &t, 10);
|
||||
@ -386,7 +389,9 @@ void report(struct slabinfo *s)
|
||||
{
|
||||
if (strcmp(s->name, "*") == 0)
|
||||
return;
|
||||
printf("\nSlabcache: %-20s Aliases: %2d Order : %2d\n", s->name, s->aliases, s->order);
|
||||
|
||||
printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %d\n",
|
||||
s->name, s->aliases, s->order, s->objects);
|
||||
if (s->hwcache_align)
|
||||
printf("** Hardware cacheline aligned\n");
|
||||
if (s->cache_dma)
|
||||
@ -1100,6 +1105,8 @@ void output_slabs(void)
|
||||
ops(slab);
|
||||
else if (show_slab)
|
||||
slabcache(slab);
|
||||
else if (show_report)
|
||||
report(slab);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user