[Previous]
[Contents]
[Next]

qnx_trace_severity()

select the minimum severity level of trace events to be logged

Synopsis:

#include <sys/trace.h>
int qnx_trace_severity( pid_t proc_pid,
                        int severity );

Description:

The qnx_trace_severity() function selects the minimum severity level of trace events to be logged. The severity level affects all further trace event logging on the machine whose process manager is addressed by pid.


Note: _TRACE_CRITICAL events cannot be suppressed, and are always logged.

The following severity levels are defined in <sys/trace.h>:

_TRACE_CRITICAL
Major fault; this should never happen.
_TRACE_SEVERE
Hardware failure (major).
_TRACE_TRANSIENT
Could possibly happen (for example, bad blocks).
_TRACE_EXPECTED
Expected errors (for example, a CRC error).
_TRACE_TESTING
Used for debugging code.

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:

EINVAL
The severity level was invalid.
ENOSYS
The process manager doesn't support trace calls.
EPERM
The calling process doesn't have sufficient privilege to select the trace severity level.
ESRCH
The proc_pid is invalid.

Examples:

/*
 * Change the trace severity level
 */
#include <stdio.h>
#include <sys/trace.h>

void main( int argc, char *argv[] )
  {
    if( argc > 1 ) {
      printf( "Changing severity to %d, ",
        atoi( argv[1] ) );
      if( qnx_trace_severity( 0, atoi( argv[1] ) )
          == -1 ) {
        printf( "Failed\n" );
      } else {
        printf( "Successful\n" );
      }
    }
  }

Classification:

QNX

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

See also:

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


[Previous]
[Contents]
[Next]