xref: /aosp_15_r20/external/bcc/tools/vfsstat_example.txt (revision 387f9dfdfa2baef462e92476d413c7bc2470293e)
1Demonstrations of vfsstat, the Linux eBPF/bcc version.
2
3
4This traces some common VFS calls and prints per-second summaries. By default,
5the output interval is one second:
6
7# ./vfsstat
8TIME         READ/s  WRITE/s CREATE/s   OPEN/s  FSYNC/s
918:35:32:       231       12        4       98        0
1018:35:33:       274       13        4      106        0
1118:35:34:       586       86        4      251        0
1218:35:35:       241       15        4       99        0
1318:35:36:       232       10        4       98        0
1418:35:37:       244       10        4      107        0
1518:35:38:       235       13        4       97        0
1618:35:39:      6749     2633        4     1446        0
1718:35:40:       277       31        4      115        0
1818:35:41:       238       16        6      102        0
1918:35:42:       284       50        8      114        0
20^C
21
22
23Here we are using an output interval of five seconds, and printing three output
24lines:
25
26# ./vfsstat 5 3
27TIME         READ/s  WRITE/s CREATE/s   OPEN/s  FSYNC/s
2818:35:55:       238        8        3      101        0
2918:36:00:       962      233        4      247        0
3018:36:05:       241        8        3      100        0
31
32
33Full usage:
34
35# ./vfsstat -h
36usage: vfsstat [-h] [-p PID] [interval] [count]
37
38Count some VFS calls.
39
40positional arguments:
41  interval           output interval, in seconds
42  count              number of outputs
43
44optional arguments:
45  -h, --help         show this help message and exit
46  -p PID, --pid PID  trace this PID only
47
48examples:
49    ./vfsstat             # count some VFS calls per second
50    ./vfsstat -p 185      # trace PID 185 only
51    ./vfsstat 2 5         # print 2 second summaries, 5 times
52