Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.362

Runnable Profiling via Instrumentation

In this topic:

Enable the VFB Trace Hooks in DaVinci Configurator

Instrument and Generate XML using iTCHi

Rebuild the application

Configure winIDEA

Start profiling

 

 

Introduction

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:

 

number1

Enabling the VFB trace hooks in DaVinci Configurator.

 

number2

Configuring iTCHi to generate instrumentation code and XML file.

The Trace Configuration Helper iTCHi is a program that helps users configure the winIDEA Analyzer to record OS and RTE aware hardware traces. Refer to Trace Configuration Helper to learn how to run and configure it.

 

number3

Recompiling the application with the generated instrumentation code.

 

Number4

Configuring winIDEA to analyze the trace data using the generated XML file and to record the instrumentation variables.

 

Number5

Recording a trace.

 

Runnable Instrumentation Workflow

Runnable Instrumentation Workflow

 

 

Enable the VFB Trace Hooks in DaVinci Configurator

For Runnable profiling via instrumentation, enable the RTE VFB trace hooks.

 

number1

In DaVinci Configurator, navigate to Runtime System General, and then to Rte VFB Tracing.

 

number2

Enable the checkbox next to Enable VFB Tracing.

 

number3

Add the start and return hooks for RTE tracing using the Import VFB Trace Functions Assistant.

 

Number4

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.

 

Number5

Select the hooks, click Finish and generate the RTE.

This process enables the VFB Runnable hooks, which can now be implemented via iTCHi.

 

 

Instrument and Generate XML using iTCHi

To implement the RTE hooks and update the Profiler XML for Runnables, follow these steps:

 

number1

In the iTCHi wizard, make sure your itchi.json file is selected.

 

number2

Ensure your ORTI file and Profiler XML file are specified correctly.

Keep existing settings for Task and ISR tracing as they are.

 

number3

Select Runnable Tracing.

 

Number4

Choose runnable_instrumentation as the command and press Next.

runnable_instrumentation

 

Number5

Configure the following:

Under runnable_instrumentation, adjust the settings to your project.

Under impl_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.

 

number6

Depending on your microcontroller, pick the right instrumentation_type.

Refer to Trace Configuration.

 

number7

Uncheck software_based_coreid_gen.

On most relevant architectures, winIDEA can infer the core ID from the trace messages.

 

number8

Click Generate to create the instrumentation and Profiler XML file.

iTCHi-Runnable-instrumentation-configuration

 

This process generates the Rte_Hook_isystem.c instrumentation file, and updates the Profiler XML for Runnable profiling.  

 

 

Rebuild the application

After enabling and generating the VFB Runnable trace hooks, follow these steps to rebuild your application.

 

number1

Copy the generated Rte_Hook_isystem.c into the Appl\Source directory.

 

number2

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

 

number3

Build your application.

Open a shell or command prompt in the build directory and execute the following command:

.\m.bat

 

Number4

Download the instrumented application via winIDEA.

 

Number5

For data tracing, add the winidea_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.

 

 

Configure winIDEA

The generated Profiler XML file shall be used from winIDEA. To profile the runnable state, a winIDEA Analyzer configuration is required. Please follow these steps to configure winIDEA accordingly:  To configure winIDEA to use the generated Profiler XML file, follow these steps:

 

number1

In winIDEA, navigate to Debug | Configure Session | Applications.

 

number2

Configure AUTOSAR.

Select winIDEA OS Info XML as RTOS description file type and select the previously generated Profiler XML file in the RTOS description file location.

 

profiling-vector-microsar

 

number3

Perform a Download or Load Symbols action to apply the changes.

 

Number4

Create a Analyzer configuration via View | Analyzer | Create New Configuration.

 

Number5

Select the Automatic Hardware Trigger to configure the hardware trace unit automatically.

 

Alternatively, you can configure the hardware trace unit manually when you select the Manual Hardware Trigger. Configure data trace comparators for all variables which must be traced (in this use case the variables used for the ORTI attributes RUNNINGTASK / RUNNINGISR2 / STATE).

iTCHi can log all variables that have to be traced by using the iTCHi command line argument --log_trace_symbols.

The trace configuration highly depends on the used microcontroller or SoC. Please check Trace Configuration for more details.

 

number6

Open the created Analyzer configuration and add the Application / Process.

The application / process has to include all cores that you want to profile.

 

number7

Enable OS Objects and Threads under OS Objects in the Profiler entry from the application / process

 

Runnables-in-addition-to-Threads-Tasks-ISRs.

 

 

Start profiling

After configuring winIDEA, you can now use the winIDEA Analyzer and start the Analyzer session to record and profile the instrumentation data.

 

thread-state-and-runnables-profiling_zoom50

 

i-icon

If you don’t see any data or the data does not look plausible, please check the Knowledge Base.

 

 

Copyright © 2025 TASKING