Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.244

Navigation: Operating Systems > AUTOSAR > How-to guides > Profile Vector MICROSAR

Scroll Prev Top Next More

Task State and ISR Profiling via Instrumentation

In this topic:

Enable ORTI and OS Timing-Hooks

Instrument and Generate XML using iTCHi

Configure winIDEA

Start profiling

 

 

Introduction

Task state and ISR profiling via instrumentation utilizes the Vector OS Timing Hooks to instrument task states and ISR executions. This approach provides detailed insights into the system’s behavior by capturing task state transitions and ISR events. This method involves the following steps:

 

number1

Enabling in DaVinci Configurator:

a.ORTI file generation

b.OS Timing Hooks generation

 

number2

Configuring iTCHi to generate instrumentation code and XML file.

iTCHi is a program that helps users configure the winIDEA Analyzer to record OS and RTE aware hardware traces. You can find the Windows 64-bit executable itchi-bin.exe in the scripts/itchi directory of your winIDEA installation. A graphical-user interface is also available. To launch it, navigate to the OS tab under the Application settings in winIDEA. There, use the iTCHi Wizard button to launch the GUI. Note that the GUI is not necessarily self-explanatory and you probably want to continue reading this document.

 

You can find more information via iTCHi Readme.

 

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.

 

Vector Task State Instrumentation Workflow

Vector Task State Instrumentation Workflow

 

 

 

Enable ORTI and OS Timing-Hooks

For OS Task and ISR profiling via instrumentation, you need to enable ORTI file generation and the OS Timing Hooks in your Vector MICROSAR project. Follow these steps:

 

number1

In DaVinci Configurator, open the Basic Editor.

 

number2

In the Basic Editor, expand the OS node.

 

number3

Navigate to the OsOS node and select the OsDebug node.

 

Number4

Activate ORTI Debug Support by selecting ORTI_23_STANDARD or ORTI_23_ADDITIONAL.

 

Number5

In the OsDebug view, locate the Timing Hooks Include Header setting.

 

number6

Add a new header by clicking the plus symbol and name it Os_TimingHooks_isystem.h.

 

number7

Regenerate the OS.

This process generates the OS ORTI file. After generating the OS, you should find a file Os_Trace.ORT in your Appl/GenData directory. It also enables the OS Timing Hooks, which can now be implemented in the specified header file.

 

Click to enlarge

 

Instrument and Generate XML using iTCHi

To implement the OS hooks and generate the respective Profiler XML, follow these steps:

 

number1

In the iTCHi wizard, make sure your itchi.json file is selected or create a new one if necessary.

 

number2

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

 

number3

Select the Task State analysis technique.

 

Number4

Choose task_state_instrumentation_microsar as the command and press Next.

Task-trace-technique

 

Number5

Under task_state_inst_microsar, configure the OS instrumentation header and source file.

a.Point vector_os_timing_hooks_h to the Appl/Include directory of your project.

b.Point vector_os_timing_hooks_c to the Appl/Source directory of your project.

c.Leave the filenames as they are, so the string for the header file would be:

<your_davinci_dir>/Appl/Include/Os_TimingHooks_isystem.h

 

number6

Depending on your microcontroller, pick the right instrumentation_type.

Refer to section Trace Configuration for more information.

In most cases, data_trace is the best approach.

For RH850 controllers without data trace capabilities, select software_trace.

oIn this case, also change the sft_dbpush_register to 10.

For devices that have STM, select stm_trace.

oIn this case, also configure stm_base_address and stm_channel.

oNote that the STM base address is device-specific.

 

number7

Unselect software_based_coreid_gen.

This allows the winIDEA analyzer to get the core ID from the trace and usually works best.

 

number8

Click Generate to create the instrumentation and XML file.

Thread-instrumentation-configuration-iTCHi

 

The process has generated the Os_TimingHooks_isystem.c and Os_TimingHooks_isystem.h source files, as well as the Profiler XML file. These files are now ready to be integrated into your project.

 

 

Adding C and H files to the build process

After generating the Profiler XML and instrumentation code, it’s necessary to add the C and H files to the build process of your Vector MICROSAR application.

 

number1

Copy the generated files to Appl\Source and Appl\Include directory in your project.

(If you did not generate them to those locations already.)

Os_TimingHooks_isystem.c

Os_TimingHooks_isystem.h

 

i-icon

Adding Os_TimingHooks_isystem.c is only required for data_trace as it contains the definition of the trace variable.

 

When using an Infineon AURIX with multiple cores, edit Os_TimingHooks_isystem.h to map the trace variable into global LMU RAM. There is a comment in the source file that explains how to do that.

 

number2

Add Os_TimingHooks_isystem.c to one of the makefiles.

Include the following line in the appropriate section of the makefile:

a.APP_SOURCE_LST += Source\Os_TimingHooks_isystem.c

b.Again, this is only required for data_trace.

 

number3

Build your application.

Open a command prompt in the build directory, and execute the following command: .\m.bat

 

Once the build has finished, download the instrumented application via winIDEA. For data tracing, add the isystem_trace variable to a Watch Window and confirm that it changes when you enable real-time updates. For instrumentation tracing, this step does not apply.

 

 

Configure winIDEA

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.

Steps-add-Profiler-XML-to-winIDEA

 

number3

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

 

 

Start profiling

After configuring the XML for Task State and ISR profiling, you can now use the winIDEA Analyzer to record and profile the instrumentation data.

 

number1

Create a new Automatic Trace Configuration.

 

number2

Enable OS Objects and Threads under OS Objects.

os-objects-threads2

 

number3

(recommended) For multi-core systems, change the Context analysis to Core via Advanced button.

os-objects-threads

 

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 variable. Also, check that you have configured the correct Analyzer cycle duration.

 

 

Number4

Start the Analyzer session.

If everything is set up correctly, you should see a trace like the one shown below.

Click to enlarge

 

i-icon

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

Copyright © 2024 TASKING Germany GmbH