2.Installation
2.1 Patched Kernel and Kernel module
This discussion concerns a plain vanilla Linux.
-
Make sure you have a LTT-supported Linux kernel
source installed. If you don't know how to do this, we suggest going through
the Linux kernel compilation HOWTO available at www.linuxdoc.org.
Do not compile it yet however, although it doesn't matter if you did. It
is just a waste of time at this point.
-
At this point, both the Linux kernel and the Linux trace toolkit
should be uncompressed. If this not the case, change to the root account
and type
cd /usr/src
tar xvzf [location of LTT]/TraceToolkit[version].tgz
Change into the newly created TraceToolkit directory
cd TraceToolkit/Patches
Copy the patch to the directory containing the uncompressed source code
cp patch-ltt-kernelversion-yymmdd [location of kernel]/linux/
Apply the patch to the kernel
cd [location of kernel]/linux/
patch -p1 < patch-ltt-kernelversion-yymmdd
Configure and compile the patched kernel. This is documented in the documentation
accompanying the kernel and in the Linux kernel compilation HOWTO available
at www.linuxdoc.org. Towards the end of
the configuration, you will find a section called "Kernel Tracing". In this section
you will be prompted to select whether you want the tracer to be part of the kernel,
whether you want it as a module or whether you do not want any trace support in the
kernel.
Edit /etc/lilo.conf and add an entry for the newly compiled kernel. Typing
man lilo.conf should help you do this successfully.
2.2 RTAI patch
Prior to doing the following, you need to be familiar with RTAI's installation. See
the documentation accompanying RTAI to know more about the installation process.
-
Get an LTT supported RTAI version (see the Patches/ directory to see which versions are
supported), the corresponding Linux kernel and patch the later using the procedure
given with RTAI. With RTAI 24.1.2 you will not find any patches for linux 2.4.0-test10.
This one will appear in the rtai directory once you patch RTAI with its corresponding
LTT patch. The patch is called "patch-2.4.0-test10-rthal1e". Use this to patch the
2.4.0-test10 kernel then proceed as follows. DO NOT COMPILE ANYTHING YET.
-
Copy the kernel patch to the directory containing the already patched kernel.
cp patch-ltt-kernelversion-with-rtaiversion-yymmdd [location of kernel]/linux/
Patch the already patched kernel with the given patch.
patch -p1 < patch-ltt-kernelversion-with-rtaiversion-yymmdd
Copy the RTAI patch to the directory containing the RTAI source code.
cp patch-ltt-rtaiversion-yymmdd [location of rtai]/rtai/
Patch RTAI with the given patch.
patch -p1 < patch-ltt-rtaiversion-yymmdd
Make sure that /usr/src/linux and /usr/src/rtai point to the
right rtai and ltt patched linux kernel and the rtai sources respectively. This is important,
otherwise the trace module in the kernel won't build.
Configure the kernel, but DO NOT compile it right away. Remember to choose tracing as
module and support for RTAI tracing. Also, make sure you DO NOT select SMP support during
the kernel config. Currently, only the UP (Uni-Processor) scheduler in RTAI is supported
and enabling SMP support will result in the SMP scheduler of RTAI to be used. That scheduler
isn't instrumented and even though traces will be generated, they won't be interpreted
accuratly by the LTT graphic front-end.
Note that if you only want to trace the Linux kernel but still intend upon using RTAI, then
still enable RTAI tracing and choose the relevant events in the configuration of the trace
daemon. This is to make sure time-stamps have meaningfull values (this should eventually be
fixed).
Configure and compile RTAI.
Finally, compile the kernel and add an appropriate entry to /etc/lilo.conf.
2.3 Trace daemon
cd Daemon
make
Install the trace daemon. This will install the trace daemon and accompanying scripts in /usr/sbin
make install
cd ..
The trace daemon can be made to not support RTAI but setting the SUPP_RTAI variable to 0
in it's makefile. Leaving support for RTAI will not modify the normal behavior of a vanilla
Linux tracing session.
2.4 Data decoder (Visualizer)
The data decoder has many compile options which are mutually independent. To see the
options, take a look at Visualizer/Makefile in the "Support" section. To enable
an option, set it's value to 1. Here are the currently available options:
- GTK_ENV: If this is set to 1, the data decoder will compile with the GTK front-end
that enables it to draw graphs.
- SUPP_RTAI: If this is set to 1, the data decoder will be able to interpret an
RTAI trace. This means being able to read the trace, analyzing the trace and, if
the data decoder is compiled with the GTK front-end, draw the graphs according to
RTAI's behavior. Enabling this will not modify anything to the way a normal Linux
trace is analyzed or viewed.
Once the options chosen (by default, they are all enabled), compile and install the data decoder
(visualizer)
That's it! By now, you should have a patched kernel ready to be used, as
well as the other software be able to fetch the results and view them.
Next section will now help you use all this!