简体   繁体   中英

Linux Performance Stats Behaving Oddly

I'm using the linux /proc//stat file to generate cpu usage information for an application. The issue that I have run into is that on Fedora 13 things seem to act strangely whlie on ubuntu 10.04 things behave as I expect them to.

Specifically:
on fedora the application logs more process system time by a ratio of 3:1
on ubuntu the application logs more process user time by a ratio of 4:1
on fedora the process user time value stops incrementing after a short while and never continues.

This seems very strange to me and the fact that user time stops incrementing at all seems like an outright bug.

I have also tried reading the values in a couple of different ways all with the same result, and I have conducted a test to confirm that the user and system times aren't transposed.

Can anyone shed some light on what might be happening? Is there any valid way that process user time would stop incrementing for a process?

The user time not incrementing at all does sound like a bug. If you can create a minimal example that demonstrates the problem, I would submit it to the Fedora bug tracker .

(Are you doing a lot of work in signal handlers, by any chance?)

Assuming you mean /proc/[pid]/stat, a process can accumulate no user time if it is spending all its time in syscall or waiting on wchan (usually disk or network or other I/O).

The level of detail of process accounting is controlled by a number of configuration variables in the Linux 2.6.x (and presumably other) kernels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM