cpuuse

Chris Johns chrisj at rtems.org
Sun Jan 5 20:56:05 UTC 2014


On 6/01/2014 7:24 am, Claus, Ric wrote:
> Sometimes I see 'cpuuse' give results like the following:
>
> [/] cpuuse
> -------------------------------------------------------------------------------
>                                CPU USAGE BY THREAD
> ------------+----------------------------------------+---------------+---------
>   ID         | NAME                                   | SECONDS       | PERCENT
> ------------+----------------------------------------+---------------+---------
>   0x09010001 | IDLE                                   |     33.568522 | 192.351
>   0x0a010001 | tcpI                                   |4294966091.3351480 |4294960389.4294966833
>   0x0a010002 | Xinp                                   |   1187.924336 |6800.972
>   0x0a010003 | CSHL                                   |      0.057157 |   0.327
>   0x0b010001 |                                        |      0.000000 |   0.000
>   0x0b010002 |                                        |      0.000078 |   0.000
>   0x0b010003 |                                        |      0.000265 |   0.001
>   0x0b010004 |                                        |      0.054508 |   0.311
> ------------+----------------------------------------+---------------+---------
>   TIME SINCE LAST CPU USAGE RESET IN SECONDS:                         17.501697
> -------------------------------------------------------------------------------
>

I have seen the same thing on the zynq in the past.

> These things can happen in combination or individually:
> - the numbers in the seconds column are either individually greater than the time since last reset
> - the numbers in the seconds column sum up to be greater than the time since last reset
> - one or more of the numbers in the percent column is greater than 100
> - the sum of the numbers in the percent column is greater than 100
>
> I think, but am not sure, that these nonsensical results show up when either CPU usage by a task other than IDLE is ~100%, and/or the interrupt rate is high.  In the above case I was sending UDP packets to the RTEMS system (with the LWIP network stack instead of the standard one) at almost, but not quite, the maximum rate.
>
> The RTEMS version is from a recent HEAD and the platform is a xilinx-zynq board.

How recent ? I fixed the capture engine testing it on the zynq and got 
good results. I have just run the cpuuse command with a few telnet 
sessions running 'ls -lsaR /net' of a large NFS share to make some load 
and I am seeing no issues. Before I would. The capture engine's ctload 
says I am running with a 50% load.

> The nameless threads are pthreads whereas the named threads are normal RTEMS tasks.
>
> Anyone have any idea about this or how to go about fixing it?
>

I suggest you update to the latest code and try again, plus I suggest 
you try the capture engine's ctload command. With the traces I am seeing 
nanosecond time stamping. I am running with no extra RTEMS patches these 
days.

Note, I have added weak function support for MMU tables residing in the 
application code.

Chris



More information about the users mailing list