views:

115

answers:

4

Here's a link to Windows documentation: http://msdn.microsoft.com/en-us/library/ms683218(VS.85).aspx.

Basically I would like to get similar data, but on Linux. If not all is possible, then at least some parts.

+1  A: 

Look at the pseudo-files under /proc/<PID>/. Maybe you can find what you need there.


Look at man 5 proc, or failing that the kernel documentation. However, I don't see much that looks promising. Sorry.

dmckee
+2  A: 

Have a look at /proc/PID/io - it's the current I/O accounting information of the process with PID.

ypnos
What kernels is this supported under? What kernel configuration options are needed? I ask because a test machine on my desk does not show this one...
dmckee
For me too... Running 2.6.25 here.
phjr
+2  A: 

If you enable CONFIG_TASK_IO_ACCOUNTING, you will have the information available in /proc/<pid>/io. This is available since kernel 2.6.20, but not normally enabled by default (However, in Ubuntu 8.04 it seems like it is enabled).

You can read about the various data items in Documentation/filesystems/proc.txt in the kernel source tree. Especially section 2.14 should be of interest.

matli
+1  A: 

Perhaps you want getrusage()? Not all fields are maintained under linux however. Perhaps enabling the CONFIG_TASK_IO_ACCOUNTING will cause them to be maintained?

Steve Baker