Skip to content
Advertisement

Linux total disk I/O from already running process

I’m working on a performance tool and I’m interested in the total disk I/O i single process have done since it started. I have the porcess PID and i can easily get the current I/O rate with tools like iotop or sar, but not the total I/O.

Is this even logged in Linux and is there a way to get it?

/Mpresmann

Advertisement

Answer

You can read the /proc/<PID>/io file for specific process

 $ sudo cat /proc/1/io

rchar: 144440702940
wchar: 4615239440674
syscr: 156954128
syscw: 173077623
read_bytes: 113700176646
write_bytes: 100325525146
cancelled_write_bytes: 2596581376
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement