diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-12-04 15:58:26 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-12-04 15:58:26 +0000 |
commit | b0aefa4ab279fb200ce2fe7f1f24e8d007195123 (patch) | |
tree | 6e7224047070425bf3b0763273a3e8672d7cfab1 /cpukit | |
parent | 2008-12-04 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-b0aefa4ab279fb200ce2fe7f1f24e8d007195123.tar.bz2 |
2008-12-04 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1348/cpukit
* rtems/src/ratemonperiod.c: Properly handle period statistics after
cpu usage information is reset while a period is running.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/rtems/src/ratemonperiod.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index d8cf203be9..700e17ea00 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2008-12-04 Joel Sherrill <joel.sherrill@oarcorp.com> + + PR 1348/cpukit + * rtems/src/ratemonperiod.c: Properly handle period statistics after + cpu usage information is reset while a period is running. + 2008-12-03 Joel Sherrill <joel.sherrill@OARcorp.com> PR 1347/cpukit diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c index 23f70c58a0..26db51f43b 100644 --- a/cpukit/rtems/src/ratemonperiod.c +++ b/cpukit/rtems/src/ratemonperiod.c @@ -74,6 +74,10 @@ void _Rate_monotonic_Update_statistics( /* Grab CPU usage when the thread got switched in */ 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 */ _Timespec_Subtract(&_Thread_Time_of_last_context_switch, &uptime, &ran); |