Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.260

Runnable Profiling via Instrumentation

In this topic:

Enable the VFB Trace Hooks

Generate the Instrumentation

Rebuild the application

Configure winIDEA

 

 

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.

 

number3

Recompiling the application with the generated instrumentation code.

 

Number4

Configuring winIDEA to analyze the trace data using the generated XML file.

 

Number5

Configuring hardware tracing to record the instrumentation variables.

 

Runnable Instrumentation Workflow

Runnable Instrumentation Workflow

 

 

Enable the VFB Trace Hooks

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.

 

 

Generate the Instrumentation

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

 

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

 

 

Configure winIDEA

number1

Add the XML to winIDEA.

number2

Create an Analyzer configuration.

number3

Download the application.

Number4

Check Runnables in addition to Threads or Tasks and ISRs.

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

 

Number5

Start the Analyzer session.

If everything is set up correctly, you should see a trace similar to the one shown in the screenshot below.

 

Visualization of an OS Task and its Runnables in the winIDEA Analyzer.

Visualization of an OS Task and its Runnables in the winIDEA Analyzer.

 

i-icon

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.

Copyright © 2024 TASKING