crash的dev命令可以获取系统磁盘IO的统计数据。
- 获取所有磁盘的IO统计数据
crash> dev -d MAJOR GENDISK NAME REQUEST_QUEUE TOTAL ASYNC SYNC 8 ffff88de95d51000 sdm ffff88de94a90000 65379 1776 63603 8 ffff88deb2396800 sda ffff88de9600d898 10089 1 10088 8 ffff88deb2390800 sdb ffff88de9600cec0 11336 0 11336 8 ffff88deb2392000 sdc ffff88de960093b0 13576 1 13575 8 ffff88deb2391800 sdd ffff88de9600f620 9 1 8 8 ffff88de95d54800 sdg ffff88de96009d88 40 36 4 8 ffff88deb2396000 sdf ffff88de9600bb10 30 25 5 8 ffff88deb2395800 sde ffff88de96008000 16 8 8 8 ffff88de95d51800 sdh ffff88de9600b138 5 1 4 8 ffff88de95d55000 sdi ffff88de9600a760 21 16 5 8 ffff88de95d52800 sdk ffff88de9600e270 10 0 10 8 ffff88de95d56000 sdl ffff88de9600c4e8 5 0 5 8 ffff88de95d54000 sdj ffff88de9600ec48 7 1 6 43 ffff88ddd0ca8000 nbd0 ffff88ddd0c70000 0 0 0 43 ffff88ddd0cab800 nbd1 ffff88ddd0c73b10 0 0 0 43 ffff88ddd0caa000 nbd2 ffff88ddd0c72760 0 0 0 43 ffff88ddd0ca8800 nbd3 ffff88ddd0c76c48 0 0 0
- 获取有IO在处理的磁盘的IO统计数据
crash> dev -D MAJOR GENDISK NAME REQUEST_QUEUE TOTAL ASYNC SYNC 8 ffff88de95d51000 sdm ffff88de94a90000 65379 1776 63603 8 ffff88deb2396800 sda ffff88de9600d898 10089 1 10088 8 ffff88deb2390800 sdb ffff88de9600cec0 11336 0 11336 8 ffff88deb2392000 sdc ffff88de960093b0 13576 1 13575 8 ffff88deb2391800 sdd ffff88de9600f620 9 1 8 8 ffff88de95d54800 sdg ffff88de96009d88 40 36 4 8 ffff88deb2396000 sdf ffff88de9600bb10 30 25 5 8 ffff88deb2395800 sde ffff88de96008000 16 8 8 8 ffff88de95d51800 sdh ffff88de9600b138 5 1 4 8 ffff88de95d55000 sdi ffff88de9600a760 21 16 5 8 ffff88de95d52800 sdk ffff88de9600e270 10 0 10 8 ffff88de95d56000 sdl ffff88de9600c4e8 5 0 5 8 ffff88de95d54000 sdj ffff88de9600ec48 7 1 6 253 ffff893e66c64000 dm-0 ffff893c7f3b0000 2 0 2 253 ffff893d10b0e800 dm-1 ffff893cb741cec0 6 0 6 253 ffff893ce1a6d800 dm-2 ffff893cb9a509d8 4 0 4 253 ffff893ce1a6e800 dm-3 ffff893cb9a55898 4 0 4 253 ffff893eb0aae000 dm-5 ffff893e5d2c1d88 3 0 3 253 ffff893e892b4800 dm-7 ffff893cb9a513b0 7 0 7
上面每一列的含义:
第1列:磁盘的主设备号
第2列:磁盘对应的gendisk结构体的地址
第3列:磁盘的名字
第4列:磁盘的request_queue的地址
第5列TOTAL:正在处理的IO请求数
第6列ASYNC: 异步IO请求数
第7列SYNC: 同步IO请求数
下面是dev -d
的帮助:
TOTAL: total number of allocated in-progress I/O requests SYNC: I/O requests that are synchronous ASYNC: I/O requests that are asynchronous READ: I/O requests that are reads (older kernels) WRITE: I/O requests that are writes (older kernels) DRV: I/O requests that are in-flight in the device driver. If the device driver uses blk-mq interface, this field shows N/A(MQ). If not available, this column is not shown.