This repository consists of parts of the tracing framework which will gradually enable generation of Common Trace Format trace output for RTEMS applications. The test suitcase is the fileio sample which comes along with the RTEMS installation.
-
Install rtems 5 for sparc/erc32 architecture-bsp pair. The RTEMS repository with modifications for enabling CTF Tracing is https://github.com/VidushiVashishth/rtems
-
Download the fileio INI file in this repository and save it on the top of the installed BSP (erc32) directory
-
Change the values of
rtems-path
andprefix
in the fileio INI file according to your installation.
The general Tracing process consists of the following steps:
- Generation of RTEMS trace.
- Transportation of the generated trace to the host machine.
- Conversion of transported traces to CTF using babeltrace scripts.
- Viewing the converted output (CTF).
This step occurs on the RTEMS target (simulator).
There are two ways of generating RTEMS trace: Using printk generators or using trace buffering. The output of the printk generators is trace dumped on console. Whereas trace buffering can both be stored in the form of binary files or printed on console. The following are instructions to generate trace using trace buffering for the fileio sample testcase. This testcase is a part of the rtems installation.
Copy the Trace_Sample_fileio
directory on the top of the installed bsp directory. Change the values of the keys prefix
and rtems-path
of the filieo-trace.ini file according to your rtems installation. Also make alterations to the value of LIBPATH
in the Makefile
according to your installation. The B option in LIBPATH
denotes the usage of full path to the lib folder. Run make
and make run
commands to execute trace enabled fileio executable. Use rtrace -l
to see the available options of commands provided with rtrace
. Use rtrace stop
followed by rtrace trace
to see the trace output on the console. Note that this example runs a precompiled sample test case. Any change to the code of the test case will require regeneration of the object and executable files.
RTEMS trace linker is used in this step to generate traces for applications.
This step transfers the RTEMS generated trace output from the target (simulator) to the development host machine. This could be done using a number of alternatives:
-
Using socket programming. The client would be running on the target (simulator) and server on the host machine.
-
Creating a transportation API.
-
(quick fix) : Parsing the console trace output on the host machine.
This step executes on the host machine. The transported RTEMS format trace is converted to CTF using babeltrace scripts.
RTEMS trace format can be saved in the form of binary files or printed on console. To convert the RTEMS trace from its binary format to CTF we would need to create a customised babeltrace plugin.
The final output can be viewed using various tools like Trace Compass.