summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems/ratemon.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-15 20:16:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-15 20:16:16 +0000
commite1bce866cf503c34f2914b76c9978bc598096013 (patch)
treed2419a46c38bc4d0eed2eaee219ec946de075596 /cpukit/rtems/include/rtems/rtems/ratemon.h
parent2007-05-15 Ray Xu <rayx@gmail.com> (diff)
downloadrtems-e1bce866cf503c34f2914b76c9978bc598096013.tar.bz2
2007-05-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, preinstall.am, libmisc/Makefile.am, rtems/Makefile.am, rtems/include/rtems.h, rtems/include/rtems/rtems/ratemon.h, rtems/inline/rtems/rtems/ratemon.inl, rtems/src/ratemoncancel.c, rtems/src/ratemoncreate.c, rtems/src/ratemondelete.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonident.c, rtems/src/ratemonperiod.c, rtems/src/ratemontimeout.c, score/Makefile.am, score/include/rtems/score/object.h, score/src/threadhandler.c, wrapup/Makefile.am: Integrate Rate Monotonic Statistics and Period Usage into Rate Monotonic Manager. Added the following directives: rtems_rate_monotonic_get_statistics, rtems_rate_monotonic_reset_statistics, rtems_rate_montonic_reset_all_statistics, rtems_rate_montonic_report_statistics, and rtems_object_get_name. Obsoleted the rtems/rtmonuse.h file as a public interface. * rtems/src/ratemongetstatistics.c, rtems/src/ratemonreportstatistics.c, rtems/src/ratemonresetall.c, rtems/src/ratemonresetstatistics.c, rtems/src/rtemsobjectgetname.c, score/src/objectgetnameasstring.c: New files. * libmisc/rtmonuse/rtmonuse.c, libmisc/rtmonuse/rtmonuse.h: Removed.
Diffstat (limited to 'cpukit/rtems/include/rtems/rtems/ratemon.h')
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h101
1 files changed, 92 insertions, 9 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
index 0d9d5aa903..84e3454164 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemon.h
@@ -15,7 +15,7 @@
* + conclude current and start the next period
* + obtain status information on a period
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -35,6 +35,9 @@ extern "C" {
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/watchdog.h>
+#include <rtems/rtems/status.h>
+
+#include <string.h>
/*
* The following enumerated type defines the states in which a
@@ -59,10 +62,26 @@ typedef enum {
#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
/*
+ * The following defines the statistics kept on each period instance.
+ */
+
+typedef struct {
+ uint32_t count;
+ uint32_t missed_count;
+ uint32_t min_cpu_time;
+ uint32_t max_cpu_time;
+ uint32_t total_cpu_time;
+ uint32_t min_wall_time;
+ uint32_t max_wall_time;
+ uint32_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;
uint32_t ticks_since_last_period;
uint32_t ticks_executed_since_last_period;
@@ -74,13 +93,14 @@ typedef struct {
*/
typedef struct {
- Objects_Control Object;
- Watchdog_Control Timer;
- rtems_rate_monotonic_period_states state;
- uint32_t owner_ticks_executed_at_period;
- uint32_t time_at_period;
- uint32_t next_length;
- Thread_Control *owner;
+ Objects_Control Object;
+ Watchdog_Control Timer;
+ rtems_rate_monotonic_period_states state;
+ uint32_t owner_ticks_executed_at_period;
+ uint32_t time_at_period;
+ uint32_t next_length;
+ Thread_Control *owner;
+ rtems_rate_monotonic_period_statistics Statistics;
} Rate_monotonic_Control;
RTEMS_EXTERN Objects_Information _Rate_monotonic_Information;
@@ -171,6 +191,52 @@ rtems_status_code rtems_rate_monotonic_get_status(
);
/*
+ * rtems_rate_monotonic_get_statistics
+ *
+ * DESCRIPTION:
+ *
+ * This routine implements the rtems_rate_monotonic_get_statistics directive.
+ * Statistics gathered from the use of this period are returned.
+ */
+
+rtems_status_code rtems_rate_monotonic_get_statistics(
+ Objects_Id id,
+ rtems_rate_monotonic_period_statistics *statistics
+);
+
+/*
+ * rtems_rate_monotonic_reset_statistics
+ *
+ * DESCRIPTION:
+ *
+ * This directive allows a thread to reset the statistics information
+ * on a specific period instance.
+ */
+rtems_status_code rtems_rate_monotonic_reset_statistics(
+ Objects_Id id
+);
+
+/*
+ * rtems_rate_montonic_reset_all_statistics
+ *
+ * DESCRIPTION:
+ *
+ * This directive allows a thread to reset the statistics information
+ * on ALL period instances.
+ */
+void rtems_rate_montonic_reset_all_statistics( void );
+
+/*
+ * rtems_rate_montonic_report_statistics
+ *
+ * DESCRIPTION:
+ *
+ * This directive allows a thread to print the statistics information
+ * on ALL period instances which have non-zero counts using printk.
+ */
+void rtems_rate_montonic_report_statistics( void );
+
+/*
* rtems_rate_monotonic_period
*
* DESCRIPTION:
@@ -199,11 +265,28 @@ rtems_status_code rtems_rate_monotonic_period(
* state and not restarted.
*/
-void _Rate_monotonic_Timeout (
+void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
);
+/*
+ * _Rate_monotonic_Reset_statistics
+ *
+ * DESCRIPTION:
+ *
+ * This method resets the statistics information for a period instance.
+ */
+
+#define _Rate_monotonic_Reset_statistics( _the_period ) \
+ do { \
+ memset( \
+ &(_the_period)->Statistics, \
+ 0, \
+ sizeof( rtems_rate_monotonic_period_statistics ) \
+ ); \
+ } while (0)
+
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/ratemon.inl>
#endif