Outputs an event to one or more output destinations.
cobrtncode_t cobctf_trace(cobuns32_t flags, const cobuns8_t *component_id, TRACE_EVENT *trace_event)
| flags | Control flags:
|
|||||||||||||||||||||||||||||||||||
| component_id | Component identifier. This is either a 32-bit unsigned integer tracer handle (from CBL_CTF_TRACER_GET) if bit 31 of flags is not set, or a text identifier if bit 31 of flags is set. | |||||||||||||||||||||||||||||||||||
| trace_event | Trace event structure: | |||||||||||||||||||||||||||||||||||
| version | Structure version. Must be 0. | |||||||||||||||||||||||||||||||||||
| flags | Control flags. Must be 0. | |||||||||||||||||||||||||||||||||||
| event_id | Component-specific event identifier used to identify the type of event being output. | |||||||||||||||||||||||||||||||||||
| level | Tracing level of the event being output. | |||||||||||||||||||||||||||||||||||
| data_count | Number of trace data items, indicating the number of elements in the event_len, event_type, and event_data arrays. This can be 0. | |||||||||||||||||||||||||||||||||||
| event_len | Pointer to an array of 32-bit unsigned integers. Each array element indicates the length of the corresponding trace data item in the event_data array. This can be NULL if data_count is 0. | |||||||||||||||||||||||||||||||||||
| event_type | Pointer to an array of 32-bit unsigned integers. Each array
element indicates the type of the corresponding trace data item in the
event_data array. This can be NULL if
data_count is 0.
|
|||||||||||||||||||||||||||||||||||
| event_data | Pointer to array of pointer items. Each array element
addresses a trace data item of the type and length indicated by the
corresponding element in the event_type and
event_len arrays respectively. This can be NULL if
data_count is 0.
For address type items, the array element is the address value; not a pointer to the address value. |
|||||||||||||||||||||||||||||||||||
| cobrtncode_t | One of:
|
|||||||||||||||||||||||||||||||||||
cobctf_trace outputs the event specified by event_id to one or more output destinations provided that the event level specified in level is greater or equal to that configured for the component.
#include "mfctf.h"
#define EVENT_TYPE_A 1
some_func()
{
const cobuns8_t *component_id = "mycomp";
cobuns32_t event_len[1];
cobuns32_t event_type[1];
void *event_data[1];
cobuns32_t flags;
TRACE_EVENT trace_event;
cobuns32_t tracer_handle;
cobuns32_t trace_info = 999;
...
/*
** Acquire tracer handle
*/
CBL_CTF_TRACER_GET(CTF_FLAG_COMP_NAME_NULL_TERM,
component_id,
(cbl_x4_comp5_t *)&tracer_handle);
/*
** Set up trace event
*/
memset(&trace_event, 0, sizeof(trace_event);
trace_event.event_id = EVENT_TYPE_A;
trace_event.level = CTF_FLAG_LEVEL_INFO;
trace_event.event_len = (cobuns32_t *)&event_len;
trace_event.event_type = (cobuns32_t *)&event_type;
trace_event.event_data = &event_data;
event_len[0] = sizeof(trace_info);
event_type[0] = TRACE_EVENT_TYPE_COMP5;
event_data[0] = &trace_info;
/*
** Output trace event
*/
cobctf_trace(0,
(const cobuns8_t *)&tracer_handle,
&trace_event);
...
}