iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.59k stars 3.88k forks source link

Add support for bcachefs to fsdist and fsslower tools #4989

Closed tangyouling closed 6 months ago

tangyouling commented 6 months ago

Add support for bcachefs to fsdist and fsslower tools.

$ sudo ./bcachefsdist 
Tracing bcachefs operation latency... Hit Ctrl-C to end.
^C
operation = 'read'
     usecs               : count    distribution
         0 -> 1          : 1        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 2359     |****************************************|
        16 -> 31         : 453      |*******                                 |
        32 -> 63         : 42       |                                        |
        64 -> 127        : 1        |                                        |

operation = 'write'
     usecs               : count    distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 2681     |****************************************|
        32 -> 63         : 89       |*                                       |
        64 -> 127        : 41       |                                        |
       128 -> 255        : 11       |                                        |
       256 -> 511        : 0        |                                        |
       512 -> 1023       : 0        |                                        |
      1024 -> 2047       : 0        |                                        |
      2048 -> 4095       : 0        |                                        |
      4096 -> 8191       : 1        |                                        |
      8192 -> 16383      : 11       |                                        |
     16384 -> 32767      : 4        |                                        |

operation = 'open'
     usecs               : count    distribution
         0 -> 1          : 3        |****************************************|
         2 -> 3          : 1        |*************                           |

operation = 'getattr'
     usecs               : count    distribution
         0 -> 1          : 26       |****************************************|
$ sudo ./bcachefsslower 
Tracing bcachefs operations slower than 10 ms... Hit Ctrl-C to end.
TIME     COMM             PID     T BYTES   OFF_KB   LAT(ms) FILENAME
11:07:15 cp               229441  W 131072  346112     10.02 vmlinux1
11:07:15 cp               229441  W 131072  347136     20.66 vmlinux1