summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-04 16:14:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-04 16:14:04 +0000
commitf7a1d76d44efd6bee742fafafba921c364c16f68 (patch)
treeda569e5e01a4c4e7f18f6f95e7c0ff4715795ddb
parentd13db6a837cf9c10aac2205b2334ccecd528d337 (diff)
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.
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/rtems/src/ratemonperiod.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index dad6cb16c2..e31ec79914 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-11-03 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1333/cpukit
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 8d0dca13d2..dbe737a283 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -81,6 +81,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);