iovisor/bcc

print_log2_hist to strip leading zeros

Ouverte

#1 109 ouverte le 12 avr. 2017

 (3 commentaires) (0 réaction) (0 personne assignée)C (4 074 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (22 627 étoiles)
Métriques de merge PR
 (Merge moyen 12j 6h) (12 PRs mergées en 30 j)

Description

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.

Guide contributeur