[Previous] [Contents] [Next]

tracelogger

Extract trace events and log them to a file (QNX)

Syntax:

tracelogger [options]

Options:

-f logfile
Append trace information to this logfile. The filename can include %m for a month expansion (01-12), %d for a day expansion (01-31), or both.

If you don't specify -f, trace events are logged to standard output, allowing you to pipe them directly into the traceinfo utility.

-M mode
In conjunction with -f, file mode to open logfile with, specified as a decimal number. Default is 409 (O_WRONLY | O_CREAT | O_APPEND | O_DSYNC | S_IRUSR | S_IWUSR).
-o
Optimize the writing of trace information to disk. If -o is used, the logfile or device specified with -f will be kept open as much as possible to reduce filesystem traffic.
-p percent_full
Extract events from the trace buffer when it becomes this full. To have events extracted as soon as they occur, set percent_full to 0.

If you don't specify this option, tracelogger will set this high water mark to 50%.

-P permissions
In conjunction with -f, permissions on the logfile, specified as a decimal number. Default is: 420 (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
-t minutes
Extract events from the trace buffer if none have been extracted for this many minutes (default is 5). To disable this feature, set minutes to 0.

Description:

The tracelogger utility automatically extracts trace events and logs them to a file. The logged event data is stored in a raw binary format that you can display in human-readable form with the traceinfo utility. Together, these utilities provide a means of capturing runtime events that you can review when diagnosing problems.

Trace events are maintained by the Process Manager (Proc) in an in-memory buffer. When programs call one of the Trace*() library functions, a trace event is generated and quickly added to this in-memory buffer. For information on this family of functions, see the Watcom C Library Reference.

Most of the system managers (Dev, Fsys, Proc, Net, ...) generate trace events while they operate. To adjust the severity of the events that are logged as well as other trace parameters, use the tracectrl utility.

To have tracelogger extract data from the trace buffer immediately, you can use the SIGALRM signal. For example:

   slay -s SIGALRM tracelogger

Note: The tracelogger utility must be started by root and is typically run in the background. To stop tracelogger, make sure you're logged in as root, then type:
    slay tracelogger

Examples:

Start in the background and create logfiles under /tracedata based on month and day (e.g. trace events on March 12 will be appended to the file /tracedata/data.0312). Also, extract events if the trace buffer becomes 20% full or if the 20% mark isn't reached after 3 minutes:

    tracelogger -f /tracedata/data.%m%d -p 20 -t 3 &

Pipe trace events into the traceinfo program:

    tracelogger -p 20 | traceinfo -

See also:

Proc, traceinfo, tracectrl

qnx_trace_close(), qnx_trace_info(), qnx_trace_open(), qnx_trace_read(), qnx_trace_severity(), qnx_trace_trigger(), and Trace*() functions in the Watcom C Library Reference.


[Previous] [Contents] [Next]