Skip to content
Snippets Groups Projects
  • Erwan Velu's avatar
    tools/dirtop: Adding dirtop utility (#2819) · 8c127942
    Erwan Velu authored
    
    This tools is about reporting IOs per directory.
    That's a clone of filetop but works in a different way :
    - user specify a set of globs to select a list of directories to watch
    - dirtop extracts the inode_id of the selected directories
    - the bpf program receives the list of top directories to consider
    - when vfs_{read|write} occurs, the bpf program check
      if one of the parents is part of the list we search for
    - if it matches, the io is accounted
    
    On the python side, the program will reconcilate IOs per directory and print stats.
    
    While filetop list the programs and filename, dirtop only list the directory name.
    
    A typical usages looks like :
    
    	[root@host]: dirtop.py -d '/hdfs/uuid/*/yarn'
    	14:56:33 loadavg: 52.21 48.81 37.78 53/2721 28720
    
    	READS  WRITES R_Kb     W_Kb     PATH
    	36821  7632   238219   149183   /hdfs/uuid/d04fccd8-bc72-4ed9-bda4-c5b6893f1405/yarn
    	20823  2      196290   3        /hdfs/uuid/b94cbf3f-76b1-4ced-9043-02d450b9887c/yarn
    	16059  12064  109748   85778    /hdfs/uuid/250b21c8-1714-45fe-8c08-d45d0271c6bd/yarn
    	14128  20360  106287   81440    /hdfs/uuid/4a833770-767e-43b3-b696-dc98901bce26/yarn
    	15883  4991   86014    82075    /hdfs/uuid/0cc3683f-4800-4c73-8075-8d77dc7cf116/yarn
    	11182  4485   28834    116917   /hdfs/uuid/7d512fe7-b20d-464c-a75a-dbf8b687ee1c/yarn
    	11848  7810   103139   31240    /hdfs/uuid/2c6a7223-cb18-4916-a1b6-8cd02bda1d31/yarn
    	10418  1272   114842   18       /hdfs/uuid/76dc0b77-e2fd-4476-818f-2b5c3c452396/yarn
    	10066  6630   93969    20218    /hdfs/uuid/c11da291-28de-4a77-873e-44bb452d238b/yarn
    	13648  15453  39450    53744    /hdfs/uuid/99c178d5-a209-4af2-8467-7382c7f03c1b/yarn
    	9509   2049   31363    48219    /hdfs/uuid/a78f846a-58c4-4d10-a9f5-42f16a6134a0/yarn
    	8112   2178   13765    63479    /hdfs/uuid/bf829d08-1455-45b8-81fa-05c3303e8c45/yarn
    	4327   0      37544    0        /hdfs/uuid/fada8004-53ff-48df-9396-165d8e42925b/yarn
    	2238   2742   72       50       /hdfs/uuid/b3b2a2ed-f6c1-4641-86bf-2989dd932411/yarn
    	3716   0      47       0        /hdfs/uuid/8138a53b-b942-44d3-82df-51575f1a3901/yarn
    
    Signed-off-by: default avatarErwan Velu <e.velu@criteo.com>
    
    Co-authored-by: default avatarErwan Velu <e.velu@criteo.com>
    Unverified
    8c127942