S32 Design Studio Tracing and Analysis User Guide
S32 Design Studio Tracing and Analysis User Guide
Chapter 1: Introduction...........................................................................................3
About this manual.................................................................................................................................................4
Accompanying documentation............................................................................................................................. 4
List of Figures................................................................................................................................38
List of Tables................................................................................................................................. 40
Index................................................................................................................................................41
2 NXP Semiconductors
Introduction
Chapter
1
Introduction
Topics: This manual explains how to use the S32 Design Studio for Tracing and
Analysis.
• About this manual
This chapter presents an overview of the manual. The topics in this chapter
• Accompanying documentation
are: About this manual Each chapter of this manual describes a different area
of software development. Accompanying documentation The Documentation
page describes the documentation included in this version of S32 Design
Studio IDE.
NXP Semiconductors 3
Introduction
Chapter Description
Introduction This chapter.
Setting up trace collection Explains how to use the S32 Design Studio for S32 series to collect trace data.
Collecting trace data Explains how to manage and view the trace data.
View Trace Data Explains how to view various types of data trace collected on an application.
Accompanying documentation
The Documentation page describes the documentation included in this version of S32 Design Studio IDE.
You can access the Documentation page by selecting Help > Help Contents from the IDE's menu bar.
4 NXP Semiconductors
Setting up trace collection
Chapter
2
Setting up trace collection
Topics: This chapter guides you on how to use the S32 Design Studio to setup trace
collection.
• Process for collecting data
It also explains the steps to create a new project, create a Debug
• Creating a new project
Configuration and setup the Software Analysis Configuration. This section
• Configuring Debug Launcher has following topics:
NXP Semiconductors 5
Setting up trace collection
6 NXP Semiconductors
Setting up trace collection
NXP Semiconductors 7
Setting up trace collection
8 NXP Semiconductors
Setting up trace collection
2. In the Project Explorer view, right-click on the project and select Debug as > Debug Configurations from the
context menu.
The Debug Configurations dialog appears.
NXP Semiconductors 9
Setting up trace collection
10 NXP Semiconductors
Setting up trace collection
The Overview page displays the flow diagram for collecting trace.
NXP Semiconductors 11
Setting up trace collection
12 NXP Semiconductors
Setting up trace collection
NXP Semiconductors 13
Setting up trace collection
14 NXP Semiconductors
Collecting trace data
Chapter
3
Collecting trace data
Topics: This section explains how to collect trace using the Trace Commander feature
of S32 Design Studio.
• Overview
This section has following topics:
• Configuring and collecting trace
using Trace Commander view
NXP Semiconductors 15
Collecting trace data
Overview
Trace Commander feature uploads the trace and configures the modules included in the target architecture in a more
user-friendly graphical interface.
For S32V234, the Trace IP looks like this:
The 4 A53-cores of the S32V234 are split in 2 clusters, each with 2 cores. Core 0 and Core 1, from Cluster 0, output
trace in ETF 0 and Core 2 and Core 3, from Cluster 1, store trace in ETF 1. You can only collect from one ETF at a
time.
Note: For some platforms, trace is not supported for all cores.
16 NXP Semiconductors
Collecting trace data
The Trace Commander view displays all trace generators and trace buffers available in the selected platform file.
The colors suggest if they are available or not for collecting trace. Green means the trace generator is enabled and
grey means that the trace generator is disabled.
3. Double click on one of the Trace Generators or Trace Buffers to configure it. You can also use Config button
and from the new Trace Configuration window click on Advanced Trace Generators configuration.
NXP Semiconductors 17
Collecting trace data
18 NXP Semiconductors
Collecting trace data
NXP Semiconductors 19
Collecting trace data
When the session is started the button looks like this , meaning the target is configured using the selected
platform file. This will be attached to the active debug session. The configuration is applied on the whole
platform. Now the trace buffer and trace generators selection and configuration becomes unavailable.
If you click again on the button the session will stop and the button will change to this again , the trace
stream gets interrupted and the file gets inactive. Hence, the trace buffer and trace generators configuration
becomes available.
7. You can click the Trace Generators Group Name, for example CORE, to Start or Stop all the modules from
that group. The Trace Commander view will update each trace generator state.
8. Once your program ran enough you can click the Upload button, available on the trace buffer, to save the data
trace collected. Data trace can be saved only on connection with the active debug session.
Note: It is recommended to suspend the generator core or the target while collecting core trace, e.g. when a
breakpoint is hit.
20 NXP Semiconductors
Collecting trace data
NXP Semiconductors 21
View Trace Data
Chapter
4
View Trace Data
Topics: This topic describes how to display the collected trace data and how to view
the decoded trace data.
• Analysis Results view
This chapter includes:
22 NXP Semiconductors
View Trace Data
The data in results table is organized (from top to bottom) in the following manner:
• Platform Configuration: Name of the platform configuration file used to collect the trace result.
• Data streams: The data source from where the trace was collected. For example, it can be ETF 0 or ETF 1.
• Result sets: Lists the collected trace data.
The Analysis Results view allows to perform the following actions:
Button Description
Refresh Refreshes the view and rescans all output folders for
trace and analysis results
Expand all Expands all nodes in the tree
Collapse all Collapses all nodes in the tree
Select custom results folder Allows to select a custom folder to scan for trace results
Apart from the above described toolbar actions, the context menu also allows to perform the following actions for a
selected trace result:
• Rename: To rename the selected trace result
• Save: To save the selected trace result. The save function creates a copy of the selected trace results with an
index appended to the name. By default when a new trace is collected it receives the name of the project from
where it was collected. If there is already a trace with that name, it is overwritten.
NXP Semiconductors 23
View Trace Data
To view the collected trace data, click on the links of profiling results from the Analysis Results View:
24 NXP Semiconductors
View Trace Data
Field Description
Index Displays the order number of the instructions.
Source Displays source of trace event.
Type Displays type of trace event.
Description Displays description of trace event.
Address Displays the starting address of the target function.
Destination Displays the end address of the target function.
Timestamp Displays the value of platform global timestamp generator (64-bit wide). Time
stamping is useful for correlating multiple trace sources.
NXP Semiconductors 25
View Trace Data
Note: To see the options for the Trace Viewer, right click on a column. When the view
has more than 100000 lines, the options "Collapse All" and "Expand All" are not shown.
The following table lists the Trace viewer events and their description:
26 NXP Semiconductors
View Trace Data
Timeline viewer has a tabbed interface. A tab for each source (usually a core) is created automatically. Each tab has
its independent timeline plot with its own setup of groups and time unit. The timeline viewer can be controlled using
the toolbar. The timeline data displays the functions that are executed in the application and the number of cycles
each function takes when the application is run. The Timeline viewer shows a timeline graph in which the functions
appear on y-axis and the number of cycles appear on x-axis. The green-colored bars show the time and cycles taken
by the function.
The Timeline viewer has the following buttons:
• Selection Mode: Allows you to mark points in the function bars to measure the difference of cycles between
those points. To mark a point in the bar:
1. Click Selection Mode.
2. Click on the bar where you want to mark the point.
3. A yellow vertical line appears displaying the number of cycles at that point.
4. Right-click on another point in the bar.
5. A red vertical line appears displaying the number of cycles at that point along with the difference of cycles
between two marked points.
• Zoom Mode: Allows you to zoom-in and zoom-out in the timeline graph. Zooming can be performed using
the mouse wheel (even if this mode is not selected).
• Full View: Resets to the default zoom that allows seeing the full timeline
• Edit Groups: Allows you to customize the timeline according to the requirements. You can change the
default color of the line bars representing the functions to differentiate. You can add/remove a function to/
from the timeline. To perform these functions, select Edit Groups. The Edit Groups dialog box appears.
NXP Semiconductors 27
View Trace Data
You can perform the following operations in the Edit Groups dialog box:
Change color
This section explains how to change the color of a function in the timeline graph.
The color appears as a horizontal bar in the graph. Click on the Color column of the corresponding function, and
select the color of your choice from the Color window that appears.
28 NXP Semiconductors
View Trace Data
Figure 24: After Editing Address Range and Color of Group Screen
To delete a group, select it, right-click on the Edit Groups dialog box, and select the Delete Selected option from
the context menu. You can also remove a group from the graph by clearing the corresponding checkbox in the
Name column. Check it again to include it in the graph.
NXP Semiconductors 29
View Trace Data
30 NXP Semiconductors
View Trace Data
The Code Coverage data displays the summarized data of a function in a tabular form. The columns are movable;
you can drag and drop the columns to move them according to your requirements. It displays data into two views;
the top view displays the summary of the functions, and the bottom view displays the statistics for all the instructions
executed in a particular function. Click on a hyperlinked function in the top view of the Code Coverage viewer to
view the corresponding statistics for the instructions executed in that function.
The below table explains the various fields of the Summary table.
Field Description
File/Function Displays the name of the function that has executed.
Address Displays the start address of the function.
Covered ASM % Displays the percentage of number of assembly
instructions executed from the total number of assembly
instructions per function or per source file
Not Covered ASM % Displays the percentage of number of assembly
instructions not executed from the total number of
assembly instructions per function or per source file.
Total ASM instructions Displays the total number of assembly instructions per
function and per source file.
ASM Decision Coverage % Displays the decision coverage computed for direct and
indirect conditional branches. It is the mean value of the
NXP Semiconductors 31
View Trace Data
Field Description
individual decision coverages. So if a function has two
conditional instructions, one with 100% and another with
50% decision coverage, the decision coverage would be
(100 + 50) / 2 = 75%. It is calculated only for assembly
instructions and not for C source code.
Time (Microsecond) Displays the total number of clock cycles that the
function takes
Size Displays the number of bytes required by each function.
The below table describes the fields of the statistics of the code coverage data.
Field Description
Line/Address Displays either the line number for each instruction in
the source code or the address for the assembly code.
Instruction Displays all the instructions executed in the selected
function.
Coverage % For C source lines, displays the percentage of number of
assembly instructions executed from the total number of
assembly instructions corresponding to the source line.
For assembly source lines, it shows if the instructions
were executed or not.
ASM Decision Coverage Displays the decision coverage computed for direct and
indirect conditional branches. It is the mean value of the
individual decision coverages. So if a function has two
conditional instructions, one with 100% and another with
50% decision coverage, the decision coverage would be
(100 + 50) / 2 = 75%. It is calculated only for assembly
instructions and not for C source code.
ASM Count Displays the number of times each instruction is
executed.
Time (CPU Cycles) Displays the total time taken by each instruction in the
function.
Note: In the Code Coverage viewer, all functions in all files associated with the project are displayed irrespective of
coverage percentage. However, the 0% coverage functions do not appear in the Performance and Call Tree viewers
because these functions are not considered to be computed and are not a part of caller-called pair.
When you double-click in Details table on an instruction, it opens (if available) the source file and highlights the
instruction line. If the source is not available, you can Locate the file.
Click on the column header to sort the code coverage data by that column. However, you can only sort the code
coverage data available on the top view. The icons available in the summary view of the Code Coverage tab allow
you to perform the following actions:
• Previous function- Lets you view the details of the previous function that was selected in the Summary table
before the currently selected function. Click it to view the details of the previous function.
• Next function- Lets you view the details of the next function that was selected in the Summary table.
32 NXP Semiconductors
View Trace Data
Note: The Previous and Next buttons are contextual and go to previous/next function according to the history
of selections. So if you select a single line in the view, these buttons will be disabled because there is no
history.
• Export - Lets you export the code coverage data in a CSV or html format. Click the button to choose between
Export to CSV or Export to HTML options. The Export to CSV option lets you export data of both
Summary and Details tables. The exported html file contains the statistics for all the source files/functions
from the Summary table along with the statistics of source, assembly or mixed instructions.
• Configure Table - Lets you show and hide column(s) of the code coverage data. Click and select the
Configure Columns for Summary Table option to show/hide columns in the Summary table (top view) or
the Configure Columns for Details table option to show/hide columns of the Details table (bottom view).
The Drag and drop to order columns dialog appears in which you can check/uncheck the checkboxes
corresponding to the available columns to show/hide them in the Code Coverage viewer. The option also
allows you to set CPU frequency and set time in cycles, milliseconds, microseconds, and nanoseconds.
• Collapse/Expand all files - Lets you expand or collapse all files in the Summary table.
• Filter Files - Allows you to choose the list of files to be displayed in the Summary table.
• Switch to executable source lines statistics/Switch to ASM instructions statistics - Lets you switch
between source lines or ASM instructions to be displayed in the Summary table.
You can perform the following actions on the Details table:
• Search - Lets you search for a particular text in the Details table. In the Search text box, type the data that you
want to search and click the Search button.
• Graphics - Lets you display the histograms in two colors for the ASM Count and Time columns in the
bottom view of the code coverage data. Click the button and select the Assembly/Source > ASM Count or
Assembly/Source > Time option to display histograms in the ASM Count or Time column. The colors in
these columns differentiate source code with the assembly code.
• Show code - Lets you display the assembly, source or mixed code in the statistics of the Code Coverage data.
NXP Semiconductors 33
View Trace Data
for various portions of your target program. The information in the Summary table can be sorted by column in
ascending or descending order. Click the column header to sort the corresponding data.
The following table explains the fields of the Summary table.
Field Description
Function Name Name of the function that has executed.
Num Calls Number of times the function has executed.
Inclusive Cumulative metric count during execution time spent
from function entry to exit.
Min Inclusive Minimum metric count during execution time spent
from function entry to exit.
Max Inclusive Maximum metric count during execution time spent
from function entry to exit.
Avg Inclusive Average metric count during execution time spent
from function entry to exit.
Percent Inclusive Percentage of total metric count spent from function
entry to exit.
Exclusive Cumulative metric count during execution time spent
within function.
Min Exclusive Minimum metric count during execution time spent
within function.
Max Exclusive Maximum metric count during execution time spent
within function.
Avg Exclusive Average metric count during execution time spent
within function.
Percent Exclusive Percentage of total metric count spent within
function.
Percent Total Calls Percentage of the calls to the function compared to
the total calls.
Code Size Number of bytes required by each function.
• The bottom view or the Details table presents call pair data for the function selected in the Summary table. It
displays call pair relationships for the selected function that shows which function called the another function.
Each function pair consists of a caller and a callee. The percent caller and percent callee data is also displayed
graphically. The functions are represented in different colors in the pie chart, you can move the mouse cursor
over the color to see the corresponding function.
When you double-click in Details pane on a call site, it opens (if available) the source file and highlights the
call-site line. If the source is not available, you can Locate the file.
The below table describes the fields of the Details table. You cannot sort the columns of this table.
Field Description
Caller Name of the calling function.
34 NXP Semiconductors
View Trace Data
Field Description
Callee Name of the function that is called by the calling
function.
Num Calls Number of times the caller called the callee.
Inclusive Cumulative metric count during execution time spent
from function entry to exit.
Min Inclusive Minimum metric count during execution time spent
from function entry to exit.
Max Inclusive Maximum metric count during execution time spent
from function entry to exit.
Avg Inclusive Average metric count during execution time spent
from function entry to exit.
Percent Callee Percent of total metric count during the time the
selected function is the caller of a specific callee. The
data is also shown in the Caller pie chart.
Percent Caller Percent of total metric count during the time the
selected function is the callee of a specific caller. The
data is also shown in the Callee pie chart.
Call Site Address from where the function was called.
The table below lists the buttons available in the Summary table of the Performance viewer.
NXP Semiconductors 35
View Trace Data
In the Call Tree viewer, START is the root of the tree. You can click on the arrow next to it to expand or to collapse
the tree. It shows the biggest depth for stack utilization in Call Tree and the functions on this call path are displayed
in green color. The Call Tree nodes are synchronized with the source code. You can double-click on the node to view
the source code. The columns can be resized by moving the columns to the left or right of another column depending
on your requirements by dragging and dropping.
The following table describe the fields of Call Tree data.
Field Description
Function Name Name of function that has executed.
Num Calls Number of times function has executed.
% Total calls of Parent Percent of number of function calls from total number of
calls in the application.
% Total times it was called Percent of number of times a function was called.
Inclusive Time Cumulative count during execution time spent from
function entry to exit.
36 NXP Semiconductors
How to Reach Us: Information in this document is provided solely to enable system and software
Home Page: implementers to use NXP products. There are no express or implied copyright licenses
granted hereunder to design or fabricate any integrate circuits based on the information
nxp.com in this document. NXP reserves the right to make changes without further notice to any
Web Support: products herein.
nxp.com/support NXP makes no warranty, representation, or guarantee regarding the suitability of its
products for any particular purpose, nor does NXP assume any liability arising out of
the application or use of any product or circuit, and specifically disclaims any and all
liability, including without limitation consequential or incidental damages. “Typical”
parameters that may be provided in NXP data sheets and/or specifications can and do
vary in different applications, and actual performance may vary over time. All operating
parameters, including “typicals”, must be validated for each customer application by
customer's technical experts. NXP does not convey any license under its patent rights nor
the rights of others. NXP sells products pursuant to standard terms and conditions of sale,
which can be found at the following address: nxp.com/SalesTermsandConditions.
While NXP Semiconductors has implemented advanced security features, all products may
be subject to unidentified vulnerabilities. Customers are responsible for the design and
operation of their applications and products to reduce the effect of these vulnerabilities on
customer’s applications and products, and NXP Semiconductors accepts no liability for
any vulnerability that is discovered. Customers should implement appropriate design and
operating safeguards to minimize the risks associated with their applications and products.
NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD,
Airfast, Altivec, CodeWarrior, ColdFire, ColdFire+, CoolFlux, CoolFluxDSP, the CoolFlux
logo, EdgeLock, EdgeScale, EdgeVerse, eIQ, Embrace, Freescale, the Freescale logo,
GreenChip, the GreenChip logo, HITAG, ICODE, I - CODE, Immersiv3D, JCOP, Kinetis,
Layerscape, MagniV, Mantis, MIFARE, the MIFARE logo, MIFARE CLASSIC, MIFARE
DESFire, MIFARE FleX, MIFARE Plus, MIFARE Ultralight, MIFARE 4Mobile, the
MIFARE4Mobile logo, MiGLO, mobileGT, NTAG, the NTAG logo, PEG, Plus X,
PowerQUICC, Processor Expert, QorIQ, QorIQ Qonverge, Qorivva, RoadLINK, the
RoadLINK logo, SafeAss ure, SmartM X, StarCore, Symphony, Tower, TriMedia,
UCODE, the UCODE DNA logo, VortiQa and Vybrid are trademarks of NXP B.V. All
other product or service names are the property of their respective owners. AMBA, Arm,
Arm7, Arm7TDMI, Arm9, Arm11, Artisan, big.LITTLE, Cordio, CoreLink, CoreSight,
Cortex, DesignStart, DynamIQ, Jazelle, Keil, Mali, Mbed, Mbed Enabled, NEON, POP,
RealView, SecurCore, Socrates, Thumb, TrustZone, ULINK, ULINK2, ULINK-ME,
ULINK-PLUS, ULINKpro, µVision, Versatile are trademarks or registered trademarks
of Arm Limited (or its subsidiaries) in the US and/or elsewhere. The related technology
may be protected by any or all of patents, copyrights, designs and trade secrets. All rights
reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. The
Power Architecture and Power.org word marks and the Power and Power.org logos and
related marks are trademarks and service marks licensed by Power.org.
NXP Semiconductors 37
List of Figures
Figure 1: Create an S32DS Application Project page......................................................................7
Figure 24: After Editing Address Range and Color of Group Screen............................................29
38 NXP
Semiconductors
Figure 26: Code Coverage viewer..................................................................................................31
NXP Semiconductors 39
List of Tables
Table 1: Manual contents................................................................................................................. 4
40 NXP
Semiconductors
Index
A
Add or Remove Function Range 28
Add or Remove Group 29
Analysis Results view 23
C
Change Color 28
Collecting trace data 15
Configuring Debug Launcher 8
Create new project 6
E
Edit Address Range of Function 28
M
Merge Groups or Functions 30
S
Setting up trace collection 5
T
Trace generators 16
V
View trace data 22