Runnable Profiling via Instrumentation
In this topic:
Runnable profiling via instrumentation utilizes the AUTOSAR RTE Virtual Function Bus (VFB) trace hooks. This approach provides insights into the Runnable runtime behavior in addition to Tasks and ISRs. It involves the following steps:
Enabling the VFB trace hooks in DaVinci Configurator. |
Configuring iTCHi to generate instrumentation code and XML file. |
Recompiling the application with the generated instrumentation code. |
Configuring winIDEA to analyze the trace data using the generated XML file. |
Configuring hardware tracing to record the instrumentation variables. |
Runnable Instrumentation Workflow
For Runnable profiling via instrumentation, enable the RTE VFB trace hooks.
In DaVinci Configurator, navigate to Runtime System General, and then to Rte VFB Tracing. |
Enable the checkbox next to Enable VFB Tracing. |
Add the start and return hooks for RTE tracing using the Import VFB Trace Functions Assistant. |
Select the Rte_Hook.h file via GenData folder of the application project. |
•Typically, Rte_Runnable and SchM_Schedulable hooks are selected.
•Note that iTCHi also requires this file to implement the Runnable hooks.
Select the hooks, click Finish and generate the RTE. |
This process enables the VFB Runnable hooks, which can now be implemented via iTCHi.
To implement the RTE hooks and update the Profiler XML for Runnables, follow these steps:
In the iTCHi wizard, make sure your itchi.json file is selected. |
Ensure your ORTI file and Profiler XML file are specified correctly. |
Keep existing settings for Task and ISR tracing as they are.
Select Runnable Tracing. |
Choose runnable_instrumentation as the command and press Next. |
Configure the following: |
•Under runnable_instrumentation, adjust the settings to your project.
•Under isystem_vfb_hooks_c, specify the name of the instrumentation file into which iTCHi generates the instrumentation code, for example Rte_Hook_isystem.c.
oInclude that file to the build process later to implement the Runnable hooks. To avoid copying the file manually, generate it into the Appl/Source directory of your project.
oOptional: To edit the hooks template, set template_file to Rte_Hook_isystem_TEMPLATE.c. iTCHi will then use that template file in the next run. The template uses the Python Jinja2 syntax.
•Under rte_hook_h, reference the Rte_Hook.h file located in the Appl/Source project of the application project.
Depending on your microcontroller, pick the right instrumentation_type. |
Refer to Trace Configuration.
Uncheck software_based_coreid_gen. |
On most relevant architectures, winIDEA can infer the core ID from the trace messages.
Click Generate to create the instrumentation and Profiler XML file. |
This process generates the Rte_Hook_isystem.c instrumentation file, and updates the Profiler XML for Runnable profiling.
After enabling and generating the VFB Runnable trace hooks, follow these steps to rebuild your application.
Copy the generated Rte_Hook_isystem.c into the Appl\Source directory. |
Add Rte_Hook_isystem.c to one of the makefiles. |
Including the following line in the appropriate section of the makefile:
APP_SOURCE_LST += Source\Rte_Hook_isystem.c |
Build your application. |
Open a shell or command prompt in the build directory and execute the following command:
.\m.bat |
Download the instrumented application via winIDEA. |
For data tracing, add the isystem_trace_runnable variable to a Watch window. |
This way you can confirm that it changes when you enable real-time updates. For instrumentation tracing, this step does not apply.
Add the XML to winIDEA. |
Create an Analyzer configuration. |
Download the application. |
Check Runnables in addition to Threads or Tasks and ISRs. |
Start the Analyzer session. |
If everything is set up correctly, you should see a trace similar to the one shown in the screenshot below.
Some architectures might require manual hardware trigger configuration. If you don’t see any data, manually configure the hardware trace to record the isystem_trace_runnable variable. Also, check that you have configured the correct Analyzer cycle duration. |