blob: f64c87b4eb00e1acecd038f3d13f880370f636d9 [file] [log] [blame]
zhenwei pi86148952021-02-15 19:19:17 +08001Demonstrations of virtiostat, the Linux eBPF/bcc version.
2
3
4This program traces virtio devices to analyze the IO operations and
5throughput. For example, guest side mounts a 9p fs, and we can't get
6io statistics by `iostat` command any more. In this scenario, we can
7only get statistics from VIRTIO layer instead of block layer.
8
9Example
10#./virtiostat -T
11Tracing virtio devices statistics ... Hit Ctrl-C to end.
1214:48:30
13 Driver Device VQ Name In SGs Out SGs In BW Out BW
14 virtio_net virtio0 input.0 260669 0 406743040 0
15 virtio_net virtio0 output.0 0 9873 0 833344
16 virtio_blk virtio4 req.0 28 46 448 278976
17 9pnet_virtio virtio6 requests 99083 99354 1883687 137537263
1814:48:33
19 Driver Device VQ Name In SGs Out SGs In BW Out BW
20 virtio_net virtio0 input.0 260718 0 406819328 0
21 virtio_net virtio0 output.0 0 7139 0 562355
22 virtio_blk virtio4 req.0 11 18 176 110768
23 9pnet_virtio virtio6 requests 91520 91141 1737364 125320785
24
25
zhenwei pifa7bec92021-03-10 18:36:24 +080026Show virtio block devices only:
27#./virtiostat.py -d virtio_blk
28Tracing virtio devices statistics ... Hit Ctrl-C to end.
29--------
30 Driver Device VQ Name In SGs Out SGs In BW Out BW
31 virtio_blk virtio4 req.0 4 6 4 24640
32 virtio_blk virtio5 req.0 678756 339378 1390431666 5430048
33
34
zhenwei pi86148952021-02-15 19:19:17 +080035Full USAGE:
36
37#./virtiostat -h
zhenwei pifa7bec92021-03-10 18:36:24 +080038usage: virtiostat.py [-h] [-T] [-d DRIVER] [-n DEVNAME] [-D]
39 [interval] [count]
zhenwei pi86148952021-02-15 19:19:17 +080040
41Show virtio devices input/output statistics
42
43positional arguments:
zhenwei pifa7bec92021-03-10 18:36:24 +080044 interval output interval, in seconds
45 count number of outputs
zhenwei pi86148952021-02-15 19:19:17 +080046
47optional arguments:
zhenwei pifa7bec92021-03-10 18:36:24 +080048 -h, --help show this help message and exit
49 -T, --timestamp show timestamp on output
50 -d DRIVER, --driver DRIVER
51 filter for driver name
52 -n DEVNAME, --devname DEVNAME
53 filter for device name
54 -D, --debug print BPF program before starting (for debugging
55 purposes)
zhenwei pi86148952021-02-15 19:19:17 +080056
57examples:
zhenwei pifa7bec92021-03-10 18:36:24 +080058 ./virtiostat # print 3(default) second summaries
59 ./virtiostat 1 10 # print 1 second summaries, 10 times
60 ./virtiostat -T # show timestamps
61 ./virtiostat -d virtio_blk # only show virtio block devices
62 ./virtiostat -n virtio0 # only show virtio0 device
63 ./virtiostat -D # show debug bpf text