Hi,
I'm working on linux and am using the values in /proc//stat to log performance data. I am currently logging process user time and process system time. The problem that I have run into is that the code puts out correct values on ubuntu 10.04 but seems to be wrong under fedora 13.
Under fedora it looks like the counter for process user time jiffies just stops dead after a while, even though the process is pulling hefty cpu usage. My suspicion is that perhaps some of the values have been moved about but it is hard to confirm.
What I am looking for is a method of getting a system time/user time breakdown from the command line. Without resorting to reading the /proc//stat file (as it can't be trusted). I have been trying to use ps
but the only place I can see an option for this is the 'obsolete bsd sorting method' that I can't get to work.
Is there a way of getting values for process user time and process system time from the command line?
Or is there a better way of extracting performance values in C++ via API functions that I am not aware of?