在/proc/[pid]/io文件里面为我们提供了这个接口。还是先看manpage:
/proc/[pid]/io (since kernel 2.6.20)
This file contains I/O statistics for the process, for example:
# cat /proc/3828/io
rchar: 323934931
wchar: 323929600
syscr: 632687
syscw: 632675
read_bytes: 0
write_bytes: 323932160
cancelled_write_bytes: 0
The fields are as follows:
rchar: characters read
The number of bytes which this task has caused to be read from storage. This is simply the sum of bytes which
&n