In the top command one of the processes is always showing a CPU usage of 4 to 5%. But in oprofile the CPU usage is 0.004%. I do not understand this.

And I also noticed that even when a process is in sleep state, the process has got some CPU usage. How is it possible?

  • 2
    And which value you think is correct? 5% CPU usage means that there must be some activity in the process like calling system calls, writing to a log file, doing something. Do you see any activity in the process? Actually I compared top and perf top -s pid on my computer (RHEL 6.3) and also there is difference for one of my process 40% vs 12%. – Sergei Kurenkov Nov 28 '13 at 11:21
  • Thanks skwllsp. I really do not know which one is correct. I am creating some 100 software timers in an already existing process and the results of top and oprofile are the same before and after adding the timers. I am calling some libraries written by other guy. May be it is calling system calls. In oprfile i see the library's CPU usage is also the same. Now i really do not know if oprofile is really working or not. How do i check it? And top command shows 4 to 5% usage for that process but the process is in sleep state "S" in the top output. – New to Rails Nov 30 '13 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.