return information from a trace buffer
#include <sys/trace.h> int qnx_trace_info( pid_t proc_pid, struct _trace_info *info );
The qnx_trace_info() function returns information from the trace buffer located on the node whose process manager is addressed by proc_pid. The _trace_info structure contains at least the following members:
If proc_pid is zero or PROC_PID, the trace buffer on the current node is accessed. To access a trace buffer on another node, you must establish a virtual circuit to the process manager on that node and pass the vid as proc_pid.
/* * Display the trace info */ #include <stdio.h> #include <errno.h> #include <sys/trace.h> void main() { struct _trace_info info; if( qnx_trace_info( 0, &info ) == -1 ) { perror( "trace_info" ); } else { printf( "overruns = %u\n", info.overruns ); printf( "severity = %d\n", info.severity ); printf( "reader = %d\n", info.reader ); printf( "buffsize = %ld\n", info.buffsize ); printf( "datasize = %ld\n", info.datasize ); printf( "tracesel = %04X\n", info.tracesel ); printf( "hi_water = %ld\n", info.hi_water ); printf( "proxy = %d\n", info.proxy ); } }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes, but modifies errno |
Thread | Yes |
errno, qnx_trace_trigger(), qnx_trace_severity(), qnx_trace_open(), qnx_trace_read(), qnx_trace_close(), Trace()