55#define RTEMS_CAPTURE_INIT (1u << 0)
56#define RTEMS_CAPTURE_ON (1U << 1)
57#define RTEMS_CAPTURE_NO_MEMORY (1U << 2)
58#define RTEMS_CAPTURE_TRIGGERED (1U << 3)
59#define RTEMS_CAPTURE_GLOBAL_WATCH (1U << 4)
60#define RTEMS_CAPTURE_ONLY_MONITOR (1U << 5)
65#define RTEMS_CAPTURE_OVERFLOW (1U << 0)
66#define RTEMS_CAPTURE_READER_ACTIVE (1U << 1)
67#define RTEMS_CAPTURE_READER_WAITING (1U << 2)
72#define RTEMS_CAPTURE_TRIGGER_TASKS (32)
113 uint32_t to_triggers;
114 uint32_t from_triggers;
115 uint32_t by_triggers;
124#define RTEMS_CAPTURE_CONTROL_FROM_MASK(_s) \
125 (UINT32_C(1) << (RTEMS_CAPTURE_TRIGGER_TASKS - ((_s) + 1)))
130#define RTEMS_CAPTURE_WATCH (1U << 0)
135#define RTEMS_CAPTURE_SWITCH (1 << 0)
136#define RTEMS_CAPTURE_CREATE (1 << 1)
137#define RTEMS_CAPTURE_START (1 << 2)
138#define RTEMS_CAPTURE_RESTART (1 << 3)
139#define RTEMS_CAPTURE_DELETE (1 << 4)
140#define RTEMS_CAPTURE_BEGIN (1 << 5)
141#define RTEMS_CAPTURE_EXITTED (1 << 6)
142#define RTEMS_CAPTURE_TERMINATED (1 << 7)
144#define RTEMS_CAPTURE_FROM_TRIGS (RTEMS_CAPTURE_SWITCH | \
145 RTEMS_CAPTURE_CREATE | \
146 RTEMS_CAPTURE_START | \
147 RTEMS_CAPTURE_RESTART | \
148 RTEMS_CAPTURE_DELETE)
150#define RTEMS_CAPTURE_TO_TRIGS (RTEMS_CAPTURE_SWITCH | \
151 RTEMS_CAPTURE_CREATE | \
152 RTEMS_CAPTURE_START | \
153 RTEMS_CAPTURE_RESTART | \
154 RTEMS_CAPTURE_DELETE | \
155 RTEMS_CAPTURE_BEGIN | \
156 RTEMS_CAPTURE_EXITTED)
161#define RTEMS_CAPTURE_TRACED (1U << 0)
162#define RTEMS_CAPTURE_INIT_TASK (1U << 1)
163#define RTEMS_CAPTURE_RECORD_TASK (1U << 2)
197#define RTEMS_CAPTURE_REAL_PRI_EVENT_MASK UINT32_C (0x000000ff)
198#define RTEMS_CAPTURE_CURR_PRI_EVENT_MASK UINT32_C (0x0000ff00)
199#define RTEMS_CAPTURE_REAL_PRIORITY_EVENT (0)
200#define RTEMS_CAPTURE_CURR_PRIORITY_EVENT (8)
201#define RTEMS_CAPTURE_EVENT_START (16)
202#define RTEMS_CAPTURE_CREATED_BY_EVENT UINT32_C (0x00010000)
203#define RTEMS_CAPTURE_CREATED_EVENT UINT32_C (0x00020000)
204#define RTEMS_CAPTURE_STARTED_BY_EVENT UINT32_C (0x00040000)
205#define RTEMS_CAPTURE_STARTED_EVENT UINT32_C (0x00080000)
206#define RTEMS_CAPTURE_RESTARTED_BY_EVENT UINT32_C (0x00100000)
207#define RTEMS_CAPTURE_RESTARTED_EVENT UINT32_C (0x00200000)
208#define RTEMS_CAPTURE_DELETED_BY_EVENT UINT32_C (0x00400000)
209#define RTEMS_CAPTURE_DELETED_EVENT UINT32_C (0x00800000)
210#define RTEMS_CAPTURE_TERMINATED_EVENT UINT32_C (0x01000000)
211#define RTEMS_CAPTURE_BEGIN_EVENT UINT32_C (0x02000000)
212#define RTEMS_CAPTURE_EXITTED_EVENT UINT32_C (0x04000000)
213#define RTEMS_CAPTURE_SWITCHED_OUT_EVENT UINT32_C (0x08000000)
214#define RTEMS_CAPTURE_SWITCHED_IN_EVENT UINT32_C (0x10000000)
215#define RTEMS_CAPTURE_TIMESTAMP UINT32_C (0x20000000)
216#define RTEMS_CAPTURE_EVENT_END (29)
225 rtems_capture_to_any,
226 rtems_capture_from_any,
227 rtems_capture_from_to
237 rtems_capture_switch,
238 rtems_capture_create,
240 rtems_capture_restart,
241 rtems_capture_delete,
243 rtems_capture_exitted,
244 rtems_capture_terminated
702rtems_capture_record_append (
void* rec,
const void* data,
size_t size)
704 memcpy (rec, data,
size);
705 return ((uint8_t*) rec) +
size;
720rtems_capture_record_extract (
const void* rec,
void* data,
size_t size)
722 memcpy (data, rec,
size);
723 return ((uint8_t*) rec) +
size;
734static inline bool rtems_capture_task_recorded (
rtems_tcb* tcb) {
735 return ((tcb->Capture.flags & RTEMS_CAPTURE_RECORD_TASK) != 0);
746static inline bool rtems_capture_task_initialized (
rtems_tcb* tcb) {
747 return ((tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0);
777 return _Objects_Get_API (
id);
823static inline uint32_t
826 return tcb->Capture.flags;
839rtems_capture_task_control (
rtems_tcb* tcb)
853static inline uint32_t
854rtems_capture_task_control_flags (
rtems_tcb* tcb)
874rtems_capture_task_start_priority (
rtems_tcb* tcb)
876 return _RTEMS_Priority_From_core (_Thread_Scheduler_get_home( tcb ),
890rtems_capture_task_real_priority (
rtems_tcb* tcb)
892 return _Thread_Get_unmapped_real_priority (tcb);
905rtems_capture_task_curr_priority (
rtems_tcb* tcb)
907 return _Thread_Get_unmapped_priority (tcb);
978static inline uint32_t
993static inline uint32_t
1008static inline uint32_t
1011 return control->from_triggers;
1023static inline uint32_t
1085static inline uint32_t
1090 return control->by[by].trigger;
1091 return control->by[0].trigger;
1103static inline uint32_t
1104rtems_capture_control_count (
void)
rtems_status_code rtems_object_get_classic_name(rtems_id id, rtems_name *name)
Gets the object name associated with the object identifier.
Definition: rtemsobjectgetclassicname.c:46
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
uint32_t rtems_name
This type represents Classic API object names.
Definition: types.h:226
uint32_t rtems_task_priority
This integer type represents task priorities of the Classic API.
Definition: types.h:257
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
uint32_t States_Control
Definition: states.h:65
rtems_status_code rtems_capture_watch_ceiling(rtems_task_priority ceiling)
Set watch ceiling.
Definition: capture.c:992
rtems_task_priority rtems_capture_watch_get_floor(void)
Capture set watch floor.
Definition: capture.c:1024
bool rtems_capture_filter(rtems_tcb *task, uint32_t events)
Capture filter.
Definition: capture.c:503
void rtems_capture_record_close(rtems_capture_record_lock_context *context)
Capture record close.
Definition: capture.c:435
struct rtems_capture_control rtems_capture_control
Capture control structure for a group of tasks.
rtems_task_priority rtems_capture_watch_get_ceiling(void)
Get watch ceiling.
Definition: capture.c:1002
rtems_status_code rtems_capture_set_monitor(bool enable)
Capture monitor enable/disable.
Definition: capture.c:748
void rtems_capture_record_unlock(rtems_capture_record_lock_context *context)
Capture record unlock.
Definition: capture.c:383
rtems_status_code rtems_capture_release(uint32_t cpu, uint32_t count)
Capture release records.
Definition: capture.c:1305
#define RTEMS_CAPTURE_CONTROL_FROM_MASK(_s)
Definition: capture.h:124
rtems_status_code rtems_capture_watch_add(rtems_name name, rtems_id id)
Capture add watch.
Definition: capture.c:834
rtems_capture_trigger_mode
Capture trigger modes.
Definition: capture.h:224
rtems_status_code rtems_capture_close(void)
Capture close.
Definition: capture.c:660
bool rtems_capture_watch_global_on(void)
Get global watch state.
Definition: capture.c:980
rtems_capture_trigger
Capture trigger.
Definition: capture.h:236
struct rtems_capture_from rtems_capture_from
Task id and mask for the from trigger.
rtems_capture_control * rtems_capture_get_control_list(void)
Capture get control list.
Definition: capture.c:1384
void rtems_capture_record_task(rtems_tcb *tcb)
Capture record task.
Definition: capture.c:469
rtems_status_code rtems_capture_read(uint32_t cpu, size_t *read, const void **recs)
Capture read records from capture buffer.
Definition: capture.c:1251
void rtems_capture_record_lock(rtems_capture_record_lock_context *context)
Capture record lock.
Definition: capture.c:373
rtems_status_code rtems_capture_set_control(bool enable)
Capture control trace enable/disable.
Definition: capture.c:720
rtems_status_code rtems_capture_open(uint32_t size, rtems_capture_timestamp timestamp)
Capture open.
Definition: capture.c:604
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 mode, rtems_capture_trigger trigger)
Capture set trigger.
Definition: capture.c:1074
rtems_status_code rtems_capture_watch_del(rtems_name name, rtems_id id)
Capture delete watch.
Definition: capture.c:865
void(* rtems_capture_timestamp)(rtems_capture_time *time)
Capture timestamp callout handler.
Definition: capture.h:255
#define RTEMS_CAPTURE_TRIGGER_TASKS
Definition: capture.h:72
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 mode, rtems_capture_trigger trigger)
Capture clear trigger.
Definition: capture.c:1152
void rtems_capture_initialize_task(rtems_tcb *tcb)
Capture initialize task.
Definition: capture.c:441
void rtems_capture_get_time(rtems_capture_time *time)
Capture returns the current time.
Definition: capture.c:165
rtems_status_code rtems_capture_watch_floor(rtems_task_priority floor)
Capture set watch floor.
Definition: capture.c:1014
rtems_status_code rtems_capture_watch_global(bool enable)
Capture enable/disable global watch.
Definition: capture.c:956
void * rtems_capture_record_open(rtems_tcb *task, uint32_t events, size_t size, rtems_capture_record_lock_context *context)
Capture record open.
Definition: capture.c:389
rtems_status_code rtems_capture_watch_ctrl(rtems_name name, rtems_id id, bool enable)
Capture enable/disable watch.
Definition: capture.c:914
uint64_t rtems_capture_time
A capture timestamp.
Definition: capture.h:79
const char * rtems_capture_event_text(int event)
Capture get event text.
Definition: capture.c:1372
ssize_t read(int fd, void *buffer, size_t count)
Definition: read.c:46
rtems_termios_device_context * context
Definition: console-config.c:62
This header file defines the RTEMS Classic API.
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:81
ISR lock control.
Definition: isrlock.h:72
Objects_Id id
Definition: objectdata.h:65
Used for passing and retrieving registers content to/from real mode interrupt call.
Definition: realmode_int.h:43
Objects_Control Object
Definition: thread.h:814
States_Control current_state
Definition: thread.h:834
Thread_Start_information Start
Definition: thread.h:921
Definition: intercom.c:87
Capture control structure for a group of tasks.
Definition: capture.h:109
Task id and mask for the from trigger.
Definition: capture.h:91
Capture record lock context.
Definition: capture.h:270
Definition: capture.h:173
Definition: capture.h:188
unsigned size
Definition: tte.h:1
This header file provides the implementation interfaces of the Task Manager.