summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems/ratemon.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-10 22:13:28 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-10 22:13:28 +0000
commit9dc2c8d16e3d54daeb394d71b2455da114bbd5c9 (patch)
tree7e70e439c02af44198c2c9d3f1d490e865ae2ab9 /cpukit/rtems/include/rtems/rtems/ratemon.h
parent2008-12-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-9dc2c8d16e3d54daeb394d71b2455da114bbd5c9.tar.bz2
2008-12-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/include/rtems/rtems/ratemon.h, rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, rtems/src/ratemonreportstatistics.c, score/include/rtems/score/thread.h, score/src/coretodgetuptime.c: Make all Thread and Period Statistics use publicly defined types. Do not leak the SuperCore Timestamp type through the APIs.
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h55
1 files changed, 48 insertions, 7 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
index 3c5d1b65dc..e0111d6c71 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemon.h
@@ -66,17 +66,29 @@ extern "C" {
#endif
/**
- * This is the type used to manage the rate monotonic timing
+ * This is the public type used for the rate monotonic timing
* statistics.
*/
#if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS)
- #include <rtems/score/timestamp.h>
+ #include <rtems/score/timespec.h>
- typedef Timestamp_Control rtems_rate_monotonic_period_time_t;
+ typedef struct timespec rtems_rate_monotonic_period_time_t;
#else
typedef uint32_t rtems_rate_monotonic_period_time_t;
#endif
+/**
+ * This is the internal type used for the rate monotonic timing
+ * statistics.
+ */
+#if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS)
+ #include <rtems/score/timestamp.h>
+
+ typedef Timestamp_Control Rate_monotonic_Period_time_t;
+#else
+ typedef uint32_t Rate_monotonic_Period_time_t;
+#endif
+
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
@@ -131,7 +143,11 @@ typedef enum {
#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
/**
- * The following defines the statistics kept on each period instance.
+ * The following defines the PUBLIC data structure that has the
+ * statistics kept on each period instance.
+ *
+ * @note The public structure uses struct timespec while the
+ * internal one uses Timestamp_Control.
*/
typedef struct {
/** This field contains the number of periods executed. */
@@ -155,6 +171,31 @@ typedef struct {
} rtems_rate_monotonic_period_statistics;
/**
+ * The following defines the INTERNAL data structure that has the
+ * statistics kept on each period instance.
+ */
+typedef struct {
+ /** This field contains the number of periods executed. */
+ uint32_t count;
+ /** This field contains the number of periods missed. */
+ uint32_t missed_count;
+
+ /** This field contains the least amount of CPU time used in a period. */
+ Thread_CPU_usage_t min_cpu_time;
+ /** This field contains the highest amount of CPU time used in a period. */
+ Thread_CPU_usage_t max_cpu_time;
+ /** This field contains the total amount of wall time used in a period. */
+ Thread_CPU_usage_t total_cpu_time;
+
+ /** This field contains the least amount of wall time used in a period. */
+ Rate_monotonic_Period_time_t min_wall_time;
+ /** This field contains the highest amount of wall time used in a period. */
+ Rate_monotonic_Period_time_t max_wall_time;
+ /** This field contains the total amount of CPU time used in a period. */
+ Rate_monotonic_Period_time_t total_wall_time;
+} Rate_monotonic_Statistics;
+
+/**
* The following defines the period status structure.
*/
typedef struct {
@@ -197,13 +238,13 @@ typedef struct {
* This field contains the total CPU usage used while executing
* the body of the loop that is executed each period.
*/
- rtems_thread_cpu_usage_t owner_executed_at_period;
+ Thread_CPU_usage_t owner_executed_at_period;
/**
* This field contains the total wall timer that passed while
* executing the body of the loop that is executed each period.
*/
- rtems_rate_monotonic_period_time_t time_at_period;
+ Rate_monotonic_Period_time_t time_at_period;
/**
* This field contains the length of the next period to be
@@ -221,7 +262,7 @@ typedef struct {
* This field contains the statistics which are maintained
* on each period.
*/
- rtems_rate_monotonic_period_statistics Statistics;
+ Rate_monotonic_Statistics Statistics;
} Rate_monotonic_Control;
/**