3. Data acquisition
3.1 Probing the kernel
-
Reboot and use the kernel built in the previous section.
-
Install the trace module (skip this if you compiled the kernel with the tracer built-in)
insmod tracer
3.2 Probing RTAI
If you've tried to do as prescribed above with an LTT patched RTAI system, then you
noticed that you can't install the tracer. The system complains about unresolved symbols.
This is because it's a little bit more complicated with RTAI.
-
Reboot and use the kernel built in the previous section.
-
Install the RTAI trace-engine, you need to do this step whether you intend to trace your
system or not. The reason is that the RTAI modules depend on this engine. If the trace
driver isn't installed, this engine will simply disregard the events sent by the different
RTAI components. If you don't want to have to do this, the configure the RTAI Linux kernel
without support for RTAI tracing
insmod [rtai-location]/rtai/modules/rtai_trace
Install the trace driver module
insmod tracer
You can now install the other RTAI modules and trace your system.
3.3 Recording the data
A trace begins when the trace daemon starts recording
events. If you have followed all the previous steps, this is currently
not the case. To start recording, do:
tracedaemon -tsT ./out.trace ./out.proc
out.trace will contain the raw events and out.proc will contain
data read from /proc that will enable the decoder to know the process'
name and hierarchy. Replace T by the number of seconds you want the
daemon to run. Using the given command line, the out.trace file will use,
approximatively, 30 M per minute it runs for a heavy loaded system. On
a normal workstation without X, the usage is less than 1 M per minute. It
is possible to reduce the usage by choosing not to trace certain events. See
the following section for the daemon's command-line options.
If you didn't specify the -t option, then you must stop the trace daemon manually.
kill [daemon pid]
Type ps if you don't know the daemon's PID.
Since the daemon and the decoder are often used in the same way on multiple runs, it is
desirable to write simple scripts to automate the passing of options. The last
section, of this Help, documents some scripts already available.