diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-17 01:10:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-17 08:23:03 -0400 |
commit | eefaca9c3246f3daf56e7ed02987f79abcee7087 (patch) | |
tree | 1eac21979f536f7a08ae77d4b59f1c615eef5b94 /Documentation/vm/slabinfo.c | |
parent | ade3aff25fb2dce76e2a9b53e1334bd0a174f739 (diff) |
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>
Diffstat (limited to 'Documentation/vm/slabinfo.c')
-rw-r--r-- | Documentation/vm/slabinfo.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c index 686a8e04a4f3..434af27a32ac 100644 --- a/Documentation/vm/slabinfo.c +++ b/Documentation/vm/slabinfo.c | |||
@@ -242,6 +242,9 @@ void decode_numa_list(int *numa, char *t) | |||
242 | 242 | ||
243 | memset(numa, 0, MAX_NODES * sizeof(int)); | 243 | memset(numa, 0, MAX_NODES * sizeof(int)); |
244 | 244 | ||
245 | if (!t) | ||
246 | return; | ||
247 | |||
245 | while (*t == 'N') { | 248 | while (*t == 'N') { |
246 | t++; | 249 | t++; |
247 | node = strtoul(t, &t, 10); | 250 | node = strtoul(t, &t, 10); |
@@ -386,7 +389,9 @@ void report(struct slabinfo *s) | |||
386 | { | 389 | { |
387 | if (strcmp(s->name, "*") == 0) | 390 | if (strcmp(s->name, "*") == 0) |
388 | return; | 391 | return; |
389 | printf("\nSlabcache: %-20s Aliases: %2d Order : %2d\n", s->name, s->aliases, s->order); | 392 | |
393 | printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %d\n", | ||
394 | s->name, s->aliases, s->order, s->objects); | ||
390 | if (s->hwcache_align) | 395 | if (s->hwcache_align) |
391 | printf("** Hardware cacheline aligned\n"); | 396 | printf("** Hardware cacheline aligned\n"); |
392 | if (s->cache_dma) | 397 | if (s->cache_dma) |
@@ -791,11 +796,11 @@ void totals(void) | |||
791 | 796 | ||
792 | store_size(b1, total_size);store_size(b2, total_waste); | 797 | store_size(b1, total_size);store_size(b2, total_waste); |
793 | store_size(b3, total_waste * 100 / total_used); | 798 | store_size(b3, total_waste * 100 / total_used); |
794 | printf("Memory used: %6s # Loss : %6s MRatio: %6s%%\n", b1, b2, b3); | 799 | printf("Memory used: %6s # Loss : %6s MRatio:%6s%%\n", b1, b2, b3); |
795 | 800 | ||
796 | store_size(b1, total_objects);store_size(b2, total_partobj); | 801 | store_size(b1, total_objects);store_size(b2, total_partobj); |
797 | store_size(b3, total_partobj * 100 / total_objects); | 802 | store_size(b3, total_partobj * 100 / total_objects); |
798 | printf("# Objects : %6s # PartObj: %6s ORatio: %6s%%\n", b1, b2, b3); | 803 | printf("# Objects : %6s # PartObj: %6s ORatio:%6s%%\n", b1, b2, b3); |
799 | 804 | ||
800 | printf("\n"); | 805 | printf("\n"); |
801 | printf("Per Cache Average Min Max Total\n"); | 806 | printf("Per Cache Average Min Max Total\n"); |
@@ -818,7 +823,7 @@ void totals(void) | |||
818 | store_size(b1, avg_ppart);store_size(b2, min_ppart); | 823 | store_size(b1, avg_ppart);store_size(b2, min_ppart); |
819 | store_size(b3, max_ppart); | 824 | store_size(b3, max_ppart); |
820 | store_size(b4, total_partial * 100 / total_slabs); | 825 | store_size(b4, total_partial * 100 / total_slabs); |
821 | printf("%%PartSlab %10s%% %10s%% %10s%% %10s%%\n", | 826 | printf("%%PartSlab%10s%% %10s%% %10s%% %10s%%\n", |
822 | b1, b2, b3, b4); | 827 | b1, b2, b3, b4); |
823 | 828 | ||
824 | store_size(b1, avg_partobj);store_size(b2, min_partobj); | 829 | store_size(b1, avg_partobj);store_size(b2, min_partobj); |
@@ -830,7 +835,7 @@ void totals(void) | |||
830 | store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj); | 835 | store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj); |
831 | store_size(b3, max_ppartobj); | 836 | store_size(b3, max_ppartobj); |
832 | store_size(b4, total_partobj * 100 / total_objects); | 837 | store_size(b4, total_partobj * 100 / total_objects); |
833 | printf("%% PartObj %10s%% %10s%% %10s%% %10s%%\n", | 838 | printf("%% PartObj%10s%% %10s%% %10s%% %10s%%\n", |
834 | b1, b2, b3, b4); | 839 | b1, b2, b3, b4); |
835 | 840 | ||
836 | store_size(b1, avg_size);store_size(b2, min_size); | 841 | store_size(b1, avg_size);store_size(b2, min_size); |
@@ -1100,6 +1105,8 @@ void output_slabs(void) | |||
1100 | ops(slab); | 1105 | ops(slab); |
1101 | else if (show_slab) | 1106 | else if (show_slab) |
1102 | slabcache(slab); | 1107 | slabcache(slab); |
1108 | else if (show_report) | ||
1109 | report(slab); | ||
1103 | } | 1110 | } |
1104 | } | 1111 | } |
1105 | 1112 | ||