<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-03-07)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-07 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libmisc/cpuuse/cpuusagereport.c: Fix calculation in case a thread
        dispatch happends in the meantime.  The percent values will not sum up
        to one hundred percent.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2763&r2=text&tr2=1.2764&diff_format=h">M</a></td><td width='1%'>1.2764</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/cpuuse/cpuusagereport.c.diff?r1=text&tr1=1.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</td><td width='100%'>cpukit/libmisc/cpuuse/cpuusagereport.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2763 rtems/cpukit/ChangeLog:1.2764
--- rtems/cpukit/ChangeLog:1.2763       Mon Mar  7 07:54:44 2011
+++ rtems/cpukit/ChangeLog      Mon Mar  7 08:55:04 2011
</font><font color='#997700'>@@ -2,6 +2,9 @@
</font> 
        * include/rtems/irq-extension.h: Documentation.
        * libmisc/monitor/mon-prmisc.c: Fix for multiprocessing configuration.
<font color='#000088'>+   * libmisc/cpuuse/cpuusagereport.c: Fix calculation in case a thread
+       dispatch happends in the meantime.  The percent values will not sum up
+       to one hundred percent.
</font> 
 2011-03-04     Ralf Corsépius <ralf.corsepius@rtems.org>
 

<font color='#006600'>diff -u rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.18 rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.19
--- rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.18   Thu Dec 16 09:46:34 2010
+++ rtems/cpukit/libmisc/cpuuse/cpuusagereport.c        Mon Mar  7 08:55:05 2011
</font><font color='#997700'>@@ -53,7 +53,7 @@
</font>   char                 name[13];
   uint32_t             ival, fval;
   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
<font color='#880000'>-    Timestamp_Control  uptime, total, ran, last_context_switch;
</font><font color='#000088'>+    Timestamp_Control  uptime, total, ran, uptime_at_last_reset;
</font>   #else
     uint32_t           total_units = 0;
   #endif
<font color='#997700'>@@ -67,9 +67,7 @@
</font>    *  guideline as to what each number means proportionally.
    */
   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
<font color='#880000'>-    last_context_switch = _Thread_Time_of_last_context_switch;
-    _TOD_Get_uptime( &uptime );
-    _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total );
</font><font color='#000088'>+    uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
</font>   #else
     for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
       #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
<font color='#997700'>@@ -133,9 +131,14 @@
</font>           ran = the_thread->cpu_time_used;
           if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
             Timestamp_Control used;
<font color='#880000'>-            _Timestamp_Subtract( &last_context_switch, &uptime, &used );
</font><font color='#000088'>+            Timestamp_Control last = _Thread_Time_of_last_context_switch;
+            _TOD_Get_uptime( &uptime );
+            _Timestamp_Subtract( &last, &uptime, &used );
</font>             _Timestamp_Add_to( &ran, &used );
<font color='#880000'>-          };
</font><font color='#000088'>+          } else {
+            _TOD_Get_uptime( &uptime );
+          }
+          _Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total );
</font>           _Timestamp_Divide( &ran, &total, &ival, &fval );
 
           /*
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>