Components of the SAT

QNX SDP8.0System Analysis Toolkit (SAT) User's GuideUser

The QNX OS System Analysis Toolkit (SAT) consists of the following main components:

You can also trace and analyze events under control of the Integrated Development Environment (IDE).

Figure 1Overall view of the SAT.

SAT Overall

Instrumented kernel

The QNX OS instrumented kernel includes a small, highly efficient event-gathering module. As threads run, this kernel module continuously intercepts information about what the kernel is doing, generating timestamped and CPU-stamped events that are then stored in buffers. Because the tracing occurs at the kernel level, the SAT can track the performance of all processes, including the data-capture program.

Kernel buffer space

The kernel buffer space is composed of many small trace buffers. Although the total number of buffers is limited only by the amount of system memory, this space must nonetheless be managed carefully. If all of the events are being traced on an active system, the number of events will be quite large.

To allow the kernel to write to one part of the kernel buffer space and store data in another part of it simultaneously, the trace buffers are organized as rings, with one ring for each CPU. Whenever a buffer in a particular ring becomes completely full, the kernel requests that the data-capture program flush the buffer. A waiting worker thread in this program then retrieves the buffer contents and saves them in a location for offline processing, or passes these contents to a data interpreter for runtime analysis. In either case, the buffer space gets emptied and becomes available again for use by the kernel.

Data-capture program (tracelogger)

The QNX OS includes a utility, tracelogger, that you can use to capture data. This service interacts with the instrumented kernel to configure the number of buffers it uses to store trace data and to receive events so it can save them in a file or send them to a device for later analysis.

Note:
Data-capture utilities such as tracelogger require the PROCMGR_AID_TRACE ability in order to allocate buffer memory. For more information about abilities, see the entry for procmgr_ability() in the QNX OS C Library Reference.

Because the tracelogger may write data at rates well in excess of 20 MB/minute, running it for prolonged periods or running it repeatedly can use up a large amount of space. If disk space is low, erase old log files regularly. (In its default mode, tracelogger overwrites its previous default file.)

You can also control tracing from your application (e.g., to turn tracing on just for a problematic area) with the TraceEvent() kernel call. This function has over 30 different commands that let you:
  • create internal trace buffers
  • set up filters
  • control the tracing process
  • insert user-defined events

For more information, see the Capturing Trace Data chapter in this guide, the entry for tracelogger in the Utilities Reference, and the entry for TraceEvent() in the C Library Reference.

Data interpretor (traceprinter)

We provide a utility, traceprinter, that outputs the trace events stored in a kernel event file generated by tracelogger. These events are ordered linearly by their timestamp as they're emitted by the kernel. You can also use the utility to do the following offline or in real time:
  • perform analysis
  • display results
  • debug applications
  • create a self-monitoring system
  • show events ordered by process or by thread
  • show thread states and transitions
  • show currently running threads
The utility uses the libtraceparser library. This library provides traceparser_*() functions for parsing and interpreting the trace events stored in the kernel event file. Specifically, the library lets you easily:
  • set up callback functions and associations for each event
  • retrieve header and system information from the trace event file
  • debug and control the parsing process

For more information, see the Interpreting Trace Data chapter in this guide, as well as the entry for traceprinter in the Utilities Reference.

Integrated Development Environment (IDE)

The QNX Momentics IDE provides a graphical interface for capturing and examining trace events. The IDE lets you filter events, zoom in on ranges of them, examine their data, save subsets of events, and more. For details, see the Analyzing System Behavior chapter of the IDE User's Guide.

Page updated: