Log tracing information into an event file
tracelogger [-acEPRrw] [-A attribute] [-b num] [-D seconds] [-d mode] [-F num] [-f file] [-k num] [-M -S size] [-n num] [-p addr] [-s num] [-v[v...]]
QNX Neutrino
If you do, tracelogger prints a message and ignores the attribute.
You can use one or more occurrences of this option to add information to identify the scenario that you're logging. For example:
tracelogger -s1 -A MACHINE_NAME=tx86 -A PERIOD=1s
You can specify more than one filter by using multiple -F options. For example, to disable both the Interrupt and VThread classes, specify -F2 -F5. For more information about these classes, see the Events and the Kernel chapter of the System Analysis Toolkit User's Guide.
The tracelogger service receives events from the instrumented kernel (procnto*-instr) and saves them in a file or on a device for later analysis. By default, tracelogger saves the events in /dev/shmem/tracebuffer.kev. The .kev extension is short for kernel events; the Integrated Development Environment opens files with this extension in the System Profiler.
The traceprinter utility doesn't have any issues with such traces because it doesn't attempt to reorder the data and interpret it; it simply dumps the contents of each event.
You can run tracelogger in the following modes:
Mode | Option | The kernel: | tracelogger: |
---|---|---|---|
Continuous | -c | Logs events | Captures the events, and continues to do so until terminated |
Daemon | -d1 | Doesn't log eventsa | Waits passivelya |
Iterations (the default) | -n | Logs events | Captures num_buffers of data and then terminates |
Ring | -r | Logs events | Doesn't capture events until it gets a SIGINT signal, or an application calls TraceEvent(_NTO_TRACE_STOP)b |
Time-based | -s | Logs events | Captures events for the specified number of seconds |
a In daemon mode, logging starts when an application calls TraceEvent(_NTO_TRACE_START) and continues until an application calls TraceEvent(_NTO_TRACE_STOP), or until you terminate tracelogger.
b When you terminate tracing in ring mode, tracelogger stops logging events, and then briefly restarts and stops it again so it can capture the state information that's emitted by the _NTO_TRACE_START command. This information includes the thread IDs and names of processes.
If you aren't using daemon mode, or you're using daemon mode with the -E option, then tracelogger:
This is the simplest way to configure the tracing. In this case, tracelogger performs all initialization and runtime control of the instrumentation module in addition to its normal task of saving the trace buffers to the filesystem. If you use daemon mode, your application needs to call TraceEvent() to start capturing trace events.
For finer (and more flexible) control of the instrumentation, run tracelogger in daemon mode without the -E option, and call TraceEvent() from your application to specify what to trace, and when to start and stop tracing. Except for specifying the number of buffers, tracelogger doesn't perform any initialization of the instrumentation module, and its almost exclusive task is to log the received trace events to the filesystem.
Start tracelogger in wide mode and display operational information on the console screen; store the logged data in the named file and stop logging when 12 trace buffers are full:
tracelogger -f /dev/shmem/my_tracebuffer.kev -n 12 -w
Start tracelogger in ring mode using 5 internal buffers and wait for an asynchronous signal (e.g., CtrlC) to stop it:
tracelogger -r -b 5
Run tracelogger in daemon mode, enabling all events, logging wide events, and filtering out events that are in the Interrupt class:
tracelogger -d1 -E -w -F2
Severe errors cause tracelogger to terminate.