Data acquisition

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

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 (I think devfs will end up fixing this for me, I'll transfer to devfs once it becomes normal practice amongst most distros).

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

Having done this, you should see a new entry in /proc/devices.

ADVICE: It is advised that you run the trace daemon at least once as soon as you've installed the trace driver in order to force it to reserve memory. If you don't do this, the trace driver might be unable to reserve enough memory to operate. This is a problem right now because we use __get_free_pages(). Stephen Tweedie strongly suggests using vmalloc(). I'll try it as soon as I get the time to do so ...

- 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

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:

- Start the trace daemon

    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, 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.

<<< Previous Page | Home | Up | Next Page >>>
Linux trace toolkit | Data acquisition