source: rtems/cpukit/libmisc/monitor/mon-extension.c @ f97536d

5
Last change on this file since f97536d was f97536d, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 16, 2015 at 6:21:48 AM

basdefs.h: Add and use RTEMS_UNUSED

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/*
2 * RTEMS Monitor extension support
3 */
4
5#ifdef HAVE_CONFIG_H
6#include "config.h"
7#endif
8
9#include <rtems.h>
10#include <rtems/monitor.h>
11
12#include <stdio.h>
13
14void
15rtems_monitor_extension_canonical(
16    rtems_monitor_extension_t *canonical_extension,
17    const void                *extension_void
18)
19{
20    const Extension_Control *rtems_extension = (const Extension_Control *) extension_void;
21    const rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
22
23    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
24                                            (void *) e->thread_create);
25
26    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
27                                            (void *) e->thread_start);
28    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
29                                            (void *) e->thread_restart);
30    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
31                                            (void *) e->thread_delete);
32    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
33                                            (void *) e->thread_switch);
34    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
35                                            (void *) e->thread_begin);
36    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
37                                            (void *) e->thread_exitted);
38    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
39                                            (void *) e->fatal);
40}
41
42void
43rtems_monitor_extension_dump_header(
44    bool verbose RTEMS_UNUSED
45)
46{
47    fprintf(stdout,"\
48  ID       NAME\n");
49/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
500         1         2         3         4         5         6         7       */
51
52    rtems_monitor_separator();
53}
54
55
56/*
57 * Dump out the canonical form
58 */
59
60void
61rtems_monitor_extension_dump(
62    rtems_monitor_extension_t *monitor_extension,
63    bool                       verbose
64)
65{
66    uint32_t             length = 0;
67
68    length += rtems_monitor_dump_id(monitor_extension->id);
69    length += rtems_monitor_pad(11, length);
70    length += rtems_monitor_dump_name(monitor_extension->id);
71
72    length += rtems_monitor_pad(18, length);
73    length += fprintf(stdout,"create: ");
74    length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
75    length += fprintf(stdout,";  start: ");
76    length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
77    length += fprintf(stdout,";  restart: ");
78    length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
79    length += fprintf(stdout,"\n");
80    length = 0;
81
82    length += rtems_monitor_pad(18, length);
83    length += fprintf(stdout,"delete: ");
84    length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
85    length += fprintf(stdout,";  switch: ");
86    length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
87    length += fprintf(stdout,";  begin: ");
88    length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
89    length += fprintf(stdout,"\n");
90    length = 0;
91
92    length += rtems_monitor_pad(18, length);
93    length += fprintf(stdout,"exitted: ");
94    length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
95    length += fprintf(stdout,";  fatal: ");
96    length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
97    length += fprintf(stdout,"\n");
98    length = 0;
99    fprintf(stdout,"\n");
100}
Note: See TracBrowser for help on using the repository browser.