The IDE lets you easily configure and start kernel event tracing. But sometimes, you might not have a target connection for controlling tracing. At these times, you can use the tracelogger utility to capture trace data. To further control tracing, your applications can call the kernel event trace API.
When you run a kernel event trace from the launch bar, the IDE tells qconn of the initial trace settings and to start capturing event data. The trace settings are based on the UI fields in the log configuration.
You can also run the tracelogger command-line tool on the target. The advantage of this approach is that you can start a trace automatically (i.e., using a script) at a specific operational phase, including during system startup when you can't use the IDE because there's no active target connection. In this case, the trace settings are based on the options given to tracelogger.
Both qconn and tracelogger use TraceEvent() to control the kernel's event-gathering module. Your applications can make TraceEvent() calls to closely control what event information is captured. For these calls to have any effect, though, the kernel's instrumentation mode must be active.
The best technique is to use the IDE or command line to start a trace before or after you begin running applications that use TraceEvent(). This way, qconn or tracelogger does the tedious work of managing buffers, collecting trace data, and saving the data in the appropriate form, while allowing the applications to choose which events get logged and to start and stop data capturing. Any adjustments made at runtime override any equivalent initial settings defined when the trace was launched.