Get information about traceparser


#include <sys/traceparser.h>

void * traceparser_get_info ( 
   struct traceparser_state * stateptr,
    info_modes_t infomodes,
    unsigned * len );


A pointer to the parser's state information, obtained by calling traceparser_init().
A _TRACEPARSER_INFO_* value (defined in traceparser.h) that indicates what information you want to get; see below.
NULL, or a pointer to a location where the function can store the length of the data returned.



Use the -l traceparser option to qcc to link against this library.


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_SYSPAGE and _TRACEPARSER_HEADER_KEYWORDS modes but it'll work 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:


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).


QNX Neutrino

Cancellation point No
Interrupt handler No
Signal handler No
Thread No