Updated: April 19, 2023 |
Get information about traceparser
#include <sys/traceparser.h> void * traceparser_get_info ( struct traceparser_state * stateptr, info_modes_t infomodes, unsigned * len );
The traceparser_get_info() function gets information related to the state of the traceparser. You can use this function if you're creating your own utility for parsing trace data (as an alternative to traceprinter).
The len argument is a pointer to the size of the return buffer. When specified, its contents are changed to indicate the size of the return. This is primarily for the _TRACEPARSER_INFO_SYSPAGE and _TRACE_HEADER_KEYWORDS() modes, but it works for all the modes. For most of the modes, len may be NULL.
The stateptr is an opaque structure obtained from traceparser_init().
User info modes for info_modes
The following are valid user info modes; see the list below for others.
Value for info_modes and Pointer to return data type, cast as void * | Description |
---|---|
_TRACEPARSER_INFO_SYSPAGE, syspage_entry | Returns a pointer to the syspage entry. |
_TRACEPARSER_INFO_ENDIAN_CONV, unsigned | Returns a dereferenced pointer; 1 if the endian conversion has been applied, 0 if no conversion has been performed. |
_TRACEPARSER_INFO_NOW_CALLBACK_CLASS,, _TRACEPARSER_INFO_NOW_CALLBACK_EVENT, unsigned | Returns the class or event numerical value of the currently executed callback function. The numerical values are considered opaque and should be used only for other traceparser functions. |
_TRACEPARSER_INFO_PREV_CALLBACK_CLASS, _TRACEPARSER_INFO_PREV_CALLBACK_EVENT, unsigned | As above, but returns the class or event numerical value of the previously executed callback function. |
_TRACEPARSER_INFO_PREV_CALLBACK_RETURN, int | Returns the value of the previously executed callback function. |
_TRACEPARSER_INFO_DEBUG, unsigned | Returns the debugging flags; see traceparser_debug(). |
_TRACEPARSER_INFO_ERROR, unsigned | Returns the traceparser error level, which you can use to diagnose errors related to the traceparser library. See <sys/traceparser.h> for a list of the returned error values. |
Other valid user info modes
The following modes return a pointer (cast as void *) to the appropriate information from the traceparser. They're defined in <sys/trace.h> using the _TRACE_MK_HK() macro (e.g., _TRACE_MK_HK(FILE_NAME)).
A pointer (cast as void *) to the requested information, or NULL if an error occurred (errno is set; you can use the _TRACEPARSER_INFO_ERROR mode of this function to get more details).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | No |