forked from Imagelibrary/rtems
libmisc/capture: Remove the reserved _t in the types.
This commit is contained in:
@@ -111,7 +111,7 @@ rtems_capture_cli_open (int argc,
|
||||
if (!enable)
|
||||
return;
|
||||
|
||||
sc = rtems_capture_control (enable);
|
||||
sc = rtems_capture_set_control (enable);
|
||||
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
@@ -161,7 +161,7 @@ rtems_capture_cli_enable (int argc RC_UNUSED,
|
||||
{
|
||||
rtems_status_code sc;
|
||||
|
||||
sc = rtems_capture_control (true);
|
||||
sc = rtems_capture_set_control (true);
|
||||
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
@@ -186,7 +186,7 @@ rtems_capture_cli_disable (int argc RC_UNUSED,
|
||||
{
|
||||
rtems_status_code sc;
|
||||
|
||||
sc = rtems_capture_control (false);
|
||||
sc = rtems_capture_set_control (false);
|
||||
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
@@ -270,9 +270,9 @@ rtems_capture_cli_task_list (int argc RC_UNUSED,
|
||||
const rtems_monitor_command_arg_t* command_arg RC_UNUSED,
|
||||
bool verbose RC_UNUSED)
|
||||
{
|
||||
rtems_capture_time_t uptime;
|
||||
rtems_capture_time uptime;
|
||||
|
||||
rtems_capture_time (&uptime);
|
||||
rtems_capture_get_time (&uptime);
|
||||
|
||||
rtems_capture_cli_task_count = 0;
|
||||
rtems_iterate_over_all_threads (rtems_capture_cli_count_tasks);
|
||||
@@ -710,14 +710,14 @@ static char const *trigger_set_types =
|
||||
/*
|
||||
* Structure to handle the parsing of the trigger command line.
|
||||
*/
|
||||
typedef struct rtems_capture_cli_triggers_s
|
||||
typedef struct rtems_capture_cli_triggers
|
||||
{
|
||||
char const * name;
|
||||
rtems_capture_trigger_t type;
|
||||
int to_only;
|
||||
} rtems_capture_cli_triggers_t;
|
||||
char const * name;
|
||||
rtems_capture_trigger type;
|
||||
int to_only;
|
||||
} rtems_capture_cli_triggers;
|
||||
|
||||
static rtems_capture_cli_triggers_t rtems_capture_cli_triggers[] =
|
||||
static const rtems_capture_cli_triggers rtems_capture_cli_trigger[] =
|
||||
{
|
||||
{ "switch", rtems_capture_switch, 0 }, /* must be first */
|
||||
{ "create", rtems_capture_create, 0 },
|
||||
@@ -728,39 +728,39 @@ static rtems_capture_cli_triggers_t rtems_capture_cli_triggers[] =
|
||||
{ "exitted", rtems_capture_exitted, 1 }
|
||||
};
|
||||
|
||||
typedef enum rtems_capture_cli_trig_state_e
|
||||
typedef enum rtems_capture_cli_trig_state
|
||||
{
|
||||
trig_type,
|
||||
trig_to,
|
||||
trig_from_from,
|
||||
trig_from
|
||||
} rtems_capture_cli_trig_state_t;
|
||||
} rtems_capture_cli_trig_state;
|
||||
|
||||
#define RTEMS_CAPTURE_CLI_TRIGGERS_NUM \
|
||||
(sizeof (rtems_capture_cli_triggers) / sizeof (rtems_capture_cli_triggers_t))
|
||||
(sizeof (rtems_capture_cli_trigger) / sizeof (rtems_capture_cli_triggers))
|
||||
|
||||
static void
|
||||
rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
|
||||
{
|
||||
rtems_status_code sc;
|
||||
int arg;
|
||||
int trigger = 0; /* switch */
|
||||
rtems_capture_trigger_mode_t trigger_mode = rtems_capture_from_any;
|
||||
bool trigger_set = false;
|
||||
bool is_from = false;
|
||||
bool is_to = false;
|
||||
rtems_name name = 0;
|
||||
rtems_id id = 0;
|
||||
bool valid_name = false;
|
||||
bool valid_id = false;
|
||||
rtems_name from_name = 0;
|
||||
rtems_id from_id = 0;
|
||||
bool from_valid_name = false;
|
||||
bool from_valid_id = false;
|
||||
rtems_name to_name = 0;
|
||||
rtems_id to_id = 0;
|
||||
bool to_valid_name = false;
|
||||
bool to_valid_id = false;
|
||||
rtems_status_code sc;
|
||||
int arg;
|
||||
int trigger = 0; /* switch */
|
||||
rtems_capture_trigger_mode trigger_mode = rtems_capture_from_any;
|
||||
bool trigger_set = false;
|
||||
bool is_from = false;
|
||||
bool is_to = false;
|
||||
rtems_name name = 0;
|
||||
rtems_id id = 0;
|
||||
bool valid_name = false;
|
||||
bool valid_id = false;
|
||||
rtems_name from_name = 0;
|
||||
rtems_id from_id = 0;
|
||||
bool from_valid_name = false;
|
||||
bool from_valid_id = false;
|
||||
rtems_name to_name = 0;
|
||||
rtems_id to_id = 0;
|
||||
bool to_valid_name = false;
|
||||
bool to_valid_id = false;
|
||||
|
||||
for (arg = 1; arg < argc; arg++)
|
||||
{
|
||||
@@ -785,7 +785,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
|
||||
int t;
|
||||
|
||||
for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++)
|
||||
if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0)
|
||||
if (strcmp (argv[arg], rtems_capture_cli_trigger[t].name) == 0)
|
||||
{
|
||||
trigger = t;
|
||||
found = true;
|
||||
@@ -874,10 +874,10 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (is_from && rtems_capture_cli_triggers[trigger].to_only)
|
||||
if (is_from && rtems_capture_cli_trigger[trigger].to_only)
|
||||
{
|
||||
fprintf (stdout, "error: a %s trigger can be a TO trigger\n",
|
||||
rtems_capture_cli_triggers[trigger].name);
|
||||
rtems_capture_cli_trigger[trigger].name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -890,14 +890,14 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
|
||||
if (!is_from && !to_valid_name && !to_valid_id)
|
||||
{
|
||||
fprintf (stdout, "error: a %s trigger needs a TO name or id\n",
|
||||
rtems_capture_cli_triggers[trigger].name);
|
||||
rtems_capture_cli_trigger[trigger].name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_from && !from_valid_name && !from_valid_id)
|
||||
{
|
||||
fprintf (stdout, "error: a %s trigger needs a FROM name or id\n",
|
||||
rtems_capture_cli_triggers[trigger].name);
|
||||
rtems_capture_cli_trigger[trigger].name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -911,11 +911,11 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
|
||||
if (set)
|
||||
sc = rtems_capture_set_trigger (from_name, from_id, to_name, to_id,
|
||||
trigger_mode,
|
||||
rtems_capture_cli_triggers[trigger].type);
|
||||
rtems_capture_cli_trigger[trigger].type);
|
||||
else
|
||||
sc = rtems_capture_clear_trigger (from_name, from_id, to_name, to_id,
|
||||
trigger_mode,
|
||||
rtems_capture_cli_triggers[trigger].type);
|
||||
rtems_capture_cli_trigger[trigger].type);
|
||||
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
@@ -1192,7 +1192,7 @@ rtems_capture_cli_init (rtems_capture_timestamp timestamp)
|
||||
for (cmd = 0;
|
||||
cmd < sizeof (rtems_capture_cli_cmds) / sizeof (rtems_monitor_command_entry_t);
|
||||
cmd++)
|
||||
rtems_monitor_insert_cmd (&rtems_capture_cli_cmds[cmd]);
|
||||
rtems_monitor_insert_cmd (&rtems_capture_cli_cmds[cmd]);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -56,21 +56,21 @@
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
rtems_capture_buffer_t records;
|
||||
uint32_t count;
|
||||
rtems_id reader;
|
||||
rtems_interrupt_lock lock;
|
||||
uint32_t flags;
|
||||
rtems_capture_buffer records;
|
||||
uint32_t count;
|
||||
rtems_id reader;
|
||||
rtems_interrupt_lock lock;
|
||||
uint32_t flags;
|
||||
} rtems_capture_per_cpu_data;
|
||||
|
||||
typedef struct {
|
||||
uint32_t flags;
|
||||
rtems_capture_control_t* controls;
|
||||
int extension_index;
|
||||
rtems_capture_timestamp timestamp;
|
||||
rtems_task_priority ceiling;
|
||||
rtems_task_priority floor;
|
||||
rtems_interrupt_lock lock;
|
||||
uint32_t flags;
|
||||
rtems_capture_control* controls;
|
||||
int extension_index;
|
||||
rtems_capture_timestamp timestamp;
|
||||
rtems_task_priority ceiling;
|
||||
rtems_task_priority floor;
|
||||
rtems_interrupt_lock lock;
|
||||
} rtems_capture_global_data;
|
||||
|
||||
static rtems_capture_per_cpu_data *capture_per_cpu = NULL;
|
||||
@@ -145,7 +145,7 @@ void rtems_capture_set_flags(uint32_t mask)
|
||||
* by the user get the time from that.
|
||||
*/
|
||||
void
|
||||
rtems_capture_get_time (rtems_capture_time_t* time)
|
||||
rtems_capture_get_time (rtems_capture_time* time)
|
||||
{
|
||||
if (capture_timestamp)
|
||||
capture_timestamp (time);
|
||||
@@ -221,9 +221,9 @@ rtems_capture_dup_name (rtems_name* dst, rtems_name src)
|
||||
* tasks is the number of bits in uint32_t.
|
||||
*/
|
||||
static inline bool
|
||||
rtems_capture_by_in_to (uint32_t events,
|
||||
rtems_tcb* by,
|
||||
rtems_capture_control_t* to)
|
||||
rtems_capture_by_in_to (uint32_t events,
|
||||
rtems_tcb* by,
|
||||
rtems_capture_control* to)
|
||||
{
|
||||
uint32_t valid_mask = RTEMS_CAPTURE_CONTROL_FROM_MASK (0);
|
||||
uint32_t valid_remainder = 0xffffffff;
|
||||
@@ -265,10 +265,10 @@ rtems_capture_by_in_to (uint32_t events,
|
||||
/*
|
||||
* This function searches for a trigger given a name.
|
||||
*/
|
||||
static inline rtems_capture_control_t*
|
||||
static inline rtems_capture_control*
|
||||
rtems_capture_find_control (rtems_name name, rtems_id id)
|
||||
{
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
for (control = capture_controls; control != NULL; control = control->next)
|
||||
if (rtems_capture_match_name_id (name, id, control->name, control->id))
|
||||
break;
|
||||
@@ -284,9 +284,9 @@ rtems_capture_initialize_control (rtems_tcb *tcb)
|
||||
{
|
||||
if (tcb->Capture.control == NULL)
|
||||
{
|
||||
rtems_name name = rtems_build_name(0, 0, 0, 0);
|
||||
rtems_id id;
|
||||
rtems_capture_control_t* control;
|
||||
rtems_name name = rtems_build_name(0, 0, 0, 0);
|
||||
rtems_id id;
|
||||
rtems_capture_control* control;
|
||||
|
||||
/*
|
||||
* We need to scan the default control list to initialise
|
||||
@@ -307,11 +307,11 @@ rtems_capture_initialize_control (rtems_tcb *tcb)
|
||||
}
|
||||
}
|
||||
|
||||
static rtems_capture_control_t*
|
||||
static rtems_capture_control*
|
||||
rtems_capture_create_control (rtems_name name, rtems_id id)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
|
||||
if ((name == 0) && (id == 0))
|
||||
return NULL;
|
||||
@@ -375,7 +375,7 @@ rtems_capture_record_open (rtems_tcb* tcb,
|
||||
rtems_capture_per_cpu_data* cpu;
|
||||
uint8_t* ptr;
|
||||
|
||||
size += sizeof (rtems_capture_record_t);
|
||||
size += sizeof (rtems_capture_record);
|
||||
|
||||
cpu = capture_per_cpu_get (rtems_get_current_processor ());
|
||||
|
||||
@@ -384,7 +384,7 @@ rtems_capture_record_open (rtems_tcb* tcb,
|
||||
ptr = rtems_capture_buffer_allocate (&cpu->records, size);
|
||||
if (ptr != NULL)
|
||||
{
|
||||
rtems_capture_record_t in;
|
||||
rtems_capture_record in;
|
||||
|
||||
++cpu->count;
|
||||
|
||||
@@ -419,7 +419,7 @@ rtems_capture_record_close (rtems_capture_record_lock_context* context)
|
||||
void
|
||||
rtems_capture_initialize_task( rtems_tcb* tcb )
|
||||
{
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
rtems_name name = rtems_build_name(0, 0, 0, 0);
|
||||
rtems_id id = rtems_capture_task_id (tcb);
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
@@ -449,7 +449,7 @@ void rtems_capture_record_task (rtems_tcb* tcb)
|
||||
{
|
||||
rtems_name name = rtems_build_name (0, 0, 0, 0);
|
||||
rtems_id id = rtems_capture_task_id (tcb);
|
||||
rtems_capture_task_record_t rec;
|
||||
rtems_capture_task_record rec;
|
||||
void* ptr;
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
rtems_capture_record_lock_context rec_context;
|
||||
@@ -486,7 +486,7 @@ bool rtems_capture_filter (rtems_tcb* tcb, uint32_t events)
|
||||
(RTEMS_CAPTURE_TRIGGERED | RTEMS_CAPTURE_ONLY_MONITOR)) ==
|
||||
RTEMS_CAPTURE_TRIGGERED))
|
||||
{
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
|
||||
control = tcb->Capture.control;
|
||||
|
||||
@@ -513,18 +513,18 @@ bool rtems_capture_filter (rtems_tcb* tcb, uint32_t events)
|
||||
* cause of a trigger.
|
||||
*/
|
||||
bool
|
||||
rtems_capture_trigger (rtems_tcb* ft, rtems_tcb* tt, uint32_t events)
|
||||
rtems_capture_trigger_fired (rtems_tcb* ft, rtems_tcb* tt, uint32_t events)
|
||||
{
|
||||
/*
|
||||
* If we have not triggered then see if this is a trigger condition.
|
||||
*/
|
||||
if (!(capture_flags_global & RTEMS_CAPTURE_TRIGGERED))
|
||||
{
|
||||
rtems_capture_control_t* fc = NULL;
|
||||
rtems_capture_control_t* tc = NULL;
|
||||
uint32_t from_events = 0;
|
||||
uint32_t to_events = 0;
|
||||
uint32_t from_to_events = 0;
|
||||
rtems_capture_control* fc = NULL;
|
||||
rtems_capture_control* tc = NULL;
|
||||
uint32_t from_events = 0;
|
||||
uint32_t to_events = 0;
|
||||
uint32_t from_to_events = 0;
|
||||
|
||||
if (ft)
|
||||
{
|
||||
@@ -582,10 +582,10 @@ rtems_capture_trigger (rtems_tcb* ft, rtems_tcb* tt, uint32_t events)
|
||||
rtems_status_code
|
||||
rtems_capture_open (uint32_t size, rtems_capture_timestamp timestamp RTEMS_UNUSED)
|
||||
{
|
||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||
size_t count;
|
||||
uint32_t i;
|
||||
rtems_capture_buffer_t* buff;
|
||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||
size_t count;
|
||||
uint32_t i;
|
||||
rtems_capture_buffer* buff;
|
||||
|
||||
/*
|
||||
* See if the capture engine is already open.
|
||||
@@ -639,7 +639,7 @@ rtems_status_code
|
||||
rtems_capture_close (void)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
rtems_status_code sc;
|
||||
uint32_t cpu;
|
||||
|
||||
@@ -676,7 +676,7 @@ rtems_capture_close (void)
|
||||
|
||||
while (control)
|
||||
{
|
||||
rtems_capture_control_t* delete = control;
|
||||
rtems_capture_control* delete = control;
|
||||
control = control->next;
|
||||
free (delete);
|
||||
}
|
||||
@@ -696,7 +696,7 @@ rtems_capture_close (void)
|
||||
}
|
||||
|
||||
rtems_status_code
|
||||
rtems_capture_control (bool enable)
|
||||
rtems_capture_set_control (bool enable)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
|
||||
@@ -724,7 +724,7 @@ rtems_capture_control (bool enable)
|
||||
* to profile the load on a system.
|
||||
*/
|
||||
rtems_status_code
|
||||
rtems_capture_monitor (bool enable)
|
||||
rtems_capture_set_monitor (bool enable)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
|
||||
@@ -811,7 +811,7 @@ rtems_capture_flush (bool prime)
|
||||
rtems_status_code
|
||||
rtems_capture_watch_add (rtems_name name, rtems_id id)
|
||||
{
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
|
||||
if ( (capture_flags_global & RTEMS_CAPTURE_ON) != 0 )
|
||||
return RTEMS_UNSATISFIED;
|
||||
@@ -843,8 +843,8 @@ rtems_status_code
|
||||
rtems_capture_watch_del (rtems_name name, rtems_id id)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control_t** prev_control;
|
||||
rtems_capture_control* control;
|
||||
rtems_capture_control** prev_control;
|
||||
bool found = false;
|
||||
|
||||
if ( (capture_flags_global & RTEMS_CAPTURE_ON) != 0 )
|
||||
@@ -892,7 +892,7 @@ rtems_status_code
|
||||
rtems_capture_watch_ctrl (rtems_name name, rtems_id id, bool enable)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
rtems_capture_control_t* control;
|
||||
rtems_capture_control* control;
|
||||
bool found = false;
|
||||
|
||||
if ( (capture_flags_global & RTEMS_CAPTURE_ON) != 0 )
|
||||
@@ -1008,7 +1008,7 @@ rtems_capture_watch_get_floor (void)
|
||||
* Map the trigger to a bit mask.
|
||||
*/
|
||||
static uint32_t
|
||||
rtems_capture_map_trigger (rtems_capture_trigger_t trigger)
|
||||
rtems_capture_map_trigger (rtems_capture_trigger trigger)
|
||||
{
|
||||
/*
|
||||
* Transform the mode and trigger to a bit map.
|
||||
@@ -1049,15 +1049,15 @@ rtems_capture_map_trigger (rtems_capture_trigger_t trigger)
|
||||
* linked to single control.
|
||||
*/
|
||||
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)
|
||||
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)
|
||||
{
|
||||
rtems_capture_control_t* control;
|
||||
uint32_t flags;
|
||||
rtems_capture_control* control;
|
||||
uint32_t flags;
|
||||
|
||||
flags = rtems_capture_map_trigger (trigger);
|
||||
|
||||
@@ -1127,15 +1127,15 @@ rtems_capture_set_trigger (rtems_name from_name,
|
||||
* This function clear a trigger.
|
||||
*/
|
||||
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)
|
||||
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)
|
||||
{
|
||||
rtems_capture_control_t* control;
|
||||
uint32_t flags;
|
||||
rtems_capture_control* control;
|
||||
uint32_t flags;
|
||||
|
||||
flags = rtems_capture_map_trigger (trigger);
|
||||
|
||||
@@ -1202,7 +1202,7 @@ rtems_capture_count_records (const void* records, size_t size)
|
||||
|
||||
while (bytes < size)
|
||||
{
|
||||
const rtems_capture_record_t* rec = (const rtems_capture_record_t*) ptr;
|
||||
const rtems_capture_record* rec = (const rtems_capture_record*) ptr;
|
||||
recs++;
|
||||
ptr += rec->size;
|
||||
bytes += rec->size;
|
||||
@@ -1234,7 +1234,7 @@ rtems_capture_read (uint32_t cpu, size_t* read, const void** recs)
|
||||
RTEMS_INTERRUPT_LOCK_REFERENCE (lock, &(capture_lock_on_cpu (cpu)))
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
size_t recs_size = 0;
|
||||
rtems_capture_buffer_t* records;
|
||||
rtems_capture_buffer* records;
|
||||
uint32_t* flags;
|
||||
|
||||
*read = 0;
|
||||
@@ -1287,12 +1287,12 @@ rtems_capture_release (uint32_t cpu, uint32_t count)
|
||||
{
|
||||
rtems_interrupt_lock_context lock_context;
|
||||
uint8_t* ptr;
|
||||
rtems_capture_record_t* rec;
|
||||
rtems_capture_record* rec;
|
||||
uint32_t counted;
|
||||
size_t ptr_size = 0;
|
||||
size_t rel_size = 0;
|
||||
RTEMS_INTERRUPT_LOCK_REFERENCE( lock, &(capture_lock_on_cpu( cpu )) )
|
||||
rtems_capture_buffer_t* records = &(capture_records_on_cpu( cpu ));
|
||||
rtems_capture_buffer* records = &(capture_records_on_cpu( cpu ));
|
||||
uint32_t* flags = &(capture_flags_on_cpu( cpu ));
|
||||
uint32_t* total = &(capture_count_on_cpu( cpu ));
|
||||
|
||||
@@ -1316,7 +1316,7 @@ rtems_capture_release (uint32_t cpu, uint32_t count)
|
||||
|
||||
rel_size = 0;
|
||||
while (counted--) {
|
||||
rec = (rtems_capture_record_t*) ptr;
|
||||
rec = (rtems_capture_record*) ptr;
|
||||
rel_size += rec->size;
|
||||
_Assert( rel_size <= ptr_size );
|
||||
ptr += rec->size;
|
||||
@@ -1341,16 +1341,6 @@ rtems_capture_release (uint32_t cpu, uint32_t count)
|
||||
return sc;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the current time. If a handler is provided
|
||||
* by the user get the time from that.
|
||||
*/
|
||||
void
|
||||
rtems_capture_time (rtems_capture_time_t* uptime)
|
||||
{
|
||||
rtems_capture_get_time(uptime);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns a string for an event based on the bit in the
|
||||
* event. The functions takes the bit offset as a number not the bit
|
||||
@@ -1368,7 +1358,7 @@ rtems_capture_event_text (int event)
|
||||
* This function returns the head of the list of control in the
|
||||
* capture engine.
|
||||
*/
|
||||
rtems_capture_control_t*
|
||||
rtems_capture_control*
|
||||
rtems_capture_get_control_list (void)
|
||||
{
|
||||
return capture_controls;
|
||||
|
||||
@@ -75,7 +75,7 @@ extern "C" {
|
||||
*
|
||||
* This is a nanosecond capture timestamp
|
||||
*/
|
||||
typedef uint64_t rtems_capture_time_t;
|
||||
typedef uint64_t rtems_capture_time;
|
||||
|
||||
/**
|
||||
* @brief Task id and mask for the from trigger.
|
||||
@@ -86,12 +86,12 @@ typedef uint64_t rtems_capture_time_t;
|
||||
* will only be a from type trigger if the flags in the control
|
||||
* structure has the specific *_BY bit set.
|
||||
*/
|
||||
typedef struct rtems_capture_from_s
|
||||
typedef struct rtems_capture_from
|
||||
{
|
||||
rtems_name name;
|
||||
rtems_id id;
|
||||
uint32_t trigger;
|
||||
} rtems_capture_from_t;
|
||||
} rtems_capture_from;
|
||||
|
||||
/**
|
||||
* @brief Capture control structure for a group of tasks.
|
||||
@@ -104,18 +104,18 @@ typedef struct rtems_capture_from_s
|
||||
* caused BY the task listed TO this task. The by_valid flag which entries
|
||||
* in by are valid.
|
||||
*/
|
||||
typedef struct rtems_capture_control_s
|
||||
typedef struct rtems_capture_control
|
||||
{
|
||||
rtems_name name;
|
||||
rtems_id id;
|
||||
uint32_t flags;
|
||||
uint32_t to_triggers;
|
||||
uint32_t from_triggers;
|
||||
uint32_t by_triggers;
|
||||
uint32_t by_valid;
|
||||
rtems_capture_from_t by[RTEMS_CAPTURE_TRIGGER_TASKS];
|
||||
struct rtems_capture_control_s* next;
|
||||
} rtems_capture_control_t;
|
||||
rtems_name name;
|
||||
rtems_id id;
|
||||
uint32_t flags;
|
||||
uint32_t to_triggers;
|
||||
uint32_t from_triggers;
|
||||
uint32_t by_triggers;
|
||||
uint32_t by_valid;
|
||||
rtems_capture_from by[RTEMS_CAPTURE_TRIGGER_TASKS];
|
||||
struct rtems_capture_control* next;
|
||||
} rtems_capture_control;
|
||||
|
||||
/**
|
||||
* The from_valid mask.
|
||||
@@ -168,13 +168,13 @@ typedef struct rtems_capture_control_s
|
||||
* the buffer. The events includes the priority of the task
|
||||
* at the time of the context switch.
|
||||
*/
|
||||
typedef struct rtems_capture_record_s
|
||||
typedef struct rtems_capture_record
|
||||
{
|
||||
size_t size;
|
||||
uint32_t events;
|
||||
rtems_capture_time_t time;
|
||||
rtems_id task_id;
|
||||
} RTEMS_PACKED rtems_capture_record_t;
|
||||
size_t size;
|
||||
uint32_t events;
|
||||
rtems_capture_time time;
|
||||
rtems_id task_id;
|
||||
} RTEMS_PACKED rtems_capture_record;
|
||||
|
||||
/*
|
||||
* @brief Capture task record.
|
||||
@@ -183,12 +183,12 @@ typedef struct rtems_capture_record_s
|
||||
* the buffer. The events includes the priority of the task
|
||||
* at the time of the context switch.
|
||||
*/
|
||||
typedef struct rtems_capture_task_record_s
|
||||
typedef struct rtems_capture_task_record
|
||||
{
|
||||
rtems_name name;
|
||||
rtems_task_priority start_priority;
|
||||
uint32_t stack_size;
|
||||
} RTEMS_PACKED rtems_capture_task_record_t;
|
||||
} RTEMS_PACKED rtems_capture_task_record;
|
||||
|
||||
/**
|
||||
* The capture record event flags.
|
||||
@@ -219,19 +219,19 @@ typedef struct rtems_capture_task_record_s
|
||||
*
|
||||
* The types of trigger modes that exist.
|
||||
*/
|
||||
typedef enum rtems_capture_trigger_mode_e
|
||||
typedef enum rtems_capture_trigger_mode
|
||||
{
|
||||
rtems_capture_to_any,
|
||||
rtems_capture_from_any,
|
||||
rtems_capture_from_to
|
||||
} rtems_capture_trigger_mode_t;
|
||||
} rtems_capture_trigger_mode;
|
||||
|
||||
/**
|
||||
* @brief Capture trigger.
|
||||
*
|
||||
* The types of triggers that exist.
|
||||
*/
|
||||
typedef enum rtems_capture_trigger_e
|
||||
typedef enum rtems_capture_trigger
|
||||
{
|
||||
rtems_capture_switch,
|
||||
rtems_capture_create,
|
||||
@@ -241,7 +241,7 @@ typedef enum rtems_capture_trigger_e
|
||||
rtems_capture_begin,
|
||||
rtems_capture_exitted,
|
||||
rtems_capture_terminated
|
||||
} rtems_capture_trigger_t;
|
||||
} rtems_capture_trigger;
|
||||
|
||||
/**
|
||||
* @brief Capture timestamp callout handler.
|
||||
@@ -251,7 +251,7 @@ typedef enum rtems_capture_trigger_e
|
||||
*
|
||||
*/
|
||||
|
||||
typedef void (*rtems_capture_timestamp)(rtems_capture_time_t* time);
|
||||
typedef void (*rtems_capture_timestamp)(rtems_capture_time* time);
|
||||
|
||||
/**
|
||||
* @brief Capture record lock context.
|
||||
@@ -313,7 +313,7 @@ rtems_status_code rtems_capture_close (void);
|
||||
* error. Otherwise, a status code is returned indicating the
|
||||
* source of the error.
|
||||
*/
|
||||
rtems_status_code rtems_capture_control (bool enable);
|
||||
rtems_status_code rtems_capture_set_control (bool enable);
|
||||
|
||||
/**
|
||||
* @brief Capture monitor enable/disable.
|
||||
@@ -328,7 +328,7 @@ rtems_status_code rtems_capture_control (bool enable);
|
||||
* error. Otherwise, a status code is returned indicating the
|
||||
* source of the error.
|
||||
*/
|
||||
rtems_status_code rtems_capture_monitor (bool enable);
|
||||
rtems_status_code rtems_capture_set_monitor (bool enable);
|
||||
|
||||
/*
|
||||
* @brief Capture flush trace buffer.
|
||||
@@ -503,12 +503,12 @@ rtems_task_priority rtems_capture_watch_get_floor (void);
|
||||
* source of the error.
|
||||
*/
|
||||
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);
|
||||
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);
|
||||
|
||||
/**
|
||||
* @brief Capture clear trigger.
|
||||
@@ -529,12 +529,12 @@ rtems_capture_set_trigger (rtems_name from_name,
|
||||
* source of the error.
|
||||
*/
|
||||
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);
|
||||
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);
|
||||
|
||||
/**
|
||||
* @brief Capture read records from capture buffer
|
||||
@@ -578,15 +578,6 @@ rtems_status_code rtems_capture_read (uint32_t cpu,
|
||||
*/
|
||||
rtems_status_code rtems_capture_release (uint32_t cpu, uint32_t count);
|
||||
|
||||
/*
|
||||
* @brief Capture nano-second time period.
|
||||
*
|
||||
* This function returns the time period in nano-seconds.
|
||||
*
|
||||
* @param[out] uptime The nano-second time period.
|
||||
*/
|
||||
void rtems_capture_time (rtems_capture_time_t* uptime);
|
||||
|
||||
/**
|
||||
* @brief Capture filter
|
||||
*
|
||||
@@ -612,7 +603,7 @@ bool rtems_capture_filter (rtems_tcb* task, uint32_t events);
|
||||
* @retval This method returns a nano-second time if no user handler
|
||||
* is provided. Otherwise, it returns a resolution defined by the handler.
|
||||
*/
|
||||
void rtems_capture_get_time (rtems_capture_time_t* time);
|
||||
void rtems_capture_get_time (rtems_capture_time* time);
|
||||
|
||||
/**
|
||||
* @brief Capture get event text.
|
||||
@@ -634,7 +625,7 @@ const char* rtems_capture_event_text (int event);
|
||||
*
|
||||
* @param[in] tcb is the task control block for the task
|
||||
*/
|
||||
void rtems_capture_initialize_task( rtems_tcb* tcb );
|
||||
void rtems_capture_initialize_task (rtems_tcb* tcb);
|
||||
|
||||
/**
|
||||
* @brief Capture record task.
|
||||
@@ -643,7 +634,7 @@ void rtems_capture_initialize_task( rtems_tcb* tcb );
|
||||
*
|
||||
* @param[in] tcb is the task control block for the task
|
||||
*/
|
||||
void rtems_capture_record_task( rtems_tcb* tcb );
|
||||
void rtems_capture_record_task (rtems_tcb* tcb);
|
||||
|
||||
/**
|
||||
* @brief Capture record lock.
|
||||
@@ -739,8 +730,8 @@ rtems_capture_record_extract (const void* rec, void* data, size_t size)
|
||||
*
|
||||
* @param[in] tcb is the task control block for the task
|
||||
*/
|
||||
static inline bool rtems_capture_task_recorded( rtems_tcb* tcb ) {
|
||||
return ( (tcb->Capture.flags & RTEMS_CAPTURE_RECORD_TASK) != 0 );
|
||||
static inline bool rtems_capture_task_recorded (rtems_tcb* tcb) {
|
||||
return ((tcb->Capture.flags & RTEMS_CAPTURE_RECORD_TASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -751,8 +742,8 @@ static inline bool rtems_capture_task_recorded( rtems_tcb* tcb ) {
|
||||
*
|
||||
* @param[in] tcb is the task control block for the task
|
||||
*/
|
||||
static inline bool rtems_capture_task_initialized( rtems_tcb* tcb ) {
|
||||
return ( (tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0 );
|
||||
static inline bool rtems_capture_task_initialized (rtems_tcb* tcb) {
|
||||
return ((tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -843,7 +834,7 @@ rtems_capture_task_flags (rtems_tcb* tcb)
|
||||
*
|
||||
* @retval This function returns the task control if present.
|
||||
*/
|
||||
static inline rtems_capture_control_t*
|
||||
static inline rtems_capture_control*
|
||||
rtems_capture_task_control (rtems_tcb* tcb)
|
||||
{
|
||||
return tcb->Capture.control;
|
||||
@@ -861,7 +852,7 @@ rtems_capture_task_control (rtems_tcb* tcb)
|
||||
static inline uint32_t
|
||||
rtems_capture_task_control_flags (rtems_tcb* tcb)
|
||||
{
|
||||
rtems_capture_control_t* control = tcb->Capture.control;
|
||||
rtems_capture_control* control = tcb->Capture.control;
|
||||
if (!control)
|
||||
return 0;
|
||||
return control->flags;
|
||||
@@ -924,7 +915,7 @@ rtems_capture_task_curr_priority (rtems_tcb* tcb)
|
||||
* @retval This function returns the head of the list of controls in the
|
||||
* capture engine.
|
||||
*/
|
||||
rtems_capture_control_t*
|
||||
rtems_capture_control*
|
||||
rtems_capture_get_control_list (void);
|
||||
|
||||
/**
|
||||
@@ -938,8 +929,8 @@ rtems_capture_get_control_list (void);
|
||||
* @retval This function returns the pointer to the next control in the list. The
|
||||
* pointer NULL terminates the list.
|
||||
*/
|
||||
static inline rtems_capture_control_t*
|
||||
rtems_capture_next_control (rtems_capture_control_t* control)
|
||||
static inline rtems_capture_control*
|
||||
rtems_capture_next_control (rtems_capture_control* control)
|
||||
{
|
||||
return control->next;
|
||||
}
|
||||
@@ -954,7 +945,7 @@ rtems_capture_next_control (rtems_capture_control_t* control)
|
||||
* @retval This function returns the control id.
|
||||
*/
|
||||
static inline rtems_id
|
||||
rtems_capture_control_id (rtems_capture_control_t* control)
|
||||
rtems_capture_control_id (rtems_capture_control* control)
|
||||
{
|
||||
return control->id;
|
||||
}
|
||||
@@ -969,7 +960,7 @@ rtems_capture_control_id (rtems_capture_control_t* control)
|
||||
* @retval This function returns the control name.
|
||||
*/
|
||||
static inline rtems_name
|
||||
rtems_capture_control_name (rtems_capture_control_t* control)
|
||||
rtems_capture_control_name (rtems_capture_control* control)
|
||||
{
|
||||
return control->name;
|
||||
}
|
||||
@@ -984,7 +975,7 @@ rtems_capture_control_name (rtems_capture_control_t* control)
|
||||
* @retval This function returns the control flags.
|
||||
*/
|
||||
static inline uint32_t
|
||||
rtems_capture_control_flags (rtems_capture_control_t* control)
|
||||
rtems_capture_control_flags (rtems_capture_control* control)
|
||||
{
|
||||
return control->flags;
|
||||
}
|
||||
@@ -999,7 +990,7 @@ rtems_capture_control_flags (rtems_capture_control_t* control)
|
||||
* @retval This function returns the task control to triggers.
|
||||
*/
|
||||
static inline uint32_t
|
||||
rtems_capture_control_to_triggers (rtems_capture_control_t* control)
|
||||
rtems_capture_control_to_triggers (rtems_capture_control* control)
|
||||
{
|
||||
return control->to_triggers;
|
||||
}
|
||||
@@ -1014,7 +1005,7 @@ rtems_capture_control_to_triggers (rtems_capture_control_t* control)
|
||||
* @retval This function returns the task control from triggers.
|
||||
*/
|
||||
static inline uint32_t
|
||||
rtems_capture_control_from_triggers (rtems_capture_control_t* control)
|
||||
rtems_capture_control_from_triggers (rtems_capture_control* control)
|
||||
{
|
||||
return control->from_triggers;
|
||||
}
|
||||
@@ -1029,7 +1020,7 @@ rtems_capture_control_from_triggers (rtems_capture_control_t* control)
|
||||
* @retval This function returns the task control by triggers.
|
||||
*/
|
||||
static inline uint32_t
|
||||
rtems_capture_control_all_by_triggers (rtems_capture_control_t* control)
|
||||
rtems_capture_control_all_by_triggers (rtems_capture_control* control)
|
||||
{
|
||||
return control->by_triggers;
|
||||
}
|
||||
@@ -1045,7 +1036,7 @@ rtems_capture_control_all_by_triggers (rtems_capture_control_t* control)
|
||||
* @retval This function returns the control valid BY flags.
|
||||
*/
|
||||
static inline int
|
||||
rtems_capture_control_by_valid (rtems_capture_control_t* control, int slot)
|
||||
rtems_capture_control_by_valid (rtems_capture_control* control, int slot)
|
||||
{
|
||||
return control->by_valid & RTEMS_CAPTURE_CONTROL_FROM_MASK (slot);
|
||||
}
|
||||
@@ -1061,7 +1052,7 @@ rtems_capture_control_by_valid (rtems_capture_control_t* control, int slot)
|
||||
* @retval This function returns the control @a by task name.
|
||||
*/
|
||||
static inline rtems_name
|
||||
rtems_capture_control_by_name (rtems_capture_control_t* control, int by)
|
||||
rtems_capture_control_by_name (rtems_capture_control* control, int by)
|
||||
{
|
||||
if (by < RTEMS_CAPTURE_TRIGGER_TASKS)
|
||||
return control->by[by].name;
|
||||
@@ -1076,7 +1067,7 @@ rtems_capture_control_by_name (rtems_capture_control_t* control, int by)
|
||||
* @retval This function returns the control @a by task id.
|
||||
*/
|
||||
static inline rtems_id
|
||||
rtems_capture_control_by_id (rtems_capture_control_t* control, int by)
|
||||
rtems_capture_control_by_id (rtems_capture_control* control, int by)
|
||||
{
|
||||
if (by < RTEMS_CAPTURE_TRIGGER_TASKS)
|
||||
return control->by[by].id;
|
||||
@@ -1091,7 +1082,7 @@ rtems_capture_control_by_id (rtems_capture_control_t* control, int by)
|
||||
* @retval This function returns the control @a by task triggers.
|
||||
*/
|
||||
static inline uint32_t
|
||||
rtems_capture_control_by_triggers (rtems_capture_control_t* control,
|
||||
rtems_capture_control_by_triggers (rtems_capture_control* control,
|
||||
int by)
|
||||
{
|
||||
if (by < RTEMS_CAPTURE_TRIGGER_TASKS)
|
||||
@@ -1111,8 +1102,8 @@ rtems_capture_control_by_triggers (rtems_capture_control_t* control,
|
||||
static inline uint32_t
|
||||
rtems_capture_control_count (void)
|
||||
{
|
||||
rtems_capture_control_t* control = rtems_capture_get_control_list ();
|
||||
uint32_t count = 0;
|
||||
rtems_capture_control* control = rtems_capture_get_control_list ();
|
||||
uint32_t count = 0;
|
||||
|
||||
while (control)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "capture_buffer.h"
|
||||
|
||||
void*
|
||||
rtems_capture_buffer_allocate (rtems_capture_buffer_t* buffer, size_t size)
|
||||
rtems_capture_buffer_allocate (rtems_capture_buffer* buffer, size_t size)
|
||||
{
|
||||
void* ptr = NULL;
|
||||
|
||||
@@ -95,11 +95,11 @@ rtems_capture_buffer_allocate (rtems_capture_buffer_t* buffer, size_t size)
|
||||
}
|
||||
|
||||
void*
|
||||
rtems_capture_buffer_free (rtems_capture_buffer_t* buffer, size_t size)
|
||||
rtems_capture_buffer_free (rtems_capture_buffer* buffer, size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
size_t next;
|
||||
size_t buff_size;
|
||||
void* ptr;
|
||||
size_t next;
|
||||
size_t buff_size;
|
||||
|
||||
if (size == 0)
|
||||
return NULL;
|
||||
|
||||
@@ -36,7 +36,7 @@ extern "C" {
|
||||
/**
|
||||
* Capture buffer. There is one per CPU.
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct rtems_capture_buffer {
|
||||
uint8_t* buffer; /**< The per cpu buffer. */
|
||||
size_t size; /**< The size of the buffer in bytes. */
|
||||
size_t count; /**< The number of used bytes in the buffer. */
|
||||
@@ -44,10 +44,10 @@ typedef struct {
|
||||
size_t tail; /**< Head == Tail for empty. */
|
||||
size_t end; /**< Buffer current end, it may move in. */
|
||||
size_t max_rec; /**< The largest record in the buffer. */
|
||||
} rtems_capture_buffer_t;
|
||||
} rtems_capture_buffer;
|
||||
|
||||
static inline void
|
||||
rtems_capture_buffer_flush (rtems_capture_buffer_t* buffer)
|
||||
rtems_capture_buffer_flush (rtems_capture_buffer* buffer)
|
||||
{
|
||||
buffer->end = buffer->size;
|
||||
buffer->head = buffer->tail = 0;
|
||||
@@ -56,7 +56,7 @@ rtems_capture_buffer_flush (rtems_capture_buffer_t* buffer)
|
||||
}
|
||||
|
||||
static inline void
|
||||
rtems_capture_buffer_create (rtems_capture_buffer_t* buffer, size_t size)
|
||||
rtems_capture_buffer_create (rtems_capture_buffer* buffer, size_t size)
|
||||
{
|
||||
buffer->buffer = malloc(size);
|
||||
buffer->size = size;
|
||||
@@ -64,7 +64,7 @@ rtems_capture_buffer_create (rtems_capture_buffer_t* buffer, size_t size)
|
||||
}
|
||||
|
||||
static inline void
|
||||
rtems_capture_buffer_destroy (rtems_capture_buffer_t* buffer)
|
||||
rtems_capture_buffer_destroy (rtems_capture_buffer* buffer)
|
||||
{
|
||||
rtems_capture_buffer_flush (buffer);
|
||||
free (buffer->buffer);
|
||||
@@ -72,19 +72,19 @@ rtems_capture_buffer_destroy (rtems_capture_buffer_t* buffer)
|
||||
}
|
||||
|
||||
static inline bool
|
||||
rtems_capture_buffer_is_empty (rtems_capture_buffer_t* buffer)
|
||||
rtems_capture_buffer_is_empty (rtems_capture_buffer* buffer)
|
||||
{
|
||||
return buffer->count == 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
rtems_capture_buffer_is_full (rtems_capture_buffer_t* buffer)
|
||||
rtems_capture_buffer_is_full (rtems_capture_buffer* buffer)
|
||||
{
|
||||
return buffer->count == buffer->size;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
rtems_capture_buffer_has_wrapped (rtems_capture_buffer_t* buffer)
|
||||
rtems_capture_buffer_has_wrapped (rtems_capture_buffer* buffer)
|
||||
{
|
||||
if (buffer->tail > buffer->head)
|
||||
return true;
|
||||
@@ -93,7 +93,7 @@ rtems_capture_buffer_has_wrapped (rtems_capture_buffer_t* buffer)
|
||||
}
|
||||
|
||||
static inline void*
|
||||
rtems_capture_buffer_peek (rtems_capture_buffer_t* buffer, size_t* size)
|
||||
rtems_capture_buffer_peek (rtems_capture_buffer* buffer, size_t* size)
|
||||
{
|
||||
if (rtems_capture_buffer_is_empty (buffer))
|
||||
{
|
||||
@@ -109,9 +109,9 @@ rtems_capture_buffer_peek (rtems_capture_buffer_t* buffer, size_t* size)
|
||||
return &buffer->buffer[buffer->tail];
|
||||
}
|
||||
|
||||
void* rtems_capture_buffer_allocate (rtems_capture_buffer_t* buffer, size_t size);
|
||||
void* rtems_capture_buffer_allocate (rtems_capture_buffer* buffer, size_t size);
|
||||
|
||||
void* rtems_capture_buffer_free (rtems_capture_buffer_t* buffer, size_t size);
|
||||
void* rtems_capture_buffer_free (rtems_capture_buffer* buffer, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const void* recs; /**< Next record to be read. */
|
||||
size_t read; /**< Number of records read. */
|
||||
size_t printed; /**< Records been printed. */
|
||||
bool rec_valid; /**< The record is valid. */
|
||||
rtems_capture_record_t rec; /**< The record, copied out. */
|
||||
} ctrace_per_cpu_t;
|
||||
const void* recs; /**< Next record to be read. */
|
||||
size_t read; /**< Number of records read. */
|
||||
size_t printed; /**< Records been printed. */
|
||||
bool rec_valid; /**< The record is valid. */
|
||||
rtems_capture_record rec; /**< The record, copied out. */
|
||||
} ctrace_per_cpu;
|
||||
|
||||
/*
|
||||
* Task block size.
|
||||
@@ -186,9 +186,9 @@ rtems_capture_print_timestamp (uint64_t uptime)
|
||||
}
|
||||
|
||||
void
|
||||
rtems_capture_print_record_task (int cpu,
|
||||
const rtems_capture_record_t* rec,
|
||||
const rtems_capture_task_record_t* task_rec)
|
||||
rtems_capture_print_record_task (int cpu,
|
||||
const rtems_capture_record* rec,
|
||||
const rtems_capture_task_record* task_rec)
|
||||
{
|
||||
fprintf(stdout,"%2i ", cpu);
|
||||
rtems_capture_print_timestamp (rec->time);
|
||||
@@ -215,10 +215,10 @@ rtems_capture_print_record_task (int cpu,
|
||||
}
|
||||
|
||||
void
|
||||
rtems_capture_print_record_capture(int cpu,
|
||||
const rtems_capture_record_t* rec,
|
||||
uint64_t diff,
|
||||
const rtems_name* name)
|
||||
rtems_capture_print_record_capture(int cpu,
|
||||
const rtems_capture_record* rec,
|
||||
uint64_t diff,
|
||||
const rtems_name* name)
|
||||
{
|
||||
uint32_t event;
|
||||
int e;
|
||||
@@ -262,11 +262,11 @@ rtems_capture_print_record_capture(int cpu,
|
||||
void
|
||||
rtems_capture_print_trace_records (int total, bool csv)
|
||||
{
|
||||
ctrace_per_cpu_t* per_cpu;
|
||||
ctrace_per_cpu_t* cpu;
|
||||
int cpus;
|
||||
rtems_capture_time_t last_time = 0;
|
||||
int i;
|
||||
ctrace_per_cpu* per_cpu;
|
||||
ctrace_per_cpu* cpu;
|
||||
int cpus;
|
||||
rtems_capture_time last_time = 0;
|
||||
int i;
|
||||
|
||||
cpus = rtems_get_processor_count ();
|
||||
|
||||
@@ -279,9 +279,9 @@ rtems_capture_print_trace_records (int total, bool csv)
|
||||
|
||||
while (total)
|
||||
{
|
||||
const rtems_capture_record_t* rec_out = NULL;
|
||||
int cpu_out = -1;
|
||||
rtems_capture_time_t this_time = 0;
|
||||
const rtems_capture_record* rec_out = NULL;
|
||||
int cpu_out = -1;
|
||||
rtems_capture_time this_time = 0;
|
||||
|
||||
/* Prime the per_cpu data */
|
||||
for (i = 0; i < cpus; i++) {
|
||||
@@ -345,7 +345,7 @@ rtems_capture_print_trace_records (int total, bool csv)
|
||||
{
|
||||
if ((rec_out->events >> RTEMS_CAPTURE_EVENT_START) == 0)
|
||||
{
|
||||
rtems_capture_task_record_t task_rec;
|
||||
rtems_capture_task_record task_rec;
|
||||
cpu->recs = rtems_capture_record_extract (cpu->recs,
|
||||
&task_rec,
|
||||
sizeof (task_rec));
|
||||
@@ -354,8 +354,8 @@ rtems_capture_print_trace_records (int total, bool csv)
|
||||
}
|
||||
else
|
||||
{
|
||||
rtems_capture_time_t diff;
|
||||
const rtems_name* name = NULL;
|
||||
rtems_capture_time diff;
|
||||
const rtems_name* name = NULL;
|
||||
if (last_time != 0)
|
||||
diff = rec_out->time - last_time;
|
||||
else
|
||||
@@ -402,9 +402,9 @@ rtems_capture_print_trace_records (int total, bool csv)
|
||||
void
|
||||
rtems_capture_print_watch_list (void)
|
||||
{
|
||||
rtems_capture_control_t* control = rtems_capture_get_control_list ();
|
||||
rtems_task_priority ceiling = rtems_capture_watch_get_ceiling ();
|
||||
rtems_task_priority floor = rtems_capture_watch_get_floor ();
|
||||
rtems_capture_control* control = rtems_capture_get_control_list ();
|
||||
rtems_task_priority ceiling = rtems_capture_watch_get_ceiling ();
|
||||
rtems_task_priority floor = rtems_capture_watch_get_floor ();
|
||||
|
||||
fprintf (stdout, "watch priority ceiling is %" PRId32 "\n", ceiling);
|
||||
fprintf (stdout, "watch priority floor is %" PRId32 "\n", floor);
|
||||
|
||||
@@ -78,7 +78,7 @@ static const rtems_extensions_table capture_extensions = {
|
||||
.thread_terminate = rtems_capture_terminated_task
|
||||
};
|
||||
|
||||
static inline void rtems_capture_record (rtems_tcb* tcb, uint32_t events)
|
||||
static inline void capture_record (rtems_tcb* tcb, uint32_t events)
|
||||
{
|
||||
rtems_capture_record_lock_context rec_context;
|
||||
|
||||
@@ -140,10 +140,10 @@ rtems_capture_create_task (rtems_tcb* ct,
|
||||
*/
|
||||
rtems_capture_initialize_task (nt);
|
||||
|
||||
if (rtems_capture_trigger (ct, nt, RTEMS_CAPTURE_CREATE))
|
||||
if (rtems_capture_trigger_fired (ct, nt, RTEMS_CAPTURE_CREATE))
|
||||
{
|
||||
rtems_capture_record (ct, RTEMS_CAPTURE_CREATED_BY_EVENT);
|
||||
rtems_capture_record (nt, RTEMS_CAPTURE_CREATED_EVENT);
|
||||
capture_record (ct, RTEMS_CAPTURE_CREATED_BY_EVENT);
|
||||
capture_record (nt, RTEMS_CAPTURE_CREATED_EVENT);
|
||||
}
|
||||
|
||||
return 1 == 1;
|
||||
@@ -167,10 +167,10 @@ rtems_capture_start_task (rtems_tcb* ct,
|
||||
if (st != NULL)
|
||||
rtems_capture_initialize_task (st);
|
||||
|
||||
if (rtems_capture_trigger (ct, st, RTEMS_CAPTURE_START))
|
||||
if (rtems_capture_trigger_fired (ct, st, RTEMS_CAPTURE_START))
|
||||
{
|
||||
rtems_capture_record (ct, RTEMS_CAPTURE_STARTED_BY_EVENT);
|
||||
rtems_capture_record (st, RTEMS_CAPTURE_STARTED_EVENT);
|
||||
capture_record (ct, RTEMS_CAPTURE_STARTED_BY_EVENT);
|
||||
capture_record (st, RTEMS_CAPTURE_STARTED_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,10 +191,10 @@ rtems_capture_restart_task (rtems_tcb* ct,
|
||||
if (!rtems_capture_task_initialized (rt))
|
||||
rtems_capture_initialize_task (rt);
|
||||
|
||||
if (rtems_capture_trigger (ct, rt, RTEMS_CAPTURE_RESTART))
|
||||
if (rtems_capture_trigger_fired (ct, rt, RTEMS_CAPTURE_RESTART))
|
||||
{
|
||||
rtems_capture_record (ct, RTEMS_CAPTURE_RESTARTED_BY_EVENT);
|
||||
rtems_capture_record (rt, RTEMS_CAPTURE_RESTARTED_EVENT);
|
||||
capture_record (ct, RTEMS_CAPTURE_RESTARTED_BY_EVENT);
|
||||
capture_record (rt, RTEMS_CAPTURE_RESTARTED_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +211,10 @@ rtems_capture_delete_task (rtems_tcb* ct,
|
||||
if (!rtems_capture_task_initialized (dt))
|
||||
rtems_capture_initialize_task (dt);
|
||||
|
||||
if (rtems_capture_trigger (ct, dt, RTEMS_CAPTURE_DELETE))
|
||||
if (rtems_capture_trigger_fired (ct, dt, RTEMS_CAPTURE_DELETE))
|
||||
{
|
||||
rtems_capture_record (ct, RTEMS_CAPTURE_DELETED_BY_EVENT);
|
||||
rtems_capture_record (dt, RTEMS_CAPTURE_DELETED_EVENT);
|
||||
capture_record (ct, RTEMS_CAPTURE_DELETED_BY_EVENT);
|
||||
capture_record (dt, RTEMS_CAPTURE_DELETED_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,8 +232,8 @@ rtems_capture_begin_task (rtems_tcb* bt)
|
||||
if (!rtems_capture_task_initialized (bt))
|
||||
rtems_capture_initialize_task (bt);
|
||||
|
||||
if (rtems_capture_trigger (NULL, bt, RTEMS_CAPTURE_BEGIN))
|
||||
rtems_capture_record (bt, RTEMS_CAPTURE_BEGIN_EVENT);
|
||||
if (rtems_capture_trigger_fired (NULL, bt, RTEMS_CAPTURE_BEGIN))
|
||||
capture_record (bt, RTEMS_CAPTURE_BEGIN_EVENT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -251,8 +251,8 @@ rtems_capture_exitted_task (rtems_tcb* et)
|
||||
if (!rtems_capture_task_initialized (et))
|
||||
rtems_capture_initialize_task (et);
|
||||
|
||||
if (rtems_capture_trigger (NULL, et, RTEMS_CAPTURE_EXITTED))
|
||||
rtems_capture_record (et, RTEMS_CAPTURE_EXITTED_EVENT);
|
||||
if (rtems_capture_trigger_fired (NULL, et, RTEMS_CAPTURE_EXITTED))
|
||||
capture_record (et, RTEMS_CAPTURE_EXITTED_EVENT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -269,8 +269,8 @@ rtems_capture_terminated_task (rtems_tcb* tt)
|
||||
if (!rtems_capture_task_initialized (tt))
|
||||
rtems_capture_initialize_task (tt);
|
||||
|
||||
if (rtems_capture_trigger (NULL, tt, RTEMS_CAPTURE_TERMINATED))
|
||||
rtems_capture_record (tt, RTEMS_CAPTURE_TERMINATED_EVENT);
|
||||
if (rtems_capture_trigger_fired (NULL, tt, RTEMS_CAPTURE_TERMINATED))
|
||||
capture_record (tt, RTEMS_CAPTURE_TERMINATED_EVENT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -288,7 +288,7 @@ rtems_capture_switch_task (rtems_tcb* ct,
|
||||
*/
|
||||
if (flags & RTEMS_CAPTURE_ON)
|
||||
{
|
||||
rtems_capture_time_t time;
|
||||
rtems_capture_time time;
|
||||
if (!rtems_capture_task_initialized (ct))
|
||||
rtems_capture_initialize_task (ct);
|
||||
|
||||
@@ -301,10 +301,10 @@ rtems_capture_switch_task (rtems_tcb* ct,
|
||||
*/
|
||||
rtems_capture_get_time (&time);
|
||||
|
||||
if (rtems_capture_trigger (ct, ht, RTEMS_CAPTURE_SWITCH))
|
||||
if (rtems_capture_trigger_fired (ct, ht, RTEMS_CAPTURE_SWITCH))
|
||||
{
|
||||
rtems_capture_record (ct, RTEMS_CAPTURE_SWITCHED_OUT_EVENT);
|
||||
rtems_capture_record (ht, RTEMS_CAPTURE_SWITCHED_IN_EVENT);
|
||||
capture_record (ct, RTEMS_CAPTURE_SWITCHED_OUT_EVENT);
|
||||
capture_record (ht, RTEMS_CAPTURE_SWITCHED_IN_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ rtems_status_code rtems_capture_user_extension_open(void);
|
||||
rtems_status_code rtems_capture_user_extension_close(void);
|
||||
|
||||
/**
|
||||
* @brief Capture trigger.
|
||||
* @brief Capture check trigger.
|
||||
*
|
||||
* This function checks if we have triggered or if this event is a
|
||||
* cause of a trigger.
|
||||
@@ -114,9 +114,9 @@ rtems_status_code rtems_capture_user_extension_close(void);
|
||||
* @retval This method returns true if we have triggered or
|
||||
* if the event is a cause of a trigger.
|
||||
*/
|
||||
bool rtems_capture_trigger (rtems_tcb* ft,
|
||||
rtems_tcb* tt,
|
||||
uint32_t events);
|
||||
bool rtems_capture_trigger_fired (rtems_tcb* ft,
|
||||
rtems_tcb* tt,
|
||||
uint32_t events);
|
||||
|
||||
/**
|
||||
* @brief Capture print trace records.
|
||||
@@ -149,9 +149,9 @@ void rtems_capture_print_timestamp (uint64_t uptime);
|
||||
* @param[in] cpu specifies the cpu the cpu the record was logged on.
|
||||
* @param[in] rec specifies the task record.
|
||||
*/
|
||||
void rtems_capture_print_record_task(int cpu,
|
||||
const rtems_capture_record_t* rec,
|
||||
const rtems_capture_task_record_t* task_rec);
|
||||
void rtems_capture_print_record_task(int cpu,
|
||||
const rtems_capture_record* rec,
|
||||
const rtems_capture_task_record* task_rec);
|
||||
|
||||
/**
|
||||
* @brief Capture print capture record.
|
||||
@@ -165,10 +165,10 @@ void rtems_capture_print_record_task(int cpu,
|
||||
* @param[in] name specifies the name of the task, NULL if none.
|
||||
* @param[in] task_count number of tasks to search for.
|
||||
*/
|
||||
void rtems_capture_print_record_capture(int cpu,
|
||||
const rtems_capture_record_t* rec,
|
||||
uint64_t diff,
|
||||
const rtems_name* name);
|
||||
void rtems_capture_print_record_capture(int cpu,
|
||||
const rtems_capture_record* rec,
|
||||
uint64_t diff,
|
||||
const rtems_name* name);
|
||||
|
||||
/**
|
||||
* @brief Capture print watch list
|
||||
|
||||
@@ -78,12 +78,12 @@ rtems_task Init(
|
||||
|
||||
rtems_capture_print_watch_list();
|
||||
|
||||
sc = rtems_capture_control (true);
|
||||
sc = rtems_capture_set_control (true);
|
||||
ASSERT_SC(sc);
|
||||
|
||||
capture_test_1();
|
||||
|
||||
sc = rtems_capture_control (false);
|
||||
sc = rtems_capture_set_control (false);
|
||||
ASSERT_SC(sc);
|
||||
|
||||
rtems_capture_print_trace_records ( 22, false );
|
||||
|
||||
@@ -232,12 +232,12 @@ static void Init(rtems_task_argument arg)
|
||||
);
|
||||
}
|
||||
|
||||
sc = rtems_capture_control (true);
|
||||
sc = rtems_capture_set_control (true);
|
||||
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
test();
|
||||
|
||||
sc = rtems_capture_control (false);
|
||||
sc = rtems_capture_set_control (false);
|
||||
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
rtems_capture_print_trace_records ( 22, false );
|
||||
|
||||
@@ -38,7 +38,7 @@ typedef struct {
|
||||
rtems_id id;
|
||||
rtems_id task_sem;
|
||||
rtems_id prev_sem;
|
||||
} task_data_t;
|
||||
} per_cpu_task_data;
|
||||
|
||||
typedef struct {
|
||||
bool found;
|
||||
@@ -49,7 +49,7 @@ typedef struct {
|
||||
} clock_interrupt_handler;
|
||||
|
||||
static rtems_id finished_sem;
|
||||
static task_data_t task_data[ TASKS_PER_CPU * TASKS_PER_CPU ];
|
||||
static per_cpu_task_data task_data[ TASKS_PER_CPU * TASKS_PER_CPU ];
|
||||
static rtems_interrupt_handler org_clock_handler;
|
||||
|
||||
typedef enum {
|
||||
@@ -65,15 +65,15 @@ typedef enum {
|
||||
typedef struct {
|
||||
uint32_t a;
|
||||
uint32_t b;
|
||||
} RTEMS_PACKED enter_add_number_record_t;
|
||||
} RTEMS_PACKED enter_add_number_record;
|
||||
|
||||
typedef struct {
|
||||
uint32_t res;
|
||||
} RTEMS_PACKED exit_add_number_record_t;
|
||||
} RTEMS_PACKED exit_add_number_record;
|
||||
|
||||
typedef struct {
|
||||
void *arg;
|
||||
} RTEMS_PACKED clock_tick_record_t;
|
||||
} RTEMS_PACKED clock_tick_record;
|
||||
|
||||
/*
|
||||
* Create a printable set of char's from a name.
|
||||
@@ -97,8 +97,8 @@ static uint32_t add_number(uint32_t a, uint32_t b)
|
||||
static uint32_t add_number_wrapper(uint32_t a, uint32_t b)
|
||||
{
|
||||
rtems_capture_record_lock_context lock;
|
||||
enter_add_number_record_t enter_rec;
|
||||
exit_add_number_record_t exit_rec;
|
||||
enter_add_number_record enter_rec;
|
||||
exit_add_number_record exit_rec;
|
||||
cap_rec_type id;
|
||||
uint32_t res;
|
||||
void* rec;
|
||||
@@ -288,10 +288,10 @@ static void Init(rtems_task_argument arg)
|
||||
size_t read;
|
||||
const void *recs;
|
||||
cap_rec_type id;
|
||||
rtems_capture_record_t rec;
|
||||
rtems_capture_record_t prev_rec;
|
||||
enter_add_number_record_t enter_rec;
|
||||
exit_add_number_record_t exit_rec;
|
||||
rtems_capture_record rec;
|
||||
rtems_capture_record prev_rec;
|
||||
enter_add_number_record enter_rec;
|
||||
exit_add_number_record exit_rec;
|
||||
clock_interrupt_handler cih = {.found = 0};
|
||||
|
||||
#ifdef VERBOSE
|
||||
@@ -309,7 +309,7 @@ static void Init(rtems_task_argument arg)
|
||||
sc = rtems_capture_watch_global(true);
|
||||
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
sc = rtems_capture_control(true);
|
||||
sc = rtems_capture_set_control(true);
|
||||
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
/* Run main test */
|
||||
@@ -337,7 +337,7 @@ static void Init(rtems_task_argument arg)
|
||||
}
|
||||
|
||||
/* Disable capturing */
|
||||
sc = rtems_capture_control(false);
|
||||
sc = rtems_capture_set_control(false);
|
||||
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
|
||||
|
||||
clock_tick_count = 0;
|
||||
|
||||
Reference in New Issue
Block a user