how to use iostat in c++ program.


Hi,

I am using ubuntu linux.I am trying cpu utilization of our software.
how to use iostat in c++ program.
iostat is a separate program to allow the user to access information at the command line.
http://linux.die.net/man/1/iostat

Files
/proc/stat contains system statistics.

/proc/partitions contains disk statistics (for pre 2.5 kernels that have been patched).

/proc/diskstats contains disks statistics (for post 2.5 kernels).

/sys contains statistics for block devices (post 2.5 kernels).

You will need to open the following files to obtain the same information in your C++ program.

If you need more help on how to query it, get the iostat source
http://www.linuxinsight.com/iostat_utility.html
and look at how it is done.

Good luck and have fun!

Hope this helps.
Last edited on

Hi

Thanks for ur information...
Topic archived. No new replies allowed.