[Crash-utility] [PATCH 0/2] Move NAME column in "kmem -s" output to the last of line

Dave Anderson anderson at redhat.com
Wed Aug 8 18:24:32 UTC 2018


Kazu,

Nicely done!  It's a huge improvement in readability, cleans up some
unnecessary duplication, and tests well on all of my old and new
kernel dumpfiles that I have on hand.  Queued for crash-7.2.4:

  https://github.com/crash-utility/crash/commit/455da1ae5c7f22ba870aa57e071dad340749bdcd

Thanks,
  Dave


----- Original Message -----
> Nowadays, "kmem -s" output can have long lines due to cache name with
> memcg name, and I don't think that it's human-readable as it is.
> 
> crash> kmem -s
> CACHE            NAME                 OBJSIZE  ALLOCATED     TOTAL  SLABS
> SSIZE
> ffff8a1522c15380 kmalloc-128(12536:session-11.scope) 128  111       128
> 4     4k
> ffff8a1522c15200 radix_tree_node(12536:session-11.scope) 576  340
> 434     31     8k
> ffff8a1523d15380 xfs_inode(12536:session-11.scope) 904  1567      1581     93
> 16k
> ffff8a1522c15080 nfs_inode_cache(12536:session-11.scope) 1072  140
> 165     11    16k
> ffff8a1523d14c00 shmem_inode_cache(12536:session-11.scope) 696  0
> 46      2    16k
> 
> So, can we move the 'NAME' column to the last of line like this?
> 
> crash> kmem -s
> CACHE             OBJSIZE  ALLOCATED     TOTAL  SLABS  SSIZE  NAME
> ffff8a1522c15380      128        111       128      4     4k
> kmalloc-128(12536:session-11.scope)
> ffff8a1522c15200      576        340       434     31     8k
> radix_tree_node(12536:session-11.scope)
> ffff8a1523d15380      904       1567      1581     93    16k
> xfs_inode(12536:session-11.scope)
> ffff8a1522c15080     1072        140       165     11    16k
> nfs_inode_cache(12536:session-11.scope)
> ffff8a1523d14c00      696          0        46      2    16k
> shmem_inode_cache(12536:session-11.scope)
> 
> If we can, crash has the three functions to print them for each slab/slub
> version and I think that it would be good to change all of them together.
> Fortunately, the header is same among them, and it looks like we can unify
> them into one function. [Patch 1]
> 
> And then, move it to the last of line. [Patch 2]
> 
> I tested this with some vmcores having PERCPU_KMALLOC_V2 or KMALLOC_SLUB
> and found no problem, but I don't have any vmcores having PERCPU_KMALLOC_V1
> or no flag.
> 
> Kazuhito Hagio (2):
>   Unify the three functions printing "kmem -s" line into one function
>   Move NAME column in "kmem -s" output to the last of line
> 
>  help.c   | 136
>  +++++++++++++++++++++++++++++++--------------------------------
>  memory.c | 132 +++++++++++++++----------------------------------------------
>  2 files changed, 99 insertions(+), 169 deletions(-)
> 
> --
> 1.8.3.1
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 




More information about the Crash-utility mailing list