Trace Configuration Helper
In this topic:
The Trace Configuration Helper (iTCHi) is a tool for generating winIDEA Analyzer configurations that enable OS and RTE-aware tracing. It simplifies the process of creating and modifying the Profiler XML file and any required instrumentation files based on ORTI input and other parameters. You can start iTCHi in three ways, via GUI, CLI or pip. Commands define what kind of trace setup you want to generate.
Use iTCHi for:
•Record task and ISR activity for AUTOSAR/OSEK-based operating systems.
•Trace Runnable functions using instrumentation or program flow.
•Analyze task state transitions, including reasons for context switches.
•Export profiling data to third-party timing tools (e.g., via BTF format).
These use cases helps you find out which of the Trace Configuration Helper (iTCHi) Commands (or flags) you need for your use case. Once you have configured each command separately you can run iTCHi with all commands combined.
Refer to AUTOSAR Classic Profiling to find the correct use case for your setup.
If you are just getting started, you want to use Running Task/ISR profiling first. If you want to:
•Analyze the data only in winIDEA, use --running_taskisr.
•Export the data into a third party timing-tool in the BTF trace format, use --running_taskisr_btf.
You can use iTCHi for the second use case if you have data trace available. If you have RH850 Software Trace (SFT) available, use task state tracing via instrumentation and select RH850 SFT as the instrumentation technique. See Trace Configuration for more details.
If the information about the currently running Task and ISR is not enough for your analysis you can record the task states. You have to look into your OS ORTI file to find the right approach. If the TASK STATE expression for your tasks is a single symbol (e.g. OS_task_states[3]) you want to use --task_state_single_variable.
If you see a more complex expression you can use --task_state_complex_native. Note that this requires a higher number of data trace comparators since each of the symbols that are part of the expression have to be recorded. If you do not have enough data trace comparators you might have to use instrumentation with the --task_state_instrumentation command.
Task state tracing requires data trace in most cases. If you do not have enough data trace comparators you might have to fall back to basic Task/ISR analysis. Software Trace is supported via instrumentation. In that case the configuration needs to be done manually. Task state tracing is not supported with program flow trace.
If you want to go beyond Task/ISR analysis you can use Runnable tracing. If you have data or Software Trace only you need to use instrumentation to record Runnables. The --runnable_instrumentation command helps with that use case. If you have program flow trace you can record Runnables with the --runnable_program_flow command. Note that you might want to use instrumentation even if you have program flow trace to record longer traces or more Runnable objects.
iTCHi supports both command-line and GUI workflows and can be run in the following ways:
•Launch the iTCHi Wizard from within winIDEA.
•Run the iTCHi CLI using the Python interpreter bundled with winIDEA.
•Install iTCHi via pip and use it with your system Python installation.
Open winIDEA. |
Navigate to Debug | Configure Session | Applications | Application | iTCHi Wizard. |
iTCHi configuration starts with selecting the input/output files and commands you wish to run.
Follow Basic configuration steps. |
Locate the the Python executable that is part of the winIDEA installation. |
The default location on Windows is C:\winIDEA\Python\python.exe.
Use the following command to run the iTCHi CLI: |
C:\winIDEA\Python\python.exe -m itchi.itchi_cli |
For example, to see available commands, use the --help or -h command:
C:\winIDEA\Python\python.exe -m itchi.itchi_cli -–help |
Follow Basic configuration steps. |
(optional) Create a virtual environment: |
python -m venv myvenv |
Activation on platforms: |
•Linux:
source myvenv/bin/activate |
•Windows:
myvenv/Scripts/activate |
Use pip: |
pip install itchi |
After the installation, the iTCHi command line interface is available as itchi-cli.exe and you can also run the GUI via itchi-gui.exe.
Prior to winIDEA version 9.21.281, itchi-bin.exe was available. This executable is no longer included. |
By default, iTCHi logs to itchi.log (visible in iTCHi Wizard in the Log tab). If you encounter any problems with iTCHi, add the log file to your support request. If you want to specify a different log file location you can do so via the --log command:
itchi-cli.exe --log path/to/my_itchi.log |
Follow Basic configuration steps. |
All Commands follow a similar workflow; they take one or more input files (usually at least an ORTI file is required) and produce one or more output files, such as a winIDEA Profiler XML file, and C source and header files with instrumentation code.
The required input files, output files, and additional settings for the different commands are configured via a configuration file called itchi.json. By default, iTCHi expects the configuration file in the current working directory, i.e. in the directory from where iTCHi is called. Alternatively, the location of the configuration file can be specified with the --config command:
itchi-cli.exe --config path/to/itchi.json |
This chapter explains how to set up the basic configuration of iTCHi via the itchi.json file or the iTCHi Wizard.
Prepare the itchi.json configuration file. |
All iTCHi use cases rely on an itchi.json configuration file. If you do not have such a file, you can generate an empty one with the --write_default_config command.
itchi-cli.exe --write_default_config --config itchi.json |
The use of --config is redundant here because the default itchi.json location is the same as the one specified in the call.
You should now have an empty configuration file with two top-level attributes called orti_file and profiler_xml_file that map to a string. All other attributes map to dictionaries (or objects if you prefer JSON terminology) with further attributes. The two top-level attributes are always required. All other objects are optional and only required for specific commands.
Configure the orti_file attribute. |
All OSEK/AUTOSAR Operating Systems can generate an ORTI file which contains information about OS objects such as Tasks, ISRs, and alarms. Refer to the documentation of your OS for how to enable the ORTI file generation.
Enter the absolute or relative path to the ORTI file to the configuration. |
The file usually it has an .ORT or .ORTI ending.
All relative file paths in itchi.json are evaluated relative to the location of the configuration file. In other words, iTCHi uses the directory in which itchi.json is located as its working directory. The reason for this was to make it easy to exchange configurations by adding them inside a winIDEA workspace directory. Absolute file paths are supported, too. |
Add the profiler.xml file to the profiler_xml_file attribute. |
If you do not have such a profiler.xml file yet, simply specify a non-existing file such as profiler.xml. iTCHi creates the file if it does not exist, otherwise it changes only those parts of the XML that are affected by the current command.
You can leave all other attributes as they are or remove them if you prefer a less cluttered configuration file. Bear in mind that relative file paths are relative to the configuration file, and you will always at least need the orti_file and the profiler_xml_file attribute.
iTCHi writes the ORTI file path into the Profiler XML file so that winIDEA can access it. Currently, iTCHi does not update the ORTI path to be relative to the Profiler XML file. To avoid issues, it is best to either create the profiler.xml in the same directory as itchi.json or to specify an absolute path to the ORTI file. |
Your itchi.json file should now look as shown on the following listing. Make sure to remove trailing commas (i.e. commas behind the last attribute in a list or object).
{ |
Run iTCHi to generate the profiler.xml file. |
itchi-cli.exe --config itchi.json --running_taskisr |
This should generate a profiler.xml file at that location you have specified. Open that file and verify that it references your ORTI file. It should also contain at least one Task and ISR object. You don't need to worry about the contents in detail. With the help of iTCHi you should never have to edit the Profiler XML manually.
Record Task. |
You can now record your first Task/ISR aware trace as explained in Configuration.