change log for rtems (2011-03-07)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Mar 7 15:10:24 UTC 2011
*sh*:
2011-03-07 Sebastian Huber <sebastian.huber at 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.
M 1.2764 cpukit/ChangeLog
M 1.19 cpukit/libmisc/cpuuse/cpuusagereport.c
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
@@ -2,6 +2,9 @@
* include/rtems/irq-extension.h: Documentation.
* libmisc/monitor/mon-prmisc.c: Fix for multiprocessing configuration.
+ * 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.
2011-03-04 Ralf Corsépius <ralf.corsepius at rtems.org>
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
@@ -53,7 +53,7 @@
char name[13];
uint32_t ival, fval;
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
- Timestamp_Control uptime, total, ran, last_context_switch;
+ Timestamp_Control uptime, total, ran, uptime_at_last_reset;
#else
uint32_t total_units = 0;
#endif
@@ -67,9 +67,7 @@
* guideline as to what each number means proportionally.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
- last_context_switch = _Thread_Time_of_last_context_switch;
- _TOD_Get_uptime( &uptime );
- _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total );
+ uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
#else
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
@@ -133,9 +131,14 @@
ran = the_thread->cpu_time_used;
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
Timestamp_Control used;
- _Timestamp_Subtract( &last_context_switch, &uptime, &used );
+ Timestamp_Control last = _Thread_Time_of_last_context_switch;
+ _TOD_Get_uptime( &uptime );
+ _Timestamp_Subtract( &last, &uptime, &used );
_Timestamp_Add_to( &ran, &used );
- };
+ } else {
+ _TOD_Get_uptime( &uptime );
+ }
+ _Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total );
_Timestamp_Divide( &ran, &total, &ival, &fval );
/*
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110307/ad5b7d07/attachment-0001.html>
More information about the vc
mailing list