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
accurately 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 meaningful 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 User-land tools
The user-land tools build and installation process is managed by autoconf/automake. The
usual commands provided by these tools are available. As usual ...
-
Configure the build system. There are few configuration options specific to LTT,
such as the capability to activate/deactivate support for the GTK GUI or support for RTAI traces.
To get the complete list of options use configure --help
./configure
Build the package's components
make
Install the various components on your system (you will need root privileges). This
will install the trace daemon and the visualizer in /usr/bin, the related
easy-use scripts in /usr/sbin and the event database and user trace
libraries in /usr/lib
make install
RTAI is enabled by default. This will not make any difference for the viewing of
normal Linux traces. It will simply enable the event database to recognize another
event format along with enabling the visualizer to display RTAI traces correctly.
That's it! By now, you should have a patched kernel ready to be used, as
well as the other software to be able to fetch the results and view them.
The next section will now help you use all this!