2011-04-08 02:39:53     CPU per-process usage percentage - Details needed

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-04-08 02:39:53     CPU per-process usage percentage - Details needed

John Peter (INDIA)

Message: 99676   

 

Hai,

 

For my custom board, I have enabled "Show CPU per-process usage percentage" option in my kernel but I cant get the per process usage details from the TOP command. I have attached the screen shot of Process Utilities from menuconfig.

 

                   Process Utilities --->

                             [*] top

                             [*]   Show CPU per-process usage percentage

                             [*]     Show CPU global usage percentage

 

With these options enabled Top command shows the mem usage for the whole application, not the per task usage. Need to check whether any other options to be enabled other than what we have enabled.

 

***************************************************************************

 

# top

          Mem: 81712K  used, 420900K free, 0K shrd, 27928K buff, 15856K  cached

CPU:  50% usr  50%  sys   0% nic   0% idle   0% io   0% irq   0% sirq

Load average: 1.00  1.03 0.92 2/57 4098

PID  PPID USER      STAT   VSZ %MEM %CPU COMMAND

1053     1 root      S    68776  14% 100% ./Application1 Application2.bdb

1066     1 dbus      S     3356   1%   0% dbus-daemon --system

1142     1 root      S     2408   0%   0% -sh

1028     1 root      S     2404   0%   0% /usr/sbin/inetd

   1     0 root      S     2320   0%   0% init

1145     1 root      S     2320   0%   0% /usr/bin/tail -f  /var/log/messages

1143     1 root      S     2320   0%   0% /sbin/syslogd -n -m 0

1144     1 root      S     2320   0%   0% /sbin/klogd -n

4098  1142 root      R     2320   0%   0% top

331     2 root      SW       0   0%   0% [kworker/0:1]

997     2 root      SW       0   0%   0% [mmcqd/0]

   3     2 root      SW       0   0%   0% [ksoftirqd/0]

1021     2 root      SW       0   0%   0% [kjournald]

  37     2 root      SW       0   0%   0% [irq/74-serial i]

   7     2 root      SW       0   0%   0% [kworker/u:1]

220     2 root      SW       0   0%   0% [kworker/u:2]

1020     2 root      SW       0   0%   0% [flush-179:0]

197     2 root      SW       0   0%   0% [khubd]

   2     0 root      SW       0   0%   0% [kthreadd]

   4     2 root      SW       0   0%   0% [kworker/0:0]

 

***************************************************************************

 

Can any one please clarify in this regard?

 

Regards,

Chinnathambi M

 

ProcessUtilities_Screenshot.JPG

QuoteReplyEditDelete

 

 

2011-04-08 02:52:41     Re: CPU per-process usage percentage - Details needed

Mike Frysinger (UNITED STATES)

Message: 99677   

 

are you confusing the terms "threads" and "tasks" ?  further, you seem to be using "mem" and "cpu" interchangeably.

 

what exactly are you having a problem with ?  your output looks fine to me.  you've enabled per-process cpu usage percentage, and top is showing that.

QuoteReplyEditDelete

 

 

2011-04-08 03:41:43     Re: CPU per-process usage percentage - Details needed

John Peter (INDIA)

Message: 99687   

 

Mike,

 

I need to check why my application is consuming 100% CPU usage even in idle case(without doing any operations). I want to check which are all the thread is having high CPU usage in my application. Can u please clarify ?

QuoteReplyEditDelete

 

 

2011-04-08 12:36:38     Re: CPU per-process usage percentage - Details needed

Mike Frysinger (UNITED STATES)

Message: 99702   

 

top already splits out multiple threads.  perhaps your display was simply not showing them all ?

 

it works for me with a simple a.out threaded app:

 

Mem: 9512K used, 45744K free, 0K shrd, 0K buff, 5884K cached

CPU:  99% usr   0% sys   0% nic   0% idle   0% io   0% irq   0% sirq

Load average: 0.15 0.03 0.01 2/24 164

  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND

  162   160 root     R      148   0%  98% /a.out

  164   118 root     R      762   1%   2% top -d 1

  118     1 root     S      794   1%   0% -/bin/sh

  120     1 root     S      758   1%   0% /sbin/syslogd -n

  121     1 root     S      754   1%   0% /sbin/klogd -n

  161   160 root     S      148   0%   0% /a.out

  159   118 root     S      148   0%   0% /a.out

  160   159 root     S      148   0%   0% /a.out

 

QuoteReplyEditDelete

Outcomes