Trace subroutine for instrumenting application code.
Posix Trace Library (libposixtrace.a)
#include <sys/type.h>
#include <trace.h>
int posix_trace_eventid_open(event_name, event_id)
const char *restrict event_name;
trace_event_id_t *restrict event_id;
The posix_trace_eventid_open subroutine associates a user trace event name with a trace event type identifier for the calling process. The trace event name is the string pointed to by the event_name parameter. It can have a maximum number of characters defined in the TRACE_EVENT_NAME_MAX (which has the minimum value of _POSIX_TRACE_EVENT_NAME_MAX). The number of user trace event type identifiers that can be defined for any given process is limited by the maximum value defined in the TRACE_USER_EVENT_MAX, which has the minimum value _POSIX_TRACE_USER_EVENT_MAX.
If there is no trace stream created, the posix_trace_eventid_open subroutine stores this information for future trace streams created for this process.
Item | Description |
---|---|
event_name | Specifies the trace event name. |
event_id | Specifies the trace event identifier. |
On successful completion, the posix_trace_eventid_open subroutine returns a value of zero. Otherwise, it returns the corresponding error number.
If successful, the posix_trace_eventid_open subroutine stores the trace event type identifier value in the object pointed to by event_id.
Item | Description |
---|---|
ENAMETOOLONG | The size of the name pointed to by the event_name parameter is longer than the value defined by TRACE_EVENT_NAME_MAX. |