CodeWarrior Development Studio for Power Architecture ...
CodeWarrior Development Studio for Power Architecture ...
CodeWarrior Development Studio for Power Architecture ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>CodeWarrior</strong><br />
<strong>Development</strong> <strong>Studio</strong> <strong>for</strong><br />
<strong>Power</strong> <strong>Architecture</strong>®<br />
Processors<br />
Version 10.x<br />
Tracing and Analysis<br />
Tools<br />
User Guide<br />
Revised: March 6, 2013
Freescale, the Freescale logo, <strong>CodeWarrior</strong>, <strong>Power</strong>QUICC, QorIQ, Qorivva, StarCore are trademarks of Freescale<br />
Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. QorIQ Qonverge, QUICC Engine are trademarks of Freescale Semiconductor,<br />
Inc. All other product or service names are the property of their respective owners. The <strong>Power</strong> <strong>Architecture</strong><br />
and <strong>Power</strong>.org word marks and the <strong>Power</strong> and <strong>Power</strong>.org logos and related marks are trademarks and service marks<br />
licensed by <strong>Power</strong>.org.<br />
© 2009-2013 Freescale Semiconductor, Inc. All rights reserved.<br />
In<strong>for</strong>mation in this document is provided solely to enable system and software implementers to use Freescale Semiconductor<br />
products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated<br />
circuits or integrated circuits based on the in<strong>for</strong>mation in this document.<br />
Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale<br />
Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products <strong>for</strong> any particular<br />
purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product<br />
or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages.<br />
“Typical” parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and<br />
do vary in different applications and actual per<strong>for</strong>mance may vary over time. All operating parameters, including “Typicals”,<br />
must be validated <strong>for</strong> each customer application by customer's technical experts. Freescale Semiconductor does<br />
not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed,<br />
intended, or authorized <strong>for</strong> use as components in systems intended <strong>for</strong> surgical implant into the body, or other<br />
applications intended to support or sustain life, or <strong>for</strong> any other application in which the failure of the Freescale Semiconductor<br />
product could create a situation where personal injury or death may occur. Should Buyer purchase or use<br />
Freescale Semiconductor products <strong>for</strong> any such unintended or unauthorized application, Buyer shall indemnify and hold<br />
Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all<br />
claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of<br />
personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale<br />
Semiconductor was negligent regarding the design or manufacture of the part.<br />
How to Contact Us<br />
Corporate Headquarters Freescale Semiconductor, Inc.<br />
6501 William Cannon Drive West<br />
Austin, TX 78735<br />
U.S.A.<br />
World Wide Web http://www.freescale.com/codewarrior<br />
Technical Support http://www.freescale.com/support
Table of Contents<br />
1 Introduction 7<br />
1.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
1.1.1 Per<strong>for</strong>mance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
1.1.2 Trace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
1.2 Overview of This Manual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
1.3 Accompanying Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />
2 Trace 11<br />
2.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
2.1.1 Creating New Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
2.1.2 Configuring Trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />
2.2 Collecting Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56<br />
2.3 Viewing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60<br />
2.3.1 Software Analysis View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60<br />
2.3.2 Finding and Filtering Trace Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76<br />
2.3.3 Exporting Trace Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79<br />
2.3.4 Configuring Time Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80<br />
2.4 Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus Trace . . . . . . . . . . . . . . . . . . 81<br />
2.4.1 Enabling Aurora. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81<br />
2.4.2 Executing Aurora Training Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81<br />
2.5 Importing Trace Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85<br />
3 Tracepoints 91<br />
3.1 Setting Software Tracepoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91<br />
3.2 Viewing Analysispoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97<br />
3.2.1 Analysispoints View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98<br />
3.2.2 Context Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104<br />
4 Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series 107<br />
4.1 Configuring Per<strong>for</strong>mance Analysis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108<br />
4.1.1 Loading Application on Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108<br />
4.1.2 Running Helper Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109<br />
Tracing and Analysis Tools User Guide<br />
3
Table of Contents<br />
4.1.3 Configuring Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110<br />
4.1.4 Using the Per<strong>for</strong>mance Analysis Configuration Editor . . . . . . . . . . . . . . . . . . . .116<br />
4.2 Collecting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130<br />
4.2.1 Specified Cycle Count Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134<br />
4.2.2 One Shot Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135<br />
4.2.3 Logic Analyzer Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136<br />
4.2.4 Configuration Access Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137<br />
4.3 Analyzing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138<br />
4.3.1 Viewing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138<br />
4.3.2 Saving Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144<br />
4.3.3 Loading Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145<br />
4.4 Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146<br />
4.4.1 Importing PFS Files and Per<strong>for</strong>mance Analysis Data . . . . . . . . . . . . . . . . . . . . .146<br />
4.4.2 Working on Scenario Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151<br />
4.4.3 Expert Mode Configuration Subroutines in PFU Files . . . . . . . . . . . . . . . . . . . .165<br />
4.4.4 Modifying Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177<br />
4.4.5 Creating New Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182<br />
4.5 Generating CSV and Summary CSV Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190<br />
4.6 Capturing Program Counter with Event Captures . . . . . . . . . . . . . . . . . . . . . . . . . . . .194<br />
4.7 Setting Per<strong>for</strong>mance Analysispoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195<br />
4.7.1 Setting Pfapoints From Disassembly View . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199<br />
4.8 Zip File Database of Event, Counter and Metric Capabilities . . . . . . . . . . . . . . . . . . .200<br />
5 Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices 203<br />
5.1 Per<strong>for</strong>mance Analysis Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203<br />
5.1.1 Per<strong>for</strong>mance Analysis View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203<br />
5.1.2 Configuration View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204<br />
5.1.3 Per<strong>for</strong>mance Analysis Session View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211<br />
5.1.4 Progress View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211<br />
5.2 Creating New Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .212<br />
5.3 Connecting to Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213<br />
5.3.1 Selecting Connection Automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .214<br />
5.3.2 Adding Connection Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216<br />
5.4 Selecting Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .217<br />
5.5 Running Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219<br />
4 Tracing and Analysis Tools User Guide
Table of Contents<br />
5.6 Viewing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221<br />
5.6.1 Tabular Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223<br />
5.6.2 Graphical Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224<br />
6 Nexus Tracing of User Space Applications 227<br />
6.1 Tracing User Space Processes Selectively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228<br />
6.2 Shared Objects and Dynamic Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228<br />
6.2.1 Input to Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228<br />
6.3 Target Configuration <strong>for</strong> Generating and Collecting Nexus Trace. . . . . . . . . . . . . . . . 233<br />
6.4 Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234<br />
Index 239<br />
Tracing and Analysis Tools User Guide<br />
5
Table of Contents<br />
6 Tracing and Analysis Tools User Guide
Introduction<br />
Tracing and Analysis Tools User Guide<br />
1<br />
This manual describes how the <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong>® V10.x Tracing and Per<strong>for</strong>mance<br />
Analysis tools can be used <strong>for</strong> the P4080, P4040, P5020, P5040, P5021, P2040/41, P5010, B4860,<br />
B4420, T4240, and T4160 devices. The current implementation of this tool is at engineering level. This<br />
chapter presents an overview of this manual and introduces you to the Tracing and Per<strong>for</strong>mance Analysis<br />
tools.<br />
NOTE The descriptions and sample applications in this document use the P4080DS development<br />
board. However, the implementation remains same <strong>for</strong> the P4040 development board.<br />
This chapter describes:<br />
Limitations<br />
Overview of This Manual<br />
Accompanying Documentation<br />
1.1 Limitations<br />
This section describes the limitations of the following tools:<br />
Per<strong>for</strong>mance Analysis<br />
Trace<br />
1.1.1 Per<strong>for</strong>mance Analysis<br />
The Per<strong>for</strong>mance Analysis tools have the following limitations:<br />
Limited integration with <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x tool chain.<br />
Does not share the same launch configuration as the debugger.<br />
Connection configuration to the target is done manually by editing a text file. There is no GUI<br />
support <strong>for</strong> this at this time. However, there is a connection configuration option to extract the<br />
configuration from the currently running application.<br />
The tools need to stop the core once during its initialization. This is because some core registers<br />
cannot be accessed while the device is running. Once this is done, <strong>for</strong> future runs in the same session<br />
with the same configuration, the target system runs without further interference.<br />
7
Introduction<br />
Overview of This Manual<br />
The tools need to stop the core whenever core changes the events that are required to be measured<br />
by the core.<br />
The tools does not support analysis of per<strong>for</strong>mance events collected in the Nexus stream.<br />
The graphical presentation of data is limited in its ability to manipulate displayed data. Scales,<br />
labels, colors, and other items cannot be changed.<br />
The user needs to launch CCS manually be<strong>for</strong>e starting the Per<strong>for</strong>mance Analysis tools. CCS must<br />
be running while the Per<strong>for</strong>mance Analysis tools are being used.<br />
The master reference clock set as core 0; PMC3 is hard coded.<br />
1.1.2 Trace<br />
The tracing tools have the following limitations:<br />
No hypervisor support.<br />
No support <strong>for</strong> dynamically loaded code, self-modifying code, and code relocated at run-time.<br />
1.2 Overview of This Manual<br />
Each chapter of this manual describes a different area of Tracing and Per<strong>for</strong>mance Analysis tools. Table<br />
1.1 describes each chapter in the manual.<br />
Table 1.1 Manual Contents<br />
Chapter Description<br />
Introduction This chapter<br />
Trace Describes the trace collection process and<br />
how to use trace data <strong>for</strong> debugging<br />
Tracepoints Describes how to enable and disable trace<br />
collection at specific instruction addresses<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P<br />
Series<br />
Describes how to configure, collect, and<br />
analyze events and data elements using the<br />
Per<strong>for</strong>mance Analysis features of the P4080<br />
and P5020 devices<br />
8 Tracing and Analysis Tools User Guide
1.3 Accompanying Documentation<br />
Tracing and Analysis Tools User Guide<br />
Introduction<br />
Accompanying Documentation<br />
The Documentation Roadmap page describes the documentation included in this version of <strong>CodeWarrior</strong><br />
<strong>Development</strong> <strong>Studio</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> Processors. You can access the Documentation Roadmap<br />
by:<br />
a shortcut link on the Desktop that the installer creates by default<br />
opening START_HERE.html in \PA\Help folder.<br />
9
Introduction<br />
Accompanying Documentation<br />
10 Tracing and Analysis Tools User Guide
Trace<br />
Tracing and Analysis Tools User Guide<br />
2<br />
Tracing is a technique that obtains diagnostic and per<strong>for</strong>mance in<strong>for</strong>mation about a program's execution.<br />
This in<strong>for</strong>mation is typically used <strong>for</strong> debugging purposes, and additionally, depending on the type and<br />
detail of in<strong>for</strong>mation contained in a trace log, to diagnose common problems with the software. The trace<br />
log includes in<strong>for</strong>mation about the trace source, type of event, description of the event and time stamp<br />
value.<br />
This chapter describes:<br />
Configuration<br />
Collecting Data<br />
Viewing Data<br />
Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus Trace<br />
Importing Trace Data File<br />
2.1 Configuration<br />
In order to collect trace, you need a project to define your application, a launch configuration to set up a<br />
debug connection to the target, and a trace configuration to define the type of trace data you would like to<br />
collect.<br />
This topic describes:<br />
Creating New Project<br />
Configuring Trace<br />
2.1.1 Creating New Project<br />
Create a new <strong>CodeWarrior</strong> bareboard project or open an existing project be<strong>for</strong>e you start collecting the<br />
trace data.<br />
To create a new bareboard project:<br />
1. Start the <strong>CodeWarrior</strong> IDE.<br />
2. From the IDE menu bar, select File > New > <strong>CodeWarrior</strong> Bareboard Project Wizard.<br />
The Create a <strong>CodeWarrior</strong> Bareboard Project Wizard page appears (Figure 2.1).<br />
11
Trace<br />
Configuration<br />
Figure 2.1 <strong>CodeWarrior</strong> Bareboard Project Wizard<br />
3. Enter a name <strong>for</strong> the new project in the Project Name text box.<br />
4. The Location text box shows the default workspace location. To change this location, clear the Use<br />
default location checkbox and click Browse to select a new location.<br />
5. Use subsequent dialog box to specify a new location.<br />
6. Click OK.<br />
The dialog box returns you to the Create a <strong>CodeWarrior</strong> Bareboard Project Wizard page, which<br />
now shows the new location.<br />
7. Click Next.<br />
The Processor page appears (Figure 2.2).<br />
12 Tracing and Analysis Tools User Guide
Figure 2.2 Processor Page<br />
8. Expand the QorIQ_P4 tree control and select P4080.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
NOTE In this chapter, P4080 has been taken as an example. The settings may differ based upon the<br />
selection of devices in the Processor page.<br />
9. Click Next.<br />
The Debug Target Settings page appears (Figure 2.3).<br />
13
Trace<br />
Configuration<br />
Figure 2.3 Debug Target Settings Page<br />
10. From the Board drop-down box, select P4080DS.<br />
11. In the Connection Type drop-down box, select the TAP that is connected to the target.<br />
NOTE The Gigabit TAP + Trace option corresponds to a Gigabit TAP that includes an Aurora<br />
daughter card, which enables you to collect Nexus trace in a real-time non-intrusive fashion<br />
from the high-speed serial trace port (the Aurora interface). To know more about collecting<br />
14 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Nexus trace using Aurora, refer Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus<br />
Trace.<br />
The Gigabit TAP devices that include an Aurora daughter card have three ways to send debug<br />
commands to the target, depending on the configuration of the P4080 board (Table 2.1).<br />
Table 2.1 Gigabit TAP + Trace Connection Type Options<br />
Option Description<br />
JTAG over JTAG cable Sends JTAG commands over the JTAG cable<br />
JTAG over Aurora cable Sends JTAG commands over the Aurora cable<br />
NOTE The settings of the Gigabit TAP + Trace debug connection should match the jumper settings<br />
on the target board.<br />
12. Enter the TAP address in the TAP address text box.<br />
13. Click Next.<br />
The Build Settings page appears.<br />
15
Trace<br />
Configuration<br />
Figure 2.4 Build Settings Page<br />
14. Click Next.<br />
The Configurations page appears (Figure 2.5).<br />
16 Tracing and Analysis Tools User Guide
Figure 2.5 Configurations Page<br />
15. From the Processing Model group, select AMP (One project per core).<br />
16. From the Core Index list, select Core 0.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
NOTE For the bareboard applications, launch the application on Core 0 in order to configure the<br />
system. In addition, you can launch other applications on Core 1 – Core 7, using the same<br />
target initialization file.<br />
NOTE You can follow the above steps (1–20) to create a <strong>CodeWarrior</strong> project <strong>for</strong> Per<strong>for</strong>mance<br />
Analysis also. In this case, click Finish after you configure the Configurations page. For<br />
details, refer to the Loading Application on Target topic.<br />
17. Click Next.<br />
The Trace Configuration page appears (Figure 2.6).<br />
17
Trace<br />
Configuration<br />
Figure 2.6 Trace Configuration Page<br />
18. To start trace session, check the Start a trace session on debug launch checkbox.<br />
19. From Generate trace configurations <strong>for</strong> the following types of trace sources group, choose the<br />
desired option (Table 2.2).<br />
Table 2.2 Trace Collection Source Options<br />
Option Description<br />
DDR Buffer This collection method sends trace to a Double Data Rate (DDR)<br />
memory buffer.<br />
NPC Buffer This collection method sends trace data to a small dedicated trace<br />
buffer.<br />
Gigabit TAP +<br />
Trace<br />
Enable circular<br />
collection<br />
This collection method collects trace data on a Gigabit TAP+Trace<br />
debug connection.<br />
Enables circular collection <strong>for</strong> DDR and NPC-based trace. In<br />
circular collection mode, the tracing continues even after the buffer<br />
is full overwriting the old data with the new data.<br />
20. Click Finish.<br />
The IDE creates a project according to your specifications.<br />
18 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
21. From the IDE menu bar, select Window > Show View > <strong>CodeWarrior</strong> Projects.<br />
The <strong>CodeWarrior</strong> Projects view appears and displays the project you just created (Figure 2.7).<br />
Figure 2.7 <strong>CodeWarrior</strong> Projects View<br />
22. From the IDE menu bar, select Project > Build Project.<br />
The Build Project dialog box appears; the build tools generate an executable program.<br />
NOTE For more in<strong>for</strong>mation on creating a <strong>CodeWarrior</strong> project, refer to the <strong>Power</strong> <strong>Architecture</strong><br />
Processors Version 10.x Targeting Manual in the folder: \PA\Help\PDF,<br />
where is the directory where <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is<br />
installed.<br />
2.1.2 Configuring Trace<br />
You need to define the trace configuration be<strong>for</strong>e debugging the application.<br />
NOTE This section documents debugger features that are specific to Trace. For more in<strong>for</strong>mation on<br />
other debugger features of <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> Processors product, refer to<br />
the <strong>Power</strong> <strong>Architecture</strong> Processors Version 10.x Targeting Manual in the folder:<br />
\PA\Help\PDF, where is the directory where<br />
<strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is installed.<br />
To define a trace configuration:<br />
1. From the IDE menu bar, select Run > Debug Configurations.<br />
The Debug Configurations dialog box appears (Figure 2.8).<br />
19
Trace<br />
Configuration<br />
Figure 2.8 Debug Configurations Dialog Box<br />
2. In the left pane of this dialog box, expand the <strong>CodeWarrior</strong> tree control.<br />
3. Select the launch configuration corresponding to your project. For example, Hello_Worldcore0_RAM_P4080_Download.<br />
A set of tabbed configuration panels appears in the right pane of the dialog box (Figure 2.9).<br />
20 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Figure 2.9 Debug Configurations Dialog Box — Create, manage, and run configurations<br />
4. Click the Trace and Profile tab.<br />
The trace configuration options appear (Figure 2.10).<br />
NOTE Trace is not supported <strong>for</strong> all processors. Also, trace may be licensed. If an unsupported<br />
processor is selected in the RSE Target Configuration, or if trace is licensed and you do not<br />
have a valid license, the trace configuration options in the Trace and Profile tab appear<br />
disabled.<br />
21
Trace<br />
Configuration<br />
Figure 2.10 Trace and Profile Tab<br />
5. Check the Start a trace session checkbox <strong>for</strong> the trace session to start immediately on debug launch.<br />
NOTE If you have checked the Start a trace session on debug launch checkbox in Figure 2.6 while<br />
creating a new bareboard project, you will see the Start a trace session checkbox checked by<br />
default in the Trace and Profile tab.<br />
6. From the Default trace Configuration drop-down list, select the desired default configuration. It also<br />
provides two options:<br />
Show all configurations — displays all configurations in the Default trace Configuration dropdown<br />
list.<br />
Only show configuration <strong>for</strong> the associated project — displays those configurations that are<br />
related to the selected project.<br />
7. From the Trace Collection group, select one of the following options <strong>for</strong> collecting trace data.<br />
22 Tracing and Analysis Tools User Guide
Table 2.3 Trace Collection Options with Description<br />
Option Sub-option Description<br />
<strong>CodeWarrior</strong><br />
configures the<br />
target and<br />
enables trace<br />
collection<br />
If the target is<br />
running and must be<br />
suspended to<br />
configure trace<br />
hardware<br />
After configuring<br />
trace hardware, start<br />
trace collection<br />
Tracing and Analysis Tools User Guide<br />
Lets you configure and control trace<br />
collection.<br />
• Suspend and resume the<br />
target Automatically —<br />
Suspends the target<br />
automatically <strong>for</strong> trace<br />
configuration. If this option is<br />
selected, and you choose to<br />
configure trace while the target<br />
is running, the target suspends<br />
immediately while trace<br />
configuration is applied, and<br />
then resumes automatically.<br />
Wait until the target is<br />
resumed manually — Lets<br />
you suspend and resume the<br />
target <strong>for</strong> trace configuration<br />
manually. If this option is<br />
selected, and you choose to<br />
configure trace while the target<br />
is running, the configuration is<br />
changed, but not applied to the<br />
target until the target is<br />
suspended and resumed.<br />
Automatically — Starts trace<br />
collection immediately after you<br />
press resume.<br />
Manually from the toolbar or<br />
by an Analysis Point — Lets<br />
you start trace session and<br />
configure trace hardware with<br />
trace collection disabled. Trace<br />
collection will be enabled later<br />
by clicking the Start Collection<br />
button in the toolbar or by<br />
executing code at an Analysis<br />
Point. For details on Analysis<br />
points, refer to the Viewing<br />
Analysispoints topic. For details<br />
on the toolbar, refer to Figure<br />
2.39 and Table 2.19.<br />
Trace<br />
Configuration<br />
23
Trace<br />
Configuration<br />
Table 2.3 Trace Collection Options with Description (continued)<br />
Option Sub-option Description<br />
The application<br />
configures the<br />
target and<br />
enables trace<br />
collection<br />
Stop trace collection<br />
when the core is<br />
suspended<br />
When trace<br />
collection stops,<br />
upload trace results<br />
If checked, stops trace collection<br />
automatically when the target is<br />
suspended. If you do not check this<br />
checkbox, you can stop trace collection<br />
either using the Stop Trace Collection<br />
button from the toolbar, or by using an<br />
Analysis Point.<br />
If you do not choose any of these options,<br />
the trace collection will stop after buffer is<br />
full or when application finishes<br />
execution.<br />
For details on Analysis points, refer to the<br />
Viewing Analysispoints topic. For details<br />
on the toolbar, refer to Figure 2.39 and<br />
Table 2.19.<br />
Automatically — Saves data<br />
to the Trace.dat file<br />
automatically after collection<br />
completes or is stopped.<br />
Manually from the toolbar —<br />
Lets you use the toolbar to<br />
save the trace data manually to<br />
the Trace.dat file.<br />
NOTE: For details on the toolbar, refer to<br />
Table 2.19.<br />
Lets you start collecting new trace data<br />
<strong>for</strong> the trace session using your<br />
application. In this case, all the above<br />
options are disabled.<br />
8. Per<strong>for</strong>m the following settings in the Trace Display group.<br />
a. Check the Display new trace data automatically checkbox to display the newly uploaded trace<br />
data automatically.<br />
b. In the Open trace at offset option, adjust the slider to select an approximate memory location <strong>for</strong><br />
opening the collected trace data. This setting is stored with the trace data, and thus will always<br />
control where the particular data is opened. The slider is approximate and provides selections<br />
from 0 to 100% in 10% increments. This option is normally set to 0%, but will be set to 100% if<br />
24 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
you check the Enable circular collection checkbox in the Trace Configurations page of the<br />
New <strong>Power</strong> <strong>Architecture</strong> wizard.<br />
This topic contains the following sub-topics:<br />
Modifying Selected Trace Configuration<br />
Configuring Trace <strong>for</strong> e6500 Core<br />
2.1.2.1 Modifying Selected Trace Configuration<br />
To modify the selected configuration, click Edit in the Trace and Profile tab of the Debug<br />
Configurations dialog box. The Trace Configurations dialog box appears (Figure 2.11). You can use<br />
this dialog box to create, delete, rename, and modify trace configuration.<br />
NOTE The trace configuration options change according to the trace collection sources you select<br />
from the Trace page.<br />
NOTE Steps 1–13 are optional; you may use these steps to modify the trace configurations.<br />
Figure 2.11 Trace Configurations Dialog Box<br />
25
Trace<br />
Configuration<br />
1. In the left pane of this dialog box, expand the appropriate tree control. For example, DDR Buffer<br />
(Hello_World-core0).<br />
The P4080 tree control appears in the left pane.<br />
NOTE The tree control appears according to the target device you select: P4080, P4040, or P5020.<br />
2. Expand the P4080 tree control and select Collection.<br />
The Collection configuration options appear in the right pane of the dialog box (Figure 2.12). These<br />
options let you modify how and where the trace data is collected.<br />
3. From the Collection drop-down list, select one of the following options:<br />
DDR Buffer — For in<strong>for</strong>mation on the options that appear <strong>for</strong> DDR Buffer collection method,<br />
refer to Table 2.4 and Figure 2.12.<br />
Figure 2.12 DDR Buffer Collection Method<br />
26 Tracing and Analysis Tools User Guide
Table 2.4 DDR Buffer Options<br />
Option Description<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Buffer Address Enter the memory address from where the buffer begins<br />
collecting trace.<br />
Buffer Size Enter the size of the collection buffer.<br />
Disable Nexus Aurora Link Check to disable the Nexus Aurora Link (NAL) layer.<br />
Enable circular collection Check to enable the buffer to contain the most recent n<br />
bytes of trace data. The circular buffer overwrites the old<br />
data with new in case the buffer is full.<br />
Note: Circular collection is useful when the events of<br />
interest may occur at some unknown point in the program<br />
during execution. In this situation, an application can be<br />
configured to set up a circular buffer and to stop tracing<br />
when the event of interest occurs, or soon thereafter. The<br />
buffer then contains the last n events to occur be<strong>for</strong>e the<br />
point of interest.<br />
Force periodic program trace<br />
synchronization<br />
Circular buffer collection is available <strong>for</strong> DDR or NPC based<br />
collection buffers.<br />
Tracing continues until you explicitly terminate the debug<br />
session using the stop trace button in the debug view, or<br />
cancel the trace collection task from the Progress view.<br />
Check to generate a synchronization trace message<br />
periodically. This is useful in situations when the branch<br />
buffer is overrun by many branches between naturally<br />
occurring synchronization messages. However, the<br />
buffered branch in<strong>for</strong>mation will be discarded leaving a<br />
sampled view of code execution rather than a complete<br />
branch-by-branch trace of execution.<br />
Note: It is recommended that this setting be used <strong>for</strong> Linux<br />
kernel tracing. This option is enabled only when the<br />
advanced properties of the trace configuration editor are<br />
enabled.<br />
NPC Buffer — The options <strong>for</strong> NPC are same as DDR. For in<strong>for</strong>mation on the options that appear<br />
<strong>for</strong> NPC Buffer collection method, refer to Table 2.4 and Figure 2.12.<br />
27
Trace<br />
Configuration<br />
Figure 2.13 NPC Buffer Collection Method<br />
Gigabit TAP + Trace — For in<strong>for</strong>mation on the options that appear <strong>for</strong> Gigabit TAP + Trace<br />
collection method, refer to Table 2.4 and Figure 2.14.<br />
Figure 2.14 Gigabit TAP + Trace Collection Method<br />
4. In the left pane of the Trace Configurations dialog box, select a core from the P4080 tree control.<br />
For example, Core 0.<br />
A set of tabbed configuration panels appears in the right pane of the dialog box with the Program<br />
Trace tab in front (Figure 2.15). These configuration options control the trace produced in the<br />
processor cores.<br />
Figure 2.15 Trace Configurations Dialog Box — Program Trace Tab<br />
28 Tracing and Analysis Tools User Guide
Table 2.5 Program Trace Options<br />
Option Description<br />
Enable Core Tracing Check to produce the trace output <strong>for</strong> Core 0.<br />
Enable Program Trace Check to enable the tracing of program flow <strong>for</strong> this core.<br />
Start Trigger Specify an event that enables the program trace.<br />
End Trigger Specify an event that disables the program trace.<br />
Mark Enable Check to generate Nexus Program Trace selectively only<br />
<strong>for</strong> processes that set MSR[PMM]. Program trace will be<br />
masked or disabled <strong>for</strong> all other processes.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
NOTE The e500mc core program trace output can also be triggered by the watchpoint events. For<br />
example, watchpoint 1: IAC1 (Instruction Address Comparator 1) event, watchpoint 2: IAC2<br />
event, or watchpoint 3: interrupt taken. For more in<strong>for</strong>mation, refer to the Core Debug<br />
Watchpoint Mappings table in the e500mc Reference Manual.<br />
5. Click Data Trace tab.<br />
The data trace configuration panel appears (Figure 2.16).<br />
Figure 2.16 Trace Configurations Dialog Box — Data Trace Tab<br />
Table 2.6 Data Trace Options<br />
Option Description<br />
Enable Data Trace Check to enable the tracing of selected memory reads and<br />
writes by this core.<br />
29
Trace<br />
Configuration<br />
Table 2.6 Data Trace Options<br />
Option Description<br />
Start Trigger Specify an event that enables the data trace.<br />
End Trigger Specify an event that disables the data trace.<br />
NOTE Data trace will only occur in the range(s) specified by the Data Address Compare settings<br />
explained in Table 2.7. If no range is specified, no trace will occur.<br />
NOTE The e500mc core data trace output can also be triggered by the watchpoint events. For<br />
example, watchpoint 1: IAC1 event, watchpoint 2: IAC2 event, or watchpoint 3: interrupt<br />
taken. For more in<strong>for</strong>mation, refer to the Core Debug Watchpoint Mappings table in the<br />
e500mc Reference Manual.<br />
6. Click Address Compare tab.<br />
The address compare configuration panel appears (Figure 2.17).<br />
30 Tracing and Analysis Tools User Guide
Figure 2.17 Trace Configurations Dialog Box — Address Compare Tab<br />
7. Check the appropriate checkbox to enable:<br />
Instruction Address Compare — For more in<strong>for</strong>mation on the options that appear <strong>for</strong> the<br />
Instruction Address Compare option, refer to Figure 2.18 and Table 2.7.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Data Address Compare — For more in<strong>for</strong>mation on the options that appear <strong>for</strong> the Data Address<br />
Compare option, refer to Figure 2.19 and Table 2.8.<br />
Figure 2.18 Instruction Address Compare Settings<br />
31
Trace<br />
Configuration<br />
Table 2.7 Instruction Address Compare Options<br />
Option Suboption Description<br />
Compare Mode Select the type of instruction address comparison to be<br />
made.<br />
Exact IAC 1 debug conditions occur only if the address of the<br />
instruction fetch is equal to the value specified in IAC 1.<br />
IAC 2 debug conditions occur only if the address of the<br />
instruction fetch is equal to the value specified in IAC 2.<br />
BitMatch IAC 1 debug conditions occur only if the address of the<br />
instruction fetch, ANDed with the contents of IAC 2 is<br />
equal to the contents of IAC 1, also ANDed with the<br />
contents of IAC 2.<br />
IAC 2 debug conditions do not occur.<br />
Inclusive Range IAC 1 debug conditions occur only if the address of the<br />
instruction fetch is greater than or equal to the value<br />
specified in IAC 1 and less than the value specified in<br />
IAC 2.<br />
IAC 2 debug conditions do not occur.<br />
Exclusive Range IAC 1 debug conditions occur only if the address of the<br />
instruction fetch is less than the value specified in IAC 1<br />
or is greater than or equal to the value specified in IAC 2.<br />
IAC 2 debug conditions do not occur.<br />
IAC 1 Check to enable instruction address 1 comparator.<br />
Address Enter the address to set the value of instruction address<br />
comparator 1.<br />
IAC 2 Check to enable instruction address 2 comparator.<br />
Enter the address to set the value of instruction address<br />
comparator 2.<br />
32 Tracing and Analysis Tools User Guide
Figure 2.19 Data Address Compare Settings<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
33
Trace<br />
Configuration<br />
Table 2.8 Data Address Compare Options<br />
Option Suboption Description<br />
Compare Mode Select the type of data address comparison to be<br />
made.<br />
Exact DAC 1 debug conditions occur only if the<br />
address of the instruction fetch is in the range<br />
specified in the DAC 1 Address and Range<br />
fields.<br />
DAC 2 debug conditions occur only if the<br />
address of the instruction fetch is in the range<br />
specified in the DAC 2 Address and Range<br />
fields.<br />
BitMatch DAC 1 debug conditions occur only if the<br />
address of the instruction fetch, ANDed with the<br />
DAC 2 Address setting is equal to the DAC 1<br />
Address setting, also ANDed with the DAC 2<br />
Address setting.<br />
DAC 2 debug conditions do not occur.<br />
Inclusive<br />
Range<br />
Exclusive<br />
Range<br />
DAC 1 debug conditions can occur only if the<br />
address of the instruction fetch is greater than or<br />
equal to the value specified in DAC 1 and less<br />
than the value specified in DAC 2.<br />
DAC 2 debug conditions do not occur.<br />
DAC 1 debug conditions occur only if the<br />
address of the instruction fetch is less than the<br />
value specified in DAC 1 or is greater than or<br />
equal to the value specified in DAC 2.<br />
DAC 2 debug conditions do not occur.<br />
34 Tracing and Analysis Tools User Guide
Table 2.8 Data Address Compare Options (continued)<br />
Option Suboption Description<br />
DAC 1 Check to enable DAC 1.<br />
Tracing and Analysis Tools User Guide<br />
Address Enter the address to set the value of data<br />
address comparator 1.<br />
Exact Range Select the range of addresses to match in Exact<br />
mode.<br />
Access Type Select an option to let a data store or data load<br />
trigger the data address 1 comparator.<br />
NOTE: For e500 core, only Stores are traced.<br />
There is no trace if you select Loads.<br />
Privilege Specify the privilege level to enable the DAC 1<br />
debug condition.<br />
Address Space Specify the memory address space to enable the<br />
DAC 1 debug condition.<br />
Link to IAC 1 Check to link DAC 1 with IAC 1. When linked to<br />
IAC 1, the DAC 1 debug event is qualified based<br />
on whether the instruction also generated an IAC<br />
1 debug condition.<br />
DAC 2 Check to enable data address comparator 2.<br />
Address Enter the address to set the value of data<br />
address comparator 2.<br />
Range Select the range of addresses to match in Exact<br />
mode.<br />
Access Type Select an option to let a data store or data load<br />
trigger the data address 2 comparator.<br />
Privilege Specify the privilege level to enable the DAC 2<br />
debug condition.<br />
Address Space Specify the memory address space to enable the<br />
DAC 2 debug condition.<br />
Link to IAC 2 When linked to IAC 2, the DAC 2 debug event is<br />
qualified based on whether the instruction also<br />
generated an IAC 2 debug condition.<br />
Trace<br />
Configuration<br />
35
Trace<br />
Configuration<br />
8. Click the Event Out Signals tab.<br />
The event out signals configuration panel appears (Figure 2.20).<br />
Figure 2.20 Trace Configurations Dialog Box — Event Out Signals Tab<br />
a. Enter the debugger event values in the respective text boxes (Table 2.9).<br />
Table 2.9 Event Out Signals Fields<br />
Field Description<br />
Event Out 0 Triggers Determines which debug event(s) triggers Event Out 0. You<br />
can select the debug event(s) from the available checkboxes.<br />
Event Out 1 Trigger Determines which debug event triggers Event Out 1.<br />
Event Out 2 Trigger Determines which debug event triggers Event Out 2.<br />
Event Out 3 Trigger Determines which debug event triggers Event Out 3.<br />
Event Out 4 Trigger Determines which debug event triggers Event Out 4.<br />
NOTE The events 1–4 can also be triggered by the watchpoint events. For example, watchpoint 1:<br />
IAC1 event, watchpoint 2: IAC2 event, or watchpoint 3: interrupt taken. For more<br />
in<strong>for</strong>mation, refer to the Core Debug Watchpoint Mappings table in the e500mc Reference<br />
Manual. However, event 0 can be triggered if any of the watchpoints selected by the event 0<br />
mask occurs, that is the selected events are OR-ed. For more in<strong>for</strong>mation, refer to the DC2<br />
Field Descriptions table in the e500mc Reference Manual<br />
36 Tracing and Analysis Tools User Guide
. Click Apply to apply the settings.<br />
9. Click the Misc tab.<br />
The miscellaneous configuration panel appears (Figure 2.21).<br />
Figure 2.21 Trace Configurations Dialog Box — Misc Tab<br />
Table 2.10 Misc Fields<br />
Field Description<br />
Timestamps Check to configure trace messages to include<br />
timestamps.<br />
Enable Data Acquisition Trace Check to generate Data Acquisition messages.<br />
Enable Ownership Trace Check to generate ownership messages.<br />
Enable Watchpoint Trace Controls which watchpoint events are enabled to<br />
produce Watchpoint Trace Messages. You can select<br />
the watchpoint events from the available checkboxes.<br />
These watchpoint events, when triggered, could<br />
optionally create a Nexus watchpoint message.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
NOTE The e500mc core watchpoint trace output can also be triggered if any of the selected<br />
watchpoints by this mask occurs (the selected events are OR-ed). For more in<strong>for</strong>mation, refer<br />
to the Core Debug Watchpoint Mappings table and Nexus Watchpoint Mask Register<br />
(WMSK) topic in the e500mc Reference Manual.<br />
37
Trace<br />
Configuration<br />
10. In the left pane of the Trace Configurations dialog box, select RCPM from the P4080 tree control.<br />
The RCPM configurations page appears in the right pane of the dialog box (Figure 2.22).<br />
Figure 2.22 RCPM Configuration Page<br />
a. To enable RCPM triggering, check Enable RCPM Triggering.<br />
The RCPM configuration options are enabled. RCPM passes signals between the cores and the<br />
rest of the chip.<br />
b. Click the Core Groups tab.<br />
The core group configuration options appear. You can use these options to create groups of cores<br />
that can be signaled together.<br />
c. Check the checkboxes <strong>for</strong> the required core corresponding to a core group.<br />
NOTE For more in<strong>for</strong>mation on Core Masks, refer to the Core Group Configuration Registers 0–7<br />
(CGCRn) topic in the P4080 Debug Reference Manual.<br />
d. Click Apply to save the settings.<br />
e. Click the EPU Events (0-3), EPU Events (4-7), EPU Events (8-11), EPU Events (12-15) tabs.<br />
The EPU event configuration options appear (Figure 2.23). These options enable EPU events to<br />
trigger actions in the cores. EPU processes the events that can be sent to different units on the<br />
chip, including the RCPM.<br />
38 Tracing and Analysis Tools User Guide
Figure 2.23 EPU Events Settings<br />
Table 2.11 describes the EPU Events configuration options.<br />
Table 2.11 EPU Events Options<br />
Option Description<br />
Enable EPU Event 0 – 15 Check to enable the event <strong>for</strong> triggering from the<br />
corresponding Sequencing and Combining Unit (SCU) in<br />
the EPU.<br />
When an EPU event is enabled, the corresponding<br />
Passive Action Mask and Core Group options are<br />
enabled.<br />
Passive Action Mask Specify the actions that will occur in the cores while the<br />
trigger is generated.<br />
Core Group Select the core group that the EPU event affects.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
NOTE A core group action control register is provided <strong>for</strong> each event generated by the EPU. For<br />
more in<strong>for</strong>mation, refer to the Core Group Action Control Registers 0–15 <strong>for</strong> EPU Events<br />
39
Trace<br />
Configuration<br />
(CGACREn) and Passive Core Action Assignments topics in the P4080 Debug Reference<br />
Manual.<br />
f. Click Apply to save the settings.<br />
11. In the left pane of the Trace Configurations dialog box, select EPU from the P4080 tree control.<br />
The EPU configuration page appears in the right pane of the dialog box.<br />
a. To enable EPU events, check Enable EPU Events (Figure 2.24).<br />
The Events configuration options are enabled. You can program each Sequencing and Combining<br />
Unit (SCU) to trigger an EPU event.<br />
Figure 2.24 EPU Configuration Page<br />
The table below describes the SCU configuration options. These configuration options remain valid<br />
<strong>for</strong> SCU 0 – SCU 15.<br />
40 Tracing and Analysis Tools User Guide
Table 2.12 SCU Configuration Options<br />
Option Description<br />
Enable SCU Check to enable the SCU unit.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Enable Edge Detect Check <strong>for</strong> the event to be triggered only <strong>for</strong> one clock cycle, when the<br />
input changes to high.<br />
Invert Output Check to invert the event logic at the output.<br />
Enable Trace Check to enable the SCU to generate trace messages.<br />
Enable Input 0 – 3 Check to enable the SCU input <strong>for</strong> processing.<br />
When an SCU input option is enabled, the corresponding Input Source,<br />
Necessary, and Invert Input options are enabled.<br />
Input Source Enter the signal to use <strong>for</strong> the SCU input.<br />
Necessary Check to make the input mandatory.<br />
To create the trigger logic, the mandatory inputs are ANDed together and<br />
then ORed with the other inputs, which are called sufficient inputs.<br />
Invert Input Check to invert the input be<strong>for</strong>e it enters the logic.<br />
NOTE For more in<strong>for</strong>mation on SCU input source signals, refer to the Event Selection Assignments<br />
topic in the P4080 Debug Reference Manual.<br />
b. Click Apply to save the settings.<br />
12. In the left pane of the Trace Configurations dialog box, select DDR, OCeaN, NXC from the P4080<br />
tree control.<br />
The DDR, OCeaN, NXC configuration page appears in the right pane of the dialog box (Figure 2.25).<br />
NXC collects and filters trace from DDR and Ocean.<br />
41
Trace<br />
Configuration<br />
Figure 2.25 DDR, OCeaN, NXC Configuration Page<br />
a. To allow the debug client to send trace through NXC, check Enable NXC Tracing checkbox.<br />
The debug client filters the trace data be<strong>for</strong>e sending it to the collector.<br />
b. In the Timestamps tab, enable timestamp <strong>for</strong> the required event.<br />
c. Click the Ocean tab.<br />
The Ocean configurations options appear in the right pane of the dialog box. The Ocean<br />
configuration allows you to produce trace from the on-chip network. The Ocean configuration<br />
options correspond to the bits in OCDICR0 (Ocean Debug Control register). Ocean tracing<br />
enables Nexus Trace of traffic on the Ocean high speed (Serial Rapid IO/PCI Express) peripheral<br />
I/O interface.<br />
Figure 2.26 Ocean Configuration Page<br />
42 Tracing and Analysis Tools User Guide
d. Configure the Ocean options.<br />
Table 2.13 describes the Ocean tracing configuration options.<br />
Table 2.13 Ocean Configuration Options<br />
Option Description<br />
Enable Ocean Tracing Check to enable Ocean tracing.<br />
Port 0 Verbose Trace Check to enable verbose trace messages <strong>for</strong> trace port0.<br />
Port 0 Trace Source Enabled when Port 0 Verbose Trace is checked.<br />
Select the message source from port 0.<br />
Port 1 Verbose Trace Check to enable verbose trace messages <strong>for</strong> trace port1.<br />
Port 1 Trace Source Enabled when Port 1 Verbose Trace is checked.<br />
Select the message source from port 1.<br />
e. Click the DDR tab.<br />
The DDR configuration page appears.<br />
Figure 2.27 DDR Configuration Page<br />
f. Check the desired DDR trace options (Table 2.14).<br />
Table 2.14 DDR Configuration Options<br />
Option Description<br />
Enable DDR 0 Tracing Enables trace <strong>for</strong> DDR 0.<br />
Verbose Enables verbose trace messages <strong>for</strong> DDR 0.<br />
Enable DDR 1 Tracing Enables trace <strong>for</strong> DDR 1.<br />
Verbose Enables verbose trace messages <strong>for</strong> DDR 1.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
43
Trace<br />
Configuration<br />
g. Choose any one or all of the Hit Gen 1, Hit Gen 2, and Hit Gen 3 tabs to make comparisons and<br />
generate signals that are used <strong>for</strong> filtering.<br />
The respective tab opens with the comparator configurations (Figure 2.28).<br />
Figure 2.28 Hit Gen 1 Tab<br />
h. Use the Trace Source list box to select a trace source as the input <strong>for</strong> the hit generator.<br />
i. Select all or any one of Comparator A, Comparator B, and Comparator C to compare the desired<br />
values.<br />
Comparator A — Check to enable address comparisons. For more in<strong>for</strong>mation on the options<br />
that appear <strong>for</strong> comparator A, refer to Figure 2.29 and Table 2.15.<br />
Comparator B — Check to enable source ID comparisons. For more in<strong>for</strong>mation on the<br />
options that appear <strong>for</strong> comparator B, refer to Figure 2.30 and Table 2.16.<br />
Comparator C — Check to enable transaction attributes comparisons. For more in<strong>for</strong>mation<br />
on the options that appear <strong>for</strong> comparator C, refer to Figure 2.31 and Table 2.17.<br />
44 Tracing and Analysis Tools User Guide
Figure 2.29 Comparator A Settings<br />
Table 2.15 Comparator A Options<br />
Option Description<br />
Compare Mode Select the comparison logic:<br />
Range — If selected, a match occurs when<br />
the transaction address falls within the<br />
values of Compare Address High text box<br />
and Compare Address Low/Mask text box.<br />
Mask — If selected, a match occurs when<br />
the transaction address after being ANDed<br />
with the value in Compare Address Low/<br />
Mask is equal to the value in Compare<br />
Address High text box.<br />
Compare Address High Enter an address <strong>for</strong> comparison.<br />
The address is a range or a value depending on the<br />
comparison mode.<br />
Compare Address Low/Mask Enter an address <strong>for</strong> comparison.<br />
Figure 2.30 Comparator B Settings<br />
Tracing and Analysis Tools User Guide<br />
The address is a range or a mask depending on the<br />
comparison mode.<br />
Trace<br />
Configuration<br />
45
Trace<br />
Configuration<br />
Table 2.16 Comparator B Options<br />
Option Description<br />
Compare Source ID High Enter the highest value of the source ID range <strong>for</strong><br />
comparison.<br />
Compare Source ID Low Enter the lowest value of the source ID range <strong>for</strong><br />
comparison.<br />
Source ID Mask Enter the mask <strong>for</strong> source ID masked comparison.<br />
Source ID Masked Compare<br />
Value<br />
NOTE For more in<strong>for</strong>mation on transaction source IDs, refer to the Global Source and Target IDs<br />
topic in the P4080 Debug Reference Manual.<br />
Figure 2.31 Comparator C Settings<br />
Table 2.17 Comparator C Options<br />
Option Description<br />
Enter the value <strong>for</strong> source ID masked comparison.<br />
Type Exact Match Value 0 Enter a transaction type value <strong>for</strong> exact matching comparison.<br />
Type Exact Match Value 1 Enter a transaction type value <strong>for</strong> exact matching comparison.<br />
Type Mask Enter a mask <strong>for</strong> transaction type masked comparison.<br />
46 Tracing and Analysis Tools User Guide
Table 2.17 Comparator C Options (continued)<br />
Option Description<br />
Type Masked Compare<br />
Value<br />
Event Condition Hit<br />
Generator<br />
Tracing and Analysis Tools User Guide<br />
Enter a value <strong>for</strong> transaction type masked comparison.<br />
Trace<br />
Configuration<br />
Enter the mask values <strong>for</strong> the hit generators.<br />
These values select the hit signals that are ANDed to generate<br />
events. Each hit generator can trigger up to five events.<br />
NOTE The transaction attributes used <strong>for</strong> comparison depend on the trace source (DDR or Ocean)<br />
and on the trace verbosity level selected in the DDR panel as well, provided the trace source is<br />
one of the DDR memory controllers. For more in<strong>for</strong>mation, refer to the HitGen Comparator<br />
Input Variance per Message Source and Type table in the P4080 Debug Reference Manual.<br />
NOTE For more in<strong>for</strong>mation on mask values <strong>for</strong> the hit generators, refer to the HGmCFG1-5 Field<br />
Descriptions table in the P4080 Debug Reference Manual.<br />
j. Click Apply to save the settings.<br />
k. Click Immediate Filters tab.<br />
The Immediate Filters configuration options appear (Figure 2.32). Use the options to enable<br />
filtering of trace messages <strong>for</strong> each NXC trace source. Each debug client that sends trace through<br />
the NXC can have its trace data filtered. The immediate filters, when enabled <strong>for</strong> a client, require<br />
that a trace message meets the filter requirements be<strong>for</strong>e the message is passed on to the collector.<br />
47
Trace<br />
Configuration<br />
Figure 2.32 Immediate Filters Tab<br />
l. To enable filters <strong>for</strong> a client, check from the available filters.<br />
The trace messages that meet the filtering criteria are passed to the collector.<br />
m. Use the respective Filter Signal list box to specify the event condition to be met in order to pass a<br />
trace message.<br />
n. Click Apply to save the settings.<br />
13. In the left pane of the Trace Configurations dialog box, select User-space Process Trace from the<br />
P4080 tree control.<br />
The User-space Trace Process page appears in the right pane of the dialog box. This page allows you<br />
to trace user-space processes. For more details, refer Tracing User Space Processes Selectively. The<br />
User-space Trace Process page is described in Decoder Configuration.<br />
14. Click OK.<br />
The Trace Configurations dialog box closes and the Debug Configurations dialog box is shown.<br />
2.1.2.2 Configuring Trace <strong>for</strong> e6500 Core<br />
The Trace and Profile tab used <strong>for</strong> configuring trace and profile parameters <strong>for</strong> the e6500 core is shown<br />
below. The e6500 core is supported by B4860, B4420, G4860, T4240, and T4160 targets.<br />
48 Tracing and Analysis Tools User Guide
Figure 2.33 Trace and Profile Tab <strong>for</strong> e6500 Core<br />
The table below describes the options of the Trace and Profile tab <strong>for</strong> the e6500 core.<br />
Table 2.18 Trace and Profile Tab Options <strong>for</strong> e6500 Core with Description<br />
Option Sub-option Description<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Overview Tab Displays the architecture of trace showing the<br />
graphical integration of trace and profile<br />
configuration of StarCore SC3900 and PA e6500<br />
cores depending on the target (B4860, B4420,<br />
G4860, T4240, T4160) selected.<br />
NOTE: B-series targets have e6500 and<br />
SC3900 cores and T-series targets have only<br />
e6500 core.<br />
Basic Tab<br />
Trace Scenarios Allows you to select predefined trace scenarios.<br />
49
Trace<br />
Configuration<br />
Table 2.18 Trace and Profile Tab Options <strong>for</strong> e6500 Core with Description (continued)<br />
Option Sub-option Description<br />
Data Acquisition Trace Provides a convenient and flexible mechanism<br />
<strong>for</strong> the debugger to observe the architectural<br />
state of the machine through software<br />
instrumentation in either Internal Debug Mode<br />
(IDM) or External Debug Mode (EDM).<br />
NOTE: IDM provides access to debug<br />
capabilities from resident software running on<br />
the device through memory-mapped registers.<br />
EDM provides full control and visibility from an<br />
off-chip external debugger with or without the<br />
need of a resident software debug agent.<br />
Light Program Trace Traces only subroutine/interrupt call/return<br />
instructions.<br />
Full Program Trace Traces each change of flow instruction.<br />
Full Program and<br />
Ownership Trace<br />
SRIO and PCI Express<br />
Trace<br />
Combines full program trace and ownership<br />
trace. Ownership trace facilitates tracking the<br />
active operating system task by providing<br />
visibility to the special purpose registers<br />
designated <strong>for</strong> use by the OS <strong>for</strong> process ID.<br />
Monitors transactions of Serial RapidIO (SRIO)<br />
and PCI Express interfaces.<br />
DDR Controller Trace Lets you collect Double Data Rate Controller<br />
(DDRC) trace.<br />
Custom Allows you to customize predefined trace<br />
scenarios. Check this option to enable the<br />
Settings button. Click the Settings button to<br />
display the Customize Trace Scenario dialog<br />
box. For details, refer Customizing Trace<br />
Scenarios.<br />
Bandwidth Indicates how many messages are routed in a<br />
trace stream depending on the selected trace<br />
scenario to collect trace. Each default trace<br />
scenario has a specific bandwidth.<br />
You can configure the predefined trace<br />
scenarios using the slider.<br />
Intermediate Tab<br />
50 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
Table 2.18 Trace and Profile Tab Options <strong>for</strong> e6500 Core with Description (continued)<br />
Option Sub-option Description<br />
Mode One buffer Stops trace collection when trace buffer gets<br />
filled.<br />
Overwrite Allows trace buffer to work in wrap mode. When<br />
trace buffer gets full, trace data continues to get<br />
collected overwriting existing data.<br />
Location NPC Buffer Saves trace data in NPC internal buffer.<br />
Trace Control<br />
Settings<br />
Gigabit TAP + Trace Saves trace data collected on the Gigabit TAP<br />
probe in the Aurora buffer.<br />
Note: This feature is not supported on the B4860<br />
target.<br />
Probe buffer size (bytes) Specifies the memory size of the Aurora probe<br />
<strong>for</strong> trace collection. The Aurora probe has a<br />
dedicated memory of 4 GB <strong>for</strong> trace collection.<br />
Magenta Saves trace data in DDR. Magenta is the bus<br />
that transfers trace data from NPC internal buffer<br />
to DDR.<br />
Buffer start address Specifies the start address of the DDR where<br />
trace data is saved.<br />
Buffer size Specifies the DDR memory size of the region<br />
used as trace buffer.<br />
Automatically (When<br />
debug session starts)<br />
Manually (Using debug<br />
toolbar trace buttons)<br />
Allows you to specify trace configuration<br />
settings.<br />
Starts the trace collection process automatically<br />
when the debug session launches.<br />
Lets you control trace collection manually. The<br />
trace collection process will not start until it is<br />
explicitly activated. Use the Start/Stop trace<br />
collection buttons available in the action bar of<br />
the Debug view to control trace collection. For<br />
details, refer Table 2.19.<br />
You can collect trace within a specific section of<br />
the program (by using debugger breakpoints).<br />
51
Trace<br />
Configuration<br />
Table 2.18 Trace and Profile Tab Options <strong>for</strong> e6500 Core with Description (continued)<br />
Option Sub-option Description<br />
SRIO and PCI<br />
Express Trace<br />
Configuration<br />
DDR Controller<br />
Trace Configuration<br />
Port #0/Port #1 Emits trace messages about PCI and SRIO<br />
transactions.<br />
Source Is the module that initiates the PCI and SRIO<br />
transaction.<br />
Save Bandwidth Saves bandwidth by filtering out data messages.<br />
The trace will continue to monitor transactions<br />
(request/response messages).<br />
Enable DDRC0/DDRC1/<br />
DDRC2 Trace<br />
Allows you to enable three DDR controllers that<br />
can be traced separately.<br />
Mode Lets you select one of the following trace modes:<br />
Verbose — provides maximum<br />
in<strong>for</strong>mation in trace as allowed by the<br />
protocol.<br />
Terse1/2/3 — provides less trace<br />
in<strong>for</strong>mation as compared to Verbose<br />
mode. This mode saves bandwidth as<br />
less data means smaller packets<br />
which results in less load on the bus.<br />
Each Terse mode provides less trace<br />
in<strong>for</strong>mation than another. The trace<br />
in<strong>for</strong>mation provides in Terse1 mode ><br />
Terse2 mode > Terse3 mode.<br />
Depending on how much trace can be<br />
generated, you can choose to get<br />
more or less in<strong>for</strong>mation along with the<br />
granularity.<br />
NOTE Full Program Trace and Light Program Trace are mutually exclusive. Data trace is used in<br />
its inclusive range mode, and it is currently tracing store operations only. There<strong>for</strong>e, the Data<br />
Trace option enables the configuration of the Start Address and Stop Address options which<br />
can be given as hexadecimal values.<br />
52 Tracing and Analysis Tools User Guide
2.1.2.2.1 Customizing Trace Scenarios<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
The Customize Trace Scenario dialog box allows you to customize trace scenarios to collect trace on the<br />
e6500 core by combining different trace scenarios. The Customize Trace Scenario dialog box appears on<br />
clicking the Settings button in the Basic tab of the Trace and Profile page.<br />
Figure 2.34 Customize Trace Scenario Dialog Box<br />
The Customize Trace Scenario dialog box displays the following options:<br />
Full Program Trace — Lets you trace each change of flow instruction.<br />
Ownership Trace — Lets you trace in<strong>for</strong>mation on process ID by tracking the active operating<br />
system.<br />
SRIO and PCI Express Trace — Lets you trace transactions of SRIO and PCI Express interfaces,<br />
which are used to transfer large amounts of data between processors.<br />
DDR Controller Trace — Lets you collect Double Data Rate Controller (DDRC) trace.<br />
Data Acquisition Trace — Lets you analyse the architectural state of the machine through software<br />
instrumentation in either IDM or EDM mode.<br />
Data Trace — Lets you collect trace of selected memory reads and writes. Data trace is collected on<br />
the memory addresses. You can specify the Start Address and Stop Address of the memory<br />
between which you want the data trace to be collected.<br />
53
Trace<br />
Configuration<br />
2.1.2.2.2 Collecting Trace on Attach Configuration<br />
The Attach configuration is supported on the e6500 core (supported by B4860, B4420, T4240, and T4160<br />
targets) <strong>for</strong> trace collection. The Attach launch configuration is useful when you want to connect to a<br />
running target without resetting the target or downloading a different application on it. For more<br />
in<strong>for</strong>mation on Attach launch configuration, refer to the <strong>Power</strong> <strong>Architecture</strong> Processors Version 10.x<br />
Targeting Manual in the folder: \PA\Help\PDF.<br />
To configure your application <strong>for</strong> trace collection (on the e6500 core) using the Attach launch<br />
configuration:<br />
1. Create a project with the Attach launch configuration using the <strong>CodeWarrior</strong> Bareboard Project<br />
Wizard.<br />
a. From the IDE menu bar, select File > New > <strong>CodeWarrior</strong> Bareboard Project Wizard.<br />
b. Enter a name <strong>for</strong> the new project in the Project Name text box.<br />
c. Click Next and select the required B4 or T4 processor in the Processors page.<br />
d. Click Next and check the Attach checkbox in the Debug Target Settings page. Choose the<br />
Default option to create an Attach configuration based on default parameters.<br />
Figure 2.35 Creating Attach Launch Configuration in Debug Target Settings Page<br />
54 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Configuration<br />
e. Select the required Connection Type and click Next.<br />
f. Follow the remaining steps of the wizard and click Finish.<br />
2. Build the project.<br />
3. Select Run > Debug Configurations to open the Debug Configurations dialog box.<br />
4. Expand <strong>CodeWarrior</strong> in the left pane of the dialog box and select the Attach launch configuration<br />
corresponding to your project.<br />
Figure 2.36 Selecting Attach Launch Configuration<br />
NOTE The Attach configuration assumes that code is already running on the board and there<strong>for</strong>e does<br />
not run a target initialization file. There<strong>for</strong>e, when attach launches are used, ensure that the<br />
target is already running.<br />
5. In the Main tab of the dialog box, make sure that Attach is selected in the Debug Session Type<br />
group.<br />
6. Open the Trace and Profile tab.<br />
7. Select the required trace scenarios and settings and click Apply.<br />
8. Collect trace as described in Collecting Data.<br />
55
Trace<br />
Collecting Data<br />
2.2 Collecting Data<br />
Now that a project is created and a launch configuration and trace configuration defined, you can start a<br />
debug session and start collecting trace data.<br />
To collect trace data:<br />
1. In the Debug Configurations dialog box, click Debug.<br />
The IDE switches to the Debug perspective; the debugger downloads your program to the P4080DS<br />
development board and halts execution at the first statement of main().<br />
In the editor view (center-left of perspective), the program counter icon on the marker bar points to<br />
the next statement to be executed (Figure 2.37).<br />
Figure 2.37 Debug Perspective<br />
56 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Collecting Data<br />
2. In the Debug view, click Resume .<br />
The data collection starts. The debugger executes all statements, the program writes the strings in the<br />
Console view and then enters an infinite loop. Once tracing starts, the progress bar in the Progress<br />
(Window > Show View > Other > General > Progress) view indicates the collection status and buffer<br />
contents based on the in<strong>for</strong>mation reported by the probe or target (Figure 2.38). The progress bar<br />
disappears after trace collection completes.<br />
NOTE Some combinations of probe and target may not result in a useful "percent full" indication.<br />
Figure 2.38 Trace Collection Status Indication<br />
3. Let the application run <strong>for</strong> several seconds.<br />
NOTE To cancel an active collection task from the progress view, click .<br />
4. In the Debug view, click Terminate .<br />
The program terminates and the debug session ends. The trace event data collects at:<br />
\Hello_World\.Analysis Data, where Hello_World is the name of the<br />
project folder you created and is your working directory.<br />
In previous versions of the <strong>Power</strong> <strong>Architecture</strong> 10.x product, tracing was configured only at the launch<br />
time, collected only when the program first resumed, and saved only when the debug session was<br />
terminated. Tracing could only be stopped by canceling the collection task, or by terminating the debug<br />
session.<br />
The new GUI buttons and menus make these actions available to the user at any appropriate time <strong>for</strong> any<br />
selected debug target.<br />
The trace controls (Table 2.19) are available on the action bar in the Debug perspective (Figure 2.39).<br />
These trace commands apply to the selected debug targets in the Debug view. They are enabled only<br />
when the selected target is in an appropriate state.<br />
57
Trace<br />
Collecting Data<br />
Figure 2.39 Debug Perspective<br />
Table 2.19 Trace Controls<br />
Controls Name Description<br />
Start Trace Session Allows you to launch a trace session.<br />
Clicking on the left side of the button<br />
launches a new trace Session using the<br />
default trace configuration. Clicking on<br />
the right side of the button shows a dropdown<br />
list of the available trace<br />
configurations.<br />
Start Trace Session<br />
drop-down list<br />
Provides immediate access to the trace<br />
configurations associated with the current<br />
launch configuration as well as access to<br />
the Trace Configurations dialog box.<br />
The available profiles can only be applied<br />
while the target is connected but not<br />
collecting trace currently. The dialog box<br />
is available at any time.<br />
An active session is marked with a<br />
checkbox, while the default trace<br />
configuration is marked with [default].<br />
Clicking on one of the configurations<br />
launches a new trace session, replacing<br />
an existing one if it exists.<br />
58 Tracing and Analysis Tools User Guide
Table 2.19 Trace Controls (continued)<br />
Controls Name Description<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Collecting Data<br />
Start Trace Collection Starts the collection of trace data. This<br />
button is enabled if a trace session is<br />
active and no trace collection or trace<br />
upload is ongoing. It is always disabled if<br />
you have selected The application<br />
configures the target and enables<br />
trace collection option in the Trace and<br />
Profile tab.<br />
Stop Trace Collection Stops an ongoing trace collection. This<br />
button does not cancel the trace, and if<br />
you have selected the automatic upload<br />
and display of trace configured in your<br />
launch configuration, then whatever trace<br />
has been collected will be uploaded and<br />
displayed.<br />
This button is available only when trace is<br />
being collected. However, the button<br />
appear disabled in case you are<br />
collecting program trace where buffer is<br />
small and fills instantaneously. The<br />
button is also disabled if you have<br />
selected The application configures<br />
the target and enables trace collection<br />
option in the Trace and Profile tab.<br />
Upload Trace Upload/saves the collected trace data to<br />
a file on the host system. It is only<br />
available when tracing has been stopped<br />
and data has been collected.<br />
After uploading, the button becomes<br />
disabled. The button is always enabled if<br />
The application configures the target<br />
and enables trace collection option is<br />
selected, and it depends on when you<br />
want to upload trace data relative to your<br />
application's execution.<br />
NOTE The button behavior is affected by the settings in the Trace and Profile tab of the launch<br />
configuration associated with the currently selected target. As a result, some buttons may not<br />
ever be enabled <strong>for</strong> that target.<br />
59
Trace<br />
Viewing Data<br />
2.3 Viewing Data<br />
This topic describes:<br />
Software Analysis View<br />
Finding and Filtering Trace Data<br />
Exporting Trace Data<br />
Configuring Time Unit<br />
2.3.1 Software Analysis View<br />
The Software Analysis view appears automatically if you have chosen to display the trace results<br />
automatically. You can manually open the Software Analysis view by selecting Window > Show View<br />
> Software Analysis in the <strong>CodeWarrior</strong> IDE menu bar.<br />
Figure 2.40 Software Analysis View<br />
The Software Analysis view provides hyperlinks to the following results:<br />
Trace<br />
Critical Code<br />
Per<strong>for</strong>mance Data<br />
Call Tree<br />
Nexus Messages<br />
The Software Analysis view toolbar provides the following actions.<br />
60 Tracing and Analysis Tools User Guide
Table 2.20 Software Analysis — Toolbar Options<br />
Option Description<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
The Software Analysis view context menu, which appears on right-click, provides the following actions.<br />
Table 2.21 Software Analysis — Context Menu Options<br />
2.3.1.1 Trace<br />
Refreshes the displayed data.<br />
Expands all the nodes.<br />
Collapses all the nodes.<br />
Lets you import an external <strong>for</strong>mat of trace into your project.<br />
Option Description<br />
Refresh Refreshes the displayed data.<br />
Expand All Expands all the nodes.<br />
Collapse All Collapses all the nodes.<br />
Import Data<br />
From Txt<br />
Lets you import an external <strong>for</strong>mat of trace into your project.<br />
Copy Cell Copies the currently selected cell. The name of the data source is<br />
copied to the clipboard.<br />
Copy Line Copies the complete line of the data source.<br />
Save Results Saves the trace results.<br />
Delete Results Deletes all the saved results.<br />
To view trace data:<br />
1. In the Software Analysis view, expand the project name.<br />
All trace collections per<strong>for</strong>med <strong>for</strong> the project are displayed.<br />
2. Click the Trace hyperlink, and view the trace data in the Trace Editor.<br />
61
Trace<br />
Viewing Data<br />
Figure 2.41 Trace Editor<br />
The Trace Editor displays the decoded trace event data generated during the data collection phase. The<br />
data is organized in a way to ease the evaluation of tracing in<strong>for</strong>mation and navigation through the events<br />
in the sequence they were logged. This data can be very complex, and the size of the decoded data can be<br />
very large, up to approximately 40 GB. The Trace Editor is constrained by the size of the decoded data.<br />
Currently, the SAE can iterate over a maximum of 2^32 items of raw Nexus trace. Each item of<br />
undecoded trace can be associated with zero, one, or multiple decoded trace events.<br />
The Trace Editor displays the source code and corresponding linear instructions, or non-executed branch<br />
instructions, which have occurred since the last program trace event of the same trace source. The source<br />
of the trace event is displayed in the Source sub-column, and the destination of the change of flow<br />
instruction is displayed in the Target sub-column of Call/Branch column.<br />
The Trace Editor displays the collected trace data in a tabular <strong>for</strong>m. You can move the columns to the<br />
left or right of another column by dragging and dropping.<br />
Table 2.22 describes the Trace Data viewer fields.<br />
Table 2.22 Trace Events View Fields<br />
Field Description<br />
Index The first number in the index specifies the Nexus Message from which<br />
the trace event has been decoded. The second number specifies the<br />
number of the decoded event, since each Nexus Message can<br />
generate 0 to n decoded events. If Nexus Messages are shown, they<br />
appear with a second index value of 0. Any decoded events always<br />
appear beginning with a second index value of 1.<br />
Event Source Specifies the trace source that produced the event, such as the Nexus<br />
client and trace probe device.<br />
Description Displays detailed in<strong>for</strong>mation about the trace line.<br />
Source Displays the source function of the trace line if it is a call or a branch.<br />
62 Tracing and Analysis Tools User Guide
Table 2.22 Trace Events View Fields (continued)<br />
Field Description<br />
Target Displays the target function of the trace line if it is a call or a branch.<br />
Type Specifies the type of event that has occurred, such as Info, Branch,<br />
Error, Function Return and Function Call.<br />
Timestamp Specifies the timestamp value that is expressed as clock ticks.<br />
Depending on the configuration of the trace source, this can be<br />
relative to the event's trace source or relative to all events logged from<br />
all sources.<br />
You can per<strong>for</strong>m the following actions from the Trace Editor:<br />
Click the navigation buttons available to move between the trace data.<br />
– Click to go to the beginning of trace data<br />
– Click to go to the previous trace entry<br />
– Click to go to the next trace entry<br />
– Click to go to the end of trace data<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
Click the Expand All button to display the source as well as assembly code of the instructions<br />
in the trace viewer.<br />
Click the Collapse All button to display the assembly code only.<br />
Click the Show Nexus Messages button to display the Nexus messages in the Trace Editor.<br />
For more in<strong>for</strong>mation, refer to the Nexus Messages topic.<br />
Click to search <strong>for</strong> particular events or categories of events within the current trace data set and<br />
filter the trace data based on certain criteria. For more in<strong>for</strong>mation, refer to the Finding and Filtering<br />
Trace Data topic.<br />
Click to export trace data to a CSV (Comma Separated Values) file. For more in<strong>for</strong>mation,<br />
refer to the Exporting Trace Data topic.<br />
2.3.1.1.1 Customizing Trace Data Viewer<br />
You can modify the appearance or display of the trace results on the Trace Editor. Right-click on a<br />
column to open a context menu that lets you per<strong>for</strong>m the following actions:<br />
63
Trace<br />
Viewing Data<br />
Hide column — Allows you to hide column(s). To hide a column on the Trace Events view, select<br />
that column, right-click and select the Hide column option from the context menu. To display it<br />
back, select the Show all columns option from the context menu. To hide multiple columns, select<br />
the columns with Ctrl key pressed, right-click and select the Hide column option from the context<br />
menu.<br />
Create column group — Allows you to group multiple columns into one. Grouping columns allows<br />
you to per<strong>for</strong>m a set of operations to a number of columns grouped together in one go. To group<br />
columns, select the columns with Ctrl key pressed. Right-click and select the Create column group<br />
option. The Create Column Group dialog box appears (Figure 2.42).<br />
Figure 2.42 Create Column Group<br />
Type a name <strong>for</strong> the group in the Group Name text box and click Group. Figure 2.43 shows the Event<br />
Source and Description columns grouped together.<br />
Figure 2.43 Columns Grouping<br />
Ungroup columns — To ungroup the columns, select the grouped columns, right-click and select the<br />
Ungroup columns option from the context menu.<br />
Choose columns — You can set the columns that you want to display in the Trace Events view.<br />
Right-click on any column and select the Choose columns option. The Column Chooser dialog<br />
box appears (Figure 2.44).<br />
64 Tracing and Analysis Tools User Guide
Figure 2.44 Column Chooser<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
Select the column in the Selected Columns section, and use the up and down arrow buttons to position<br />
the column up or down according to your choice. Use the left and right arrow buttons to move the<br />
columns to Available Columns from Selected Columns. The columns moved to the Available<br />
Columns section are not shown in the Trace Events view. Click Done to save the settings.<br />
Auto resize column — Select the columns, right-click and select the Auto resize columns option to<br />
resize them according to their width.<br />
Rename column — Select the column, right-click and select the Rename column option. The<br />
Rename Column dialog box appears. Type a new name <strong>for</strong> the column in the Rename text box and<br />
click OK (Figure 2.45).<br />
Figure 2.45 Rename Column<br />
2.3.1.2 Critical Code<br />
To view critical code data:<br />
1. In the Software Analysis view, expand the project name.<br />
All trace collections per<strong>for</strong>med <strong>for</strong> the project are displayed.<br />
2. Click the Critical Code hyperlink.<br />
The Critical Code viewer appears.<br />
65
Trace<br />
Viewing Data<br />
Figure 2.46 Critical Code Viewer<br />
The Critical Code viewer allows you to analyze the flat profile of your application either at a functional<br />
level or at a file level. The Critical Code viewer divides the critical code data in two tabs: Critical Code<br />
and File Coverage.<br />
2.3.1.2.1 Critical Code Tab<br />
The Critical Code tab displays data into two views; the top view displays the summary of the functions,<br />
and the bottom view displays the statistics <strong>for</strong> all the instructions executed in a particular function.<br />
The table below describes the fields of the top view. The columns are movable; you can drag and drop the<br />
columns to move them according to your requirements.<br />
Table 2.23 Critical Code Tab — Description of Fields<br />
Name Description<br />
Address Displays the start address of the function.<br />
Function Displays the name of the function that has executed.<br />
Coverage % Displays the percentage of number of assembly instructions executed<br />
from the total number of assembly instructions in a function.<br />
ASM<br />
Decision<br />
Coverage %<br />
Displays the decision coverage computed <strong>for</strong> direct and indirect<br />
conditional branches. It is the mean value of the individual decision<br />
coverages. So if a function has two conditional instructions, one with<br />
100% and another with 50% decision coverage, the decision coverage<br />
would be (100 + 50) / 2 = 75% . It is calculated only <strong>for</strong> assembly<br />
instructions and not <strong>for</strong> C source code.<br />
ASM Count Displays the number of lines executed in the function.<br />
66 Tracing and Analysis Tools User Guide
Table 2.23 Critical Code Tab — Description of Fields<br />
Name Description<br />
Time (CPU<br />
Cycles)<br />
Displays the total number of clock cycles that the function takes.<br />
Size Displays the number of bytes required by each function.<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
Click a hyperlinked function in the top view of the Critical Code viewer to view the corresponding<br />
statistics <strong>for</strong> the instructions executed in that function. For example, the statistics of the main() function<br />
are shown in the figure below.<br />
Figure 2.47 Statistics of Critical Code Data<br />
The table below describes the fields of the statistics of the critical code data.<br />
Table 2.24 Description of Statistics of Critical Code Data<br />
Name Description<br />
Line/Address Displays either the line number <strong>for</strong> each instruction in the source<br />
code or the address <strong>for</strong> the assembly code.<br />
Instruction Displays all the instructions executed in the selected function.<br />
Coverage % For C source lines, displays the percentage of number of<br />
assembly instructions executed from the total number of assembly<br />
instructions corresponding to the source line. For assembly source<br />
lines, it shows if the instructions were executed or not.<br />
67
Trace<br />
Viewing Data<br />
Table 2.24 Description of Statistics of Critical Code Data<br />
Name Description<br />
ASM Decision<br />
Coverage<br />
Displays the decision coverage computed <strong>for</strong> direct and indirect<br />
conditional branches. It is the mean value of the individual<br />
decision coverages. So if a function has two conditional<br />
instructions, one with 100% and another with 50% decision<br />
coverage, the decision coverage would be (100 + 50) / 2 = 75% . It<br />
is calculated only <strong>for</strong> assembly instructions and not <strong>for</strong> C source<br />
code.<br />
ASM Count Displays the number of times each instruction is executed.<br />
Time Displays the total number of clock cycles that each instruction in<br />
the function takes.<br />
Click the column header to sort the critical code data by that column. However, you can only sort the<br />
critical code data available on the top view. The table below lists the buttons available in the statistics<br />
view of the Critical Code tab.<br />
Table 2.25 Buttons Available in Statistics View of Critical Code Tab<br />
Name Button Description<br />
Search Lets you search <strong>for</strong> a particular text in the statistics view.<br />
In the Search text box, type the data that you want to<br />
search and click the Search button. The first instance of<br />
the data is selected in the statistics view. Click the button<br />
again or press the Enter key to view the next instances of<br />
the data.<br />
Previous<br />
function<br />
Lets you view the details of the previous function that<br />
was selected in the bottom view be<strong>for</strong>e the currently<br />
selected function. Click it to view the details of the<br />
previous function.<br />
Next function Lets you view the details of the next function that was<br />
selected in the bottom view.<br />
NOTE: The Previous and Next buttons are contextual<br />
and go to previous/next function according to the history<br />
of selections. So if you select a single line in the view,<br />
these buttons will be disabled because there is no<br />
history.<br />
68 Tracing and Analysis Tools User Guide
Table 2.25 Buttons Available in Statistics View of Critical Code Tab<br />
Name Button Description<br />
Export Lets you export the critical code data of both top and<br />
bottom views in a CSV file. Click the button and select<br />
the Export the statistics above option to export the<br />
details of the top view or the Export the statistics below<br />
option to export the details of the bottom view<br />
respectively.<br />
Configure<br />
table<br />
2.3.1.2.2 File Coverage Tab<br />
Tracing and Analysis Tools User Guide<br />
Lets you show and hide column(s) of the critical code<br />
data. Click the button and select the Configure the table<br />
above option to show/hide columns of the top view or the<br />
Configure the table below option to show/hide columns<br />
of the bottom view. The Drag and drop to order<br />
columns dialog box appears in which you can check/<br />
clear the checkboxes corresponding to the available<br />
columns to show/hide them in the Critical Code viewer.<br />
The option also allows you to set CPU frequency and set<br />
time in cycles, milliseconds, microseconds, and<br />
nanoseconds. For details, refer to the Configuring Time<br />
Unit topic.<br />
Graphics Lets you display the histograms in two colors <strong>for</strong> the CPU<br />
Cycles and ASM Count columns in the bottom view of<br />
the critical code data. Click the button and select the<br />
Assembly/Source > ASM Count or Assembly/Source<br />
> Time option to display histograms in the ASM Count or<br />
Time column. You can also display histograms <strong>for</strong><br />
Coverage % column as well. The colors in these<br />
columns differentiate source code with the assembly<br />
code.<br />
Show code Lets you display the assembly, source or mixed code in<br />
the statistics of the critical code data.<br />
Trace<br />
Viewing Data<br />
The File Coverage tab displays in<strong>for</strong>mation about the lines executed from each file or the functions<br />
executed <strong>for</strong>m each library in the application.<br />
Click the File Coverage tab to display the file coverage data.<br />
69
Trace<br />
Viewing Data<br />
Figure 2.48 File Coverage Tab<br />
The table below describes the fields of the file coverage data.<br />
Table 2.26 Description of File Coverage Data<br />
Name Description<br />
Name Displays the name of the file.<br />
Number of Lines Displays the size of the file in number of lines present in the file.<br />
Lines Executed Displays the number of lines executed in the file.<br />
Coverage % Displays the percentage of number of lines executed compared to<br />
the total number of lines, that is (lines executed / number<br />
of lines) * 100.<br />
You can per<strong>for</strong>m the Export and Configure table actions on the file coverage data.<br />
2.3.1.3 Per<strong>for</strong>mance Data<br />
To view per<strong>for</strong>mance data:<br />
1. In the Software Analysis view, expand the project name.<br />
All trace collections per<strong>for</strong>med <strong>for</strong> the project are displayed.<br />
2. Click the Per<strong>for</strong>mance hyperlink.<br />
The Per<strong>for</strong>mance viewer appears.<br />
70 Tracing and Analysis Tools User Guide
Figure 2.49 Per<strong>for</strong>mance Viewer<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
The Per<strong>for</strong>mance viewer is divided into two views:<br />
The top view presents function per<strong>for</strong>mance data in the Function Per<strong>for</strong>mance table. It displays the<br />
count and invocation in<strong>for</strong>mation <strong>for</strong> each function that executes during the measurement, enabling<br />
you to compare the relative data <strong>for</strong> various portions of your target program. The in<strong>for</strong>mation in the<br />
Function Per<strong>for</strong>mance table can be sorted by column in ascending or descending order. Click the<br />
column header to sort the corresponding data. Table 2.27 below describes the fields of the Function<br />
Per<strong>for</strong>mance table.<br />
The bottom view or the Call Site Per<strong>for</strong>mance table presents call pair data <strong>for</strong> the function selected<br />
in the Function Per<strong>for</strong>mance table. It displays call pair relationships <strong>for</strong> the selected function, that is<br />
which function called which function. Each function pair consists of a caller and a callee. The<br />
percent caller and percent callee data is also displayed graphically. The functions are represented in<br />
different colors in the pie chart, you can move the mouse cursor over the color to see the<br />
corresponding function. Table 2.28 describes the fields of the Call Site Per<strong>for</strong>mance table. You<br />
cannot sort the columns of this table.<br />
Table 2.27 Field Description of Function Per<strong>for</strong>mance Table<br />
Name Description<br />
Function Name Name of the function that has executed.<br />
Num Calls Number of times the function has executed.<br />
71
Trace<br />
Viewing Data<br />
Table 2.27 Field Description of Function Per<strong>for</strong>mance Table<br />
Name Description<br />
Inclusive Cumulative metric count during execution time spent from function entry to<br />
exit.<br />
Min Inclusive Minimum metric count during execution time spent from function entry to<br />
exit.<br />
Max Inclusive Maximum metric count during execution time spent from function entry to<br />
exit.<br />
Avg Inclusive Average metric count during execution time spent from function entry to<br />
exit.<br />
Percent Inclusive Percentage of total metric count spent from function entry to exit.<br />
Exclusive Cumulative metric count during execution time spent within function.<br />
Min Exclusive Minimum metric count during execution time spent within function.<br />
Max Exclusive Maximum metric count during execution time spent within function.<br />
Avg Exclusive Average metric count during execution time spent within function.<br />
Percent Exclusive Percentage of total metric count spent within function.<br />
Percent Total Calls Percentage of the calls to the function compared to the total calls.<br />
Code Size Number of bytes required by each function.<br />
Table 2.28 Field Description of Call Site Per<strong>for</strong>mance Table<br />
Name Description<br />
Caller Name of the calling function.<br />
Callee Name of the function that is called by the calling function.<br />
Num Calls Number of times the caller called the callee.<br />
Inclusive Cumulative metric count during execution time spent from function entry to<br />
exit.<br />
Min Inclusive Minimum metric count during execution time spent from function entry to<br />
exit.<br />
72 Tracing and Analysis Tools User Guide
Table 2.28 Field Description of Call Site Per<strong>for</strong>mance Table<br />
Name Description<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
Max Inclusive Maximum metric count during execution time spent from function entry to<br />
exit.<br />
Avg Inclusive Average metric count during execution time spent from function entry to<br />
exit.<br />
Percent Callee Percent of total metric count during the time the selected function is the<br />
caller of a specific callee. The data is also shown in the Caller pie chart.<br />
Percent Caller Percent of total metric count during the time the selected function is the<br />
callee of a specific caller. The data is also shown in the Callee pie chart.<br />
Call Site Address from where the function was called.<br />
You can move the columns to the left or right of another column by dragging and dropping. You can<br />
per<strong>for</strong>m the Export and Configure table actions on the per<strong>for</strong>mance data similar to critical code data. You<br />
can also view the previous and next functions of the per<strong>for</strong>mance data using the icons available in the<br />
lower section of the Per<strong>for</strong>mance viewer. For details on these icons, refer to Table 2.25.<br />
2.3.1.4 Call Tree<br />
To view call tree data:<br />
1. In the Software Analysis view, expand the project name.<br />
All trace collections per<strong>for</strong>med <strong>for</strong> the project are displayed.<br />
2. Click the Call Tree hyperlink.<br />
The Call Tree viewer appears.<br />
73
Trace<br />
Viewing Data<br />
Figure 2.50 Call Tree Viewer<br />
In the Call Tree viewer, START is the root of the tree. You can click “+” to expand the tree and “-” to<br />
collapse the tree. It shows the biggest depth <strong>for</strong> stack utilization in Call Tree and the functions on this<br />
call path are displayed in green color.<br />
The Call Tree nodes are synchronized with the source code. You can double-click the node to view the<br />
source code.<br />
The table below describe the fields of Call Tree data. The columns are movable; you can move the<br />
columns to the left or right of another column by dragging and dropping.<br />
Table 2.29 Call Tree Viewer Fields<br />
Name Description<br />
Function Name Name of function that has executed.<br />
Num Calls Number of times function has executed.<br />
% Total calls of parent Percent of number of function calls from total number of<br />
calls in the application.<br />
% Total times it was<br />
called<br />
Percent of number of times a function was called.<br />
Inclusive Time Cumulative count during execution time spent from<br />
function entry to exit.<br />
You can set CPU frequency and set Inclusive Time displayed in the Call Tree viewer in cycles,<br />
milliseconds, microseconds, and nanoseconds. Click the Configure Table button to configure time unit<br />
and set CPU frequency. For more in<strong>for</strong>mation, refer to the Configuring Time Unit topic.<br />
74 Tracing and Analysis Tools User Guide
2.3.1.5 Nexus Messages<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
For QorIQ, trace is stored in the <strong>for</strong>m of Nexus messages. Normally, these messages are translated to<br />
higher-level trace events that are displayed in the Trace Editor. The Nexus messages themselves can<br />
also be seen in the Nexus Messages view.<br />
This topic describes:<br />
Nexus Messages View<br />
Nexus Messages in Trace Editor<br />
2.3.1.5.1 Nexus Messages View<br />
Click the Nexus Messages hyperlink in the Software Analysis view to open the Nexus Messages view.<br />
Figure 2.51 Nexus Messages View<br />
The Nexus Messages view contains the following fields.<br />
Table 2.30 Nexus Messages View Fields Description<br />
Name Description<br />
Timestamp Specifies the timestamp value that is expressed as clock ticks.<br />
Source Specifies the trace source that produced the event.<br />
Type Specifies the Nexus Message type as encoded in the TCODE.<br />
Details Displays detailed in<strong>for</strong>mation of the Nexus fields <strong>for</strong> each Nexus<br />
Message type. It includes a Nexus Message index in parenthesis <strong>for</strong><br />
easy correlation with the Trace Editor.<br />
NOTE You can also open the Nexus Messages view by selecting Window > Show View > Other ><br />
Software Analysis > Nexus Messages.<br />
75
Trace<br />
Viewing Data<br />
2.3.1.5.2 Nexus Messages in Trace Editor<br />
To display Nexus messages in the Trace Editor, click the Show Nexus Messages button available in the<br />
toolbar of the Trace Editor. Figure 2.52 shows the Trace Editor displaying Nexus messages.<br />
Figure 2.52 Trace Editor Displaying Nexus Messages<br />
The indices in the Index column are shown in pairs. The left number corresponds to the Nexus Message<br />
number. For the right number, 0 is used <strong>for</strong> the actual Nexus Message, while 1- n are used <strong>for</strong> the trace<br />
events derived from the Nexus Message. The rest of the fields are same as the fields of the Trace Editor.<br />
To hide the Nexus messages, click the Show Nexus Messages button again.<br />
2.3.2 Finding and Filtering Trace Data<br />
You can find and filter the trace data displayed in the Trace Events view. Click the button to find a<br />
particular set of events that define a set of criteria <strong>for</strong> filtering desired events within the current trace data<br />
set (Figure 2.53).<br />
76 Tracing and Analysis Tools User Guide
Figure 2.53 Find and Filter Dialog Box<br />
To find events in trace data:<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
1. On the Trace Editor toolbar, click the Find and Filter button to open the Event Find window<br />
and type the text you want to find in the Find textbox.<br />
2. Click the Advanced button if you wish to specify a search criteria <strong>for</strong> your entry.<br />
3. Double-click on one of the fields in the list box <strong>for</strong> defining your search criteria and add the entry to<br />
the textbox next to Advanced button.<br />
4. Select an operator from the list box. For numerical fields, standard equivalency operators are provided<br />
(<strong>for</strong> example, =, >, !=, depending upon the field). For text fields, Contains, Doesn-t-contain, Doesnt-equal,<br />
and Equals operators are provided:<br />
Contains — tests that the character string entered is contained in the field value.<br />
Doesn-t-contain — tests that the character string entered is not contained in the field value.<br />
Doesn-t-equal — tests that the character string entered does not exactly match the string in the field<br />
value.<br />
Equals — tests that the character string entered exactly matches the string in the field value.<br />
5. Select the value <strong>for</strong> comparison by typing in the Value field.<br />
6. If you want to add more fields to the search expression, define another entry.<br />
7. Repeat the steps to add additional fields to the search expression.<br />
8. Click FIND (F3). The focus in the data will move to the first event that matches the search<br />
expression.<br />
9. Press F3 on your keyboard to locate the next event that matches the search expression.<br />
A search <strong>for</strong> events matching the specified criteria is initiated. Every click on Find will move the<br />
cursor to the next event searched in the Trace Events view according to the criteria specified.<br />
77
Trace<br />
Viewing Data<br />
The search starting point is determined by the currently selected cell in the Trace Events view and the<br />
search direction. If no cell is currently selected then the search starts at the beginning of the trace data if<br />
the search direction is <strong>for</strong>ward, or at the end of the trace data if the search direction is backward.<br />
If a cell is currently selected then the search begins in the row immediately after the selected row if the<br />
search direction is <strong>for</strong>ward, or in the row immediately preceeding the selected row if the search direction<br />
is backward.<br />
NOTE Similar to filtering, you can add appropriate logical operators to the compare expression while<br />
specifying a criteria <strong>for</strong> locating a particular set of data.<br />
To filter events:<br />
1. Per<strong>for</strong>m steps 2–7 of Finding and Filtering Trace Data to specify the criteria <strong>for</strong> filtering a particular<br />
data. For example, to filter the data where Type is equal to Info.<br />
Figure 2.54 Specifying Criteria <strong>for</strong> Filtering<br />
2. Click Filter.<br />
The data will be filtered to show only the data that matches the filter expression.<br />
Figure 2.55 Filtered Data Results<br />
78 Tracing and Analysis Tools User Guide
2.3.3 Exporting Trace Data<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Viewing Data<br />
You can export trace data to a CSV file. The Exporting Trace Data dialog box appears on clicking the<br />
button (Figure 2.56). The Exporting Trace Data dialog box lets you define a set of criteria <strong>for</strong><br />
exporting desired trace data to a CSV file.<br />
The CSV file <strong>for</strong>mat is supported <strong>for</strong> import to common spreadsheet applications. It contains the event<br />
names and values of the collected samples.<br />
Figure 2.56 Exporting Trace Data<br />
To export trace data to a CSV file:<br />
1. Select one of the following options in the Exporting Trace Data dialog box<br />
Export Full Trace — Allows you to export the entire trace data to the CSV file.<br />
Export Partial Trace — Allows you to export the desired trace data to the CSV file depending on the<br />
indices selected in the Begin index and End index text boxes. The trace data falling between the<br />
Begin index and End index will be exported to the CSV file.<br />
2. Click OK.<br />
The Export Trace Data to CSV dialog box appears.<br />
79
Trace<br />
Viewing Data<br />
Figure 2.57 Export Trace Data to CSV<br />
3. Browse to the location where you want to save the trace data and click Save.<br />
2.3.4 Configuring Time Unit<br />
The Configure Time Unit option allows you to set CPU frequency and convert the clock cycles into real<br />
time in milliseconds, microseconds, or nanoseconds. Click this button and select the Configure Time<br />
Unit option. To convert the clock cycles into milliseconds, microseconds, or nanoseconds, select the<br />
corresponding option.<br />
Figure 2.58 Configuring Time Unit<br />
The Set CPU Frequency option allows you to set the CPU frequency needed to convert the clock<br />
cycles into real time. Select this option to display the Set CPU Frequency dialog box. Set the new<br />
CPU frequency according to requirements.<br />
NOTE The Configure Time Unit option is available in Critical Code Data, Per<strong>for</strong>mance, and Call<br />
Tree viewers. All the viewers share the same time and frequency that you set <strong>for</strong> a particular<br />
80 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus Trace<br />
viewer. For example, if you set time in microseconds <strong>for</strong> Critical Code Data viewer, all other<br />
viewers will display time in microseconds.<br />
2.4 Preparing Aurora Interface <strong>for</strong> Collecting Aurora<br />
Nexus Trace<br />
If you want to collect Nexus trace from the target via Aurora, you need to first prepare the Aurora<br />
interface to be used by the trace probe. A TCL script or the Aurora training script is used to train Aurora<br />
on the target.<br />
This topic describes how to prepare Aurora interface to extract Nexus trace from the Aurora port (<strong>for</strong><br />
processors that support Aurora) using a Gigabit tap with Aurora daughter card.<br />
This topic contains the following sub-topics:<br />
Enabling Aurora<br />
Executing Aurora Training Script<br />
2.4.1 Enabling Aurora<br />
You can enable Aurora on T4240QDS, P4080DS, and P5020DS boards using Reset Configuration Word<br />
(RCW). On P5020DS board, the Aurora debug lanes must be configured to run at 2.5 Gbps. For this, both<br />
the SW5[1:2] switches must be off (00) to select a 100MHz SERDES reference clock. Also, the<br />
SRDS_DIV_B1 <strong>for</strong> the I-J lanes (RCW bit 143) must be on in the used RCW to enable the clock divider.<br />
When Aurora is enabled, the Aurora interface needs to be trained so that it can run properly.<br />
2.4.2 Executing Aurora Training Script<br />
The Aurora training script should be executed be<strong>for</strong>e configuring or extracting trace through the Aurora<br />
port. You can execute the training script to train Aurora on P4080DS, P5020DS and T4240QDS targets<br />
as follows.<br />
On P4080DS/P5020DS Target<br />
On T4240QDS Target<br />
2.4.2.1 On P4080DS/P5020DS Target<br />
For P4080DS/P5020DS target, the TCL script that is used to train Aurora on the target is available in the<br />
<strong>CodeWarrior</strong> installation folder at:<br />
PA/PA_Support/Initialization_Files/Aurora/train_aurora.tcl<br />
The routine inside this file which executes the required training is called train_aurora.<br />
81
Trace<br />
Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus Trace<br />
There are different ways to execute the Aurora training script on the P4080DS/P5020DS target depending<br />
on the following scenarios.<br />
2.4.2.1.1 Setting Up Debugger Launch — General<br />
Approach<br />
You can set up a debugger launch configuration to execute train_aurora be<strong>for</strong>e executing normal debug<br />
initialization script to collect trace via Aurora on the Aurora probe during the debug session.<br />
Set the Initialize target script field of the Hardware or Simulator Target<br />
specification to train_aurora.tcl so that train_aurora is called immediately be<strong>for</strong>e the normal<br />
initialization file is executed when a connection is established from <strong>CodeWarrior</strong>.<br />
The routine train_aurora can also be called directly from the Debugger Shell after a connection has<br />
been established.<br />
2.4.2.1.2 Downloading and Debugging Application Using<br />
<strong>CodeWarrior</strong><br />
If you are downloading and debugging the application using <strong>CodeWarrior</strong>, execute the TCL script using<br />
the following steps:<br />
1. Copy the TCL training script to your project directory hierarchy in the folder /CFG. It is recommended to rename this file to avoid confusion with other versions needed<br />
<strong>for</strong> other use cases. For example, rename it from train_aurora.tcl to<br />
train_aurora_download.tcl.<br />
2. Edit this file to call the train_aurora routine, and then execute the appropriate initialization script<br />
(present in the folder /CFG) from the training script copied in step 1. For<br />
example, if P4080 ComE is the target device, and you want to debug without cache, a call to the<br />
training script and then a call to the P4080ComE_init_core.tcl initialization script should be<br />
added as follows at the very bottom of the training script file:<br />
train_aurora<br />
source [file dirname [info script]]/P4080ComE_init_core.tcl<br />
3. Modify your target configuration to point to the training script you just edited.<br />
a. Open the Debug Configurations dialog box and select the required configuration.<br />
b. Click Edit in the Main tab <strong>for</strong> the connection setting.<br />
c. Select the appropriate target (or create a new one) in the Target drop-down box.<br />
d. Edit the new target settings by clicking Edit.<br />
e. Specify the training script edited in step 2 in the Initialize target script <strong>for</strong> each core.<br />
82 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus Trace<br />
f. Click OK.<br />
Now, whenever a launch configuration is debugged that uses the target modified to execute the new<br />
Initialize target script, Aurora will be initialized and ready <strong>for</strong> trace collection.<br />
2.4.2.1.3 Attaching to and Debugging Target Using<br />
<strong>CodeWarrior</strong><br />
If you are attaching to and debugging the target using <strong>CodeWarrior</strong>, execute the TCL script using the<br />
following steps:<br />
1. Copy the TCL training script to your project directory hierarchy in the folder /CFG. It is recommended to rename this file to avoid confusion with other versions needed<br />
<strong>for</strong> other use cases. For example, rename it from train_aurora.tcl to<br />
train_aurora_attach.tcl.<br />
2. Edit this file to call the train_aurora routine by adding the following line at the bottom of the script<br />
file:<br />
train_aurora<br />
3. Modify your target configuration to point to the training script you just edited.<br />
a. Open the Debug Configurations dialog box and select the required configuration.<br />
b. Click Edit in the Main tab <strong>for</strong> the connection setting.<br />
c. Select the appropriate target (or create a new one) in the Target drop-down box.<br />
d. Edit the new target settings by clicking Edit.<br />
e. Specify the training script edited in step 2 in the Initialize target script <strong>for</strong> each core.<br />
f. Click OK.<br />
Now, whenever a launch configuration is debugged that uses the target modified to execute the new<br />
Initialize target script, Aurora will be initialized and ready <strong>for</strong> trace collection.<br />
2.4.2.1.4 Executing Training From Debugger Console<br />
You can execute the training script from the <strong>CodeWarrior</strong> Debugger Shell window (Window->Show<br />
View->Debugger Shell). Type the following command in the window to source the training script:<br />
source “path/train_aurora.tcl”<br />
To execute the training script, call train_aurora.<br />
83
Trace<br />
Preparing Aurora Interface <strong>for</strong> Collecting Aurora Nexus Trace<br />
2.4.2.1.5 Initializing Aurora Trace Outside <strong>CodeWarrior</strong><br />
Debugger<br />
You can run the training script from CCS when <strong>CodeWarrior</strong> is not being used <strong>for</strong> debugging. You need<br />
to open a CCS console, source the train_aurora.tcl file, and then execute the training by calling<br />
train_aurora.<br />
2.4.2.2 On T4240QDS Target<br />
For T4240QDS target, the TCL script that is used to train Aurora on the target is available in the<br />
<strong>CodeWarrior</strong> installation folder at:<br />
PA/PA_Support/Initialization_Files/Aurora/train_aurora_t4.tcl<br />
The routine inside this file which executes the required training is called train_aurora.<br />
To train Aurora on the T4240QDS target:<br />
1. Ensure that the RCW on board is having Aurora enabled (SERDES port #4) and the speed is set to 2.5<br />
Gbps.<br />
NOTE Use the custom JTAG file to override the board RCW and enable Aurora interface <strong>for</strong> trace<br />
collection. Use it as reference to build your own RCW if you need some other functionality on<br />
board that is not enabled by this RCW.<br />
2. Ensure that the following DIP switches on the board are configured <strong>for</strong> Aurora lanes to be routed to<br />
Aurora connector on the board:<br />
SW4.7=0 SW4.8=0 (SW_SD4=00 -> 100MHz reference clock)<br />
SW9.2=0 SW9.3=0 (SW_SD4_MX_CTL=00 -> SD4 Lanes 4-7 muxed to SATA/Aurora)<br />
3. Run the TCL script from the CCS console window, the Debugger Shell window, or an initialization<br />
file.<br />
From the CCS console window:<br />
a. Make sure you have a proper Command Converter started and configured.<br />
b. In console, type: source {$path}/train_aurora_t4.tcl, where $path is a valid<br />
system path to the TCL script.<br />
c. In console, type: train_aurora to call the training procedure.<br />
d. Look <strong>for</strong> a confirmation message that Aurora interface was successfully trained. If it was not<br />
successfully trained, repeat step c.<br />
From the Debugger Shell window:<br />
84 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Trace<br />
Importing Trace Data File<br />
a. In shell, type: source {$path}/train_aurora_t4.tcl, where $path is a valid system<br />
path to the TCL script<br />
b. In shell: train_aurora_dbg to call the training procedure.<br />
c. Look <strong>for</strong> a confirmation message that Aurora interface was successfully trained. If it was not<br />
successfully trained, repeat step b.<br />
From initialization file:<br />
a. Copy train_aurora_t4.tcl script to your project in the CFG folder.<br />
b. Add the following line to the start of your initialization file:<br />
source [file dirname [info script]]/train_aurora_t4.tcl<br />
c. Add a call to train_aurora_dbg procedure in the init_plat<strong>for</strong>m procedure:<br />
train_aurora_dbg<br />
2.5 Importing Trace Data File<br />
This feature allows you to import trace data from an existing project into another project and view the<br />
data in the Trace Editor.<br />
To import trace data:<br />
1. From the IDE menu bar, select File > Import.<br />
The Import wizard appears.<br />
85
Trace<br />
Importing Trace Data File<br />
Figure 2.59 Import Wizard<br />
2. Expand the Software Analysis tree node and select the Trace option (Figure 2.59).<br />
3. Click Next.<br />
The Import Trace page appears.<br />
86 Tracing and Analysis Tools User Guide
Figure 2.60 Import Trace Page<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Importing Trace Data File<br />
4. Click Browse next to the Trace data file field to select the trace data file to be imported. The trace<br />
data file is located in the .Analysis Data folder of the project in the workspace.<br />
5. Select one of the following options:<br />
Existing project: Imports the trace data file to an existing project present in your current<br />
workspace. Selecting this option opens the Select an Existing Project page (Figure 2.61) where<br />
you can select the project you wish to import the trace data file to.<br />
New project: Imports the trace data file to a new project.<br />
6. Check the Copy the file to the workspace checkbox if you want to maintain a copy of the trace data<br />
file in your current workspace.<br />
7. Check the View the trace data on finish checkbox to open the Trace Editor automatically after<br />
clicking the Finish button.<br />
8. Click Next.<br />
The Import Trace to Existing Project page appears.<br />
87
Trace<br />
Importing Trace Data File<br />
Figure 2.61 Import Trace to Existing Project Page<br />
9. Select the project in which you want to import the trace data, in the Import trace in project group.<br />
10. Type a new file name <strong>for</strong> the trace data file in the New trace file name will be text box. This field is<br />
optional.<br />
11. Click Next.<br />
The Import Trace Configuration page appears.<br />
88 Tracing and Analysis Tools User Guide
Figure 2.62 Import Trace Configuration Page<br />
Tracing and Analysis Tools User Guide<br />
Trace<br />
Importing Trace Data File<br />
12. Select the desired hardware <strong>for</strong> the trace in the System drop down.<br />
13. Click Finish.<br />
The trace data file is imported to the .Analysis Data folder in your project and the Trace Editor<br />
appears with the imported trace data.<br />
NOTE Check the project folder in your workspace to access the .Analysis Data folder.<br />
89
Trace<br />
Importing Trace Data File<br />
90 Tracing and Analysis Tools User Guide
Tracepoints<br />
Tracing and Analysis Tools User Guide<br />
3<br />
Setting tracepoints limits tracing to certain blocks of a program instead of tracing everything and filtering<br />
the unnecessary parts later. This decreases the time required to upload and process. Additionally, setting<br />
tracepoints reduces the storage space requirements.<br />
Based on the available resources, a tracepoint may be a hardware or a software tracepoint which can be<br />
determined at runtime. For each type of tracepoint, a different menu item is created.<br />
Hardware tracepoint — You can set only two hardware tracepoints. If you try to install a third<br />
tracepoint, the application provides you with the options to remove an existing tracepoint or cancel<br />
the action.<br />
Software tracepoint — You can set multiple software tracepoints. The hardware resources required<br />
<strong>for</strong> tracepoints on the <strong>Power</strong> <strong>Architecture</strong> plat<strong>for</strong>m are limited. Software tracepoints provide a way<br />
to increase the number of tracepoints that can be used in an application using interrupts.<br />
NOTE At present, the P4080DS development board supports only software tracepoints.<br />
This chapter explains:<br />
Setting Software Tracepoints<br />
Viewing Analysispoints<br />
3.1 Setting Software Tracepoints<br />
You can set points <strong>for</strong> trace to start and stop in the source code. If there is a stop tracepoint and no start<br />
tracepoint, the trace automatically starts at the beginning of the application. If there is at least one start<br />
tracepoint, the trace is automatically disabled at the beginning of the application. This solution uses a<br />
runtime patching mechanism. However, to reconfigure the software tracepoints, the running application<br />
needs to be re-compiled. You may combine tracing and debugging easily.<br />
Each tracepoint is defined by the:<br />
virtual address where the trace should be started or stopped<br />
type of the tracepoint (software; action: start or stop)<br />
The tracepoints can be set either in the Debug or C/C++ perspective.<br />
Be<strong>for</strong>e setting tracepoints, you need to modify your project to use the software tracepoints. The following<br />
steps demonstrate the procedure of modifying a project to use the software tracepoints in a sample source<br />
code.<br />
91
Tracepoints<br />
Setting Software Tracepoints<br />
1. Navigate to the <strong>CodeWarrior</strong> Projects view.<br />
2. Expand the <strong>CodeWarrior</strong> project tree control <strong>for</strong> which you want to set the tracepoints.<br />
3. Modify main.c.<br />
a. From the project tree structure, expand the Source tree control.<br />
b. Double-click the source code file main.c.<br />
The source code file opens in the default editor area.<br />
c. Replace the contents of main.c with the contents of Listing 3.1.<br />
Listing 3.1 Sample source code <strong>for</strong> setting software tracepoints<br />
#include <br />
int main()<br />
{<br />
int i=0;<br />
//currently software trace points can't be used on change-of-flow<br />
instructions<br />
i++;<br />
i += 100;<br />
unsigned long proc_id;<br />
asm ("mfpir %0" : "=r" (proc_id));<br />
printf("Core%d: Software trace points test!\r\n", proc_id>>5);<br />
i++;<br />
while (1) { printf("Core%d: Welcome to <strong>CodeWarrior</strong>!\r\n",<br />
proc_id>>5); } // loop <strong>for</strong>ever<br />
}<br />
d. Save the file.<br />
4. Add sa_tphandle.c to the project.<br />
a. Select the Source folder in the <strong>CodeWarrior</strong> Projects view and right-click.<br />
b. Select the Add Files option from the context menu, and navigate to the location<br />
\PA\cdde\sasdk\samples\cw\sa_software_tracepoints\sour<br />
ce where is the directory where <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is<br />
installed<br />
c. Select sa_tphandle.c in the Open dialog box and click Open.<br />
The File Operation dialog box appears.<br />
d. Select the Copy files option and click OK.<br />
The sa_tphandle.c file is added to the project.<br />
5. Open the pa_exception.asm file present in the Source folder in the Editor view.<br />
92 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Setting Software Tracepoints<br />
6. Overwrite pa_exception.asm with pa_exception_hw.asm located at<br />
\PA\cdde\sasdk\samples\cw\sa_software_tracepoints\source,<br />
and save the file.<br />
7. Edit the linker control file.<br />
a. Expand the LCF folder of your project, and open the gccport_ore0.lcf file in the Editor<br />
view.<br />
b. Add the _swtp_addr section to the file as follows.<br />
_swtp_addr = 0x00100000;/*reserve the memory needed */<br />
_swtp_end = 0x0010ffff;/*software tracepoints table*/<br />
.....<br />
.....<br />
.sw_hashtable 0x00100000 :<br />
{<br />
*(.sw_hashtable)<br />
} = 0x0010ffff<br />
.....<br />
.....<br />
The added section is highlighted in Figure 3.1.<br />
c. Save the file.<br />
93
Tracepoints<br />
Setting Software Tracepoints<br />
Figure 3.1 Adding _swtp_addr Section to Linker File<br />
8. Update the sa_tphandle.c file with the number of software tracepoints used.<br />
a. Open sa_tphandle.c in the Editor view.<br />
b. Update the macro TRACEPOINTS_NUMBER with the number of software tracepoints used. For<br />
example, if you are using two tracepoints, modify the macro as follows:<br />
#define TRACEPOINTS_NUMBER 0x2//number of trace points used by<br />
project<br />
c. Save the file.<br />
9. Right-click on your project in the <strong>CodeWarrior</strong> Projects view and select the Properties option.<br />
The Properties dialog box appears.<br />
10. Select the C/C++ Build node and click the References tab.<br />
11. Clear the Build referenced projects and build configurations........ checkbox.<br />
12. Click Apply and close the dialog box.<br />
13. Build your project.<br />
14. Set tracepoints in the source code.<br />
94 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Setting Software Tracepoints<br />
a. Navigate to the Editor view and select the statement i++; (after int i = 0;).<br />
b. Right-click on the marker bar, and select Toggle Trace Start Point > Software Trace Point from<br />
the context menu (Figure 3.2).<br />
Figure 3.2 Source Code Editor — Context Menu<br />
The start trace point icon appears on the marker bar.<br />
NOTE It is not recommended to set tracepoints on the lines containing only comments, parenthesis,<br />
and variable declaration with no value. Do not set software tracepoints on a call, return or<br />
branch.<br />
c. Select the statement i++; (after printf()) and right-click on the marker bar.<br />
d. Select Toggle Trace Stop Point > Software Trace Point from the context menu.<br />
The stop trace point icon appears on the marker bar.<br />
NOTE Be<strong>for</strong>e setting the tracepoints in the Debug perspective, ensure that the project is debugged<br />
and the source code file is open in the Editor view of the Debug perspective. For in<strong>for</strong>mation<br />
on creating and debugging a <strong>CodeWarrior</strong> project, refer to the Configuration and Collecting<br />
Data topics.<br />
95
Tracepoints<br />
Setting Software Tracepoints<br />
NOTE To disable the start or stop tracepoints, navigate to the corresponding source code line, rightclick<br />
on the marker bar and from the context menu, select Toggle Trace Start Point or<br />
Toggle Trace Stop Point.<br />
15. Add Debug Configuration Control and Status Register (DCSR) address space to your project. This is<br />
necessary if you are using the non-cacheable launch configuration.<br />
a. Open the Debug Configurations dialog box and select your project in the left pane.<br />
b. Click Edit in the Main tab.<br />
c. Click Edit in the Properties dialog box.<br />
d. Select the Initialize target script column against core 0 in the Initialization tab (Figure 3.3).<br />
The Target Initialization File dialog box appears.<br />
e. Click File System and browse to the location<br />
\PA\cdde\sasdk\samples\cw\sa_software_tracepoints\CFG<br />
in the Open dialog box.<br />
f. Select the P4080DS_init_DCSR_core0.cfg file and click Open.<br />
The file gets added to the Initialize target script column (Figure 3.3).<br />
Figure 3.3 Adding Initialize target script<br />
g. Click OK to close the Properties dialog box.<br />
16. Enable tracing in the Debug Configurations dialog box.<br />
17. Click Debug.<br />
18. Click Resume.<br />
The <strong>CodeWarrior</strong> starts collecting trace when a start tracepoint occurs and stops collecting trace when<br />
a stop tracepoint occurs.<br />
96 Tracing and Analysis Tools User Guide
19. Click Suspend to suspend the application.<br />
Figure 3.4 shows the trace data that is collected after setting tracepoints.<br />
Figure 3.4 Trace Events View — Trace Data with Tracepoints<br />
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Viewing Analysispoints<br />
NOTE <strong>CodeWarrior</strong> can handle any number of start and stop tracepoints, which can be reached any<br />
number of times during the program execution.<br />
3.2 Viewing Analysispoints<br />
You can view the list of all the existing analysispoints, that is both tracepoints and Pfapoints, in the<br />
Analysispoints view that displays the attributes of the analysispoints set in source code or/and assembly<br />
code. You can enable, disable, or remove a analysispoint in this view.<br />
To view analysispoints:<br />
1. From the IDE menu bar, select Window > Show View > Other.<br />
The Show View dialog box appears.<br />
2. Expand the Software Analysis tree control and select the Analysispoints options (Figure 3.5).<br />
97
Tracepoints<br />
Viewing Analysispoints<br />
Figure 3.5 Show View Dialog Box — Software Analysis Options<br />
3. Click OK.<br />
The Analysispoints view appears with a list of existing analysispoints (Figure 3.6).<br />
Figure 3.6 Analysispoints View<br />
4. Check or clear the checkbox next to the analysispoint if you want to enable or disable the associated<br />
analysispoint.<br />
3.2.1 Analysispoints View<br />
The Analysispoints view displays the following attributes of the analysispoints set from the source code:<br />
Path the file where analysispoint is set<br />
Type of the analysispoint, that is software or hardware<br />
Line number where analysispoint is set<br />
98 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Viewing Analysispoints<br />
Action of the analysispoint, that is start or stop<br />
The Analysispoints view displays the following attributes of the analysispoints set from the Disassembly<br />
view:<br />
Path of the file where analysispoint is set<br />
Type of the analysispoint, that is software or hardware<br />
Address where analysispoint is set<br />
Line number where analysispoint is set<br />
Action of the analysispoint, that is start or stop<br />
You can use the Analysispoints view to per<strong>for</strong>m the following actions:<br />
View Full path of Analysispoint Attribute<br />
Group Analysispoints<br />
Define Working Set<br />
Add New Analysispoint<br />
Enable/Disable Analysispoints<br />
Navigate to Analysispoint Line<br />
Remove Analysispoints<br />
NOTE The actions per<strong>for</strong>med in the Analysispoints view are same <strong>for</strong> both tracepoints and<br />
Pfapoints. For more in<strong>for</strong>mation on Pfapoints, refer to the Setting Per<strong>for</strong>mance Analysispoints<br />
topic.<br />
3.2.1.1 View Full path of Analysispoint Attribute<br />
To view the complete path of the files of the analysispoint attribute, click the drop-down in the<br />
Analysispoints view and select the Show Full Paths option. Select the option again to hide the complete<br />
path.<br />
3.2.1.2 Group Analysispoints<br />
You can group the attributes of the analysispoints by analysispoint type, files, projects, or working sets.<br />
To group the attributes, click the drop-down in the Analysispoints view, click Group By and then select<br />
the necessary option. Figure 3.7 shows the analysispoint attributes in the Analysispoints view which are<br />
grouped by projects. You can ungroup the attributes by selecting Group By > Analysispoints.<br />
99
Tracepoints<br />
Viewing Analysispoints<br />
Figure 3.7 Analysispoints View — Group by Projects<br />
You can also specify nested groupings <strong>for</strong> the Analysispoints view. Click the drop-down and select<br />
Group By > Advanced. The Group Analysis Points dialog box appears. Move the Analysispoint<br />
Types and Projects groups from the Available Groups section to the Selected Groups section using the<br />
Add button. You can use the Move Up and Move Down buttons to customize the nesting of groups, that<br />
is to move a particular group up or down according to your choice.<br />
Figure 3.8 Group Analysis Points Dialog Box<br />
Click OK to view the nested grouped analysispoints in the Analysispoints view.<br />
3.2.1.3 Define Working Set<br />
Working sets allow you to create named groups <strong>for</strong> the analysispoints. You can define working sets <strong>for</strong><br />
the selected analysispoints and then group the analysispoints by working sets. To create a working set:<br />
1. Click the drop-down in the Analysispoints view and select the Working Sets option.<br />
The Select Working Set dialog box appears (Figure 3.9).<br />
100 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Viewing Analysispoints<br />
2. Click New to create a new working set.<br />
The New Working Set dialog box appears.<br />
3. Type a name <strong>for</strong> the working set in the Working Set Name textbox.<br />
4. Select the analysispoints in the Working Sets list that you want to add to the new working set. For<br />
example, you can select analysispoints of core 0 <strong>for</strong> one working set and analysispoints of core 1 <strong>for</strong><br />
another working set.<br />
5. Click Finish.<br />
The new working set appears in the Select Working Set dialog box.<br />
Figure 3.9 Select Working Set Dialog Box<br />
6. Click OK to close the dialog box.<br />
To group analysispoints by working sets, click the drop-down in the Analysispoints view and select<br />
Group By > Analysispoint Working Set. The analysispoints grouped by the working sets appear in the<br />
Analysispoints view.<br />
Figure 3.10 Analysispoints Grouped by Working Sets<br />
101
Tracepoints<br />
Viewing Analysispoints<br />
You can also set a working set as the default one so that whenever you add any stop or start analysispoint<br />
to your application, it gets automatically added to the default working set. In this way, working sets help<br />
you work on a particular set of analysispoints at a particular time. Click the drop-down in the<br />
Analysispoints view and select Select Default Working Set option. It opens the Select Default<br />
Working Set dialog box where you can set one of the available analysispoints working sets as the default<br />
one. Alternatively, right-click on the working set, and select the ToggleDefault.label option from the<br />
context menu to set the working set as default.<br />
You can deselect the working set which you set as default, using the Deselect Default Working Set<br />
option from the drop-down or selecting the ToggleDefault.label option from the context menu.<br />
3.2.1.4 Add New Analysispoint<br />
You can use the Analysispoints view to add an analysispoint on the address of an instruction. To add an<br />
address analysispoint:<br />
1. Click the Add a new Analysispoint button, in the Analysispoints view, to display the Add new<br />
analysispoint dialog box.<br />
Figure 3.11 Add New Analysispoint Dialog Box<br />
2. Select the required project from the Projects drop-down box.<br />
3. Select the family of analysispoint, that is whether it is a Pfapoint or a tracepoint, from the Family<br />
drop-down box.<br />
4. Select the type of the analysispoint from the Type drop-down box.<br />
5. Select the action of the analysispoint, that is whether start or stop, from the Action drop-down box.<br />
6. Enter the address where you want to set the analysispoint in the Address text box.<br />
7. Click OK.<br />
The analysispoint is set and appears in the Analysispoints view.<br />
102 Tracing and Analysis Tools User Guide
Figure 3.12 Address Analysispoint Set in Analysispoints View<br />
3.2.1.5 Enable/Disable Analysispoints<br />
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Viewing Analysispoints<br />
You can enable/disable an analysispoint from Analysispoints view by checking/clearing it. The cleared<br />
attribute indicates the disabled analysispoint. A disabled analysispoint will have no effect during the<br />
collection of trace data.<br />
You can also use the Ignore all Analysispoints icon to disable all the analysispoints without manually<br />
selecting them (Figure 3.13). Click Ignore All Analysispoints again to enable the analysispoints.<br />
Figure 3.13 Disabling Analysispoints from Analysispoints View<br />
3.2.1.6 Navigate to Analysispoint Line<br />
The Analysispoints view shows where start and stop analysispoints are set in the editor area or the<br />
Disassembly view. It helps you navigate to the source code or assembly code where the analysispoint is<br />
set. If you want to go to the specific line of the source code where the analysispoint is set, select the<br />
analysispoint attribute in the Analysispoints view and click the Go To File <strong>for</strong> Analysispoints icon.<br />
This option will navigate you to that line.<br />
3.2.1.7 Remove Analysispoints<br />
To remove an analysispoint, select the analysispoint attribute and click the Remove Selected<br />
Analysispoint icon. To remove all the analysispoint, click the Remove All Analysispoints icon.<br />
103
Tracepoints<br />
Viewing Analysispoints<br />
3.2.2 Context Menu<br />
Right-click in the Analysispoints view or on the analysispoint to display a context menu, which allows<br />
you to per<strong>for</strong>m the following actions:<br />
Go to File — Navigates you to the specific line of the source file where you have set the selected<br />
analysispoint.<br />
Enable/Disable — Allows you to enable/disable analysispoints. A disabled analysispoint will have<br />
no effect during the collection of trace data.<br />
Remove — Removes the selected analysispoint.<br />
Remove All — Removes all analysispoints that are displayed in the Analysispoints view.<br />
Select All — Selects all analysispoints in the Analysispoints view.<br />
Copy — Copies the selected analysispoint on the clipboard.<br />
Set Cores — Lets you select the cores <strong>for</strong> which you want to set analysispoints. To choose the cores<br />
to set a analysispoint, select the analysispoint and right-click. Select Set cores from the context<br />
menu. The Select Cores dialog box appears (Figure 3.14). By default, all cores are selected in the<br />
Select Cores dialog box if the application is not in the debug mode. For a selected analysispoint,<br />
you can check/uncheck the required core to associate it with the analysispoint. If the application is<br />
in the debug mode then depending on the thread selected in the Debug view, the Select Cores<br />
dialog box will have the corresponding core checked <strong>for</strong> the selected analysispoint.<br />
Figure 3.14 Select Cores Dialog Box<br />
NOTE The default settings mark all the cores checked.<br />
104 Tracing and Analysis Tools User Guide
Table 3.1 describes the Select Cores dialog box options.<br />
Table 3.1 Select Cores Options<br />
Option Description<br />
Core 0 - Core 7 Clear or check the desired checkboxes to install the analysispoint<br />
on the selected cores.<br />
Select All Click to select all the checkboxes. This installs the analysispoint on<br />
all cores.<br />
Deselect All Click to clear all the checkboxes. The analysispoint is not installed<br />
on any core.<br />
Tracing and Analysis Tools User Guide<br />
Tracepoints<br />
Viewing Analysispoints<br />
Export Analysispoints — Lets you save the analysispoints in a .apt file at a desired location.<br />
Select this option to display the Export Analysis Points dialog box. Select the analysispoint(s) that<br />
you want to save, and click Browse to navigate to a location where you want to save the<br />
analysispoint(s), in the Save Analysis Points As dialog box. Specify a filename in which the<br />
analysispoints will be exported. The full path will appear in the Destination text box. Click Finish.<br />
Figure 3.15 Export Analysis Points Dialog Box<br />
Import Analysispoints — Lets you import analysispoints from another location in the<br />
Analysispoints view. Select this option to display the Import Analysis Points dialog box. Click<br />
Browse to locate the .apt file where you saved the analysispoints. Click Finish. The<br />
analysispoints will be imported in the Analysispoints view.<br />
105
Tracepoints<br />
Viewing Analysispoints<br />
106 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong><br />
QorIQ P Series<br />
Tracing and Analysis Tools User Guide<br />
4<br />
The Per<strong>for</strong>mance Analysis tool enables you to configure, collect, and analyze events in the QorIQ<br />
processors: P4080, P4040, P2040/41, P3041, P5010, P5040, and P5020/21. This tool uses various<br />
elements of the debug IP. The tool is integrated in the <strong>CodeWarrior</strong> IDE to handle configuration and<br />
communication with the target system. The Per<strong>for</strong>mance Analysis tool does not require the code to be<br />
instrumented or a program running on the target. It does not require the presence of an operating system<br />
(OS) also. The tool can be used in applications running on Linux and other operating systems.<br />
The Per<strong>for</strong>mance Analysis tool <strong>for</strong> the P4080 device has two components:<br />
Graphical User Interface (GUI) — Visible component of the Per<strong>for</strong>mance Analysis tool that enables<br />
you to configure the analysis tool, collect data, and analyze results.<br />
Software Analysis Engine (SAE) — Core component of software analysis in <strong>CodeWarrior</strong> <strong>for</strong><br />
<strong>Power</strong> <strong>Architecture</strong> V10.x that helps parse instructions received from the GUI, configure target,<br />
collect data from various counters, and display results in the GUI.<br />
NOTE The data is stored using Open Trace Format (OTF). For more in<strong>for</strong>mation, go to the following<br />
link: http://www.paratools.com/otf.php.<br />
This chapter explains:<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Collecting Data<br />
Analyzing Data<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Generating CSV and Summary CSV Reports<br />
Capturing Program Counter with Event Captures<br />
4.7Setting Per<strong>for</strong>mance Analysispoints<br />
Zip File Database of Event, Counter and Metric Capabilities<br />
107
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
4.1 Configuring Per<strong>for</strong>mance Analysis Tools<br />
The latest version of the Per<strong>for</strong>mance Analysis tool is not fully integrated in the <strong>Power</strong> <strong>Architecture</strong><br />
V10.x environment, there<strong>for</strong>e it must be configured manually. For details, refer to the Limitations topic.<br />
This topic describes:<br />
1. Loading Application on Target<br />
2. Running Helper Programs<br />
3. Configuring Target<br />
4. Using the Per<strong>for</strong>mance Analysis Configuration Editor<br />
4.1.1 Loading Application on Target<br />
To load an application on the target:<br />
1. Compile and build your program (no special libraries or instrumentation is needed).<br />
NOTE For details, refer to steps 1–20 of Creating New Project topic. The Per<strong>for</strong>mance Analysis tool<br />
is not integrated with the Trace tool. To avoid potential conflicts, keep the Trace<br />
Configuration options disabled in the New Project Wizard while you create a <strong>CodeWarrior</strong><br />
project <strong>for</strong> Per<strong>for</strong>mance Analysis.<br />
2. Load the program on the target.<br />
3. Run the program.<br />
NOTE The Per<strong>for</strong>mance Analysis tool does not have the ability to trigger or get triggered by the<br />
application, there<strong>for</strong>e you have to decide how to run the target that you have analyzed.<br />
NOTE For more in<strong>for</strong>mation on creating and debugging a <strong>CodeWarrior</strong> project, refer to the <strong>Power</strong><br />
<strong>Architecture</strong> Processors Version 10.x Targeting Manual in the folder:<br />
\PA\Help\PDF, where is the directory where<br />
<strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is installed.<br />
4. When the program runs and is ready to analyze, you may need to detach the debugger.<br />
108 Tracing and Analysis Tools User Guide
4.1.2 Running Helper Programs<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
The current version of the Per<strong>for</strong>mance Analysis tool will launch cdde automatically, but it is<br />
recommended to launch it manually because automatic launching at the start of each measurement is<br />
slower.<br />
To run the program on the Windows and Linux operating systems:<br />
1. Invoke a command prompt window; DOS window in Windows XP or command shell in Linux.<br />
2. Navigate to the location \PA\cdde\bin and locate the file cdde.exe.<br />
3. Double-click to run the cdde.exe.<br />
4. Navigate to the location \PA\ccs\bin and locate the file ccs.exe.<br />
NOTE While connecting to the Gigabit TAP debug device, it is recommended to allow cdde to<br />
automatically launch ccs.<br />
5. Run ccs.exe.<br />
The <strong>CodeWarrior</strong> connection server starts and the icon appears on the status bar. You need to<br />
configure the <strong>CodeWarrior</strong> Connection Server (ccs server).<br />
a. Click ccs server icon .<br />
The ccs server console opens.<br />
b. Connect to the target development board using the following commands:<br />
delete all<br />
config cc etap:<br />
Where is the target development board IP address.<br />
c. Verify if you are connected to the target development board using the command:<br />
show cc<br />
d. Configure the chain so that ccs connects to the target development board with a valid chain.<br />
ccs::config_chain <br />
For , enter the name of the device to use.<br />
For example, ccs::config_chain p4080.<br />
NOTE Steps e and f are optional.<br />
e. View the configuration chain.<br />
display ccs:get_config_chain<br />
109
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
f. View the traffic.<br />
log verbose hh<br />
NOTE Let the cdde and ccs executables run <strong>for</strong> the time you use the Per<strong>for</strong>mance Analysis tool.<br />
You can terminate the processes, when you terminate the Tracing and Analysis session.<br />
NOTE is the directory where <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is<br />
installed.<br />
4.1.3 Configuring Target<br />
The current version of the tool uses its own configuration and does not use the target configuration<br />
settings from the <strong>CodeWarrior</strong> session. However, the user can choose to edit and use the connection file,<br />
or you can choose to extract the connection in<strong>for</strong>mation from a launch configuration automatically using<br />
the options in Preferences window (Figure 4.18).<br />
This topic describes:<br />
1. Creating Default Empty Project<br />
2. Editing Target Configuration File<br />
4.1.3.1 Creating Default Empty Project<br />
You need to create a default empty project to view the newly created Per<strong>for</strong>mance Analysis configuration<br />
file .pfa** in the Eclipse workspace. The Per<strong>for</strong>mance Analysis (PFA) tool stores all<br />
the captured counter data in this project.<br />
NOTE It is recommended to create the PFA projects by importing the scenarios.zip file rather<br />
than creating it manually. For details, refer to the Per<strong>for</strong>mance Analysis Scenarios (PFS)<br />
Editor topic.<br />
110 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
NOTE By default, the PFA tool creates the \per<strong>for</strong>manceanalysisdata<br />
folder, but creating an empty project brings it in the Eclipse workspace. is<br />
your working directory.<br />
To create a default empty project:<br />
1. From the IDE menu bar, select File > New > Project.<br />
The New Project wizard starts and the Select a Wizard page appears (Figure 4.1).<br />
Figure 4.1 New Project Wizard — Select a Wizard Page<br />
2. Expand the General tree control and select Project.<br />
3. Click Next.<br />
The Project page appears (Figure 4.2).<br />
111
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.2 Project Page<br />
4. Enter per<strong>for</strong>manceanalysisdata in the Project name text box.<br />
5. Click Next.<br />
The Project References page appears (Figure 4.3).<br />
112 Tracing and Analysis Tools User Guide
Figure 4.3 Project References Page<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
6. From the Referenced projects group, select the appropriate project. For example, Hello_Worldcore0.<br />
7. Click Finish.<br />
The Project References page closes, and the IDE creates the per<strong>for</strong>manceanalysisdata<br />
project according to your specifications in the <strong>CodeWarrior</strong> Projects view.<br />
8. From the IDE menu bar, select Window > Show View > <strong>CodeWarrior</strong> Projects.<br />
The <strong>CodeWarrior</strong> Projects view appears with the per<strong>for</strong>manceanalysisdata project you<br />
just created (Figure 4.4).<br />
113
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.4 <strong>CodeWarrior</strong> Projects View<br />
4.1.3.2 Editing Target Configuration File<br />
The Per<strong>for</strong>mance Analysis tool target configuration file is a text file with no extension. The name of this<br />
file is connection. The target configuration file must be changed to match the settings that are<br />
appropriate <strong>for</strong> the current debug session.<br />
To edit the target configuration file:<br />
1. Copy the connection file from<br />
\eclipse\plugins\com.freescale.per<strong>for</strong>manceanalysis.metri<br />
cs.db_xxxxxx\per<strong>for</strong>manceanalysisdata, where is the directory where<br />
<strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is installed.<br />
2. Paste the connection file in \per<strong>for</strong>manceanalysisdata, where<br />
is your working directory and per<strong>for</strong>manceanalysisdata is the project<br />
folder you created.<br />
You can edit the connection file now.<br />
114 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
3. Edit the file to set the connection parameters.<br />
Following is an example of connection file.<br />
#cc:etap:1.2.1.3<br />
#cc:etap:1.2.2.3<br />
#cc:etap:1.2.2.4<br />
cc:etap:<br />
#port:41475<br />
#useRemoteCCS:1<br />
#remoteCCSAddr:1.2.3.4<br />
#specifyCCSExe:1<br />
#ccsExe:d:/ccs/bin/ccs.exe<br />
#clockSpeed:1000<br />
#ccsTimeout:20<br />
Lines that begin with # are considered comments and are ignored. The only parameter to edit is cc, where<br />
is the IP address of the target development board.<br />
Table 4.1 lists the connection file parameters.<br />
Table 4.1 Connection File Parameters<br />
Parameter Description<br />
ccs Specifies the command converter string to pass to CCS. For<br />
example, cc:etap:1.2.3.4 or cc:utap.<br />
port Specifies the port that CCS is listening to. The default listening<br />
port is 41475.<br />
useRemoteCCS Specifies whether the Tracing and Analysis will connect to a<br />
remote CCS. 1 indicates that Tracing and Analysis will connect to<br />
a remote CCS.<br />
remoteCCSAddr If using a remote CCS, this field specifies the IP address of the<br />
machine running CCS.<br />
specifyCCSExe Specifies which CCS executable is to be used. 1 indicates that<br />
the path up to and including the CCS executable will be<br />
specified, and 0 indicates that the default CCS executable will be<br />
called.<br />
ccsExe If specifying the CCS executable, this parameter contains the<br />
path up to, and including the CCS executable.<br />
115
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Table 4.1 Connection File Parameters (continued) (continued)<br />
Parameter Description<br />
clockSpeed Specifies the speed of the JTAG clock in KHz (default value is<br />
1000 KHz).<br />
ccsTimeOut Specifies the CCS communication timeout time in seconds<br />
(default value is 20 seconds).<br />
NOTE This version of Per<strong>for</strong>mance Analysis is not fully automated. Ensure that you start the cdde<br />
executable be<strong>for</strong>e starting the Per<strong>for</strong>mance Analysis tool. Keep this program running as long<br />
as you use the tool. When you stop using <strong>CodeWarrior</strong>, terminate the CDDE executable<br />
process manually.<br />
4.1.4 Using the Per<strong>for</strong>mance Analysis Configuration<br />
Editor<br />
The Per<strong>for</strong>mance Analysis Configuration Editor enables you to configure the events, counters, and<br />
sampling parameters. You can also view the configuration summary and the state of events and counters.<br />
This topic describes:<br />
Creating Per<strong>for</strong>mance Analysis Configuration File<br />
Configuring Events and Counters<br />
Chart Parameter Settings<br />
4.1.4.1 Creating Per<strong>for</strong>mance Analysis Configuration<br />
File<br />
To create the Per<strong>for</strong>mance Analysis configuration file:<br />
1. Start the <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x IDE.<br />
2. From the IDE menu bar, select File > New > Other.<br />
The New wizard appears (Figure 4.5).<br />
116 Tracing and Analysis Tools User Guide
Figure 4.5 New Wizard<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
3. Expand the Per<strong>for</strong>mance Analysis Configurations tree control and select Pfa Suffix Per<strong>for</strong>mance<br />
Analysis Event to Counter Configuration.<br />
4. Click Next.<br />
The Per<strong>for</strong>mance Analysis Configuration File page appears (Figure 4.6).<br />
117
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.6 Per<strong>for</strong>mance Analysis Configuration File Page<br />
5. Select the container directory:<br />
a. Click Browse.<br />
The Folder Selection dialog box appears.<br />
118 Tracing and Analysis Tools User Guide
Figure 4.7 Folder Selection Dialog Box<br />
b. Select the desired directory.<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
NOTE Creating new files in the <strong>CodeWarrior</strong> project folder may trigger project rebuild operation<br />
be<strong>for</strong>e the next launch. You can create a separate folder to hold the PFA configuration files.<br />
For details, refer to the Creating Default Empty Project topic.<br />
c. Click OK.<br />
The Folder Selection dialog box closes. The name of the selected directory appears in the<br />
Container text box.<br />
6. Enter a name <strong>for</strong> the PFA file in the File name text box.<br />
You can also use the default filename new_file.pfa.<br />
7. In the Device Number group, select a device from the PA tree control.<br />
You can select only a single device type.<br />
8. Click Finish.<br />
The Per<strong>for</strong>mance Analysis Configuration File page closes. This creates an initial configuration<br />
with the state file in the selected folder. The Per<strong>for</strong>mance Analysis Configuration Editor appears<br />
with tabs that can be configured <strong>for</strong> Per<strong>for</strong>mance Analysis. The Events tab appears in the front.<br />
119
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.8 Initial State File Configuration — Events Selector<br />
Table 4.2 describes the tabs in the pfa1.pfa editor view.<br />
Table 4.2 Per<strong>for</strong>mance Analysis Configuration Editor Window<br />
Tab Description<br />
Events Enables you to select the events you want to configure <strong>for</strong> Per<strong>for</strong>mance Analysis.<br />
Counters Enables you to select the counters you want to configure <strong>for</strong> Per<strong>for</strong>mance Analysis.<br />
Configured Enables you to select an events:counter pairing to edit or remove.<br />
State Shows the state saved as configuration.<br />
Options Enables you to select analysis options.<br />
Analyze Enables you to initiate the analyze operation to end at a specified sample count.<br />
NOTE Alternatively, to configure the events, counters, and sampling parameters from the IDE menu<br />
bar, click . The Per<strong>for</strong>mance Analysis Configuration File dialog box appears. Use the<br />
above procedure to get to the PFA configuration editor.<br />
4.1.4.2 Configuring Events and Counters<br />
There are two ways to configure and view the events, or the per<strong>for</strong>mance related counters available in the<br />
P4080 blocks (Figure 4.11).<br />
120 Tracing and Analysis Tools User Guide
To configure specific counters:<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
1. Click Counters tab in the Per<strong>for</strong>mance Analysis Configuration Editor window.<br />
2. Expand the tree control and select a counter.<br />
3. Right-click and select Assign Event from the context menu (Figure 4.9).<br />
The Select event <strong>for</strong> counter dialog box appears.<br />
Figure 4.9 Counters Selector — Assigning Events<br />
4. In the Select event <strong>for</strong> counter dialog box, expand the P4080-EVENTS tree control.<br />
The CORES tree control appears.<br />
5. Expand the CORES tree control and select the desired core (Figure 4.10).<br />
121
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.10 Select Event <strong>for</strong> Counter Dialog Box<br />
6. Expand the core and select an event.<br />
7. Click OK.<br />
The assigned event appears in the Events column (Figure 4.11).<br />
Figure 4.11 Counters Selector<br />
122 Tracing and Analysis Tools User Guide
Table 4.3 lists the options in the Counters Selector tab.<br />
Table 4.3 Counters Selector Options<br />
Option Description<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Counters Displays the hardware registers that are used to count events.<br />
Event Displays the events assigned to a counter.<br />
Id Displays the configuration value used to modify the hardware <strong>for</strong> a<br />
particular counter.<br />
Description Displays the description of the counter.<br />
NOTE Right-click in the Counters tab and use the context menu to expand or collapse the tree<br />
control. To view only the events that have been assigned to a counter, use the Show Only<br />
Assigned context menu option.<br />
To configure events:<br />
1. Click Events tab in the Per<strong>for</strong>mance Analysis Configuration Editor window.<br />
2. Expand the P4080-EVENTS tree control and select an event <strong>for</strong> the desired core (Figure 4.12).<br />
123
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.12 Events Selector<br />
3. Right-click and select a counter from the context menu.<br />
The assigned counter appears in the Counter column (Figure 4.13).<br />
NOTE Multiple counters can be assigned to the same event independently. This can be used to count<br />
memory accesses from each core independently. For example, with the DDRx > SRCID<br />
choices, adding the SRCID filter limits the counts to those of a specific source.<br />
124 Tracing and Analysis Tools User Guide
Figure 4.13 Events Selector — Showing Selected Counters<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
NOTE You can use the text box above the Events and Counters tabs to filter and limit the number of<br />
displayed events or counters. For this, replace the text type filter text with the search<br />
string and press Enter.<br />
Table 4.4 lists the options in the Event Selector tab.<br />
Table 4.4 Event Selector Options<br />
Option Description<br />
Events Displays the hardware defined signals that may be counted.<br />
Counter Displays the counter assigned to an event.<br />
Id Displays the configuration value used to modify the hardware <strong>for</strong> a<br />
particular event.<br />
Description Displays the description <strong>for</strong> the event.<br />
4. To filter the event list, right-click in the Events tab.<br />
A context menu appears (Figure 4.14).<br />
125
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Figure 4.14 Events Selector — Context Menu<br />
Table 4.5 lists the context menu options.<br />
Table 4.5 Events View — Context Menu Options<br />
Option Description<br />
Expand All Select to expand the tree control.<br />
Collapse Select to collapse the tree control.<br />
Show only Assigned Select to view the events that have been assigned to a<br />
counter.<br />
Show Metrics Select to view only the metrics associated with the events.<br />
Events will be temporarily supressed.<br />
To view the metrics enabled <strong>for</strong> an event, select a metrics and<br />
right-click; from the context menu select Show Metric<br />
Required Events.<br />
To view the configured event counter pairing, click Configured tab. For example, the UPMC3 counter<br />
counts every process cycle (Figure 4.15).<br />
126 Tracing and Analysis Tools User Guide
Figure 4.15 Configured Event Counter Pairings<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
You can view the state of the events and counters as configuration. Click State tab to view the State File<br />
(Figure 4.16).<br />
Figure 4.16 State File<br />
127
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
For the EVENTS:REFERENCE_VALUES, you can edit the value field <strong>for</strong> each of the non-sampled value.<br />
These are handled as constant values in the metric evaluation.<br />
For the list of references with in<strong>for</strong>mation on the features and use of P4080 debug IP, refer to the<br />
Accompanying Documentation topic.<br />
4.1.4.3 Chart Parameter Settings<br />
You can set the chart and metrics parameters in order to view the results in the Per<strong>for</strong>mance Analysis<br />
Events view with desired configuration.<br />
To set the chart and metrics preferences:<br />
1. Start the <strong>CodeWarrior</strong> IDE.<br />
2. From the IDE menu bar, select Window > Preferences.<br />
The Preferences dialog box appears.<br />
3. From the left pane of the Preferences dialog box, select Per<strong>for</strong>mance Analysis Charts.<br />
The Per<strong>for</strong>mance Analysis Charts options appear in the right pane of the Preferences dialog box<br />
(Figure 4.17).<br />
Figure 4.17 Preferences Dialog Box — Per<strong>for</strong>mance Analysis Charts Settings<br />
4. Select the required options <strong>for</strong> the Per<strong>for</strong>mance Analysis chart configuration (Table 4.6).<br />
128 Tracing and Analysis Tools User Guide
Table 4.6 Per<strong>for</strong>mance Analysis Charts Configuration Options<br />
Configuration<br />
Parameter<br />
Tree Type Events Per<br />
Sample<br />
Option Description<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Configuring Per<strong>for</strong>mance Analysis Tools<br />
Select to create the chart based on the number of events per<br />
sample.<br />
Events Average Select to create charts based on the average value of<br />
events.<br />
Dataset Type Normalized Time Select to create charts based on the normalized time values.<br />
Deltas Select to create charts based on the raw delta values.<br />
Normalized Select to create charts based on the raw delta/raw time delta<br />
in ticks.<br />
All the deltas are normalized using time base.<br />
Chart Type Dot Markers Select to create charts based on the group of data points.<br />
Line Select to create a line chart that displays in<strong>for</strong>mation as a<br />
series of data points connected by straight segments.<br />
5. Click Apply to save the configuration.<br />
6. In the left pane of the Preferences dialog box, select Per<strong>for</strong>mance Analysis Metrics.<br />
The Per<strong>for</strong>mance Analysis Metrics options appear in the right pane of the dialog box (Figure 4.18).<br />
129
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
Figure 4.18 Preferences Dialog Box — Per<strong>for</strong>mance Analysis Metrics Settings<br />
7. Enter the frequency of reference clock to be used, in the Frequency of Reference Clock (MHz)...<br />
text box.<br />
8. Enter the loop count in the Loop Count, number of samples collected text box.<br />
9. Check the desired checkboxes.<br />
10. Click Apply to save the configuration.<br />
4.2 Collecting Data<br />
Use the Per<strong>for</strong>mance Analysis Configuration Editor window of the <strong>CodeWarrior</strong> IDE to set the system<br />
<strong>for</strong> data collection (Figure 4.19).<br />
NOTE You can also use the PFA configuration editor. For details, refer to the Using the Per<strong>for</strong>mance<br />
Analysis Configuration Editor topic.<br />
130 Tracing and Analysis Tools User Guide
Figure 4.19 Per<strong>for</strong>mance Analysis Configuration Editor Window<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
To collect data:<br />
1. Configure the events and counters. For more in<strong>for</strong>mation, refer to the Configuring Events and<br />
Counters topic.<br />
NOTE Make sure that the target is running during the collection phase. The core stops only once to<br />
write the configuration on the target. After this, the data collection is non-intrusive.<br />
2. In the Per<strong>for</strong>mance Analysis Configuration Editor window, click Options tab.<br />
The Options Selection settings appear (Figure 4.20).<br />
Figure 4.20 Options Selection<br />
3. Enter the clock frequency to be used in the Frequency of reference clock (MhZ) text box.<br />
131
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
4. Check the required analysis options (Table 4.7).<br />
Table 4.7 Analysis Options<br />
Options Description<br />
Log Configuration Register<br />
Accesses<br />
Save configuration with each<br />
captured data<br />
5. Click Analyze tab.<br />
Various data collection options appear in the Analysis tab (Figure 4.21).<br />
Figure 4.21 Analyze Tab Options<br />
Check to save the target configuration register accesses log in<br />
accesslog.txt, along with the collected data in the<br />
per<strong>for</strong>manceanalysisdata/.pfa** folders <strong>for</strong><br />
each analysis.<br />
Check to save a configuration state file state.pfa along with the<br />
collected data in the per<strong>for</strong>manceanalysisdata/<br />
.pfa** folder <strong>for</strong> each analysis.<br />
Table 4.8 lists the different modes you can use to configure and collect data.<br />
132 Tracing and Analysis Tools User Guide
Table 4.8 Modes to Configure and Collect Data<br />
Mode Description<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
Specified Cycle Count Operation Analysis with the specified cycle count initiates when you click the<br />
Analyze button. It ends sampling at the sample count specified in<br />
Number of Samples.<br />
The Specified Cycle Count Operation executes both the configure<br />
and the collect operations. The configure operation halts each<br />
core while modifying the configuration registers. This halt is<br />
intrusive, and may interfere with the debugger operation which<br />
interprets the configuration halt as having hit a hardware<br />
breakpoint. In this mode, when the program runs and is ready to<br />
analyze, you need to detach the debugger from the running target.<br />
If you fail to detach the debugger from the running target, the PFA<br />
tool does not work and the debugger reports errors.<br />
One Shot Mode To complete the initial configuration, the Configure button<br />
executes all the register configuration operations that require halt<br />
of the target device. You can then use the Collect button<br />
repeatedly to collect a number of samples specified in Sample<br />
Count without halting the device. The collect register accesses<br />
are non-intrusive.<br />
The One Shot Mode has separate configure and collect<br />
operations. The collect operation retrieves counter data from the<br />
pre-configured core without halting the cores. In this mode, you<br />
can make measurements without disconnecting the debugger, but<br />
make sure that the cores are suspended after the configure<br />
operation completes.<br />
133
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
Table 4.8 Modes to Configure and Collect Data (continued)<br />
Mode Description<br />
Logic Analyzer Mode To complete the initial configuration, the Configure button<br />
executes all the register configuration operations that require halt<br />
of the target device. You can then use the Collect button to collect<br />
samples continuously in an internal circular sample buffer of the<br />
size specified in the Sample Count text box.<br />
The Logic Analyzer mode also has separate configure and collect<br />
operations as of the One Shot Mode. This mode collects samples<br />
continuously in an internal circular sample buffer of the size<br />
specified in the Sample Count text box. When you click Cancel in<br />
the progress dialog box, sampling halts and the most recent<br />
circular buffer contents are stored.<br />
Configuration Access Log The Generate button is used to generate a log of the register<br />
accesses executed <strong>for</strong> a particular configuration. This collection<br />
mode ignores the connection in<strong>for</strong>mation and uses a null backend<br />
and a fixed collection count of one. It does not access the<br />
hardware but simply logs the accesses that would take place to<br />
configure the device and then collect a single sample of the<br />
counter registers. You cannot parse this log or use it <strong>for</strong><br />
configuration.<br />
NOTE You can use any one, or all of the above mentioned modes to configure and collect data.<br />
4.2.1 Specified Cycle Count Operation<br />
To collect data using the Specified Cycle Count Operation:<br />
1. In the Debug perspective, detach the debugger from a single core process:<br />
a. Click Resume in the Debug view.<br />
The debugger executes the program.<br />
b. Click Disconnect in the Debug view.<br />
The debugger disconnects from the single core process.<br />
When you disconnect the debugger, it is not required <strong>for</strong> the per<strong>for</strong>mance measurement session.<br />
134 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
NOTE To disconnect the debugger from a multicore application, press Multicore Resume , the<br />
debugger executes the program. Right-click in the Debug view and from the context menu,<br />
select Terminate/Disconnect All.<br />
2. Switch to the Per<strong>for</strong>mance Analysis Configuration Editor.<br />
3. Expand the Analyze With Specified Cycle Count Operation group (Figure 4.22).<br />
Figure 4.22 Analyze with Specified Cycle Count Operation<br />
4. Enter the number of samples you want to collect in the Number of Samples text box.<br />
5. Click Analyze.<br />
The Progress In<strong>for</strong>mation dialog box appears where you can monitor the analysis progress. The<br />
time duration depends on the number of events configured and the number of samples to be collected.<br />
NOTE The reference clock in this version is hard coded to use Core 0, and counter 3 to count the<br />
clock cycles. This count value is used as the cycle count in metric evaluation, as well as in the<br />
per-cycle normalized values displayed in the chart.<br />
4.2.2 One Shot Mode<br />
To collect data using One Shot Mode:<br />
135
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
1. Expand the One Shot Mode group (Figure 4.23).<br />
Figure 4.23 One Shot Mode<br />
2. Enter the number of samples to be collected in the Sample Count text box.<br />
3. While all cores are suspended, click Configure.<br />
The initial configuration of the counter is completed.<br />
4. Click Multicore Resume in the Debug view.<br />
All cores resume.<br />
5. Switch to the Per<strong>for</strong>mance Analysis Configuration Editor.<br />
6. Click Collect.<br />
The Progress In<strong>for</strong>mation dialog box appears. The specified sample count is collected without<br />
halting the cores.<br />
7. Click Collect repeatedly to collect a number of samples without halting the device again.<br />
NOTE In case you need to configure the cores again, you must suspend the debugger operation using<br />
the suspend or multicore suspend icons in the Debug view.<br />
4.2.3 Logic Analyzer Mode<br />
To collect data using the Logic Analyzer Mode:<br />
WARNING! Currently the size of the log file is not limited. From the Options tab, check the Log<br />
Configuration Register Accesses checkbox.<br />
136 Tracing and Analysis Tools User Guide
1. Expand the Logic Analyzer Mode group (Figure 4.24).<br />
Figure 4.24 Logic Analyzer Mode<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Collecting Data<br />
2. Enter the number of samples to be collected in the Sample Count text box.<br />
3. While all cores are suspended, click Configure.<br />
The initial configuration of the counter is completed.<br />
4. Click Multicore Resume in the Debug view.<br />
All cores resume.<br />
5. Switch to the Per<strong>for</strong>mance Analysis Configuration Editor.<br />
6. Click Collect.<br />
The Progress In<strong>for</strong>mation dialog box appears. Samples are collected, without halting the cores, in a<br />
circular buffer until the Cancel button is pressed.<br />
7. In the Progress In<strong>for</strong>mation dialog box, click Cancel.<br />
Sampling stops and the most recent circular buffer contents are stored.<br />
NOTE In case you need to configure the cores again, you must suspend the debugger operation using<br />
the suspend or multicore suspend icons in the Debug view.<br />
4.2.4 Configuration Access Log<br />
To collect data using the Configuration Access Log:<br />
137
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
1. Expand the Generate a Configuration Access Log group (Figure 4.25).<br />
Figure 4.25 Generate a Configuration Access Log Mode<br />
2. Click Generate.<br />
The accessLog.txt file is generated in the timestamped collection folder at /<br />
per<strong>for</strong>manceanalysisdata/.pfa**, where is your<br />
working directory.<br />
NOTE The accesslog.txt contains the register configuration writes, and the collection read<br />
register accesses <strong>for</strong> a single sample collection. You can use this in<strong>for</strong>mation <strong>for</strong> regression<br />
testing and <strong>for</strong> analysis of problems.<br />
4.3 Analyzing Data<br />
The results of the analysis are stored in the timestamped collection folder /<br />
per<strong>for</strong>manceanalysisdata/.pfa**, where is your working<br />
directory.<br />
This topic describes:<br />
Viewing Results<br />
Saving Configuration<br />
Loading Configuration<br />
4.3.1 Viewing Results<br />
This topic describes:<br />
138 Tracing and Analysis Tools User Guide
Viewing Analysis Results<br />
Opening Charts in Open Trace Format (OTF) Editor<br />
Exporting Existing Charts<br />
4.3.1.1 Viewing Analysis Results<br />
After the data collection is over, you can view the analysis results.<br />
To view the analysis results:<br />
1. Start the <strong>CodeWarrior</strong> IDE.<br />
2. From the IDE menu bar, select Window > Show View > Other.<br />
The Show View dialog box appears (Figure 4.26).<br />
Figure 4.26 Show View Dialog Box<br />
3. Expand the Per<strong>for</strong>mance Analysis tree control.<br />
4. Select Per<strong>for</strong>mance Analysis Events and click OK.<br />
The Per<strong>for</strong>mance Analysis Events view appears.<br />
5. Right-click in the Per<strong>for</strong>mance Analysis Events view (Figure 4.27).<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
139
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
Figure 4.27 Per<strong>for</strong>mance Analysis Events View<br />
6. From the context menu, select Open File.<br />
The Open an OTF File dialog box opens.<br />
NOTE In the current version, the Per<strong>for</strong>mance Analysis in<strong>for</strong>mation is saved in the counters.otf<br />
file.<br />
7. Browse to the timestamped collection folder /per<strong>for</strong>manceanalysisdata/<br />
.pfa**, where is your working directory.<br />
8. Select the counters.otf file and click Open.<br />
The file loads and updates the Per<strong>for</strong>mance Analysis Events view with the most recent sample data<br />
(Figure 4.28).<br />
NOTE If the Per<strong>for</strong>mance Analysis Events view is open while you collect data, the Events column<br />
is automatically loaded with the most recent sample data once data collection is over.<br />
140 Tracing and Analysis Tools User Guide
Figure 4.28 Per<strong>for</strong>mance Analysis Events View — Updated<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
9. To view the events, press the Ctrl key and select multiple events in the Events column.<br />
10. Right-click while placing the cursor on the selected events and select Event Counts Summary or<br />
Event Rate from the context menu.<br />
If you select Event Counts Summary option, you can view the events with their average<br />
values (Figure 4.29).<br />
Figure 4.29 Displaying Event Counts Summary<br />
141
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
If you select Event Rate option, you can view raw delta values or normalized values (Figure<br />
4.30). For normalized values, all the deltas are normalized using time base. For raw delta<br />
values, raw values are displayed.<br />
Figure 4.30 Events Rate<br />
In addition to the initial chart parameters configuration, as described in Chart Parameter Settings,<br />
you can also configure some of the chart parameters from the right pane of the Per<strong>for</strong>mance<br />
Analysis Events view.<br />
To view the Event Rate graph as connected lines, or as markers, right-click in the chart view and<br />
from the context menu select the desired option.<br />
You can also configure the chart to view the Time base in cycles on X-axis or Y-axis using the<br />
context menu options, Show Time (seconds) on X or Show Cycles on X.<br />
4.3.1.2 Opening Charts in Open Trace Format (OTF)<br />
Editor<br />
You can open and view multiple counters.otf files in the OTF editor.<br />
NOTE This OTF editor does not permit you to make any changes to the file. There<strong>for</strong>e, the Save As<br />
or Save menu options are disabled <strong>for</strong> the OTF files.<br />
To open the files in the OTF editor:<br />
142 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
1. From the <strong>CodeWarrior</strong> IDE, select File > Open File.<br />
The Windows browser opens.<br />
2. Browse to the timestamped collection folder /per<strong>for</strong>manceanalysisdata/<br />
.pfa**, where is your working directory.<br />
3. Select the counters.otf file.<br />
4. Click Open.<br />
The counters.otf file opens in the OTF editor (Figure 4.31).<br />
Figure 4.31 Open Trace Format Editor<br />
NOTE Alternatively, from the IDE menu bar, select File > Open Path. In the Find and Open dialog<br />
box, specify the path of the counters.otf file and click OK.<br />
You can repeat the above procedure to open multiple counters.otf files in the OTF editor.<br />
4.3.1.3 Exporting Existing Charts<br />
You can export an existing chart as an SVG (Scalable Vector Graphics) file, a CSV file, or a PNG<br />
(Portable Network Graphic) file in the Per<strong>for</strong>mance Analysis Events view.<br />
The CSV file <strong>for</strong>mat is supported <strong>for</strong> import to common spreadsheet applications. It contains the event<br />
names and values of the collected samples.<br />
143
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
To export a chart as SVG, CSV, or PNG file:<br />
1. Right-click in the right pane of the Per<strong>for</strong>mance Analysis Events view.<br />
The context menu appears (Figure 4.32).<br />
Figure 4.32 Per<strong>for</strong>mance Analysis Events View — Exporting Chart<br />
2. From the context menu, select Export As.<br />
The Export chart as dialog box appears.<br />
3. Use the Save in list box to select a folder location to save the file.<br />
4. Use the File name field to select or type a name <strong>for</strong> the file.<br />
5. Use the Save as type list box to select Export as SVG(*.svg), Export as Comma Separated Values<br />
(*.csv), or Export as PNG image(*.png) file <strong>for</strong>mat.<br />
6. Click Save to save your file.<br />
4.3.2 Saving Configuration<br />
Once you configure the events, you can save the configuration file.<br />
To save the configuration file:<br />
1. From the IDE menu bar, select File > Save or File > Save As.<br />
The Save Per<strong>for</strong>mance Analysis Configuration dialog box appears (Figure 4.33).<br />
144 Tracing and Analysis Tools User Guide
Figure 4.33 Save Per<strong>for</strong>mance Analysis Configuration<br />
2. Use OK to save the configuration file (.pfa) to the specified location.<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Analyzing Data<br />
NOTE By default the.pfa file is saved at:<br />
\PA\PA_Support\Initialization_Files\Memory, where<br />
is the directory where <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is<br />
installed.<br />
3. Enter a name in the File name text box, or else use the default filename.<br />
4. Click Save to save the configuration file.<br />
NOTE If you check the Save configuration with each captured data checkbox during analysis, the<br />
configuration state file state.pfa is saved along with the collected data (Table 4.7).<br />
4.3.3 Loading Configuration<br />
There are four methods to load a previously saved configuration. You can:<br />
Select File > Open File, from the IDE menu bar. In the Open File dialog box, specify the location<br />
of the.pfa file in the File name text box and click Open.<br />
Select File > Open Path, from the IDE menu bar. In the Find and Open dialog box, specify the<br />
path of the.pfa file and click OK.<br />
Double-click the.pfa files in the project browser to open them directly.<br />
145
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Drag the.pfa files in the browser to open the files in the editor.<br />
4.4 Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
The Per<strong>for</strong>mance Analysis Scenarios (PFS) editor provides support <strong>for</strong> collection of sequences of<br />
measurements of Per<strong>for</strong>mance Analysis configurations. The PFS editor can be used to select and execute<br />
groups of PFA configuration files by creating execution tasks <strong>for</strong> the target task framework. It provides<br />
persistence of the configuration group settings in the.pfs files which are edited by the PFS editor.<br />
This topic describes:<br />
Importing PFS Files and Per<strong>for</strong>mance Analysis Data<br />
Working on Scenario Editor<br />
Expert Mode Configuration Subroutines in PFU Files<br />
Modifying Scenarios<br />
Creating New Scenarios<br />
4.4.1 Importing PFS Files and Per<strong>for</strong>mance Analysis Data<br />
The PA10 layout includes pre-configured scenario files or PFS files that can be imported into the user<br />
workspace. Two projects with their subfolders are imported:<br />
The per<strong>for</strong>manceanalysisdata project where the user-collected measurements are added. It also<br />
contains a connection file <strong>for</strong> manual connection configuration.<br />
The scenarios project contains all the scenario configuration files which can be executed using the<br />
scenario editor actions.<br />
To import PFS files and Per<strong>for</strong>mance Analysis data in the workspace:<br />
1. From the IDE menu bar, select File > Import.<br />
The Import wizard appears (Figure 4.34).<br />
146 Tracing and Analysis Tools User Guide
Figure 4.34 Import Wizard<br />
2. Select General > Existing Projects into Workspace.<br />
3. Click Next.<br />
The Import Projects page appears (Figure 4.35).<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
147
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.35 Import Projects Page<br />
4. Choose the Select archive file option and browse to<br />
\PA\cdde\per<strong>for</strong>manceanalysis, where is the directory<br />
where <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is installed.<br />
5. Select scenarios.zip file, and click Open.<br />
The per<strong>for</strong>manceanalysisdata and scenarios project folders appear in the Projects list of the<br />
Import Projects page (Figure 4.36).<br />
148 Tracing and Analysis Tools User Guide
Figure 4.36 Import Projects Page — Project Folders<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
6. Make sure that the per<strong>for</strong>manceanalysisdata and scenarios project folders are selected.<br />
7. Click Finish.<br />
The per<strong>for</strong>manceanalysisdata and scenarios folders appear in the <strong>CodeWarrior</strong> Projects view<br />
(Figure 4.37).<br />
149
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.37 <strong>CodeWarrior</strong> Projects View<br />
The Scenarios folder contains all the support files <strong>for</strong> the p4040, p4080 and p5020 Per<strong>for</strong>mance Analysis<br />
measurements. The Scenarios folder contains the .pfs suffix scenario configuration files that define<br />
groups and sequences of measurements, along with the global preference settings that apply during a<br />
sequence of measurements. Each measurement in the .pfs file combines the application of a PFA event<br />
to counter configuration and zero or more PFU configuration subroutines. The Scenarios folder has<br />
scenes and scripts subfolders <strong>for</strong> scenario operations.<br />
The scenes subfolders contain the .pfa suffix event-to-counter configurations used by the<br />
measurements. The scripts subfolders contain the .pfu suffix low level, expert mode configuration<br />
subroutines that permit configuration of additional Per<strong>for</strong>mance Analysis measurement capabilities<br />
beyond the simple event-to-counter associations provided by the PFA configuration.<br />
The PFS and PFU configuration files are instances of Eclipse EMF configurations, based on ecore<br />
models. The PFA configuration file is a simple Eclipse property file. The configuration files are saved in<br />
text <strong>for</strong>mat in an XML or XMI <strong>for</strong>m that can be edited in a text editor if required. The relative path<br />
references in all the Scenario PFS configuration files are relative to the PFS file location, so there are no<br />
modifications required in the pathnames or locations after importing the scenario file to the user<br />
workspace.<br />
The per<strong>for</strong>manceanalysisdata project is currently a fixed project where all measurement data is stored.<br />
Each time a group of measurements is executed, a timestamped subfolder is created under the<br />
per<strong>for</strong>manceanalysisdata project with a prefix of your choice that can be specified in the Ttf<br />
Default Properties section of the .pfs file.<br />
The scripts5020 folder contains low level configuration subroutines as well as the register definition<br />
database, e5500mc.pfu, which is provided as a support <strong>for</strong> filling in register details during edit<br />
150 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
operations on the low level subroutine configurations (.pfu suffix files). The e500multicore.pfu<br />
register definition database in the scripts folder provides the register details in<strong>for</strong>mation <strong>for</strong> the p4040<br />
and p4080 devices. You can select a register or memory location in the PFU editor to display the content<br />
of these register details files during configuration of the low level subroutines in the Properties view.<br />
Selecting a register or memory location will fill in all the required details <strong>for</strong> the register or memory<br />
access, including the register name, the register group name, the memory space, the address and the<br />
length of the access, in the Properties view. You only need to fill in operation (modify or write) and the<br />
new desired value. Modify operations also require that the user supply a mask value, with the bits set in<br />
the mask to specify that only those bits will be affected by the read-modify-write operation. Figure 4.38<br />
shows the e5500mc.pfu file opened in the PFU editor.<br />
Figure 4.38 e5500mc.pfu Register Details File <strong>for</strong> P5020<br />
4.4.2 Working on Scenario Editor<br />
Double-click the Scenario_Container_5020.pfs file in the <strong>CodeWarrior</strong> Projects view to<br />
open the Scenario Editor (Figure 4.39). You can use the Scenario Editor to group the Per<strong>for</strong>mance<br />
Analysis measurements and check the desired options from the grid of operations in the tree structure.<br />
The Scenario_Container_5020.pfs file holds the scenario measurement selection tree <strong>for</strong><br />
P5020. Checking an item in the treeview of the Scenario Editor selects all measurements in the subtree<br />
below the checked item.<br />
151
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.39 Scenario Editor<br />
1. Select a scenario file from the tree structure and right-click.<br />
2. From the context menu, select Show Properties View.<br />
The Properties view appears with the default properties of the selected scenario (Figure 4.40).<br />
152 Tracing and Analysis Tools User Guide
Figure 4.40 Properties View<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
3. Select a property you want to modify and change its value in the Value column. For example, you can<br />
update the Launch Configuration value to a valid value like<br />
Hello_World-core0_Hardware_Debug_core0_P4080DS_Download.<br />
You can select a scenario from the PFS editor tree structure <strong>for</strong> which you want to view or modify the<br />
properties.<br />
4.4.2.1 Executing Scenarios<br />
The items that are checked in the Scenario Editor treeview can be copied to the Target Tasks viewer<br />
where they can be manually selected and executed using the Target Tasks manager. When transferred to<br />
the Target Tasks viewer, all in<strong>for</strong>mation required to execute the selected sequence of measurements is<br />
transferred from the Scenario Editor to the Target Tasks preference settings. There is no further<br />
communication from the Target Tasks viewer back to the Scenario Editor.<br />
To execute a scenario, <strong>for</strong> example, Step1- Offline Configuration**Intrusive**:<br />
153
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
1. In the Scenario Editor treeview structure, check the checkbox against the scenario Step1- Offline<br />
Configuration**Intrusive** and right-click.<br />
2. From the context menu, select Execute Enabled Operations in Target Task Framework.<br />
The Target Tasks manager implements all the sequence control of the enabled tasks in jobs under its<br />
control. The Target Tasks view (Figure 4.41) appears as the tasks are copied from the Scenario<br />
Editor <strong>for</strong> execution. The tasks execute with their progress displaying in the Progress view (Window<br />
> Show View> Other > Progress).<br />
Figure 4.41 Target Tasks View<br />
The result of the target tasks execution is saved and the result folder appears in the <strong>CodeWarrior</strong><br />
Projects view under the per<strong>for</strong>manceanalysisdata project (Figure 4.42).<br />
Figure 4.42 <strong>CodeWarrior</strong> Projects View — Target Tasks Execution Results<br />
154 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
NOTE The results depend on the selections made from the Properties view. You can get the<br />
execution results <strong>for</strong> single or multiple operations by making appropriate selections from the<br />
Scenario Editor treeview structure. Each of the result is timestamped.<br />
To copy a scenario <strong>for</strong> manual execution, right-click on the selected item in the Scenario Editor and select<br />
the Copy Enabled Operations to Target Task Framework option.<br />
4.4.2.2 Scenario Measurements with Address Range<br />
Qualification<br />
The e500 and e5500 architectures support same Per<strong>for</strong>mance Analysis configuration capabilities. Each<br />
core has four 32-bit event counters that can be configured to count many events. You can configure the<br />
event-to-counter associations with the PFA editor, and those event-to-counter configurations are stored in<br />
the .pfa suffix files.<br />
In addition to the basic event-to-counter configuration, the core event counters can be configured to<br />
trigger on and trigger off event counting based on various trigger sources. One possible trigger source is<br />
the pair of Instruction Address Compare registers that are available to each core. Each core has an IAC1<br />
and IAC2 Instruction Address Compare register, and any or all of each core's four event counters can be<br />
configured to count events only within ranges enabled and disabled by the IAC counters. Assigning<br />
addresses to the IAC pair, and configuring a counter to use these as TriggerOn and TriggerOff is all that<br />
is necessary to qualify event collection to a specific area of the user program. The addresses specified are<br />
virtual, there<strong>for</strong>e, the additional qualification is required to isolate the counts to a particular process in the<br />
Linux environment. At this time, only the pre-configured routines to support address range qualification<br />
within a bareboard setting are available. However, these measurements will also be applicable to the<br />
Linux environment if a single application dominates the processing time of all cores.<br />
To enable address range qualification, the low level configuration subroutines are assigned to the<br />
scenario. For example, to enable address range qualification of CPU - Branch Miss Ratio:<br />
1. In the Scenario editor, expand CPU > CPU - Utilization > Branch Miss Ratio > Step1 - Offline<br />
Configuration **Intrusive**.<br />
2. Check the CPU - Branch Miss Ratio checkbox, right-click, and select the Show Properties View<br />
option from the pop-up menu.<br />
3. In the Properties view, select the Pfu Configurations property.<br />
4. Click the button available in the Value column of the Pfu Configurations property.<br />
The Pfu Configurations dialog box appears.<br />
155
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.43 Pfu Configurations Dialog Box<br />
5. Select the required subroutine(s) from the Choices list box and click Add.<br />
The selected subroutine gets added to the Feature list.<br />
Figure 4.44 Pfu Configurations Dialog Box — Assigning Subroutine to Scenario<br />
156 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
6. Click OK.<br />
The entry <strong>for</strong> the added subroutine appears in the Pfu Configurations property.<br />
7. Execute the CPU - Branch Miss Ratio scenario by selecting the Execute Enabled Operations in<br />
Target Task Framework option from the context-menu.<br />
The per<strong>for</strong>manceanalysisdata folder gets updated with new results in the <strong>CodeWarrior</strong> Projects<br />
view.<br />
8. Expand per<strong>for</strong>manceanalysisdata > run_. folder in the <strong>CodeWarrior</strong> Projects<br />
view, and double-click the CPU_Branch_MISS_Ratio.otf file.<br />
When an address range qualification configuration subroutine is assigned to a scenario, the core event<br />
measurements start and end in ranges determined by the Instruction Address Compare register values.<br />
For example, the CPU - Branch Miss Ratio measurements with addr1AllCores qualification<br />
produces Branches Finished event counts (Figure 4.45). The two cores are running identical<br />
programs. The difference in measurements is due to the selection of different IAC address ranges <strong>for</strong><br />
each core.<br />
Figure 4.45 Measurements of BRANCHES_FINISHED Event with addr1AllCores<br />
The address range configuration subroutines provide capability to configure all cores, specified cores, or<br />
specified event counters on specified cores. In addition, the following four address range measurement<br />
157
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
modes are supported. You can view these modes in the PFU editor. Double-click on the<br />
p5020_addr.pfu file in the scripts5020 folder to open the PFU editor (Figure 4.46).<br />
The addr1 PFU subroutines configure event counting to start whenever the core's instruction<br />
address exactly matches the IAC1 value, and the counter discontinues counting whenever the core's<br />
instruction address exactly matches the IAC2 value. This means that event counting will continue<br />
while any subroutines are called during execution between IAC1 and IAC2.<br />
The addr2 PFU subroutines configure event counting to occur only when the instruction address<br />
matches an address within the range set by IAC1 and IAC2. This means that counting of events halts<br />
during execution of subroutine calls outside that address range and resumes immediately upon<br />
return to the range from the subroutine.<br />
The addr3 and addr4 PFU subroutines operate in conjunction with the IAC event measurements.<br />
Counting of these IAC events is enabled <strong>for</strong> each target in the CPU_IAC.pfa configuration file,<br />
which is accessible from scenes > CPU in the Scenarios project. The events count instructions<br />
executed within an IAC1 to IAC2 range, or can be configured to use each IAC address separately.<br />
The addr3 PFU subroutines are provided to configure <strong>for</strong> range operation, and the addr4<br />
subroutines are provided <strong>for</strong> the single IAC counters. For example, the addr4 subroutines enable<br />
counting of hits of 15 separate IAC addresses on the eight core p4080. The Core 0, counter 3 is<br />
reserved as the reference clock, so it is not available <strong>for</strong> IAC event counting.<br />
Figure 4.46 PFU Editor<br />
Expand the addr1 PFU subroutine to display its access operations such as ModifyCoreRegister and<br />
WriteCoreRegister (Figure 4.47). Each subroutine is a sequence of register or memory accesses with<br />
Write of the full value or Read-Modify-Write of the value to bits selected by the provided mask value.<br />
158 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Each subroutine can contain user access operations and user variable definitions. You can add another<br />
sibling to a subroutine as User Access or User Variable; select the subroutine, right-click and select the<br />
New Sibling > User Access/User Variable option from the context menu.<br />
Both the properties, value and mask, are associated with each User Access operation in the subroutines.<br />
The User Access operations are simple subroutines with the only capability to execute the limited set of<br />
operations. These subroutines provide low level access of registers, memory and memory mapped<br />
registers, there<strong>for</strong>e, allowing you to configure all Per<strong>for</strong>mance Analysis hardware capabilities beyond the<br />
simple event to counter assignments supplied by the PFA configuration file.<br />
Each User Access line includes a Description property that is displayed in the PFU editor, as well as in<br />
the accesslog.txt that can be created when logging all configuration accesses.<br />
Figure 4.47 Sample PFU File Subroutine<br />
You can set properties of the PFU User Access Value explicitly in the hexadecimal <strong>for</strong>mat or add an orb<br />
variable. The orb variable is a variable created with a name attribute that starts with @. The scenario<br />
execution substitutes the orb variables with the values supplied in the same named orb variables at the<br />
bottom of the configuration file (Figure 4.48). For example, this enables the modification of the IAC orb<br />
variables at the bottom of the p5020_addr.pfu file, and the modification will apply to all the IAC<br />
register settings in all configuration subroutines in that file, rather than having to modify each IAC<br />
register write in the subroutines individually.<br />
159
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.48 IAC Orb Variables<br />
While setting orb variable values <strong>for</strong> the IAC registers, you can copy address values from a disassembled<br />
elf file. To do this:<br />
1. Right-click on an elf binary file in your project (under Binaries folder) and select the Disassemble<br />
option from the context menu.<br />
2. Press Ctrl+F and search <strong>for</strong> your subroutine in the text file, which appears in the source editor after<br />
disassembling the elf file. Figure 4.49 shows a disassembled elf file being searched <strong>for</strong> the inc1()<br />
function with the assembly start address of the function highlighted. In the PFU editor, currently the<br />
addresses of variables take hexadecimal values.<br />
160 Tracing and Analysis Tools User Guide
Figure 4.49 Disassembled elf File<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
3. Replace the start and end addresses in the Value field of the iac1 and iac2 orb variables in the<br />
Properties view with the start and end address in the code range <strong>for</strong> which you want to make<br />
measurements of other events. (Figure 4.50).<br />
161
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.50 Copying Start Address from Disassembled File to PFU Editor<br />
4. Expand p5020_addr > p5020_addr:addr1AllCores at the top of p5020_addr.pfu file, and view<br />
the subroutine that will use the orb variable value defined at the end of the same file (Figure 4.51).<br />
The Properties view shows an orb variable <strong>for</strong> the WriteCoreRegister Operation in the Value<br />
property, which causes the substitution to occur at execution time.<br />
162 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.51 Orb Variable String in Value property of User Access item<br />
5. Close PFU Editor.<br />
Be<strong>for</strong>e executing the scenario measurement, you can enable generation of access log file,<br />
accesslog.txt, which will be included along with each measurement. To do this:<br />
1. Select Ttf Default Properties, in the Scenario Editor, to open its properties in the Properties view.<br />
2. Set the Save Access Log With Capture property to true.<br />
3. Execute the scenario.<br />
4. Expand per<strong>for</strong>manceanalysisdata > 5206_run_., and double-click on the<br />
accesslog.txt file.<br />
Figure 4.52 shows the contents of an accesslog.txt file generated <strong>for</strong> a measurement executed <strong>for</strong> a<br />
subroutine from the p5020_addr.pfu file. The subroutine accesses in this case begin with the<br />
ModifyCoreRegVal statement in the log.<br />
163
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.52 Accesslog.txt Displaying Log of Accesses from Low Level PFU<br />
Configurations<br />
NOTE The subroutine modifications are done after all configuration statements are generated <strong>for</strong> the<br />
basic event to counter assignment associated with the assigned .pfa file configuration.<br />
The current basic Scenario core measurement operations do not use Address Range Qualification and do<br />
not pre-configure those registers at all. If one of the PFU Address Range Qualification subroutines has<br />
been added to a measurement's properties and applied during execution, it may be necessary to undo the<br />
address range qualification modifications prior to executing other measurements. The unqualified register<br />
state can be restored by hardware reset, or by running the Special - Reset Core Perfmon Region<br />
Scenario measurement (Figure 4.53).<br />
164 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.53 Special - Reset Core Perfmon Region Restores Reset State of Address<br />
Qualification Registers<br />
4.4.3 Expert Mode Configuration Subroutines in PFU<br />
Files<br />
This topic describes:<br />
Modifying PFU Configurations<br />
Adding PFU Configuration Groups<br />
4.4.3.1 Modifying PFU Configurations<br />
To modify PFU configurations <strong>for</strong> a selected scenario measurement, <strong>for</strong> example <strong>for</strong> CPU - Branch Miss<br />
Ratio, per<strong>for</strong>m the following steps. Figure 4.54 shows the Pfu Configurations property of CPU -<br />
Branch Miss Ratio has been assigned a PFU subroutine named addr1AllCores. In this example, you will<br />
remove addr1AllCores and replace it with addr1Core0 and addr1Core1 subroutines, which are<br />
equivalent to the addr1AllCores operation <strong>for</strong> this particular target.<br />
Tracing and Analysis Tools User Guide<br />
165
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
1. Open PFU Configurations dialog box (Figure 4.43).<br />
2. Select p5020_addr:addr1.Core0 and p5020_addr:addr1Core1 from the Choices list on the<br />
left side, and add them to the Features list on the right side.<br />
NOTE You can use the PFU Configurations dialog box to configure all cores, or configure cores<br />
individually, or to configure each core counter independently.<br />
Figure 4.54 PFU Configurations Dialog Box<br />
3. Click OK.<br />
The newly selected PFU subroutine configurations appear in the Pfu Configurations property, as<br />
shown in Figure 4.55. Both of these subroutines will be executed in the order configured following<br />
the configurations specified by the PFA file's event to counter assignments and prior to any accesses<br />
required to latch and read the counter registers during measurement operations.<br />
NOTE In this particular example, the CPU - Branch Miss Ratio configuration and measurement<br />
operations are divided into two steps in the Scenario sequence, but it is also possible to<br />
166 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
configure steps that do both Configure and Collect in a single measurement operation by<br />
changing the Operationtype property of the measurement.<br />
Figure 4.55 PFU Configuration Modified<br />
4.4.3.2 Adding PFU Configuration Groups<br />
The Ttf Default Properties (Figure 4.56) stores the list of PFU Configuration Groups that are available<br />
<strong>for</strong> subroutine choices when configuring operations in the Scenario (PFS) file. The group names are in<br />
the PFU file properties. The list in the Pfu Configurations property are references to the groups of<br />
configuration subroutines in the documents external to the edited PFS configuration file.<br />
Tracing and Analysis Tools User Guide<br />
167
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.56 Pfu Configuration Groups Property — Ttf Default Properties of PFS File<br />
To add additional PFU Configuration Groups:<br />
1. Right-click in the Scenario Editor, and select the Load Resource option from the pop-up menu.<br />
Figure 4.57 Load Resource Dialog Box<br />
2. Locate the p5020_addr.pfu file in the workspace and click OK in the Load Resource dialog<br />
box.<br />
3. Click the “...” button in the Pfu Configuration Groups property in the Properties view.<br />
The Pfu Configurations Groups dialog box appears which displays the configuration groups from<br />
all loaded PFU resources. The list of loaded PFU resources also appear in the Outline view.<br />
168 Tracing and Analysis Tools User Guide
Figure 4.58 Pfu Configuration Groups Dialog Box<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
The PFU Editor operations provide capability to per<strong>for</strong>m two basic operations of Read-Modify-Write or<br />
Write. It provides access to Core Registers, Memory Mapped Registers, and simple memory spaces. The<br />
combination of these provides the six access operations that can be assigned as a single line in a PFU<br />
subroutine. These six access operations are:<br />
ModifyCoreRegister<br />
ModifyMmrRegister<br />
ModifyMemByAddress<br />
WriteCoreRegister<br />
WriteMmrRegister<br />
WriteMemByAddress<br />
4.4.3.2.1 Adding PFU Configuration Subroutine<br />
You can create a new configuration subroutine in a PFU configuration file using the following steps:<br />
169
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
1. Right-click on the configuration group item in the PFU file, and select the New Child ><br />
Configuration option from the context menu, as shown in Figure 4.59.<br />
Figure 4.59 Adding New Configuration in PFU File<br />
The Configuration item gets added to the tree.<br />
2. Right-click on the Configuration item, and select the New Child > User Access option from the<br />
context menu.<br />
170 Tracing and Analysis Tools User Guide
Figure 4.60 Adding Access Line<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
This adds an access line of a subroutine to the tree.<br />
3. Right-click on the User Access item added to the tree, and select Set Properties > Choose Register<br />
or Memory Space option from the context menu, as shown in Figure 4.61.<br />
Figure 4.61 Adding Register or Memory Access in Pfu Configuration Subroutine<br />
A window displaying all PFU configurations appear (Figure 4.62).<br />
4. Type the filter text to look <strong>for</strong> the required register or the memory space.<br />
171
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.62 Adding New Subroutine Configuration<br />
5. Click OK.<br />
6. Modify the value of the User Access item in the Properties view.<br />
7. Change the label of the "Configuration" item by typing a unique name, <strong>for</strong> example, newsub1 <strong>for</strong> the<br />
subroutine in the Configuration Name property (Figure 4.63). You may also edit the Description<br />
property to describe the subroutine.<br />
Figure 4.63 Editing Configuration Name in Properties Page<br />
172 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
8. Save the application.<br />
The PFU Configuration Group is added to the referenced PFU Configuration Groups <strong>for</strong> the<br />
scenarios.<br />
9. Return to the PFS Editor.<br />
10. Select the CPU - Branch Miss Ratio scenario.<br />
11. Open the Pfu Configurations dialog box by clicking on the ... button in the Pfu Configurations<br />
property.<br />
12. Type the choice pattern to filter the available subroutines <strong>for</strong> the newsub1 subroutine as shown in<br />
Figure 4.64.<br />
Figure 4.64 New Pfu Subroutine Appears in PFU Configurations Dialog Box<br />
13. Select the subroutine from the Choices list and add it to the Feature list.<br />
14. Click OK.<br />
Figure 4.65 shows that the newly created newsub1 subroutine has been added to provide additional<br />
low level configuration <strong>for</strong> the CPU - Branch Miss Ratio Ttf Operation item, Test Index 5206.<br />
173
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.65 New Pfu Subroutine Added to PFS Measurement Operation<br />
NOTE The PFU configuration subroutines are applied to PFS Ttf Operation items and these<br />
operations also require an associated .pfa configuration file. The .pfa configuration<br />
contains configuration details, such as the target name, which are required by the<br />
configuration operations.<br />
The PFU Editor allows you to copy and paste a duplicate of a subroutine. Per<strong>for</strong>m the following steps:<br />
174 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
1. Right-click on the Configuration item (in the tree) that you want to copy and select the Copy option.<br />
Figure 4.66 Copying Existing Pfu Configuration Subroutine<br />
2. Right-click on the PFU Configuration Group item, that is the parent subroutine in the tree, and select<br />
Paste.<br />
Tracing and Analysis Tools User Guide<br />
175
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.67 Paste PFU Configuration Subroutine<br />
The duplicated subroutine is placed at the bottom of the list of subroutines. It will have the same name<br />
as the copied subroutine. Since the subroutine names must be unique within a configuration group,<br />
this will create a validation error as shown in Figure 4.68.<br />
Figure 4.68 Validation Error<br />
3. Change the name of the subroutine against the Configuration Name property in the Properties view.<br />
176 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
4. Right-click on the parent subroutine in the tree, and select the Validate option.<br />
A successful validation result is displayed (Figure 4.69).<br />
Figure 4.69 PFU Configuration Editor Successful Validation Result<br />
4.4.4 Modifying Scenarios<br />
Once the scenarios are in your workspace, you can modify the scenarios. This feature is useful when you<br />
add new configurations.<br />
To modify scenarios:<br />
1. From the PFS editor treeview structure, select a scenario, <strong>for</strong> example, Step1- Offline<br />
Configuration**Intrusive**, and right-click.<br />
Figure 4.70 Scenarios Editor — Modifying Scenarios<br />
177
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
2. From the context menu, select New Child > Ttf Configuration Group.<br />
A new operation adds to the selected scenario.<br />
Figure 4.71 Scenarios Editor — New Operation Added<br />
3. Enter a name <strong>for</strong> the new operation in the Properties view. For example, group1.<br />
The name you enter replaces the default name Ttf Configuration Group.<br />
Figure 4.72 Properties View — Adding Name <strong>for</strong> the New Operation<br />
NOTE You can repeat steps 1 and 2 above to add as many operations <strong>for</strong> each group.<br />
Figure 4.73 Scenarios Editor — Adding Operations to New Group<br />
4. In the PFS editor, select the new operation and right-click.<br />
178 Tracing and Analysis Tools User Guide
Figure 4.74 Scenarios Editor — Applying Default Values<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
5. From the context menu, select Set Properties > Apply All Default Values.<br />
The properties of the operation are set to default and the updated values are shown in the Properties<br />
view.<br />
Figure 4.75 Properties View — Values Updated<br />
You can modify the state.pfa file to apply a specific layout to the new operations.<br />
a. In the PFS editor, select the operation <strong>for</strong> which you want to modify the state.pfa file and<br />
right-click.<br />
b. From the context menu, select Set Properties > Choose Configuration File.<br />
The Choose Configuration File dialog box appears.<br />
c. Browse to /per<strong>for</strong>manceanalysisdata/<br />
result_2011.02.02.14.14.15.573/0001_op/state.pfa, where is<br />
your working directory.<br />
d. Click Open.<br />
The Configuration File value updates in the Properties view.<br />
179
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
6. From the PFS editor, select the scenario and right-click.<br />
Figure 4.76 Scenarios Editor — Validating Operations<br />
7. From the context menu, select Validate.<br />
The Progress In<strong>for</strong>mation and Validation In<strong>for</strong>mation dialog boxes appear with the validation<br />
status.<br />
Figure 4.77 Validation Progress and Validation In<strong>for</strong>mation Dialog Boxes<br />
8. Click OK.<br />
The validation of the selected scenario completes.<br />
9. From the IDE menu bar, select File > Save/Save As and save the scenario configuration you just<br />
modified.<br />
10. From the PFS editor, check or clear the operations you want to execute.<br />
11. Select a scenario and right-click.<br />
180 Tracing and Analysis Tools User Guide
Figure 4.78 Scenarios Editor — Executing Selected Operations<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
12. From the context menu, select Execute Enabled Operations in Target Task Framework.<br />
The Executing Target Task progress window appears. The progress window disappears after<br />
execution completes. The Target Tasks view appears.<br />
Figure 4.79 Target Tasks View — Updated<br />
181
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
4.4.5 Creating New Scenarios<br />
You can use the Per<strong>for</strong>mance Analysis wizard to create completely new scenarios, add operations,<br />
modify properties, validate, save, and execute the scenarios.<br />
To create and configure a new scenario:<br />
1. From the <strong>CodeWarrior</strong> Projects view, select the Scenarios folder and right-click.<br />
A context menu appears.<br />
Figure 4.80 <strong>CodeWarrior</strong> Projects View — Creating New Scenario<br />
2. From the context menu, select New > Folder.<br />
The New Folder dialog box appears.<br />
182 Tracing and Analysis Tools User Guide
Figure 4.81 New Folder Dialog Box<br />
NOTE Skip the above step if the scenarios.zip file was imported.<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
3. Select Scenarios folder.<br />
4. Enter a name <strong>for</strong> the new scenario in the Folder name text box. For example scen2.<br />
5. Click Finish.<br />
A new scenario folder, like scen2, appears under Scenarios folder in the <strong>CodeWarrior</strong> Projects<br />
view.<br />
183
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.82 <strong>CodeWarrior</strong> Projects View — New Scenario<br />
6. From the IDE menu bar, select File > New > Other.<br />
The New wizard opens.<br />
Figure 4.83 New Wizard<br />
7. Select Per<strong>for</strong>mance Analysis EMF Wizards > Pfs Per<strong>for</strong>mance Analysis Scenario Model.<br />
184 Tracing and Analysis Tools User Guide
8. Click Next.<br />
The Pfs Per<strong>for</strong>mance Analysis Scenario Model page appears.<br />
Figure 4.84 Pfs Per<strong>for</strong>mance Analysis Scenario Model Page<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
9. Modify the scenario file name in the File name text box. For example, scen2.pfs.<br />
10. Click Next.<br />
The Pfs Per<strong>for</strong>mance Analysis Scenario Model page appears with model selection options.<br />
185
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.85 Pfs Per<strong>for</strong>mance Analysis Scenario Model Page — Model Selection<br />
11. Select Scenario Page from Model Object drop down list.<br />
12. Click Finish.<br />
The Scenario Editor appears with the new scenario (Figure 4.86).<br />
Figure 4.86 Scenario Editor — New Scenario<br />
186 Tracing and Analysis Tools User Guide
13. In the Properties view, enter some meaningful names <strong>for</strong> the properties.<br />
The corresponding values are updated in Scenarios Editor (Figure 4.87).<br />
Figure 4.87 Scenarios Editor — Properties View<br />
14. From Scenarios Editor, select scen2 and right-click (Figure 4.88).<br />
Figure 4.88 Scenarios Editor — Adding a new Scenario Element<br />
15. From the context menu, select New Child > Ttf Default Properties.<br />
A new scenario element gets added with default properties (Figure 4.89).<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
187
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
Figure 4.89 Scenarios Editor — Default Properties<br />
16. Modify the properties to contain valid and meaningful values. For instance, update the values <strong>for</strong><br />
Launch Configuration, Reference Clock Frequency, Loop Count, and so on.<br />
17. Select scen2 and right-click.<br />
18. From the context menu, select New Child > Scenario Root.<br />
The Scenario Root gets added (Figure 4.90).<br />
Figure 4.90 Scenario Editor — Adding Scenario Root<br />
188 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS) Editor<br />
19. In Properties view, enter the values <strong>for</strong> Description and Label of the Scenario Root. For example,<br />
enter core1 as Label (Figure 4.91).<br />
Figure 4.91 Scenario Editor — Modified Scenario Root Properties<br />
20. Select core1 and right-click.<br />
21. From the context menu, select New Child > Scenario Inner Node.<br />
A node is added to core1 (Figure 4.92).<br />
Figure 4.92 Scenario Editor — Adding Inner Node<br />
NOTE You can create the desired hierarchal structure using context menu options like Scenario Leaf<br />
Nodes and Scenario Inner Nodes, and add descriptions and labels to the nodes. You can also<br />
add Ttf Configuration Group(s) and add operations to these groups.<br />
NOTE For further in<strong>for</strong>mation on how to set default properties, modify properties <strong>for</strong> configuration<br />
groups, set configuration files and validate, save, and execute scenarios, refer to the<br />
4.4Modifying Scenarios topic.<br />
189
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Generating CSV and Summary CSV Reports<br />
4.5 Generating CSV and Summary CSV Reports<br />
The new Target Task is used to generate Comma Separated Value (CSV) files <strong>for</strong> a group of Ttf<br />
Operations. The new Target Task also lets you merge results of a group of CSV files into a summary<br />
report. You can open the CSV files in spreadsheet programs such as Excel or OpenOffice.<br />
The capability to generate CSV files existed in previous versions of the Per<strong>for</strong>mance Analysis Tools, but<br />
it was initiated either manually after measurements were complete, or automatically immediately after<br />
each measurement was made. The new GenCSV Target Task operation executes after the group of<br />
measurements have been completed, without causing stalls between measurement operations. Both the<br />
GenCSV and Merge operations require a .pfa file specification. These two operations only operate on<br />
Ttf Operations in the measurement group that specify the same .pfa file, because this guarantees that<br />
the measured events are the same and so allows <strong>for</strong> meaningful comparisons in the summary columns of<br />
the CSV files created by the Merge operations.<br />
You can view GenCSVs and Merge operations in the Scenario Editor as shown in Figure 4.93. The<br />
seven measurement steps prior to the GenCSVs operation can be enabled <strong>for</strong> execution. These steps<br />
execute without pauses <strong>for</strong> CSV generation. The GenCSVs step generates CSV files <strong>for</strong> all the seven<br />
measurement items, placing the generated CSV files in the respective measurement folders. Then the<br />
Merge step creates a summarized CSV file in a merge operation folder.<br />
Figure 4.93 GenCSVs and Merge Operations in Scenario Editor<br />
To operate CSV generation:<br />
1. Select Window > Show View > Other > Per<strong>for</strong>mance Analysis > Per<strong>for</strong>mance Analysis Events<br />
from CW IDE menu bar.<br />
The Per<strong>for</strong>mance Analysis Events viewer appears. You need to keep this viewer open <strong>for</strong> the CSV<br />
files to generate in the viewer automatically during the measurements. Also, the OTF files are loaded<br />
190 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Generating CSV and Summary CSV Reports<br />
automatically into the viewer upon completion of each measurement set. However, the graph is not<br />
updated unless you select a tree item.<br />
NOTE To load the OTF results automatically into the Per<strong>for</strong>mance Analysis Events viewer after the<br />
measurement, enable the TTF option by selecting True against the Enabled property of the<br />
TTf Default Properties item (in the Scenario Editor).<br />
2. Check all the checkboxes corresponding to the measurements of the DDR group, in the Scenario<br />
Editor.<br />
3. Select the parent node of DDR, right-click, and select the Execute Enabled Operations in Target<br />
Task Framework option.<br />
This initiates the execution of the measurements checked in the DDR group including GenCSVs and<br />
Merge. The execution progresses through the group of measurements. Figure 4.94 shows the<br />
Progress view after executing the first six steps. The seventh step is executing and the GenCSVs and<br />
Merge steps are blocked awaiting execution.<br />
NOTE These measurements are initially copied to the Target Tasks list, and they are optionally<br />
scheduled <strong>for</strong> immediate execution, or can be executed manually via the Target Tasks view<br />
controls.<br />
191
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Generating CSV and Summary CSV Reports<br />
Figure 4.94 Progress of Execution of DDR Measurements — Including GenCSVs and<br />
Merge<br />
After the operations complete in the Progress view, the results of the collection <strong>for</strong> all steps appear<br />
under the timestamped per<strong>for</strong>manceanalysisdata/run… folder in the <strong>CodeWarrior</strong><br />
Projects view. Expanding each folder displays an OTF measurement file and an associated CSV file<br />
if the associated item contains measurement data collection. Figure 4.95 shows measurement results<br />
of the GenCSVs step, and Figure 4.96 shows measurement results of the Merge step, which is a<br />
single CSV file that contains a summary table <strong>for</strong> the measurements in the DDR group.<br />
NOTE The <strong>CodeWarrior</strong> Projects view displays the events in an alphabetical order based on the<br />
Test Index prefix. The Scenario measurements Test Index values have been organized such<br />
that the folders with OTF data are grouped at the start of the list. However, the configuration<br />
and measurement steps are executed in the order as they appear in the Scenario Editor (in the<br />
.pfs configuration file), and the execution order appears same in the Target Tasks list also.<br />
192 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Generating CSV and Summary CSV Reports<br />
Figure 4.95 Results of GenCSVs After Executing DDR Measurements<br />
Figure 4.96 Results of Merge After Executing DDR Measurements<br />
4. Open the CSV files in Excel to view the results and summary report.<br />
Tracing and Analysis Tools User Guide<br />
193
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Capturing Program Counter with Event Captures<br />
4.6 Capturing Program Counter with Event Captures<br />
You need to capture the program counter (PCC) <strong>for</strong> each core at the time when the counter events are<br />
latched. You can modify any core measurement to enable collection of the PCC register by assigning<br />
PCC to the PCC event under the 22_PC event group <strong>for</strong> the core. The PFA editor is used <strong>for</strong> making<br />
modifications to the PFA files to add PCC capture event. Figure 4.97 shows modification of the CPU-<br />
Branch.pfa file, which is one of the many event-to-counter configuration files provided with the preconfigured<br />
scenarios.<br />
To modify the CPU-Branch.pfa file to add PCC capture:<br />
1. Browse to the Scenarios\scenes5020\CPU directory in the <strong>CodeWarrior</strong> Projects view and doubleclick<br />
on the CPU-Branch.pfa file.<br />
2. Expand P5020-EVENTS > CORES > CORE0 > 22_PC.<br />
3. Right-click on the PCC node, and select the PCC option from the context menu.<br />
Figure 4.97 Modifying CPU-Branch.pfa File<br />
Figure 4.98 shows the output of PCC collection. The OTF viewer has been configured to display the<br />
individual samples to view the PC values displayed in the tree <strong>for</strong> each sample collected. The PC<br />
values are displayed in hexadecimal in the OTF tree sample presentation, but all data in the associated<br />
graph are currently displayed as the decimal equivalent values.<br />
194 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Setting Per<strong>for</strong>mance Analysispoints<br />
Figure 4.98 OTF Editor Showing Presentation of Captured PCC Values<br />
4.7 Setting Per<strong>for</strong>mance Analysispoints<br />
You can set start and stop Per<strong>for</strong>mance Analysispoints (Pfapoints) in the source code of your application,<br />
similar to tracepoints, to collect per<strong>for</strong>mance analysis measurements between a particular range. This<br />
feature works in coordination with the scenario measurements to handle the start and stop range of the<br />
measurements. The feature creates the pfaAnalysisPoints.pfsc file in the<br />
per<strong>for</strong>manceanalysisdata folder that you need to import into the workspace be<strong>for</strong>e setting Pfapoints.<br />
Refer to the Importing PFS Files and Per<strong>for</strong>mance Analysis Data topic to know how to import the<br />
Per<strong>for</strong>mance Analysis data folders into your project.<br />
To set start and stop Pfapoints in the source code, per<strong>for</strong>m the following steps. This procedure<br />
demonstrates the steps of setting Pfapoints in a multicore (core 0 and core 1) P4080DS project within a<br />
particular source range and then configuring and measuring the branch events (CPU Branch Miss Ratio)<br />
<strong>for</strong> that source range. The steps are same <strong>for</strong> setting Pfapoints in a single core project.<br />
1. Debug your multicore project.<br />
2. Open Scenario_Container_4080.pfs in the Scenario Editor.<br />
3. Open Target Tasks view if it is not opened by selecting Window > Show View > Other > Debug ><br />
Target Tasks.<br />
4. Open Per<strong>for</strong>mance Analysis Events viewer by selecting Window > Show View > Other ><br />
Per<strong>for</strong>mance Analysis > Per<strong>for</strong>mance Analysis Events.<br />
5. Set start and stop Pfapoints in the source code of core 0.<br />
195
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Setting Per<strong>for</strong>mance Analysispoints<br />
a. Right-click on the marker bar against the statement where you want to set the start Pfapoint<br />
(Figure 4.99).<br />
b. Select Toggle Pfa Start Point > Toggle Pfa Start Point from the context menu.<br />
The Pfa start point is set in the source code.<br />
c. Right-click on the marker bar against the statement where you want to set the stop Pfapoint<br />
(Figure 4.99).<br />
d. Select Toggle Pfa Stop Point > Toggle Pfa Stop Point from the context menu.<br />
The Pfa stop point is set in the source code.<br />
Figure 4.99 Start and Stop Pfapoints Set in Source Code — Core 0<br />
6. Similarly set start and stop Pfapoints in the source code of core 1 as shown in Figure 4.100.<br />
Figure 4.100 Start and Stop Pfapoints Set in Source Code — Core 1<br />
The Pfapoints set in core 0 and core 1 appear in the Analysispoints view. Open the Analysispoints<br />
view by selecting Window > Show View > Other > Software Analysis > Analysispoints.<br />
196 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Setting Per<strong>for</strong>mance Analysispoints<br />
Figure 4.101 Analysispoints View Displaying Start and Stop Pfapoints<br />
7. Execute the IAC scenario measurement in the Scenario Editor<br />
(Scenario_Container_4080.pfs) to apply the start and stop Pfapoints configuration to your<br />
application.<br />
a. Expand CPU > CPU - IAC in the Scenario Editor and check the Set IAC start to stop checkbox.<br />
b. Right-click and select the Execute Enabled Operations in Target Task Framework option from<br />
the context menu.<br />
The Target Tasks view displays the executed tasks.<br />
c. Clear the Set IAC start to stop checkbox in the Scenario Editor.<br />
8. Click the Multicore Resume button in the Debug view to resume your application.<br />
9. Expand CPU > CPU - Utilization and check the Branch Miss Ratio checkbox.<br />
10. Right-click and select the Execute Enabled Operations in Target Task Framework option from the<br />
context menu.<br />
The Target Tasks view displays the executed tasks, and the collected results are added to the<br />
per<strong>for</strong>manceanalysisdata folder in the <strong>CodeWarrior</strong> Projects view.<br />
11. View the results in the Per<strong>for</strong>mance Analysis Events viewer. The viewer displays results collected<br />
after setting Pfapoints in a particular source range.<br />
197
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Setting Per<strong>for</strong>mance Analysispoints<br />
Figure 4.102 Per<strong>for</strong>mance Analysis Events Viewer with Results After Setting Pfapoints<br />
NOTE Since you are using core 0 and core 1 of P4080 (which has total eight cores), only these two<br />
cores will have collection related to the source stop and start Pfapoints that you set in the<br />
source code. The data on the unused cores will be zero.<br />
Figure 4.103 shows results collected be<strong>for</strong>e setting Pfapoints. The branches as per event counts collected<br />
are different because you selected different ranges <strong>for</strong> different cores.<br />
198 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Setting Per<strong>for</strong>mance Analysispoints<br />
Figure 4.103 Per<strong>for</strong>mance Analysis Results Collected Be<strong>for</strong>e Setting Pfapoints<br />
NOTE To view results of both the cores in the same chart, click BRANCHES_FINISHED in Core 0,<br />
press the Ctrl key, and click BRANCHES_FINISHED in Core 1.<br />
4.7.1 Setting Pfapoints From Disassembly View<br />
You can also set Pfapoints from the Disassembly view after debugging your application. In the<br />
Disassembly view, the Pfapoints are set corresponding to the addresses of the functions <strong>for</strong> which you<br />
want o collect measurements. To set start and stop Pfapoints from Disassembly view:<br />
1. Select core 0 thread in the Debug view.<br />
2. In the Disassembly view, right-click on the marker bar against the address of the function at which<br />
you want to set start Pfapoint. Similarly, set the stop Pfapoint.<br />
199
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Zip File Database of Event, Counter and Metric Capabilities<br />
Figure 4.104 Pfapoints Set in Disassembly View<br />
3. Select core 1 thread in the Debug view, and set start and stop Pfapoints in the Disassembly view.<br />
4. View the set Pfapoints in the Analysispoints view. For detailed in<strong>for</strong>mation on the Analysispoints<br />
view, refer to the Analysispoints View topic. The actions/functions available in the Analysispoints<br />
view are same <strong>for</strong> both tracepoints and Pfapoints.<br />
4.8 Zip File Database of Event, Counter and Metric<br />
Capabilities<br />
The metric definitions and the event to counter configuration capabilities database have been provided in<br />
the <strong>for</strong>m of approximately 1500 individual xml files per target device. The depth of the tree and the<br />
lengthy filenames cause potential problems of exceeding Windows 264 character pathname limits,<br />
depending upon the installation path of the database. This has been resolved by packing the database into<br />
several zip files, and re-writing the XML processing code to use the directory hierarchy preserved in the<br />
zip file. This also benefits in reducing the installation time.<br />
Figure 4.105 shows the location of the zip database files with the hover text showing 1102 files and<br />
folders in the single p4040-Events.zip file. The XML configuration files contained within the zip<br />
200 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Zip File Database of Event, Counter and Metric Capabilities<br />
file databases are exactly the same as in prior versions. The only difference is that the path limitations of<br />
the Operating System do not come into play beyond the name of the zip file.<br />
To do any modification in the XML files in the database, <strong>for</strong> example, to add a new metric definition, you<br />
will need to unzip the zipped files to a folder <strong>for</strong> editing. Then recompress the folder to the zip <strong>for</strong>mat and<br />
replace it in the layout. Currently, a custom editor is not provided to support modifications to the metrics<br />
and defined events and counters.<br />
Figure 4.105 Zip File Database Contents<br />
201
Per<strong>for</strong>mance Analysis <strong>for</strong> QorIQ P Series<br />
Zip File Database of Event, Counter and Metric Capabilities<br />
202 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong><br />
B4 and T4 Devices<br />
Tracing and Analysis Tools User Guide<br />
5<br />
The Per<strong>for</strong>mance Analysis tool enables you to configure, collect, and analyze scenarios in the B4 and T4<br />
devices. The tool helps you optimize your bareboard application by using core and plat<strong>for</strong>m counters to<br />
provide enhanced levels of visibility to the application. This tool is integrated in the <strong>CodeWarrior</strong> IDE to<br />
handle configuration and communication with the target system.<br />
This chapter explains:<br />
Per<strong>for</strong>mance Analysis Perspective<br />
Creating New Configuration<br />
Connecting to Board<br />
Selecting Scenarios<br />
Running Scenarios<br />
Viewing Results<br />
5.1 Per<strong>for</strong>mance Analysis Perspective<br />
The Per<strong>for</strong>mance Analysis perspective provides a user-friendly interface to per<strong>for</strong>m the scenario<br />
measurement activities, such as adding a configuration, configuring connection, defining scenarios, and<br />
collecting data. The Per<strong>for</strong>mance Analysis perspective contains the following views:<br />
Per<strong>for</strong>mance Analysis View<br />
Configuration View<br />
Per<strong>for</strong>mance Analysis Session View<br />
Progress View<br />
5.1.1 Per<strong>for</strong>mance Analysis View<br />
The Per<strong>for</strong>mance Analysis view organizes measurement activities in terms of projects. A project<br />
contains configuration in<strong>for</strong>mation and the data that is collected as shown in the following figure.<br />
203
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
Figure 5.1 Per<strong>for</strong>mance Analysis View<br />
You can import or export your project using the Per<strong>for</strong>mance Analysis view. To import a Per<strong>for</strong>mance<br />
Analysis configuration or project into your workspace, right-click the project and select the Import<br />
option from the context menu. In the Import wizard that appears, select the archived file or the root<br />
directory at which the project to be imported is located. Click Finish.<br />
To export a Per<strong>for</strong>mance Analysis project, right-click the project and select the Export option from the<br />
context menu. In the Export wizard that appears, select the destination type and the directory where you<br />
want to export the project. Click Finish.<br />
5.1.2 Configuration View<br />
The Configuration view lets you configure connections and scenarios <strong>for</strong> measurement.<br />
204 Tracing and Analysis Tools User Guide
Figure 5.2 Configuration View<br />
The Configuration view contains the following panes:<br />
Connection Pane<br />
Scenarios Pane<br />
Sampling Pane<br />
Filter Core Events Pane<br />
Target In<strong>for</strong>mation Pane<br />
5.1.2.1 Connection Pane<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
The Connection pane of the Configuration view lets you define the connection method that is used to<br />
communicate to the target hardware when a probe is being used in bareboard applications.<br />
Figure 5.3 Configuration View – Connection Pane<br />
The following table lists the options available in the Connection pane.<br />
205
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
Table 5.1 Configuration View – Connection Pane Options<br />
Option Name Description<br />
Drop-down menu Lists the previously selected connections and<br />
displays the currently selected connection on<br />
top. Appears blank if there is no selected<br />
connection.<br />
New Connection Lets you add/configure a connection manually<br />
to a bareboard application. Refer Adding<br />
Connection Manually <strong>for</strong> more details.<br />
Search For<br />
Connections<br />
Search the local subnet <strong>for</strong> available probes.<br />
Refer Selecting Connection Automatically <strong>for</strong><br />
more details.<br />
Edit Connection Lets you modify an existing connection. The<br />
connection could be either automatically<br />
selected or manually added.<br />
Remove<br />
Connection<br />
Removes an existing connection from the list.<br />
Select the connection you want to remove and<br />
click this button.<br />
Menu Allows you to select an option to display the<br />
selected connection by IP address, host name<br />
or alias.<br />
Processor Displays the target processor. This determines<br />
what metrics and scenarios will be available to<br />
measure.<br />
Status Shows the availability of a selected connection.<br />
RED represents that the target is<br />
unavailable<br />
ORANGE represents that the status<br />
is unknown.<br />
GREEN represents that the target is<br />
available to use<br />
Scan Probe Scans the connection and determines the<br />
status of the connection and the type of<br />
processor that is connected to the probe.<br />
206 Tracing and Analysis Tools User Guide
5.1.2.2 Scenarios Pane<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
The Scenarios pane lets you define the scenarios that will be measured. A scenario contains the<br />
following:<br />
Events — Hardware occurrences that can be counted to any event in the T4 or B4 processor,<br />
including the output of other counters in a feedback loop.<br />
Counters — Counters that can be connected to any event in the T4 or B4 processor, including the<br />
output of other counters in a feedback loop.<br />
Metrics — A mathematical combination of counters (which count events) to provide an additional<br />
answer.<br />
Figure 5.4 Configuration View – Scenarios Pane<br />
The following table lists the options available in the Scenarios pane.<br />
Table 5.2 Configuration View – Scenarios Pane Options<br />
Option Name Description<br />
Add a Stock Scenario Lets you select different stock scenarios. A stock scenario is<br />
the standard scenario available on the tools. Refer Selecting<br />
Scenarios <strong>for</strong> more details.<br />
Delete a Stock<br />
Scenario<br />
Removes the selected scenario from the list.<br />
207
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
Table 5.2 Configuration View – Scenarios Pane Options<br />
Option Name Description<br />
Move Scenarios Up Moves scenarios up in the order of execution. This option is<br />
only available when multiple scenarios are added. The<br />
scenarios run in the order they appear in the Scenarios view.<br />
All scenarios are independent of each other.<br />
Move Scenarios<br />
Down<br />
Show/Hide Advanced<br />
Options<br />
5.1.2.3 Sampling Pane<br />
The Sampling pane is used to configure the events sampling or collection settings.<br />
Figure 5.5 Configuration View – Sampling Pane<br />
Moves scenarios down in the order of execution. This option is<br />
only available when multiple scenarios are added. The<br />
scenarios run in the order they appear in the Scenarios view.<br />
All scenarios are independent of each other.<br />
When clicked to show advanced options, adds the Configure<br />
Counters column to the right of the Description column. The<br />
Configure Counters column displays the checkboxes against<br />
each scenario. If checked, the hardware is configured to<br />
measure the selected scenario when the profiling session<br />
starts. If unchecked, no hardware configuration happens, that<br />
is the previous hardware settings remain active and the current<br />
values of the counters are read.<br />
The table below lists the options available in the Sampling pane of the Configuration view.<br />
208 Tracing and Analysis Tools User Guide
Table 5.3 Options Available in Sampling Pane<br />
Group Option Description<br />
Start Sampling<br />
Events<br />
Stop Sampling<br />
Events<br />
Automatically after<br />
launch<br />
When I press the<br />
‘Go’ toolbar button<br />
After <br />
samples<br />
When I press the<br />
‘Stop’ toolbar<br />
button. Keep the<br />
last <br />
samples<br />
5.1.2.4 Filter Core Events Pane<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
The Filter Core Events pane is used to limit the data collection between two addresses. For example, if<br />
you want the branch miss ration event generated only <strong>for</strong> a specific part of the code.<br />
Figure 5.6 Configuration View – Filter Core Events Pane<br />
Lets you specify the settings <strong>for</strong> starting the event<br />
collection.<br />
If selected, starts collecting events automatically<br />
when Profile button is clicked. This button is<br />
used to launch profiling to measure scenarios. For<br />
details, refer Running Scenarios.<br />
If selected, waits <strong>for</strong> you to click the Go button after<br />
Profile button is clicked. The Go button is<br />
present in the Per<strong>for</strong>mance Analysis Session View.<br />
Lets you specify the settings <strong>for</strong> stopping the event<br />
collection.<br />
Stops event collection or scenario measurement after<br />
collecting a specified number of samples.<br />
Stops event collection after you click the Stop button<br />
in the Per<strong>for</strong>mance Analysis Session View. The<br />
number of last collected samples that will be<br />
displayed need to be specified in the textbox.<br />
The table below lists the options available in the Filter Core Events pane of the Configuration view.<br />
209
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
Table 5.4 Options Available in Filter Core Events Pane<br />
Option Description<br />
Count events<br />
unconditionally<br />
Count events if PC is in<br />
Address 0..Address 1<br />
Range<br />
Start counting at Address 0,<br />
stop at Address 1<br />
5.1.2.5 Target In<strong>for</strong>mation Pane<br />
Collects events without specifying any range in the code.<br />
Counts events within a specified address range only.<br />
Starts counting when address 0 is hit and stops at address 1.<br />
The Target In<strong>for</strong>mation pane allows you to set the clock frequencies and multipliers on the target board.<br />
These frequencies are used to compute complex metrics that imply reporting the number of events to a<br />
certain time frame, <strong>for</strong> example, computing the DDR traffic. The accuracy of the results depends on the<br />
correctness of the frequency values you specify.<br />
The default values are displayed in the respective textboxes; you can modify them according to the speed<br />
on a particular target board.<br />
Figure 5.7 Configuration View – Target In<strong>for</strong>mation Pane<br />
Check the Automatically display all results checkbox to display the generated data automatically after<br />
data measurement or collection stops.<br />
210 Tracing and Analysis Tools User Guide
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Per<strong>for</strong>mance Analysis Perspective<br />
5.1.3 Per<strong>for</strong>mance Analysis Session View<br />
The Per<strong>for</strong>mance Analysis Session view displays the status of all the events that are being generated<br />
when collection starts. Once an event is generated successfully, the status is shown as Done. For pending<br />
events, the status is shown as Running.<br />
Figure 5.8 Per<strong>for</strong>mance Analysis Session View<br />
The buttons available in the Per<strong>for</strong>mance Analysis Session view are:<br />
Go — Click this button to start data collection if you have selected the When I press the ‘Go’<br />
toolbar button option in the Sampling Pane, else the data collection starts automatically after<br />
pressing the Profile button.<br />
Figure 5.9 Go Button to Start Data Collection<br />
Pause — Click this button to pause data collection.<br />
Stop — Click this button to stop data collection.<br />
5.1.4 Progress View<br />
The Progress view of the Per<strong>for</strong>mance Analysis perspective displays the progress of the launching<br />
configuration. The progress bar continues as events generate one by one. After complete generation, it<br />
displays the status as ‘No operations to display at this time’.<br />
Tracing and Analysis Tools User Guide<br />
211
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Creating New Configuration<br />
Figure 5.10 Progress View<br />
5.2 Creating New Configuration<br />
To create a new configuration <strong>for</strong> Per<strong>for</strong>mance Analysis:<br />
1. Select Window > Open Perspective > Other > Per<strong>for</strong>mance Analysis from the <strong>CodeWarrior</strong> IDE<br />
menu bar to open the Per<strong>for</strong>mance Analysis perspective.<br />
2. Select File > New > Other to open the New wizard.<br />
Figure 5.11 New Wizard<br />
3. Select Per<strong>for</strong>mance Analysis > Configuration to open the New Configuration screen.<br />
Alternatively, click the icon from the main menu bar to get the New Configuration screen<br />
directly.<br />
212 Tracing and Analysis Tools User Guide
Figure 5.12 New Configuration Screen<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Connecting to Board<br />
4. Type a name <strong>for</strong> the configuration in the Configuration name textbox.<br />
5. Type a name <strong>for</strong> the project in the Project name textbox. This is the project in which your<br />
Per<strong>for</strong>mance Analysis configuration is defined. You can create the Per<strong>for</strong>mance Analysis<br />
configuration either in the existing project or in the new project. If you are creating the Per<strong>for</strong>mance<br />
Analysis project <strong>for</strong> the first time, the Use existing project option is disabled.<br />
6. Click Finish.<br />
The Per<strong>for</strong>mance Analysis project along with its configuration is created and appears in the<br />
Per<strong>for</strong>mance Analysis view.<br />
5.3 Connecting to Board<br />
After creating a Per<strong>for</strong>mance Analysis project, you need to select a connection to the board. You can<br />
select a connection to the board either automatically by using the Automatic Connection Discovery<br />
feature or by manually configuring the connection.<br />
Selecting Connection Automatically<br />
Adding Connection Manually<br />
213
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Connecting to Board<br />
5.3.1 Selecting Connection Automatically<br />
The Automatic Connection Discovery feature is used to select a connection automatically. This feature<br />
searches the local network <strong>for</strong> available probes and devices connected to them. These probes let you<br />
control software running on target hardware, with minimal intrusion into target operation.<br />
To select a connection automatically:<br />
1. Select the Search <strong>for</strong> Connections icon in the Configuration view.<br />
Figure 5.13 Search <strong>for</strong> Connection<br />
The Search Connections window appears and the Per<strong>for</strong>mance Analysis application starts scanning<br />
the local network <strong>for</strong> available probes.<br />
NOTE The search may take some time depending on how many probes are present in the network.<br />
Also this search only works on a local subnet and will not work across VPN connections.<br />
214 Tracing and Analysis Tools User Guide
Figure 5.14 Search Connections Window<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Connecting to Board<br />
Once the scan completes, the discovered probes along with the following details are populated in a<br />
table.<br />
Connection Details — Provides connection type and IP Addresses of the probes that were found on<br />
the network. If you want to display the connection type and host names, check the Use host names<br />
instead of IP Addresses checkbox.<br />
Name — Provides any names associated with the probe.<br />
Processor — Displays the processor that the emulator is connected to.<br />
Status — Displays additional in<strong>for</strong>mation about the probe.<br />
2. Scroll through the list of probes to select one or multiple probes. To select multiple probes, hold the<br />
control key and click through the probes.<br />
3. Select the connection in the Connection Details column and click OK.<br />
The connection reflects in the Configuration view and you have a connection to a system.<br />
215
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Connecting to Board<br />
Figure 5.15 Connection Selected in Configuration View<br />
4. Scan the probe to determine the processor that is connected to the probe.<br />
5. Click File > Save to save your configuration.<br />
5.3.2 Adding Connection Manually<br />
To manually add a connection to the board:<br />
1. Click the New Connection icon to open the Add a New Connection screen.<br />
2. Select the processor and connection type in the respective fields.<br />
3. Provide hostname or IP address depending on the connection type selected.<br />
Figure 5.16 Add a New Connection Screen<br />
4. Specify an alias <strong>for</strong> the connection in the Alias textbox. This field is optional.<br />
5. Click OK to save the settings.<br />
The connection is set and selected in the Configuration view.<br />
216 Tracing and Analysis Tools User Guide
Figure 5.17 Connection Added<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Selecting Scenarios<br />
NOTE If the connection displays unknown status, click the Scan Probe hyperlink to scan the probe<br />
connected to the processor.<br />
6. Click File > Save to save your configuration.<br />
5.4 Selecting Scenarios<br />
To select a scenario to add it to the Per<strong>for</strong>mance Analysis configuration:<br />
1. Click Add a Stock Scenario in the Scenarios section of the Configuration view.<br />
Figure 5.18 Add a Stock Scenario<br />
The Add Stock Scenarios screen appears in which only those scenarios that are<br />
applicable to the selected processor are displayed.<br />
2. Select the subsystem that you want to analyze.<br />
217
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Selecting Scenarios<br />
Figure 5.19 Add Stock Scenarios Screen<br />
3. Click OK to add the selected scenarios to the configuration.<br />
Figure 5.20 Scenarios Added to Configuration<br />
4. Click File > Save to save your configuration.<br />
218 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Running Scenarios<br />
You can also modify your configuration settings such as configuring board connection or adding<br />
scenarios using the Profile Configurations dialog box. The Profile Configurations dialog box appears<br />
on selecting Run > Profile Configurations from the <strong>CodeWarrior</strong> IDE menu bar.<br />
Select your configuration on left side, specify the required settings, and click Apply to save the settings.<br />
Figure 5.21 Profile Configuration Dialog Box<br />
5.5 Running Scenarios<br />
To run the selected scenarios, select Run > Profile from the <strong>CodeWarrior</strong> IDE menu bar to launch<br />
profiling. You can also click the Profile button in the main toolbar of the <strong>CodeWarrior</strong> IDE.<br />
Alternatively, you can click Profile in the Profile Configurations dialog box, which appears on selecting<br />
Run > Profile Configurations from the <strong>CodeWarrior</strong> IDE menu bar.<br />
219
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Running Scenarios<br />
Figure 5.22 Profiling/Measurement in Progress<br />
The Progress View provides a summary of the operations being carried out. Once the measurements are<br />
complete, the results are collected as part of the project and appear in the project folder in the<br />
Per<strong>for</strong>mance Analysis view.<br />
220 Tracing and Analysis Tools User Guide
Figure 5.23 Measurement Results<br />
5.6 Viewing Results<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Viewing Results<br />
You can view the scenario measurement results either in tabular or graphical <strong>for</strong>mat. To view the results,<br />
double-click the collections associated with your project in the Per<strong>for</strong>mance Analysis view (Figure<br />
5.23). The generated data appears displaying a summary of the metrics and scenarios collected in a<br />
tabular <strong>for</strong>mat as shown in the following figure.<br />
NOTE If you have kept the Automatically display all results checkbox checked in the Target<br />
In<strong>for</strong>mation section of the Configuration view, the results will get open automatically while<br />
data is collecting.<br />
221
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Viewing Results<br />
Figure 5.24 Data Collection Results<br />
At the bottom of the table view, there are four tabs:<br />
Results — Displays the default view showing the event data generated from the Per<strong>for</strong>mance<br />
Analysis tool. For details, refer Tabular Format.<br />
Graphs — Displays a graphical view of the data. For details, refer Graphical Format.<br />
Configuration — Displays a summary of the connection to the target.<br />
Notes — Allows you to write your own notes corresponding to the data results. The notes that you<br />
write get automatically saved which can be viewed later when you open the corresponding data<br />
results.<br />
Right-click a particular data result in the Per<strong>for</strong>mance Analysis view to get a context menu displaying<br />
the following options:<br />
Normalization — Provides three options to view results:<br />
– None — Displays the number of events without further processing.<br />
– Per Cycle — Displays the number of events occurring per cycle.<br />
– Per Second — Displays the number of events occurring per second. To compute normalization<br />
per second, the system clock set in the Target In<strong>for</strong>mation Pane is used.<br />
222 Tracing and Analysis Tools User Guide
Delete — Deletes the selected result.<br />
Rename — Lets you rename the selected result.<br />
Import — Lets you import the selected result into another project.<br />
Export — Lets you export results from another project.<br />
5.6.1 Tabular Format<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Viewing Results<br />
The tabular <strong>for</strong>mat of the results generated from the Per<strong>for</strong>mance Analysis tool displays the number of<br />
samples in rows and the number of events in columns. There is one event per core generated in each<br />
column.<br />
If you want to view event data of a particular column only, you can hide other columns. The columns<br />
hidden in the Results view are visible in the Graphs view.<br />
Figure 5.25 Data Collection Results in Tabular Form<br />
Right-click a column header to view the various options available:<br />
Export to CSV — Allows you to export the selected column into a CSV file. Click this option to<br />
open the Export to CSV dialog box. Specify the location and name of the file and click Save.<br />
Hide column — Allows you to hide the selected column. To hide multiple columns, hold the<br />
control key and click through the columns.<br />
Show all columns — Displays all columns in the table.<br />
Auto resize column — Resizes all displayed columns according to table width.<br />
223
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Viewing Results<br />
Rename column — Allows you to rename the selected column.<br />
5.6.2 Graphical Format<br />
Click the Graphs tab to view the graphical <strong>for</strong>m of the collected data.<br />
Figure 5.26 Data Collection Results in Graphical Format<br />
A graph is generated <strong>for</strong> each event per core. You can use the scroll bar to view all the generated graphs<br />
<strong>for</strong> a particular collection. You can per<strong>for</strong>m various tasks on the graphs, such as auto scaling, zooming-in/<br />
out, and panning. The table below lists the description of each option available on the graph.<br />
224 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Viewing Results<br />
Table 5.5 Options Available in Graphical Format of Collected Results<br />
Option Name Description<br />
Display Measurements Allows you to specify strings to filter graphs according to their<br />
titles. For example, to display graphs with title<br />
BTB_MISS_RATIO (of Branch Miss Ratio event), specify the<br />
string BTB_MISS_RATIO in the text box, and click Apply.<br />
Only the graphs with BTB_MISS_RATIO as title will be<br />
displayed.<br />
If you want a specific string to be matched, uncheck the<br />
Regular Expression checkbox. If you want to match a<br />
particular string, anchor the string with * on both sides. For<br />
example, *core6* (with Regular Expressions unchecked)<br />
will display all results corresponding to core6 only. If you<br />
want to match a single character, anchor it with ? on both<br />
sides. For example, ?z?.<br />
Configure Settings Allows you to configure the settings of a selected graph.<br />
Click to display the Configure Graph Settings dialog box,<br />
and specify the graph settings (such as title color, legend,<br />
title font), axes settings (such as title, color, grid <strong>for</strong>mat), and<br />
traces settings (such as name, trace type, color, line width).<br />
Add Annotation Allows you to add annotations to a selected graph. Click to<br />
display the Add Annotation dialog box and specify the<br />
settings according to requirements.<br />
Remove Annotation Lets you remove the added annotations from a selected<br />
graph.<br />
Per<strong>for</strong>m Auto scale Lets you adjust the x-axis and y-axis according to the range<br />
of the data in the selected graph.<br />
Rubberband Zoom Lets you select a rectangular area in the graph to zoom in.<br />
Horizontal Zoom Lets you specify the exact range horizontally in the graph to<br />
zoom in.<br />
Vertical Zoom Lets you specify the exact range vertically in the graph to<br />
zoom in.<br />
Zoom In Horizontally Zooms in horizontally in the area you clicked.<br />
Zoom Out Horizontally Zooms out horizontally in the area you clicked.<br />
225
Per<strong>for</strong>mance Analysis <strong>for</strong> B4 and T4 Devices<br />
Viewing Results<br />
Table 5.5 Options Available in Graphical Format of Collected Results<br />
Option Name Description<br />
Zoom In Vertically Zooms in vertically in the area you clicked.<br />
Zoom Out Vertically Zooms out vertically in the area you clicked.<br />
Panning Lets you move the selected graph to view a specific area of<br />
the graph.<br />
Undo Panning Lets you undo the panning action on the graph.<br />
Redo Panning Lets you redo the panning action on the graph.<br />
Save Snapshot to PNG<br />
FIle<br />
Allows you to capture image of the selected graphs in the<br />
PNG <strong>for</strong>mat.<br />
226 Tracing and Analysis Tools User Guide
Nexus Tracing of User<br />
Space Applications<br />
Tracing and Analysis Tools User Guide<br />
6<br />
The Nexus features implemented by the current Freescale <strong>Power</strong> <strong>Architecture</strong> cores provide a real-time<br />
view into the execution of a program. These features include program trace via Branch Trace Messaging,<br />
ownership trace via Ownership Trace Messaging, data trace, watchpoint messaging and so on. By<br />
configuring the hardware to generate these messages and by collecting and decoding the generated Nexus<br />
messages, a host side tool such as <strong>CodeWarrior</strong> <strong>for</strong> PA 10.x is able to reconstruct the overall program<br />
flow without any overhead to the running system.<br />
When a modern Operating System like Linux is running on the target, the reconstruction of events gets<br />
more sophisticated. Such Operating Systems usually segregate virtual memory into kernel space and user<br />
space. Kernel space is reserved <strong>for</strong> running the kernel, kernel extensions, and device drivers, whereas,<br />
user space is the memory where all user space applications run.<br />
In Nexus tracing of user space applications, the following key aspects affect the tracing that differentiate<br />
it from regular tracing of bareboard applications:<br />
Relocation of executables<br />
Most Linux user space applications use dynamic libraries that are built position-independent and are<br />
loaded at arbitrary addresses by the Operating System. To reconstruct program flow accurately, the<br />
in<strong>for</strong>mation about where these executables got loaded and adjusting the trace decoder accordingly is<br />
required. In addition, a big part of dynamic linking is the resolution of external symbol bindings<br />
between different executables. This in<strong>for</strong>mation is also required <strong>for</strong> trace reconstruction and needs<br />
to be captured from the system at runtime.<br />
Selective tracing<br />
In an Operating System that supports multi-tasking, multiple processes may share the same core/<br />
cores and may migrate from one core to another. There<strong>for</strong>e, it is necessary to support tracing of a<br />
process selectively.<br />
This chapter describes:<br />
Tracing User Space Processes Selectively<br />
Shared Objects and Dynamic Linking<br />
Target Configuration <strong>for</strong> Generating and Collecting Nexus Trace<br />
Workflow<br />
227
Nexus Tracing of User Space Applications<br />
Tracing User Space Processes Selectively<br />
6.1 Tracing User Space Processes Selectively<br />
A typical Operating System scheduler runs different processes on a core or a set of cores in time slices to<br />
optimize the usage of available resources. As such, processes get swapped out or migrated to other CPUs.<br />
For user space applications, it is required to trace only a process or a set of processes of interest while<br />
filtering out or disabling trace generation <strong>for</strong> the rest of the activity. <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong><br />
V10.x supports tracing a specific process of interest.<br />
The current Freescale <strong>Power</strong> <strong>Architecture</strong> cores provide functionality that can be configured to enable<br />
trace <strong>for</strong> a specific process. For Linux, a Kernel Module nexus_pmm.ko is provided.<br />
This package is available in \PA\PA_Tools\LinuxUST where is the<br />
directory where <strong>CodeWarrior</strong> <strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x is installed.<br />
6.2 Shared Objects and Dynamic Linking<br />
Most Linux user-space applications use shared libraries, which are relocated by the host operating<br />
system. In addition, symbol bindings between different shared libraries are resolved by the dynamic<br />
linker. For proper reconstruction of program flow, it is necessary to know the addresses, where these<br />
addresses get loaded, and details on the symbol bindings between different shared libraries. <strong>CodeWarrior</strong><br />
<strong>for</strong> <strong>Power</strong> <strong>Architecture</strong> V10.x provides an audit library that runs on the target and collects this<br />
in<strong>for</strong>mation from a running system with a minimal overhead. This audit library creates a log file with all<br />
the in<strong>for</strong>mation needed <strong>for</strong> trace analysis of the user space application.<br />
6.2.1 Input to Decoder<br />
The in<strong>for</strong>mation that you collect using the audit library needs to be input to the decoder. The audit library<br />
generates a log file .log <strong>for</strong> each process that it audits. The file is logged to a file path<br />
pointed to by the LD_LOG_PATHS environment variable. The file complies to an ASCII <strong>for</strong>mat and has<br />
the following entry types:<br />
Process Identifier In<strong>for</strong>mation<br />
Dynamic Symbol Binding<br />
6.2.1.1 Process Identifier In<strong>for</strong>mation<br />
There is just one PID entry in an audit log file and it is typically the first entry, although the list of events<br />
may be unordered as far as the decoder is concerned. The <strong>for</strong>mat of PID entry is:<br />
PID| where is the process identifier.<br />
For example, PID|1530<br />
The <strong>for</strong>mat of an executable Load event appears as:<br />
228 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Nexus Tracing of User Space Applications<br />
Shared Objects and Dynamic Linking<br />
L||| where is an integer token identifying<br />
the library that was loaded.<br />
For example, the listing below shows a log of captured load events.<br />
Listing 6.1 A sample log displaying captured load events<br />
L|0x48021f70|/lib/libdl.so.2|fbae000<br />
L|0x48022218|/usr/lib/libstdc++.so.6|fa71000<br />
L|0x480224e0|/home/root/skodikal/audittest/hello/libfoo.so|fa50000<br />
L|0x480227c0|/home/root/skodikal/audittest/hello/libbar.so|fa2f000<br />
L|0x48022a80|/lib/libm.so.6|f962000<br />
L|0x48022d28|/lib/libgcc_s.so.1|f92c000<br />
L|0x48022fd0|/lib/libc.so.6|f799000<br />
L|0x48030788|/lib/ld.so.1|48000000<br />
L|0x48030b60|main|0<br />
6.2.1.2 Dynamic Symbol Binding<br />
The dynamic symbol binding event describes how symbolic bindings are resolved by the dynamic linker.<br />
A dynamic symbol binding takes the following <strong>for</strong>mat:<br />
B|||<br />
where<br />
is the unmangled symbol name,<br />
is the effective address that this symbol maps to at run time, and<br />
is the shared library that defines this symbol.<br />
The listing below shows an example of captured dynamic symbol resolutions.<br />
Listing 6.2 A sample log displaying captured dynamic symbol resolutions<br />
B|_Z3barv|fa2f4ec|/home/root/skodikal/audittest/hello/libbar.so<br />
B|_Z3fooj|fa50578|/home/root/skodikal/audittest/hello/libfoo.so<br />
B|_ZNKSt5ctypeIwE19_M_convert_to_wmaskEt|fb34c50|/usr/lib/<br />
libstdc++.so.6<br />
B|_ZNKSt6locale2id5_M_idEv|fad31e0|/usr/lib/libstdc++.so.6<br />
B|_ZNSo5flushEv|fb06c20|/usr/lib/libstdc++.so.6<br />
6.2.1.2.1 Decoder Configuration<br />
This log file is provided to the decoder using the Eclipse Trace Configurations dialog box (Figure 6.1).<br />
229
Nexus Tracing of User Space Applications<br />
Shared Objects and Dynamic Linking<br />
Figure 6.1 Trace Configurations Dialog Box<br />
You can use the Eclipse Trace Configurations dialog box to partition the system, that is which<br />
Operating System controls which cores. You can define the name of the Operating System and select the<br />
core <strong>for</strong> the Operating System. The names of the Operating Systems must be unique.<br />
Click Add to define a new Operating System to display the Add Operating System In<strong>for</strong>mation dialog<br />
box. This dialog box allows you to add:<br />
the name of the Operating System,<br />
the path to the target file system on the host machine running the trace tool, and<br />
a list of Audit Log Files collected from the target.<br />
230 Tracing and Analysis Tools User Guide
Figure 6.2 Add Operating System In<strong>for</strong>mation<br />
Tracing and Analysis Tools User Guide<br />
Nexus Tracing of User Space Applications<br />
Shared Objects and Dynamic Linking<br />
To edit the Operating System settings, select it in the Operating Systems list in the Trace<br />
Configurations dialog box and click Edit. The Edit Operating System In<strong>for</strong>mation dialog box appears<br />
displaying the details of the selected Operating System.<br />
Figure 6.3 Edit Context Dialog Box<br />
Click Add in the dialog box to specify the path of audit log file <strong>for</strong> decoder configuration. The Select<br />
Audit File dialog box appears. This dialog allows you to manually enter the path, or select it from the<br />
workspace, filesystem or relative to a variable.<br />
231
Nexus Tracing of User Space Applications<br />
Shared Objects and Dynamic Linking<br />
Figure 6.4 Select Audit File Dialog Box<br />
6.2.1.2.2 Configuration via XML <strong>for</strong> Python Trace Clients<br />
At the low level <strong>for</strong> Python API users, the log file is provided using the Decoder XML configuration file.<br />
The Decoder XML configuration file contains a Context Awareness config block that lists all the<br />
contexts, such as OS and bareboard in which the applications run. Each config block inside the Context<br />
Awareness block describes one Context. This context describes the environment in which anything<br />
on that core runs.<br />
For each Context, there is an optional Target FileSystem path attribute. The users will have the<br />
target filesystem mounted or copied on their local machines. All paths collected by the audit library will<br />
be relative to this Target FileSystem path.<br />
Each core entry provides the name of the Context that it is hosting. Each Context also has a sub<br />
config block that lists all the Other executables. These may be paths to kernel modules, shared libraries,<br />
or ROM executable.<br />
Finally, there is another config block named Audit Files where all audit files are listed.<br />
The listing below shows an example of the Decoder XML Configuration file <strong>for</strong> user space tracing input<br />
to the decoder.<br />
Listing 6.3 A sample Decoder XML Configuration file <strong>for</strong> user space tracing input to the<br />
decoder<br />
<br />
Context Awareness<br />
true<br />
<br />
<br />
Linux<br />
<br />
FS Info<br />
<br />
232 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Nexus Tracing of User Space Applications<br />
Target Configuration <strong>for</strong> Generating and Collecting Nexus Trace<br />
Target Filesystem<br />
X:<br />
<br />
<br />
<br />
Other Executables<br />
true<br />
<br />
Executable0<br />
<br />
ExecPath<br />
<br />
<br />
<br />
<br />
<br />
Audit Files<br />
true<br />
<br />
path0<br />
X:/tmp/logs/1785.log<br />
<br />
<br />
....<br />
6.3 Target Configuration <strong>for</strong> Generating and Collecting<br />
Nexus Trace<br />
The trace of Linux user space applications is configured using a control script ntrace.py that<br />
configures trace by writing to the debug registers using the qoriq-dbg kernel module. This kernel<br />
module exposes debug registers through the debugfs virtual filesystem. The control script needs to<br />
access these registers using the files read/write operations and to ensure that the kernel module is loaded.<br />
The qoriq-dbg package is distributed as a part of the DPAA SDK 1.1.<br />
When ntrace.py runs on the target directly, it configures the trace and launch the user application<br />
without any delays. In addition, it uses a telnet/ssh session to per<strong>for</strong>m the configuration and collection<br />
without using a debug probe.<br />
The control script ntrace.py allows configuring the type of tracing to per<strong>for</strong>m, the trace buffer to use,<br />
the size and location in case of DDR, and the cores on which to run the users application.<br />
To get a complete list of all the supported attributes, use the following command on the target system<br />
python ntrace.py --help<br />
The key configurable attributes are:<br />
ownership — whether to configure ownership trace messaging.<br />
233
Nexus Tracing of User Space Applications<br />
Workflow<br />
daq — whether to configure data acquisition trace messaging.<br />
timestamp — whether to generate timestamps with trace.<br />
prog — whether to generate program trace.<br />
watchpoint — whether to generate watchpoint trace.<br />
cores — an array that lists all the cores on which the user application may run. The control script<br />
uses the Linux scheduler APIs to ensure that the application only runs on that set of cores.<br />
filterProgTrace — whether to trace only the user application.<br />
QORIQ_DBG — optional argument <strong>for</strong> providing the path to the qoriq-dbg virtual filesystem.<br />
There is a default path, however where to mount this path depends on the users setup.<br />
AUDIT_LIB — the path to the audit library.<br />
ddr — whether to collect data trace in DDR. The default is NPC.<br />
wrap — whether the trace buffer should be circular.<br />
6.4 Workflow<br />
The workflow of collecting trace is as follows:<br />
1. One time setup<br />
a. Deploy the qoriq-dbg, nexus_pmm, and libaudit packages into your system builder<br />
workspace, and build these packages. Refer to the system builder documentation <strong>for</strong> instructions<br />
on using and building packages.<br />
b. Deploy ntrace.py on to the target root filesystem.<br />
c. Load kernel modules qoriq-dbg, nexus_pmm, and nexus_instr.<br />
d. Invoke the application that you want to trace using ntrace.py with options of your choice.<br />
The sample code below demonstrates how you can use ntrace.py to:<br />
configure target to generate program trace with timestamps <strong>for</strong> myapp only<br />
launch myapp with cpu affinity 0<br />
collect trace to ddr<br />
python ntrace.py -cmdline=./myapp -prog -filterProgTrace -tstamp -<br />
cpu=[0, 1, 3] -ddr<br />
2. Upload trace to host<br />
The <strong>CodeWarrior</strong> Software Analysis support uploading and decoding trace in two ways: using the<br />
Python utility GetBufferTrace, or using the Trace and Profile tab of the Eclipse <strong>CodeWarrior</strong><br />
(Figure 6.5).<br />
234 Tracing and Analysis Tools User Guide
Tracing and Analysis Tools User Guide<br />
Nexus Tracing of User Space Applications<br />
Workflow<br />
Figure 6.5 Debug Configurations Dialog Box — Trace and Profile Tab<br />
3. Check the Start a trace session checkbox and specify other settings as required.<br />
4. Click Edit to display the Trace Configurations dialog box.<br />
5. Configure the User-space Process Trace settings as required. Assign the appropriate Operating<br />
System to any core(s) of the target. For details on configuring the User-space Process Trace settings,<br />
refer to the Decoder Configuration topic.<br />
6. Configure other trace settings in the Trace Configurations dialog box.<br />
7. Save the settings and launch a debug session.<br />
8. Starts a trace session by clicking the Start Trace Session button in the toolbar shown below.<br />
235
Nexus Tracing of User Space Applications<br />
Workflow<br />
Figure 6.6 Toolbar Used <strong>for</strong> Controlling Trace<br />
9. Upload the collected trace by clicking the Upload Trace button available in the toolbar.<br />
The Software Analysis view appears with the trace results.<br />
10. View the collected trace in the Software Analysis Trace Editor.<br />
236 Tracing and Analysis Tools User Guide
Index<br />
A<br />
Add a Stock Scenario 207, 217<br />
Add Annotation 225<br />
Add new analysispoint 102<br />
Add Operating System In<strong>for</strong>mation 230<br />
Adding PFU Configuration Groups 167<br />
Adding PFU Configuration Subroutine 169<br />
Address 66<br />
analysispoints<br />
viewing 97<br />
Analysispoints view 97<br />
analyzing data 60<br />
analyzing system 130<br />
ASM Count 66<br />
Attach Configuration 54<br />
Aurora Nexus Trace 81<br />
Aurora training script 81<br />
Automatically after launch 209<br />
B<br />
buffer<br />
DDR 18, 27<br />
NPC 18, 27<br />
C<br />
Capturing Program Counter with Event<br />
Captures 194<br />
chart parameters 128<br />
collecting data<br />
new project 11<br />
Collecting Nexus Trace 233<br />
comparator 44<br />
configuration access log 137<br />
Configuration tab 222<br />
Configuration view 204<br />
Configure Settings 225<br />
configuring<br />
ccs 109<br />
chart 128<br />
counters 121<br />
debugger 108<br />
Tracing and Analysis Tools User Guide<br />
Per<strong>for</strong>mance Analysis 116<br />
Per<strong>for</strong>mance Analysis tool 108<br />
target 110<br />
trace 19<br />
Connection Pane 213<br />
Connection pane 205<br />
connection parameters 115<br />
ccs 115<br />
ccsExe 115<br />
ccsTimeOut 116<br />
clockSpeed 116<br />
port 115<br />
remoteCCSAddr 115<br />
specifyCCSExe 115<br />
useRemoteCCS 115<br />
Count events if PC is in Address 0..Address 1<br />
Range 210<br />
Count events unconditionally 210<br />
counters 121<br />
Coverage 67<br />
Coverage % 66<br />
Creating New Per<strong>for</strong>mance Analysis<br />
Configuration 212<br />
Creating New Scenarios 182<br />
CSV 143<br />
Customize Trace Scenario 50, 53<br />
D<br />
data address 34<br />
DDR buffer 27<br />
configuration 43<br />
DDR Controller Trace 50<br />
DDRC0/DDRC1/DDRC2 52<br />
debugger 108<br />
Decoder Configuration 229<br />
default empty project 110<br />
Delete a Stock Scenario 207<br />
Display Measurements 225<br />
Dynamic Linking 228<br />
Dynamic Symbol Binding 229<br />
239
E<br />
Edit Connection 206<br />
Edit Operating System In<strong>for</strong>mation 231<br />
event out control 36<br />
event rate view 142<br />
events<br />
per<strong>for</strong>mance analysis 139<br />
events and counters 120<br />
Executing Scenarios 153<br />
Expert Mode Configuration Subroutines 165<br />
Export Per<strong>for</strong>mance Analysis project 204<br />
exporting chart 79, 143<br />
CSV 144<br />
PNG 144<br />
SVG 144<br />
Exporting Collected Data 69<br />
F<br />
Filter Core Events pane 209<br />
Flat Profile viewer<br />
Configure table 69<br />
Graphics 69<br />
Next function 68<br />
Previous function 68<br />
Search 68<br />
Show code 69<br />
Function 66<br />
G<br />
Generating CSV and Summary CSV Reports 190<br />
Go To File <strong>for</strong> Analysispoints 103<br />
Graphs tab 222, 224<br />
Group By 99<br />
GTAP 18<br />
GUI 107<br />
H<br />
helper programs 109<br />
Horizontal Zoom 225<br />
I<br />
Ignore all Analysispoints 103<br />
Import Per<strong>for</strong>mance Analysis project 204<br />
Importing PFS Files and Per<strong>for</strong>mance Analysis<br />
Data 146<br />
importing trace data file 85<br />
Instruction 67<br />
Instruction Address 32<br />
J<br />
JTAG 15<br />
L<br />
limitations 7<br />
Line Number/Address 67<br />
load configuration 145<br />
log configuration register accesses 132<br />
logic analyzer mode 136<br />
M<br />
manual overview 8<br />
Menu 206<br />
Modifying PFU Configurations 165<br />
Modifying Scenarios 177<br />
N<br />
NAL 27<br />
New Connection 206, 216<br />
Nexus Messages 75<br />
Nexus Messages View 75<br />
Normalization 222<br />
Notes tab 222<br />
O<br />
one shot mode 135<br />
Open Trace Format 107<br />
OTF 107, 142<br />
P<br />
P4080 107<br />
Panning 226<br />
Per<strong>for</strong>m Auto scale 225<br />
per<strong>for</strong>mance analysis 7, 116<br />
analyzing data 138<br />
collecting data 130<br />
configuration access log 137<br />
240 Tracing and Analysis Tools User Guide
configuration editor window 131<br />
configuring target 110<br />
editing target configuration 114<br />
exporting chart 143<br />
loading configuration 145<br />
logic analyzer mode 136<br />
one shot mode 135<br />
saving configuration 144<br />
specified cycle count operation 134<br />
viewing result 138<br />
Per<strong>for</strong>mance Analysis perspective 203<br />
Per<strong>for</strong>mance Analysis Scenarios (PFS)<br />
Editor 146<br />
Per<strong>for</strong>mance Analysis Session view 211<br />
Per<strong>for</strong>mance Analysis tool 107, 203<br />
Per<strong>for</strong>mance Analysis tools<br />
configuring 108<br />
starting 116<br />
Per<strong>for</strong>mance Analysis view 203<br />
PNG 143<br />
Process Identifier In<strong>for</strong>mation 228<br />
Profile button 219<br />
Profile Configurations dialog box 219<br />
Progress view 211<br />
R<br />
Redo Panning 226<br />
Remove All Analysispoints 103<br />
Remove Annotation 225<br />
Remove Connection 206<br />
Remove Selected Analysispoint 103<br />
Results tab 222<br />
Rubberband Zoom 225<br />
Running Scenarios 219<br />
S<br />
Sampling pane 208<br />
Save Snapshot to PNG FIle 226<br />
saving configuration 132, 144<br />
Scan Probe 206<br />
Scenario Editor 151<br />
Scenarios pane 207<br />
Search For Connections 206<br />
Search <strong>for</strong> Connections 214<br />
Tracing and Analysis Tools User Guide<br />
Selecting Scenarios 217<br />
Set CPU Frequency 80<br />
setting tracepoints 91<br />
Shared Objects 228<br />
Show Full Paths 99<br />
Show Nexus Messages 63<br />
Size 67<br />
Software Analysis Engine 107<br />
SAE 107<br />
Software Analysis View 60<br />
specified cycle count operation 134<br />
Start counting at Address 0, stop at Address<br />
1210<br />
Start Sampling Events 209<br />
Stop Sampling Events 209<br />
SVG 143<br />
T<br />
Target In<strong>for</strong>mation pane 210<br />
Terse1/2/3 52<br />
Time (CPU Cycles) 67<br />
trace 8, 11<br />
analyze data 60<br />
collecting data 56<br />
configuring 19<br />
configuring target 11<br />
new project 11<br />
Trace and Profile Tab <strong>for</strong> e6500 48<br />
Trace Editor 62<br />
tracepoints 91<br />
Tracing and Per<strong>for</strong>mance Analysis tools 7<br />
Tracing User Space Processes 228<br />
U<br />
Undo Panning 226<br />
User space applications 227<br />
V<br />
Verbose 52<br />
Vertical Zoom 225<br />
Viewing scenario measurement results 221<br />
Graphical Format 224<br />
Tabular <strong>for</strong>mat 223<br />
241
W<br />
When I press the ‘Go’ toolbar button 209, 211<br />
Working Set 100<br />
Z<br />
Zoom In Horizontally 225<br />
Zoom In Vertically 226<br />
Zoom Out Horizontally 225<br />
Zoom Out Vertically 226<br />
242 Tracing and Analysis Tools User Guide