Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disk IO profiler for a C++ application on Linux

A program is massively reading from the disk but I don't know which file it is reading nor where in the code it is reading.

Is there any kind of tools on linux to monitor this ?

Related question (windows) : Disk IO profiler for existing applications

like image 523
Barth Avatar asked Feb 23 '26 23:02

Barth


1 Answers

So, you can use: /proc/PID/fd or lsof -p PID

to know which file your process use.

for example, with lsof -p 27666 (assume 27666 is the PID of a.out program) you can see this:

./a.out 22531 me    9w   REG   8,5   131072   528280 /home/me/tmp/test.db
./a.out 22531 me    9r   REG   8,5   131072   528280 /home/me/tmp/test2.db
like image 194
A.H Avatar answered Feb 25 '26 14:02

A.H