iovisor/bcc

print_log2_hist to strip leading zeros

Aperta

#1109 aperta il 12 apr 2017

 (3 commenti) (0 reazioni) (0 assegnatari)C (4072 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (22.626 stelle)
Metriche merge PR
 (Merge medio 12g 6h) (12 PR mergiate in 30 g)

Descrizione

Instead of this:

# ./funclatency vfs_write
Tracing 1 functions for "vfs_write"... Hit Ctrl-C to end.
^C
     nsecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 0        |                                        |
        32 -> 63         : 0        |                                        |
        64 -> 127        : 0        |                                        |
       128 -> 255        : 0        |                                        |
       256 -> 511        : 0        |                                        |
       512 -> 1023       : 0        |                                        |
      1024 -> 2047       : 1        |                                        |
      2048 -> 4095       : 400      |*                                       |
      4096 -> 8191       : 4250     |*******************                     |
      8192 -> 16383      : 8652     |****************************************|
     16384 -> 32767      : 4663     |*********************                   |
     32768 -> 65535      : 453      |**                                      |
     65536 -> 131071     : 17       |                                        |
    131072 -> 262143     : 0        |                                        |
    262144 -> 524287     : 0        |                                        |
    524288 -> 1048575    : 0        |                                        |
   1048576 -> 2097151    : 0        |                                        |
   2097152 -> 4194303    : 1        |                                        |
Detaching...

Print this:

# ./funclatency vfs_write
Tracing 1 functions for "vfs_write"... Hit Ctrl-C to end.
^C
     nsecs               : count     distribution
      1024 -> 2047       : 1        |                                        |
      2048 -> 4095       : 400      |*                                       |
      4096 -> 8191       : 4250     |*******************                     |
      8192 -> 16383      : 8652     |****************************************|
     16384 -> 32767      : 4663     |*********************                   |
     32768 -> 65535      : 453      |**                                      |
     65536 -> 131071     : 17       |                                        |
    131072 -> 262143     : 0        |                                        |
    262144 -> 524287     : 0        |                                        |
    524288 -> 1048575    : 0        |                                        |
   1048576 -> 2097151    : 0        |                                        |
   2097152 -> 4194303    : 1        |                                        |
Detaching...

To keep the output more concise. This is especially noticeable by tools that print multiple histograms.

Guida contributor