54 #define RTEMS_CAPTURE_TRIGGER_TASKS (32) 96 uint32_t from_triggers;
106 #define RTEMS_CAPTURE_CONTROL_FROM_MASK(_s) \ 107 (UINT32_C(1) << (RTEMS_CAPTURE_TRIGGER_TASKS - ((_s) + 1))) 112 #define RTEMS_CAPTURE_WATCH (1U << 0) 117 #define RTEMS_CAPTURE_SWITCH (1 << 0) 118 #define RTEMS_CAPTURE_CREATE (1 << 1) 119 #define RTEMS_CAPTURE_START (1 << 2) 120 #define RTEMS_CAPTURE_RESTART (1 << 3) 121 #define RTEMS_CAPTURE_DELETE (1 << 4) 122 #define RTEMS_CAPTURE_BEGIN (1 << 5) 123 #define RTEMS_CAPTURE_EXITTED (1 << 6) 124 #define RTEMS_CAPTURE_TERMINATED (1 << 7) 126 #define RTEMS_CAPTURE_FROM_TRIGS (RTEMS_CAPTURE_SWITCH | \ 127 RTEMS_CAPTURE_CREATE | \ 128 RTEMS_CAPTURE_START | \ 129 RTEMS_CAPTURE_RESTART | \ 130 RTEMS_CAPTURE_DELETE) 132 #define RTEMS_CAPTURE_TO_TRIGS (RTEMS_CAPTURE_SWITCH | \ 133 RTEMS_CAPTURE_CREATE | \ 134 RTEMS_CAPTURE_START | \ 135 RTEMS_CAPTURE_RESTART | \ 136 RTEMS_CAPTURE_DELETE | \ 137 RTEMS_CAPTURE_BEGIN | \ 138 RTEMS_CAPTURE_EXITTED) 143 #define RTEMS_CAPTURE_TRACED (1U << 0) 144 #define RTEMS_CAPTURE_INIT_TASK (1U << 1) 145 #define RTEMS_CAPTURE_RECORD_TASK (1U << 2) 157 rtems_capture_time_t time;
180 #define RTEMS_CAPTURE_REAL_PRI_EVENT_MASK UINT32_C (0x000000ff) 181 #define RTEMS_CAPTURE_CURR_PRI_EVENT_MASK UINT32_C (0x0000ff00) 182 #define RTEMS_CAPTURE_REAL_PRIORITY_EVENT (0) 183 #define RTEMS_CAPTURE_CURR_PRIORITY_EVENT (8) 184 #define RTEMS_CAPTURE_EVENT_START (16) 185 #define RTEMS_CAPTURE_CREATED_BY_EVENT UINT32_C (0x00010000) 186 #define RTEMS_CAPTURE_CREATED_EVENT UINT32_C (0x00020000) 187 #define RTEMS_CAPTURE_STARTED_BY_EVENT UINT32_C (0x00040000) 188 #define RTEMS_CAPTURE_STARTED_EVENT UINT32_C (0x00080000) 189 #define RTEMS_CAPTURE_RESTARTED_BY_EVENT UINT32_C (0x00100000) 190 #define RTEMS_CAPTURE_RESTARTED_EVENT UINT32_C (0x00200000) 191 #define RTEMS_CAPTURE_DELETED_BY_EVENT UINT32_C (0x00400000) 192 #define RTEMS_CAPTURE_DELETED_EVENT UINT32_C (0x00800000) 193 #define RTEMS_CAPTURE_TERMINATED_EVENT UINT32_C (0x01000000) 194 #define RTEMS_CAPTURE_BEGIN_EVENT UINT32_C (0x02000000) 195 #define RTEMS_CAPTURE_EXITTED_EVENT UINT32_C (0x04000000) 196 #define RTEMS_CAPTURE_SWITCHED_OUT_EVENT UINT32_C (0x08000000) 197 #define RTEMS_CAPTURE_SWITCHED_IN_EVENT UINT32_C (0x10000000) 198 #define RTEMS_CAPTURE_TIMESTAMP UINT32_C (0x20000000) 199 #define RTEMS_CAPTURE_EVENT_END (29) 208 rtems_capture_to_any,
209 rtems_capture_from_any,
210 rtems_capture_from_to
220 rtems_capture_switch,
221 rtems_capture_create,
223 rtems_capture_restart,
224 rtems_capture_delete,
226 rtems_capture_exitted,
227 rtems_capture_terminated
316 rtems_capture_flush (
bool prime);
490 rtems_capture_trigger_mode_t mode,
491 rtems_capture_trigger_t trigger);
516 rtems_capture_trigger_mode_t mode,
517 rtems_capture_trigger_t trigger);
571 rtems_capture_time (rtems_capture_time_t* uptime);
613 static inline bool rtems_capture_task_recorded(
rtems_tcb* tcb ) {
614 return ( (tcb->Capture.flags & RTEMS_CAPTURE_RECORD_TASK) != 0 );
625 static inline bool rtems_capture_task_initialized(
rtems_tcb* tcb ) {
626 return ( (tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0 );
654 rtems_capture_task_state (
rtems_tcb* tcb)
687 static inline uint32_t
688 rtems_capture_task_flags (
rtems_tcb* tcb)
690 return tcb->Capture.flags;
703 rtems_capture_task_control (
rtems_tcb* tcb)
705 return tcb->Capture.control;
717 static inline uint32_t
718 rtems_capture_task_control_flags (
rtems_tcb* tcb)
723 return control->flags;
738 rtems_capture_task_start_priority (
rtems_tcb* tcb)
755 rtems_capture_task_real_priority (
rtems_tcb* tcb)
770 rtems_capture_task_curr_priority (
rtems_tcb* tcb)
801 return control->next;
831 return control->name;
843 static inline uint32_t
846 return control->flags;
858 static inline uint32_t
861 return control->to_triggers;
873 static inline uint32_t
876 return control->from_triggers;
888 static inline uint32_t
891 return control->by_triggers;
924 return control->by[by].name;
925 return control->by[0].name;
939 return control->by[by].id;
940 return control->by[0].id;
950 static inline uint32_t
955 return control->by[by].trigger;
956 return control->by[0].trigger;
968 static inline uint32_t
969 rtems_capture_control_count (
void)
977 control = rtems_capture_next_control (control);
rtems_status_code rtems_capture_watch_floor(rtems_task_priority floor)
Capture set watch floor.
Definition: capture.c:970
ssize_t read(int fd, void *buffer, size_t count)
POSIX 1003.1b 6.4.1 - Read From a File.
Definition: read.c:27
rtems_status_code rtems_capture_watch_del(rtems_name name, rtems_id id)
Capture delete watch.
Definition: capture.c:821
rtems_status_code rtems_capture_watch_global(bool enable)
Capture enable/disable global watch.
Definition: capture.c:912
Priority_Control current_priority
This field is the current priority state of this thread.
Definition: thread.h:683
rtems_status_code rtems_capture_clear_trigger(rtems_name from_name, rtems_id from_id, rtems_name to_name, rtems_id to_id, rtems_capture_trigger_mode_t mode, rtems_capture_trigger_t trigger)
Capture clear trigger.
Definition: capture.c:1108
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:80
struct rtems_capture_control_s rtems_capture_control_t
Capture control structure for a group of tasks.
rtems_capture_trigger_mode_e
Capture trigger modes.
Definition: capture.h:206
Thread_Start_information Start
This field contains information about the starting state of this thread.
Definition: thread.h:782
rtems_status_code rtems_capture_monitor(bool enable)
Capture monitor enable/disable.
Definition: capture.c:711
void rtems_capture_record_task(rtems_tcb *tcb)
Capture record task.
Definition: capture.c:375
bool rtems_capture_watch_global_on(void)
Get global watch state.
Definition: capture.c:936
void(* rtems_capture_timestamp)(rtems_capture_time_t *time)
Capture timestamp callout handler.
Definition: capture.h:238
rtems_status_code rtems_capture_set_trigger(rtems_name from_name, rtems_id from_id, rtems_name to_name, rtems_id to_id, rtems_capture_trigger_mode_t mode, rtems_capture_trigger_t trigger)
Capture set trigger.
Definition: capture.c:1030
rtems_status_code rtems_capture_close(void)
Capture close.
Definition: capture.c:623
rtems_status_code rtems_capture_release(uint32_t cpu, uint32_t count)
Capture release records.
Definition: capture.c:1256
#define RTEMS_CAPTURE_TRIGGER_TASKS
The number of tasks in a trigger group.
Definition: capture.h:54
rtems_status_code rtems_capture_watch_add(rtems_name name, rtems_id id)
Capture add watch.
Definition: capture.c:790
Priority_Control rtems_task_priority
Define the type for an RTEMS API task priority.
Definition: tasks.h:79
rtems_status_code
Classic API Status.
Definition: status.h:46
uint64_t rtems_capture_time_t
A capture timestamp.
Definition: capture.h:61
Objects_Control Object
This field is the object management structure for each thread.
Definition: thread.h:673
rtems_task_priority rtems_capture_watch_get_floor(void)
Capture set watch floor.
Definition: capture.c:980
uint32_t rtems_name
Classic API object name type.
Definition: types.h:74
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
void rtems_capture_initialize_task(rtems_tcb *tcb)
Capture initialize task.
Definition: capture.c:350
Priority_Control real_priority
This field is the base priority of this thread.
Definition: thread.h:691
rtems_status_code rtems_capture_control(bool enable)
Capture control trace enable/disable.
Definition: capture.c:683
rtems_status_code rtems_capture_watch_ctrl(rtems_name name, rtems_id id, bool enable)
Capture enable/disable watch.
Definition: capture.c:870
Task id and mask for the from trigger.
Definition: capture.h:72
rtems_capture_control_t * rtems_capture_get_control_list(void)
Capture get control list.
Definition: capture.c:1340
rtems_status_code rtems_object_get_classic_name(rtems_id id, rtems_name *name)
Obtain Name of Object.
Definition: rtemsobjectgetclassicname.c:25
States_Control current_state
This field is the current execution state of this thread.
Definition: thread.h:675
Definition: rtems_bsdnet.h:233
uint32_t States_Control
The following type defines the control block used to manage a thread's state.
Definition: states.h:41
rtems_task_priority rtems_capture_watch_get_ceiling(void)
Get watch ceiling.
Definition: capture.c:958
const char * rtems_capture_event_text(int event)
Capture get event text.
Definition: capture.c:1328
enum rtems_capture_trigger_e rtems_capture_trigger_t
Capture trigger.
RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_tasks_Priority_from_Core(Priority_Control priority)
Converts a core priority into an RTEMS API priority.
Definition: tasksimpl.h:127
struct rtems_capture_from_s rtems_capture_from_t
Task id and mask for the from trigger.
enum rtems_capture_trigger_mode_e rtems_capture_trigger_mode_t
Capture trigger modes.
Capture control structure for a group of tasks.
Definition: capture.h:90
#define RTEMS_CAPTURE_CONTROL_FROM_MASK(_s)
The from_valid mask.
Definition: capture.h:106
rtems_status_code rtems_capture_watch_ceiling(rtems_task_priority ceiling)
Set watch ceiling.
Definition: capture.c:948
rtems_status_code rtems_capture_read(uint32_t cpu, uint32_t *read, rtems_capture_record_t **recs)
Capture read records from capture buffer.
Definition: capture.c:1208
rtems_status_code rtems_capture_open(uint32_t size, rtems_capture_timestamp timestamp)
Capture open.
Definition: capture.c:567
rtems_capture_trigger_e
Capture trigger.
Definition: capture.h:218
Definition: capture.h:154
Classic Tasks Manager Implementation.
Definition: capture.h:169
Objects_Id id
This is the object's ID.
Definition: object.h:236