Non-Instrumented Task State and ISR Profiling
In this topic:
•Configure OS/RTE Profiling in DaVinci Configurator
•Use iTCHi to generate the XML
•Configure winIDEA and start profiling
This section explains how to profile Task states and running ISR information utilizing data tracing without instrumentation (meaning no changes to the source code are necessary).
To facilitate this use case, the ORTI file provides a STATE attribute for each task. By evaluating the state expression, the state of the task at a given moment can be deduced. The challenge with Vector MICROSAR state tracing is that the state attribute consists of multiple variables as shown in the following listing.
TASK Default_Appl_Init_Task { PRIORITY = "OsCfg_Task_Default_Appl_Init_Task_Dyn.Priority"; STATE = "OsCfg_Core_OsCore_Core0_Status_Dyn.OsState == 2 ? ( OsCfg_Trace_OsCore_Core0_Dyn.CurrentTask == &OsCfg_Trace_Default_Appl_Init_Task ? 0 : OsCfg_Task_Default_Appl_Init_Task_Dyn.State ) : 0xFF"; /* other attributes here */ }; /* Default_Appl_Init_Task */ |
To configure this use case properly, two points have to be kept in mind: •Enough data trace comparators to record all variables that are part of the state expression must be available. •Variables that don’t change during the trace recording, have to be preset to their expected value in the Profiler configuration. oFor example, the OsState variable in the listing above is only written once at the startup of the application. To be able to start a recording at a different point in time, this variable has to be set to 2. oSimilarly, for a background task, the State variable always has the value 1 for READY. |
The following configuration steps are required for state analysis without instrumentation:
Enabling ORTI file generation in DaVinci Configurator. |
Configuring iTCHi to generate the XML file. |
Configuring winIDEA to record all variables that are part of the STATE expression. |
Configuring winIDEA to analyze the trace data using the generated XML file. |
Configuring hardware tracing to record the instrumentation variables. |
In DaVinci Configurator, open the Basic Editor. |
In the Basic Editor, expand the OS node. |
Navigate to the OsOS node and select the OsDebug node. |
Activate ORTI Debug Support by selecting ORTI_23_STANDARD or ORTI_23_ADDITIONAL. |
Regenerate the OS. |
This process enables the OS ORTI file generation. After generating the OS, you should find a file Os_Trace.ORT in your Appl/GenData directory.
To generate a winIDEA OS Info XML for task state and ISR analysis without instrumentation, 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. |
Select the Task State analysis technique. |
Choose task_state_complex_native as the command and press Next. |
You can leave the running_taskisr settings as they are.
Under task_state_complex, use constant_variables to set all non-changing variables to their expected constant value. |
•For Vector MICROSAR, set OsState variables to 2. The screenshot below shows how this would look like for an application that uses six cores. Also set task State variables to 1 (meaning READY) for tasks that might not otherwise change their state. This might be required for background tasks.
•If you start recording before the startup of the application, you don’t have to do this.
•For other operating systems, you can leave constant_variables empty.
Click Generate to create the XML. |
After adding the generated Profiler XML to winIDEA, follow these steps to finish the configuration:
Create a new Manual Trace Configuration via View / Analyzer / Create New Configuration. |
Enable data trace for all variables that are part of the state expressions. |
You can use the iTCHi --log_trace_symbols flag if you are not sure which variables are required.
Press OK and reopen the configuration, and add the relevant Application. |
The application has to include all cores that you want to profile.
Enable OS Objects and all task and ISR objects. |
Start the Analyzer session. |
If everything is set up correctly, you should see a trace like the one shown below.
If you don’t see any data or the data does not look plausible, please check the Knowledge Base. |