Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eefaca9c authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

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: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ade3aff2
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -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);
	}
}