forked from Imagelibrary/rtems
2009-12-11 Glenn Humphrey <glenn.humphrey@OARcorp.com>
PR 1481/cpukit * rtems/src/ratemonperiod.c: Moved check for cpu usage being smaller than when period initiated.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2009-12-11 Glenn Humphrey <glenn.humphrey@OARcorp.com>
|
||||||
|
|
||||||
|
PR 1481/cpukit
|
||||||
|
* rtems/src/ratemonperiod.c: Moved check for cpu usage being smaller
|
||||||
|
than when period initiated.
|
||||||
|
|
||||||
2009-12-10 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2009-12-10 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
PR 1482
|
PR 1482
|
||||||
|
|||||||
@@ -135,16 +135,16 @@ void _Rate_monotonic_Update_statistics(
|
|||||||
/* Grab CPU usage when the thread got switched in */
|
/* Grab CPU usage when the thread got switched in */
|
||||||
used = _Thread_Executing->cpu_time_used;
|
used = _Thread_Executing->cpu_time_used;
|
||||||
|
|
||||||
/* partial period, cpu usage info reset while executing. Throw away */
|
|
||||||
if (_Timespec_Less_than( &used, &the_period->owner_executed_at_period))
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* How much time time since last context switch */
|
/* How much time time since last context switch */
|
||||||
_Timespec_Subtract(&_Thread_Time_of_last_context_switch, &uptime, &ran);
|
_Timespec_Subtract(&_Thread_Time_of_last_context_switch, &uptime, &ran);
|
||||||
|
|
||||||
/* executed += ran */
|
/* executed += ran */
|
||||||
_Timespec_Add_to( &used, &ran );
|
_Timespec_Add_to( &used, &ran );
|
||||||
|
|
||||||
|
/* partial period, cpu usage info reset while executing. Throw away */
|
||||||
|
if (_Timespec_Less_than( &used, &the_period->owner_executed_at_period))
|
||||||
|
return;
|
||||||
|
|
||||||
/* executed = current cpu usage - value at start of period */
|
/* executed = current cpu usage - value at start of period */
|
||||||
_Timespec_Subtract(
|
_Timespec_Subtract(
|
||||||
&the_period->owner_executed_at_period, &used, &executed
|
&the_period->owner_executed_at_period, &used, &executed
|
||||||
|
|||||||
Reference in New Issue
Block a user