According to man proc
, the information you are looking for should stand in /proc/(pid)/io
:
/proc/[pid]/io (since kernel 2.6.20) This file contains I/O statisticsfor the process, for example: /proc/[pid]/io (since kernel 2.6.20)…
Of course, you might well not find this pseudo file since it depends on extra stats made by the kernel depending on one config option :
CONFIG_TASK_IO_ACCOUNTING (Enable per-task storage I/O accounting)
Therefore, you should rebuild your kernel after having made sure this option is set.As you'll read on the link above, you might well be constrained to select misc. other config options.CONFIG_TASK_XACCT (Enable extended accounting over taskstats) in particular since it defaults to no and CONFIG_TASK_IO_ACCOUNTING depends on it.
BTW, I can't guarantee the pseudo file will be readable by anyone but root and the pid owner. There have been lots of discussion some time ago on that matter, it could well then depend on your kernel version.
Note : The need for these options can be deduced from the reading of the /usr/src/linux/kernel/tsacct.c code :
#ifdef CONFIG_TASK_XACCT...#ifdef CONFIG_TASK_IO_ACCOUNTING stats->read_bytes = p->ioac.read_bytes & KB_MASK; stats->write_bytes = p->ioac.write_bytes & KB_MASK; stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes & KB_MASK;...