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
Having done this, you should see a new entry in /proc/devices.
Create a new device in /dev to point to the new device (you only need to do this once)
mknod tracer c [number seen in /proc/devices] 0
I know, I know, this should be automated. I promise I'll do this
one day.
3.2 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:
[location of LTT]/TraceDaemon -tsT /dev/tracer ./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, 4 M per minute it runs for a heavy loaded system. On
a normal workstation using X, the usage is less than 1 M per minute. It
is possible to reduce this 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.