[Previous]
[Contents]
[Next]

qnx_trace_info()

return information from a trace buffer

Synopsis:

#include <sys/trace.h>
int qnx_trace_info( pid_t proc_pid,
                    struct _trace_info *info );

Description:

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:

long buffsize
The size of the trace buffer
long datasize
The amount of data in the trace buffer
unsigned short overruns
The current number of overruns
unsigned short severity
The minimum severity level to be logged
pid_t reader
If another process is currently doing a qnx_trace_read(), then the reader member contains its process id; otherwise, this field is zero.
unsigned short tracesel
The segment of the trace buffer
long hi_water
The number of bytes required to be in the trace buffer before the proxy is triggered
pid_t proxy
The proxy to be triggered

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.

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

ENOSYS
The process manager doesn't support trace calls.
ESRCH
The proc_pid is invalid.

Examples:

/*
 * 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 );
    }
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes

See also:

errno, qnx_trace_trigger(), qnx_trace_severity(), qnx_trace_open(), qnx_trace_read(), qnx_trace_close(), Trace()


[Previous]
[Contents]
[Next]