1 | monitor task |
---|
2 | |
---|
3 | The monitor task is an optional task that knows about RTEMS |
---|
4 | data structures and can print out information about them. |
---|
5 | It is a work-in-progress and needs many more commands, but |
---|
6 | is useful now. |
---|
7 | |
---|
8 | The monitor works best when it is the highest priority task, |
---|
9 | so all your other tasks should ideally be at some priority |
---|
10 | greater than 1. |
---|
11 | |
---|
12 | To use the monitor: |
---|
13 | ------------------- |
---|
14 | |
---|
15 | #include <rtems/monitor.h> |
---|
16 | |
---|
17 | ... |
---|
18 | |
---|
19 | rtems_monitor_init(0); |
---|
20 | |
---|
21 | The parameter to rtems_monitor_init() tells the monitor whether |
---|
22 | to suspend itself on startup. A value of 0 causes the monitor |
---|
23 | to immediately enter command mode; a non-zero value causes the |
---|
24 | monitor to suspend itself after creation and wait for explicit |
---|
25 | wakeup. |
---|
26 | |
---|
27 | |
---|
28 | rtems_monitor_wakeup(); |
---|
29 | |
---|
30 | wakes up a suspended monitor and causes it to reenter command mode. |
---|
31 | |
---|
32 | Monitor commands |
---|
33 | ---------------- |
---|
34 | |
---|
35 | The monitor prompt is 'rtems> '. |
---|
36 | Can abbreviate commands to "uniquity" |
---|
37 | There is a 'help' command. Here is the output from various |
---|
38 | help commands: |
---|
39 | |
---|
40 | Commands (may be abbreviated) |
---|
41 | |
---|
42 | help -- get this message or command specific help |
---|
43 | task -- show task information |
---|
44 | queue -- show message queue information |
---|
45 | symbol -- show entries from symbol table |
---|
46 | pause -- pause monitor for a specified number of ticks |
---|
47 | fatal -- invoke a fatal RTEMS error |
---|
48 | |
---|
49 | task [id [id ...] ] |
---|
50 | display information about the specified tasks. |
---|
51 | Default is to display information about all tasks on this node |
---|
52 | |
---|
53 | queue [id [id ... ] ] |
---|
54 | display information about the specified message queues |
---|
55 | Default is to display information about all queues on this node |
---|
56 | |
---|
57 | symbol [ symbolname [symbolname ... ] ] |
---|
58 | display value associated with specified symbol. |
---|
59 | Defaults to displaying all known symbols. |
---|
60 | |
---|
61 | pause [ticks] |
---|
62 | monitor goes to "sleep" for specified ticks (default is 1) |
---|
63 | monitor will resume at end of period or if explicitly awakened |
---|
64 | |
---|
65 | fatal [status] |
---|
66 | Invoke 'rtems_fatal_error_occurred' with 'status' |
---|
67 | (default is RTEMS_INTERNAL_ERROR) |
---|
68 | |
---|
69 | continue |
---|
70 | put the monitor to sleep waiting for an explicit wakeup from the |
---|
71 | program running. |
---|
72 | |
---|
73 | |
---|
74 | Sample output from 'task' command |
---|
75 | --------------------------------- |
---|
76 | |
---|
77 | rtems> task |
---|
78 | ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES |
---|
79 | ------------------------------------------------------------------------ |
---|
80 | 00010001 UI1 2 READY P:T:nA NONE15: 0x40606348 |
---|
81 | 00010002 RMON 1 READY nP NONE15: 0x40604110 |
---|
82 | |
---|
83 | 'RMON' is the monitor itself, so we have 1 "user" task. |
---|
84 | Its modes are P:T:nA which translate to: |
---|
85 | |
---|
86 | preemptable |
---|
87 | timesliced |
---|
88 | no ASRS |
---|
89 | |
---|
90 | It has no events. |
---|
91 | (this is the libc thread state) |
---|
92 | |
---|