summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-06 15:44:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-06 15:44:11 +0000
commit5fa51853245aefdbc5827cb819359afe8f6e06ff (patch)
treea78d310dc6c0758bb53dd0222261660593278e3a /cpukit/rtems/include
parent2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-5fa51853245aefdbc5827cb819359afe8f6e06ff.tar.bz2
2008-06-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/__times.c, libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c, libmisc/monitor/mon-task.c, rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, score/include/rtems/score/thread.h, score/src/threaddispatch.c, score/src/threadinitialize.c, score/src/threadtickletimeslice.c: Add typedefs for cpu usage and period timing statistics. Also renamed related variables and structure members so they are the same whether you are using nanosecond (e.g. struct timespec) or ticks (e.g. uint32_t) granularity. This lays the groundwork for future cleanup.
Diffstat (limited to 'cpukit/rtems/include')
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h59
1 files changed, 19 insertions, 40 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
index 038c26e31e..3f990f28bd 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemon.h
@@ -62,6 +62,11 @@ extern "C" {
* is used.
*/
#define RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
+
+ typedef struct timespec rtems_rate_monotonic_period_time_t;
+
+#else
+ typedef uint32_t rtems_rate_monotonic_period_time_t;
#endif
#include <rtems/score/object.h>
@@ -72,6 +77,7 @@ extern "C" {
#include <string.h>
+
/**
* The following enumerated type defines the states in which a
* period may be.
@@ -98,42 +104,23 @@ typedef enum {
typedef struct {
uint32_t count;
uint32_t missed_count;
- #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
- struct timespec min_cpu_time;
- struct timespec max_cpu_time;
- struct timespec total_cpu_time;
- #else
- uint32_t min_cpu_time;
- uint32_t max_cpu_time;
- uint32_t total_cpu_time;
- #endif
- #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
- struct timespec min_wall_time;
- struct timespec max_wall_time;
- struct timespec total_wall_time;
- #else
- uint32_t min_wall_time;
- uint32_t max_wall_time;
- uint32_t total_wall_time;
- #endif
+ RTEMS_CPU_USAGE_STATISTICS_TIME_TYPE min_cpu_time;
+ RTEMS_CPU_USAGE_STATISTICS_TIME_TYPE max_cpu_time;
+ RTEMS_CPU_USAGE_STATISTICS_TIME_TYPE total_cpu_time;
+
+ rtems_rate_monotonic_period_time_t min_wall_time;
+ rtems_rate_monotonic_period_time_t max_wall_time;
+ rtems_rate_monotonic_period_time_t total_wall_time;
} rtems_rate_monotonic_period_statistics;
/**
* The following defines the period status structure.
*/
typedef struct {
- Objects_Id owner;
- rtems_rate_monotonic_period_states state;
- #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
- struct timespec since_last_period;
- #else
- uint32_t ticks_since_last_period;
- #endif
- #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
- struct timespec executed_since_last_period;
- #else
- uint32_t ticks_executed_since_last_period;
- #endif
+ Objects_Id owner;
+ rtems_rate_monotonic_period_states state;
+ rtems_rate_monotonic_period_time_t since_last_period;
+ RTEMS_CPU_USAGE_STATISTICS_TIME_TYPE executed_since_last_period;
} rtems_rate_monotonic_period_status;
/**
@@ -144,16 +131,8 @@ typedef struct {
Objects_Control Object;
Watchdog_Control Timer;
rtems_rate_monotonic_period_states state;
- #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
- struct timespec owner_executed_at_period;
- #else
- uint32_t owner_ticks_executed_at_period;
- #endif
- #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
- struct timespec time_at_period;
- #else
- uint32_t time_at_period;
- #endif
+ RTEMS_CPU_USAGE_STATISTICS_TIME_TYPE owner_executed_at_period;
+ rtems_rate_monotonic_period_time_t time_at_period;
uint32_t next_length;
Thread_Control *owner;
rtems_rate_monotonic_period_statistics Statistics;