summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2007-09-05 20:35:36 +0000
committerThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2007-09-05 20:35:36 +0000
commit501ab69168fbfcd81270f7e1943162b87c62b8cc (patch)
treef747727466317e8b93709046fd0367270d6d550e /cpukit
parent2007-09-05 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-501ab69168fbfcd81270f7e1943162b87c62b8cc.tar.bz2
Added osmonweb support functionality to monitor
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog8
-rw-r--r--cpukit/libmisc/monitor/mon-monitor.c36
-rw-r--r--cpukit/libmisc/monitor/mon-object.c24
-rw-r--r--cpukit/libmisc/monitor/mon-part.c68
-rw-r--r--cpukit/libmisc/monitor/mon-region.c69
-rw-r--r--cpukit/libmisc/monitor/mon-sema.c80
-rw-r--r--cpukit/libmisc/monitor/mon-task.c8
-rw-r--r--cpukit/libmisc/monitor/monitor.h63
8 files changed, 352 insertions, 4 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index fa3e0b4c35..c0220bc2dd 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-05 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+ * libmisc/monitor/mon-object.c,
+ * libmisc/monitor/monitor.h, libmisc/monitor/mon-part.c,
+ * libmisc/monitor/mon-region.c, libmisc/monitor/mon-sema.c,
+ * libmisc/monitor/mon-task, libmisc/Makefile.am:
+ Added functionality for osmonweb support
+
2007-09-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-object.c,
diff --git a/cpukit/libmisc/monitor/mon-monitor.c b/cpukit/libmisc/monitor/mon-monitor.c
index b48a7777da..4d4dd95349 100644
--- a/cpukit/libmisc/monitor/mon-monitor.c
+++ b/cpukit/libmisc/monitor/mon-monitor.c
@@ -160,6 +160,33 @@ rtems_monitor_command_entry_t rtems_monitor_commands[] = {
{ RTEMS_MONITOR_OBJECT_QUEUE },
&rtems_monitor_commands[11],
},
+ { "sema",
+ "sema [id [id ... ] ]\n"
+ " display information about the specified semaphores\n"
+ " Default is to display information about all semaphores on this node\n"
+ ,
+ 0,
+ rtems_monitor_object_cmd,
+ RTEMS_MONITOR_OBJECT_SEMAPHORE,
+ },
+ { "region",
+ "region [id [id ... ] ]\n"
+ " display information about the specified regions\n"
+ " Default is to display information about all regions on this node\n"
+ ,
+ 0,
+ rtems_monitor_object_cmd,
+ RTEMS_MONITOR_OBJECT_REGION,
+ },
+ { "part",
+ "part [id [id ... ] ]\n"
+ " display information about the specified partitions\n"
+ " Default is to display information about all partitions on this node\n"
+ ,
+ 0,
+ rtems_monitor_object_cmd,
+ RTEMS_MONITOR_OBJECT_SEMAPHORE,
+ },
{ "object",
"Display information about specified RTEMS objects. "
"Object id's must include 'type' information. "
@@ -505,6 +532,10 @@ rtems_monitor_task(
}
}
+ if (!(monitor_flags & RTEMS_MONITOR_NOSYMLOAD)) {
+ rtems_monitor_symbols_loadup();
+ }
+
if (monitor_flags & RTEMS_MONITOR_SUSPEND)
(void) rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
@@ -573,10 +604,7 @@ rtems_monitor_init(
rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
rtems_monitor_default_node = rtems_monitor_node;
- rtems_monitor_symbols_loadup();
-
- if (monitor_flags & RTEMS_MONITOR_GLOBAL)
- rtems_monitor_server_init(monitor_flags);
+ rtems_monitor_server_init(monitor_flags);
if (!(monitor_flags & RTEMS_MONITOR_NOTASK)) {
/*
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
index 69027e6e64..05c0d30afd 100644
--- a/cpukit/libmisc/monitor/mon-object.c
+++ b/cpukit/libmisc/monitor/mon-object.c
@@ -84,6 +84,30 @@ rtems_monitor_object_info_t rtems_monitor_object_info[] =
(rtems_monitor_object_dump_header_fn) rtems_monitor_queue_dump_header,
(rtems_monitor_object_dump_fn) rtems_monitor_queue_dump,
},
+ { RTEMS_MONITOR_OBJECT_SEMAPHORE,
+ (void *) &_Semaphore_Information,
+ sizeof(rtems_monitor_sema_t),
+ (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
+ (rtems_monitor_object_canonical_fn) rtems_monitor_sema_canonical,
+ (rtems_monitor_object_dump_header_fn) rtems_monitor_sema_dump_header,
+ (rtems_monitor_object_dump_fn) rtems_monitor_sema_dump,
+ },
+ { RTEMS_MONITOR_OBJECT_REGION,
+ (void *) &_Region_Information,
+ sizeof(rtems_monitor_region_t),
+ (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
+ (rtems_monitor_object_canonical_fn) rtems_monitor_region_canonical,
+ (rtems_monitor_object_dump_header_fn) rtems_monitor_region_dump_header,
+ (rtems_monitor_object_dump_fn) rtems_monitor_region_dump,
+ },
+ { RTEMS_MONITOR_OBJECT_PARTITION,
+ (void *) &_Partition_Information,
+ sizeof(rtems_monitor_part_t),
+ (rtems_monitor_object_next_fn) rtems_monitor_manager_next,
+ (rtems_monitor_object_canonical_fn) rtems_monitor_part_canonical,
+ (rtems_monitor_object_dump_header_fn) rtems_monitor_part_dump_header,
+ (rtems_monitor_object_dump_fn) rtems_monitor_part_dump,
+ },
{ RTEMS_MONITOR_OBJECT_EXTENSION,
(void *) &_Extension_Information,
sizeof(rtems_monitor_extension_t),
diff --git a/cpukit/libmisc/monitor/mon-part.c b/cpukit/libmisc/monitor/mon-part.c
new file mode 100644
index 0000000000..ff9c165208
--- /dev/null
+++ b/cpukit/libmisc/monitor/mon-part.c
@@ -0,0 +1,68 @@
+/*
+ * RTEMS Monitor partition support
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "monitor.h"
+#include <rtems/rtems/attr.inl>
+#include <stdio.h>
+#include <string.h> /* memcpy() */
+
+void
+rtems_monitor_part_canonical(
+ rtems_monitor_part_t *canonical_part,
+ void *part_void
+)
+{
+ Partition_Control *rtems_part = (Partition_Control *) part_void;
+
+ canonical_part->attribute = rtems_part->attribute_set;
+ canonical_part->start_addr = rtems_part->starting_address;
+ canonical_part->length = rtems_part->length;
+ canonical_part->buf_size = rtems_part->buffer_size;
+ canonical_part->used_blocks = rtems_part->number_of_used_blocks;
+}
+
+
+void
+rtems_monitor_part_dump_header(
+ boolean verbose
+)
+{
+ printf("\
+ ID NAME ATTR STARTADDR LENGTH BUF_SIZE USED_BLOCKS\n");
+/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
+ 1 2 3 4 5 6 7 */
+
+ rtems_monitor_separator();
+}
+
+/*
+ */
+
+void
+rtems_monitor_part_dump(
+ rtems_monitor_part_t *monitor_part,
+ boolean verbose
+)
+{
+ int length = 0;
+
+ length += rtems_monitor_dump_id(monitor_part->id);
+ length += rtems_monitor_pad(11, length);
+ length += rtems_monitor_dump_name(monitor_part->name);
+ length += rtems_monitor_pad(18, length);
+ length += rtems_monitor_dump_attributes(monitor_part->attribute);
+ length += rtems_monitor_pad(30, length);
+ length += rtems_monitor_dump_hex((uint32_t)monitor_part->start_addr);
+ length += rtems_monitor_pad(40, length);
+ length += rtems_monitor_dump_hex(monitor_part->length);
+ length += rtems_monitor_pad(50, length);
+ length += rtems_monitor_dump_hex(monitor_part->buf_size);
+ length += rtems_monitor_pad(60, length);
+ length += rtems_monitor_dump_hex(monitor_part->used_blocks);
+ printf("\n");
+}
+
diff --git a/cpukit/libmisc/monitor/mon-region.c b/cpukit/libmisc/monitor/mon-region.c
new file mode 100644
index 0000000000..136d739fab
--- /dev/null
+++ b/cpukit/libmisc/monitor/mon-region.c
@@ -0,0 +1,69 @@
+/*
+ * RTEMS Monitor region support
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "monitor.h"
+#include <rtems/rtems/attr.inl>
+#include <stdio.h>
+#include <string.h> /* memcpy() */
+
+void
+rtems_monitor_region_canonical(
+ rtems_monitor_region_t *canonical_region,
+ void *region_void
+)
+{
+ Region_Control *rtems_region = (Region_Control *) region_void;
+
+ canonical_region->attribute = rtems_region->attribute_set;
+ canonical_region->start_addr = rtems_region->starting_address;
+ canonical_region->length = rtems_region->length;
+ canonical_region->page_size = rtems_region->page_size;
+ canonical_region->max_seg_size = rtems_region->maximum_segment_size;
+ canonical_region->used_blocks = rtems_region->number_of_used_blocks;
+}
+
+
+void
+rtems_monitor_region_dump_header(
+ boolean verbose
+)
+{
+ printf("\
+ ID NAME ATTR STARTADDR LENGTH PAGE_SIZE USED_BLOCKS\n");
+/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
+ 1 2 3 4 5 6 7 */
+
+ rtems_monitor_separator();
+}
+
+/*
+ */
+
+void
+rtems_monitor_region_dump(
+ rtems_monitor_region_t *monitor_region,
+ boolean verbose
+)
+{
+ int length = 0;
+
+ length += rtems_monitor_dump_id(monitor_region->id);
+ length += rtems_monitor_pad(11, length);
+ length += rtems_monitor_dump_name(monitor_region->name);
+ length += rtems_monitor_pad(18, length);
+ length += rtems_monitor_dump_attributes(monitor_region->attribute);
+ length += rtems_monitor_pad(30, length);
+ length += rtems_monitor_dump_hex((uint32_t)monitor_region->start_addr);
+ length += rtems_monitor_pad(40, length);
+ length += rtems_monitor_dump_hex(monitor_region->length);
+ length += rtems_monitor_pad(50, length);
+ length += rtems_monitor_dump_hex(monitor_region->page_size);
+ length += rtems_monitor_pad(60, length);
+ length += rtems_monitor_dump_hex(monitor_region->used_blocks);
+ printf("\n");
+}
+
diff --git a/cpukit/libmisc/monitor/mon-sema.c b/cpukit/libmisc/monitor/mon-sema.c
new file mode 100644
index 0000000000..dd60ad8884
--- /dev/null
+++ b/cpukit/libmisc/monitor/mon-sema.c
@@ -0,0 +1,80 @@
+/*
+ * RTEMS Monitor semaphore support
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "monitor.h"
+#include <rtems/rtems/attr.inl>
+#include <stdio.h>
+#include <string.h> /* memcpy() */
+
+void
+rtems_monitor_sema_canonical(
+ rtems_monitor_sema_t *canonical_sema,
+ void *sema_void
+)
+{
+ Semaphore_Control *rtems_sema = (Semaphore_Control *) sema_void;
+
+ canonical_sema->attribute = rtems_sema->attribute_set;
+ canonical_sema->priority_ceiling =
+ rtems_sema->Core_control.mutex.Attributes.priority_ceiling;
+
+ canonical_sema->holder_id =
+ rtems_sema->Core_control.mutex.holder_id;
+
+ if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) {
+ /* we have a counting semaphore */
+ canonical_sema->cur_count =
+ rtems_sema->Core_control.semaphore.count;
+
+ canonical_sema->max_count =
+ rtems_sema->Core_control.semaphore.Attributes.maximum_count;
+ }
+ else {
+ /* we have a binary semaphore (mutex) */
+ canonical_sema->cur_count = rtems_sema->Core_control.mutex.lock;
+ canonical_sema->max_count = 1; /* mutex is either 0 or 1 */
+ }
+}
+
+
+void
+rtems_monitor_sema_dump_header(
+ boolean verbose
+)
+{
+ printf("\
+ ID NAME ATTR PRICEIL CURR_CNT HOLDID \n");
+/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
+ 1 2 3 4 5 6 7 */
+
+ rtems_monitor_separator();
+}
+
+/*
+ */
+
+void
+rtems_monitor_sema_dump(
+ rtems_monitor_sema_t *monitor_sema,
+ boolean verbose
+)
+{
+ int length = 0;
+
+ length += rtems_monitor_dump_id(monitor_sema->id);
+ length += rtems_monitor_pad(11, length);
+ length += rtems_monitor_dump_name(monitor_sema->name);
+ length += rtems_monitor_pad(18, length);
+ length += rtems_monitor_dump_attributes(monitor_sema->attribute);
+ length += rtems_monitor_pad(30, length);
+ length += rtems_monitor_dump_priority(monitor_sema->priority_ceiling);
+ length += rtems_monitor_pad(38, length);
+ length += rtems_monitor_dump_decimal(monitor_sema->cur_count);
+ length += rtems_monitor_pad(47, length);
+ length += rtems_monitor_dump_id(monitor_sema->holder_id);
+ printf("\n");
+}
diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c
index 98e097dc71..d559fd3962 100644
--- a/cpukit/libmisc/monitor/mon-task.c
+++ b/cpukit/libmisc/monitor/mon-task.c
@@ -33,6 +33,14 @@ rtems_monitor_task_canonical(
canonical_task->state = rtems_thread->current_state;
canonical_task->wait_id = rtems_thread->Wait.id;
canonical_task->events = api->pending_events;
+ /*
+ * FIXME: make this optionally cpu_time_executed
+ */
+#if 0
+ canonical_task->ticks = rtems_thread->ticks_executed;
+#else
+ canonical_task->ticks = 0;
+#endif
/* XXX modes and attributes only exist in the RTEMS API .. */
/* XXX not directly in the core thread.. they will have to be derived */
diff --git a/cpukit/libmisc/monitor/monitor.h b/cpukit/libmisc/monitor/monitor.h
index d80df9d8ee..1d88cae4f9 100644
--- a/cpukit/libmisc/monitor/monitor.h
+++ b/cpukit/libmisc/monitor/monitor.h
@@ -105,6 +105,7 @@ typedef struct {
uint32_t notepad[RTEMS_NUMBER_NOTEPADS];
rtems_id wait_id;
uint32_t wait_args;
+ uint32_t ticks;
} rtems_monitor_task_t;
/*
@@ -138,6 +139,20 @@ typedef struct {
} rtems_monitor_queue_t;
/*
+ * Semaphore
+ */
+typedef struct {
+ rtems_id id;
+ rtems_name name;
+ /* end of common portion */
+ rtems_attribute attribute;
+ rtems_task_priority priority_ceiling;
+ uint32_t max_count;
+ uint32_t cur_count;
+ rtems_id holder_id;
+} rtems_monitor_sema_t;
+
+/*
* Extension
*/
typedef struct {
@@ -154,6 +169,35 @@ typedef struct {
rtems_monitor_symbol_t e_fatal;
} rtems_monitor_extension_t;
+ /*
+ * Region
+ */
+typedef struct {
+ rtems_id id;
+ rtems_name name;
+ /* end of common portion */
+ rtems_attribute attribute;
+ void * start_addr;
+ uint32_t length;
+ uint32_t page_size;
+ uint32_t max_seg_size;
+ uint32_t used_blocks;
+} rtems_monitor_region_t;
+
+/*
+ * Partition
+ */
+typedef struct {
+ rtems_id id;
+ rtems_name name;
+ /* end of common portion */
+ rtems_attribute attribute;
+ void * start_addr;
+ uint32_t length;
+ uint32_t buf_size;
+ uint32_t used_blocks;
+} rtems_monitor_part_t;
+
/*
* Device driver
*/
@@ -220,9 +264,12 @@ typedef union {
rtems_monitor_generic_t generic;
rtems_monitor_task_t task;
rtems_monitor_queue_t queue;
+ rtems_monitor_sema_t sema;
rtems_monitor_extension_t extension;
rtems_monitor_driver_t driver;
rtems_monitor_config_t config;
+ rtems_monitor_region_t region;
+ rtems_monitor_part_t part;
#if defined(RTEMS_MULTIPROCESSING)
rtems_monitor_mpci_t mpci;
#endif
@@ -364,6 +411,7 @@ int rtems_monitor_dump_notepad(uint32_t *notepad);
/* object.c */
rtems_id rtems_monitor_id_fixup(rtems_id, uint32_t , rtems_monitor_object_type_t);
+rtems_monitor_object_info_t *rtems_monitor_object_lookup(rtems_monitor_object_type_t type);
rtems_id rtems_monitor_object_canonical_get(rtems_monitor_object_type_t, rtems_id, void *, size_t *size_p);
rtems_id rtems_monitor_object_canonical_next(rtems_monitor_object_info_t *, rtems_id, void *);
void *rtems_monitor_object_next(void *, void *, rtems_id, rtems_id *);
@@ -403,11 +451,26 @@ void rtems_monitor_task_canonical(rtems_monitor_task_t *, void *);
void rtems_monitor_task_dump_header(boolean verbose);
void rtems_monitor_task_dump(rtems_monitor_task_t *, boolean);
+/* sema.c */
+void rtems_monitor_sema_canonical(rtems_monitor_sema_t *, void *);
+void rtems_monitor_sema_dump_header(boolean verbose);
+void rtems_monitor_sema_dump(rtems_monitor_sema_t *, boolean);
+
/* queue.c */
void rtems_monitor_queue_canonical(rtems_monitor_queue_t *, void *);
void rtems_monitor_queue_dump_header(boolean verbose);
void rtems_monitor_queue_dump(rtems_monitor_queue_t *, boolean);
+/* region.c */
+void rtems_monitor_region_canonical(rtems_monitor_region_t *, void *);
+void rtems_monitor_region_dump_header(boolean verbose);
+void rtems_monitor_region_dump(rtems_monitor_region_t *, boolean);
+
+/* partition.c */
+void rtems_monitor_part_canonical(rtems_monitor_part_t *, void *);
+void rtems_monitor_part_dump_header(boolean verbose);
+void rtems_monitor_part_dump(rtems_monitor_part_t *, boolean);
+
/* driver.c */
void *rtems_monitor_driver_next(void *, rtems_monitor_driver_t *, rtems_id *);
void rtems_monitor_driver_canonical(rtems_monitor_driver_t *, void *);