forked from Imagelibrary/rtems
2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-part.c, libmisc/monitor/mon-prmisc.c, libmisc/monitor/mon-queue.c, libmisc/monitor/mon-region.c, libmisc/monitor/mon-sema.c, libmisc/monitor/mon-task.c, libmisc/monitor/monitor.h: Use rtems_object_get_name() instead of internal routine. This makes it possible to also print string names of POSIX objects. Adjust task report to realign since we can have longer names.
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c,
|
||||
libmisc/monitor/mon-part.c, libmisc/monitor/mon-prmisc.c,
|
||||
libmisc/monitor/mon-queue.c, libmisc/monitor/mon-region.c,
|
||||
libmisc/monitor/mon-sema.c, libmisc/monitor/mon-task.c,
|
||||
libmisc/monitor/monitor.h: Use rtems_object_get_name() instead of
|
||||
internal routine. This makes it possible to also print string names
|
||||
of POSIX objects. Adjust task report to realign since we can have
|
||||
longer names.
|
||||
|
||||
2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* sapi/include/confdefs.h, score/src/threadcreateidle.c: Idle thread
|
||||
|
||||
@@ -69,7 +69,7 @@ rtems_monitor_extension_dump(
|
||||
|
||||
length += rtems_monitor_dump_id(monitor_extension->id);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += rtems_monitor_dump_name(monitor_extension->name);
|
||||
length += rtems_monitor_dump_name(monitor_extension->id);
|
||||
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += fprintf(stdout,"create: ");
|
||||
|
||||
@@ -96,7 +96,7 @@ rtems_monitor_init_task_dump(
|
||||
length += rtems_monitor_dump_decimal(monitor_itask->id);
|
||||
|
||||
length += rtems_monitor_pad(7, length);
|
||||
length += rtems_monitor_dump_name(monitor_itask->name);
|
||||
length += rtems_monitor_dump_name(monitor_itask->id);
|
||||
|
||||
length += rtems_monitor_pad(14, length);
|
||||
length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
|
||||
|
||||
@@ -52,7 +52,7 @@ rtems_monitor_part_dump(
|
||||
|
||||
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_dump_name(monitor_part->id);
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += rtems_monitor_dump_attributes(monitor_part->attribute);
|
||||
length += rtems_monitor_pad(30, length);
|
||||
|
||||
@@ -42,15 +42,6 @@ rtems_monitor_pad(
|
||||
return fprintf(stdout,"%*s", pad_length, "");
|
||||
}
|
||||
|
||||
int
|
||||
rtems_monitor_dump_char(char ch)
|
||||
{
|
||||
if (isprint(ch))
|
||||
return fprintf(stdout,"%c", ch);
|
||||
else
|
||||
return fprintf(stdout,"%02x", (unsigned char)ch);
|
||||
}
|
||||
|
||||
int
|
||||
rtems_monitor_dump_decimal(uint32_t num)
|
||||
{
|
||||
@@ -98,25 +89,13 @@ rtems_monitor_dump_id(rtems_id id)
|
||||
}
|
||||
|
||||
int
|
||||
rtems_monitor_dump_name(rtems_name name)
|
||||
rtems_monitor_dump_name(rtems_id id)
|
||||
{
|
||||
uint32_t i;
|
||||
int length = 0;
|
||||
union {
|
||||
uint32_t ui;
|
||||
char c[4];
|
||||
} u;
|
||||
char name_buffer[18];
|
||||
|
||||
u.ui = (uint32_t ) name;
|
||||
rtems_object_get_name( id, sizeof(name_buffer), name_buffer );
|
||||
|
||||
#if (CPU_BIG_ENDIAN == TRUE)
|
||||
for (i=0; i<sizeof(u.c); i++)
|
||||
length += rtems_monitor_dump_char(u.c[i]);
|
||||
#else
|
||||
for (i=0; i<sizeof(u.c); i++)
|
||||
length += rtems_monitor_dump_char(u.c[sizeof(u.c)-1-i]);
|
||||
#endif
|
||||
return length;
|
||||
return fprintf( stdout, name_buffer );
|
||||
}
|
||||
|
||||
int
|
||||
@@ -250,15 +229,10 @@ rtems_assoc_t rtems_monitor_events_assoc[] = {
|
||||
int
|
||||
rtems_monitor_dump_events(rtems_event_set events)
|
||||
{
|
||||
uint32_t length = 0;
|
||||
|
||||
if (events == EVENT_SETS_NONE_PENDING) /* value is 0 */
|
||||
length += fprintf(stdout,"NONE");
|
||||
return fprintf(stdout," NONE ");
|
||||
|
||||
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
|
||||
":",
|
||||
events);
|
||||
return length;
|
||||
return fprintf(stdout,"%08" PRIx32, events);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -54,7 +54,7 @@ rtems_monitor_queue_dump(
|
||||
|
||||
length += rtems_monitor_dump_id(monitor_queue->id);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += rtems_monitor_dump_name(monitor_queue->name);
|
||||
length += rtems_monitor_dump_name(monitor_queue->id);
|
||||
length += rtems_monitor_pad(19, length);
|
||||
length += rtems_monitor_dump_attributes(monitor_queue->attributes);
|
||||
length += rtems_monitor_pad(31, length);
|
||||
|
||||
@@ -53,7 +53,7 @@ rtems_monitor_region_dump(
|
||||
|
||||
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_dump_name(monitor_region->id);
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += rtems_monitor_dump_attributes(monitor_region->attribute);
|
||||
length += rtems_monitor_pad(30, length);
|
||||
|
||||
@@ -67,7 +67,7 @@ rtems_monitor_sema_dump(
|
||||
|
||||
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_dump_name(monitor_sema->id);
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += rtems_monitor_dump_attributes(monitor_sema->attribute);
|
||||
length += rtems_monitor_pad(30, length);
|
||||
|
||||
@@ -61,7 +61,8 @@ rtems_monitor_task_dump_header(
|
||||
)
|
||||
{
|
||||
fprintf(stdout,"\
|
||||
ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
|
||||
ID NAME PRI STATE MODES EVENTS WAITID WAITARG NOTES\n\
|
||||
");
|
||||
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
|
||||
0 1 2 3 4 5 6 7 */
|
||||
|
||||
@@ -81,24 +82,24 @@ rtems_monitor_task_dump(
|
||||
|
||||
length += rtems_monitor_dump_id(monitor_task->id);
|
||||
length += rtems_monitor_pad(11, length);
|
||||
length += rtems_monitor_dump_name(monitor_task->name);
|
||||
length += rtems_monitor_pad(18, length);
|
||||
length += rtems_monitor_dump_name(monitor_task->id);
|
||||
length += rtems_monitor_pad(26, length);
|
||||
length += rtems_monitor_dump_priority(monitor_task->priority);
|
||||
length += rtems_monitor_pad(24, length);
|
||||
length += rtems_monitor_pad(29, length);
|
||||
length += rtems_monitor_dump_state(monitor_task->state);
|
||||
length += rtems_monitor_pad(31, length);
|
||||
length += rtems_monitor_pad(37, length);
|
||||
length += rtems_monitor_dump_modes(monitor_task->modes);
|
||||
length += rtems_monitor_pad(39, length);
|
||||
length += rtems_monitor_pad(45, length);
|
||||
length += rtems_monitor_dump_events(monitor_task->events);
|
||||
if (monitor_task->wait_id)
|
||||
{
|
||||
length += rtems_monitor_pad(47, length);
|
||||
length += rtems_monitor_pad(54, length);
|
||||
length += rtems_monitor_dump_id(monitor_task->wait_id);
|
||||
length += rtems_monitor_pad(57, length);
|
||||
length += rtems_monitor_pad(63, length);
|
||||
length += rtems_monitor_dump_hex(monitor_task->wait_args);
|
||||
}
|
||||
|
||||
length += rtems_monitor_pad(65, length);
|
||||
length += rtems_monitor_pad(72, length);
|
||||
length += rtems_monitor_dump_notepad(monitor_task->notepad);
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
@@ -401,11 +401,10 @@ void rtems_monitor_help_cmd(int, char **, rtems_monitor_command_arg_t *, bool
|
||||
/* prmisc.c */
|
||||
void rtems_monitor_separator(void);
|
||||
uint32_t rtems_monitor_pad(uint32_t dest_col, uint32_t curr_col);
|
||||
int rtems_monitor_dump_char(char ch);
|
||||
int rtems_monitor_dump_decimal(uint32_t num);
|
||||
int rtems_monitor_dump_hex(uint32_t num);
|
||||
int rtems_monitor_dump_id(rtems_id id);
|
||||
int rtems_monitor_dump_name(rtems_name name);
|
||||
int rtems_monitor_dump_name(rtems_id id);
|
||||
int rtems_monitor_dump_priority(rtems_task_priority priority);
|
||||
int rtems_monitor_dump_state(States_Control state);
|
||||
int rtems_monitor_dump_modes(rtems_mode modes);
|
||||
|
||||
Reference in New Issue
Block a user