Re: How to get IO for a specific program



On 12 juil, 11:27, Emmanuel Christophe <melan...@xxxxxxxxx> wrote:

I'm trying to measure the IO of a specific program. Basically, I would
like to know exactly how many bytes this program read and write from
the hard drive once it's completed.
I'm looking for something similar to the 'time' command. The call
would be something like:
#countio myprogram myprogramarguments
Once it's completed, it would return the number of bytes read/written.

Does such a program exist for Linux ? Looking around, the only thing
I've found would be using the iostat, but it can't isolate the
activity of one process only.


Have a look at the pidstat(1) command, which belongs to the sysstat
package (the same package containing iostat).
If you have :
1) a recent version of sysstat (7.1.5 or later)
2) a recent version of the kernel (2.6.20 or later) with the option
CONFIG_TASK_IO_ACCOUNTING compiled in.
Then you can try something like:
$ pidstat -d -p ALL -C "myprogram" <interval> <count>
Once pidstat has been launched, run your program...

Read the manual page to learn some more about the pidstat command.

Regards,
Sebastien.

.



Relevant Pages

  • Re: Ran ccmclean on site server, what are implications???
    ... i ran the synctool command line in a cmd running under system account using ... The sync tool only has to retrieve the files from the distribution share ... only created the package folder. ... baffles me that the advanced client that resides on the sms ...
    (microsoft.public.sms.setup)
  • Re: What are the core packages for a desktops Linux desktop distribution?
    ... Your use of the term package is a bit confusing ... You'll need the mount command as well. ... As for Gnome, if you are going for minimalism, I ... wouldn't install it - you don't need it. ...
    (comp.os.linux.misc)
  • Re: Life on the Command Line
    ... Gutsy as the IM package or the ICQ package. ... There are a lot of games you can play in the Command Line, ... terminals in one window (like tabbing, except it can be used everywhere, ...
    (Ubuntu)
  • Re: perl menubased user interface
    ... actually use a perl package OR a hash for this, In a "perl package" ... sub map_method { ... # and they're all shell commands. ... Do whatever you want to wrap a shell command. ...
    (comp.lang.perl.misc)
  • Re: Unsure about security requirements for workstation/server
    ... When the logs of osiris and such show changes you can do "dpkg -L packagename" to see what files belong to a new package. ... About Lids: after you learn what commands you'll have to use to setup your system with Lids, you can copy and paste rules from the Lids and Lids wiki site. ... If these kind of programs are too difficult you can take a look a the "chroot" command to try to minimize the impact on your filesystem when you are compromised. ...
    (Debian-User)