Linux Trace Toolkit Reference Manual
<<< Previous Page Home Up Next Page >>>

4. Trace daemon command-line operation


    tracedaemon - The trace daemon component of the Linux Trace Toolkit (LTT)


    tracedaemon  [ -d ] [ -p ] [ -m ] [ -f ] [ -o ] [ -k ] [ -q ] [ -j ] [ -v ] [ -bBufSize ] [ -nNBuffers ] [ -eEventTypes ] [ -DEventTypes ] [ -cCPU-ID ] [ -PPID ] [ -GPGRP ] [ -gGID ] [ -uUID ] [ -s { dCallDepth | lLowerBound | uUpperBound } ] [ -t { sSeconds | uMicroseconds } ] [ TraceFile ] [ ProcFile ]


    Note for embedded Linux users: The trace daemon is run on the target system.

    The tracedaemon program is the daemon component of Linux Trace Toolkit (LTT). Its primary function is to collect the data from the trace module in the kernel and to commit it to a file. In order to do so, it needs a minimum of 2 arguments: the file in which to commit the trace and a file to write the description of the system as found is /proc on startup. The later is used by the data decoder in order to reconstruct the system as it was when the trace started. In the case of flight recorder data, however, only the trace file needs be specified; a proc file isn't generated.

    Moreover, the trace daemon can be used to configure the trace module by passing it different command line arguments. The trace module is configured using a series of calls to ioctl(). Contrary to the command line arguments options possible for the trace decoder, the options given to the daemon have a direct impact on the data collected by the kernel. That is, if some data is configured to be omitted then that data will not be available in the raw trace and cannot be extracted by the decoder. On the other hand if the same is done on the decoder level, the data might not be present in the decoder's output, but it will still be available in the raw trace. Therefore, the choice of configuration of the daemon should be selected with caution, the data omitted being truly omitted in the trace. You have been warned!

    As noted, the tracedaemon is used to start both normal traces i.e. traces in which all traced data is logged to disk, and 'flight recorder' traces, which are traces that run continuously and are only written to disk when requested (see the -j option below) or are examined after a system crash has taken place (see SGI's LKCD (Linux Kernel Crash Dump) for tools that allow the retrieval of the flight recorder buffers in a post-mortem situation). The default set of events that are logged in flight recorder mode are: syscall entry/exit, trap entry/exit, irq entry/exit, schedchange, kernel timer, softirq, and process. Note that all of these events, except for kernel timer, softirq and process, are required to display a trace graphically using the LTT visual tools.


    -d    Set the trace module to it's default configuration. It is wise to always include this options since it makes sure that the trace module is set to it's default configuration even if it has already been used by a previous run of the daemon.

    -p    Print the current trace mask. When the trace daemon is already running, simply call on tracedaemon -p to print the current trace mask. You won't need to provide the daemon with any other option whatsoever.

    -m    Modify the curren trace mask. When the trace daemon is already running, use this option with the -e or -D options to modify the curren trace mask. As with -p, you don't need to provide any of the traditionnaly required files.

    -f    Use the lock-free tracing scheme. If -b and/or -n are unspecified, the defaults will be 4 buffers of 512 K each. The lock-free scheme is the default so this option need not be used, but is maintained for backward compatibility.

    -l    Use the locking tracing scheme. If -b and/or -n are unspecified, the defaults will be 2 buffers of 1,000,000 bytes each. If -l is not specified, the lock-free scheme will be used with 4 buffers of 512K each.

    -o    Force the use of gettimeofday() timestamping. The default timestamping method is TSC timestamping, if the platform supports it, otherwise gettimeofday() timestamping is used. This option avoids TSC timestamping even if the platform supports it.

    -k    If specified, the remaining options refer to the flight recorder trace. Otherwise, all options refer to the normal trace. Specifying -k with no other options starts the flight recorder trace, which will run continuously forever unless stopped using the -q option. A snapshot of the current flight recorder trace data can be retrieved using the -j option.

    -q    Stop the flight recorder trace, if active.

    -j    Dump the current flight recorder trace data into the tracefile specified by the TraceFile option. If there are multiple CPUs being traced, the TraceFile name will be used as the base for the multiple resulting tracefiles. A ProcFile is not created when recording traces in flight recorder mode. If you specify a ProcFile name, it is ignored.

    -v    Display information about the current trace and or flight recorder. This can be used to verify the status and activity of the flight recorder trace.

    -b    Sets the trace module's data collection buffer to the size given by BufSize. Giving too small of a size will result in a loss of events and too large of a size will result in lost kernel space. The default size for the locking scheme is 1000000 bytes. The default size for the lock-free scheme is 524288 (512K). For the lock-free scheme, the size should be a power of 2; if it isn't, it will be rounded down to the next lower power of 2. As of 26/03/2000, the trace module will not accept sizes below 1000 bytes.

    -n    Sets the number of trace module data collection buffers to the number given by NBuffers. The default number of buffers for the lock-free scheme is 4, and 2 for the locking scheme. The number of buffers should be a power of 2; if it isn't, it will be rounded down to the next lower power of 2. The maximum number of buffers is 256.

    -e    Trace only the given events. This will set the trace mask passed to the module to include the event given in EventTypes. This option can be used more than once to specify all the events to be traced. The following is the list of event types traced:

If you've compiled the trace daemon with RTAI support, then the following event types can be configured: Note that the start trace event is always traced, whether it is configured as such or not. This is done by the trace module and should not be modified since the trace decoder needs information included in this first event.

    -D    Sets the module to record the details of the event given. See -e for the events available. This too can be used more than once to specify all the events for which the details are recorded. The details of the start trace event are always recorded, whether -D is used to specify this or not. The reason is the same than for the -e option. For the data decoder to be able to draw the event graph, the following events must have their details recorded : syscall, irq, trap entry and exit and schedchange.

    -c    Trace CPU-ID. Only include events that occurred on CPU-ID in trace.

    -P    Trace PID. Only include process number PID in trace.

    -G    Trace process group. Only include processes part of PGRP in trace.

    -g    Trace GID. Only include processes part of GID in trace.

    -u    Trace UID. Only include processes belonging to UID in trace.

    -s    Set the syscall EIP fetching policy. If -sd is used then the instruction pointer (EIP) will be fetched up the call stack at the given CallDepth. If the EIP has to be fetched from a certain range then -su and -sl must be used in this sequence. Each must be followed by a hexadecimal formatted address, 0xXXXXXXXX. These will be the UpperBound and the LowerBound used to fetch the EIP.

    -t    Set the time for which the daemon should run. -ts sets the number of seconds to run to Seconds. -tu sets the number of microseconds to run to Microseconds.

<<< Previous Page Home Up Next Page >>>
Linux trace toolkit Daemon command-line operation