UART console based on interrupt

Joel Sherrill joel.sherrill at oarcorp.com
Mon Jul 23 15:21:49 UTC 2007


John Pickwick wrote:
> Through the classical CPU_DumpUsage function call. Sometimes you need 
> to reset the statitistics otherwise the wrapped counter gives wrong 
> figures.
>  
> In my case of interrupt driven io I expected to get a lower CPU usage 
> by the console task since I assumed it wakes up only "when there is 
> something to process".  This is not the case, the figure is the same 
> as with the polled version. :=(
In 4.7 and older, CPU usage was measured using clock tick granularity.  Each
time a task was context switched out, it was assumed to have executed 1
clock tick.  So if you do a lot of context switches, you get charged a 
lot more
cpu usage "units" than the number of clock ticks that have occurred. 

Since termios drivers block for 1 clock tick when no data is available 
from the
UART, there may not be enough difference for this measurement to notice.

In the current CVS code, you have the option (if the BSP supports it) 
for nanosecond
granularity on timestamps.  This lets you have much more accurate 
measurements
of CPU usage.  If you run your test with the CVS head, you will see the 
difference.
The erc32 BSP supports this feature.

In neither case, is interrupt time measured.

--joel
>  
> John.
>
>     ----- Original Message -----
>     *From:* Grigori Khmyrov <mailto:Grigori_Khmyrov at uml.edu>
>     *To:* rtems-users at rtems.org <mailto:rtems-users at rtems.org>
>     *Sent:* Thursday, July 19, 2007 3:42 PM
>     *Subject:* Re: UART console based on interrupt
>
>     John,
>
>     Can you please share or point to how do you measure CPU usage.
>
>     Thank you,
>     Grigori
>
>     John Pickwick wrote:
>>     Hi to all,
>>      
>>     I recently re-compiled my SparcLEON2 BSP / RTEMS4.7.1 using the
>>     USE_CONSOLE_INTERRUPT macro and I compared the CPU usage with the
>>     default BSP version that uses polled UART.
>>     I have a task waiting on console input with getchar and I
>>     expected the interrupt driven version of the console to be less
>>     CPU consuming. Unfortunately I find the same CPU usage percentage
>>     for that one.
>>      
>>     Can someone explain this ?
>>      
>>     Best regards,
>>      
>>     John
>>     ------------------------------------------------------------------------
>>
>>     _______________________________________________
>>     rtems-users mailing list
>>     rtems-users at rtems.com
>>     http://rtems.rtems.org/mailman/listinfo/rtems-users
>>       
>
>     ------------------------------------------------------------------------
>     _______________________________________________
>     rtems-users mailing list
>     rtems-users at rtems.com
>     http://rtems.rtems.org/mailman/listinfo/rtems-users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list