codewarrior development studio for advanced packet ...€¦ · 2.2.3 code coverage data the code...

115
CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide Document Number: CWAPPSWAUG Rev. 10.2, 01/2016

Upload: others

Post on 10-Mar-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

CodeWarrior Development Studio forAdvanced Packet Processing Tracing

and Profiling User Guide

Document Number: CWAPPSWAUGRev. 10.2, 01/2016

Page 2: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

2 Freescale Semiconductor, Inc.

Page 3: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Contents

Section number Title Page

Chapter 1Introduction

1.1 Release notes.....................................................................................................................................................................7

1.2 About this Guide...............................................................................................................................................................7

1.3 Accompanying Documentation........................................................................................................................................ 8

Chapter 2Getting Started

2.1 About CodeWarrior interface........................................................................................................................................... 9

2.2 About data collection........................................................................................................................................................ 10

2.2.1 Trace data...............................................................................................................................................................11

2.2.2 Timeline data..........................................................................................................................................................11

2.2.3 Code Coverage data............................................................................................................................................... 11

2.2.4 Performance data....................................................................................................................................................12

2.2.5 Call Tree data......................................................................................................................................................... 12

2.2.6 Point-to-point profiler data.....................................................................................................................................12

2.2.7 GCov data.............................................................................................................................................................. 13

Chapter 3Collecting Data

3.1 Process for collecting data................................................................................................................................................ 15

3.2 Creating new project......................................................................................................................................................... 15

3.2.1 Creating simulator project......................................................................................................................................15

3.2.2 Creating hardware project......................................................................................................................................21

3.3 Configuring launcher........................................................................................................................................................ 26

3.3.1 Configuring simulator project................................................................................................................................26

3.3.1.1 Launching simulator................................................................................................................................ 27

3.3.1.2 Generating code coverage files................................................................................................................ 27

3.3.1.3 Setting launch configuration.................................................................................................................... 28

3.3.2 Configuring hardware project................................................................................................................................ 29

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 3

Page 4: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Section number Title Page

3.4 Collecting trace................................................................................................................................................................. 32

3.4.1 Using simulator...................................................................................................................................................... 33

3.4.2 Using hardware...................................................................................................................................................... 34

Chapter 4Viewing data

4.1 Analysis Results view.......................................................................................................................................................37

4.2 Viewing data generated by simulator............................................................................................................................... 40

4.2.1 Viewing trace data................................................................................................................................................. 40

4.2.1.1 Opening trace file in CodeWarrior...........................................................................................................41

4.2.1.2 Trace view................................................................................................................................................42

4.2.2 Viewing timeline data............................................................................................................................................ 44

4.2.2.1 Opening .timeline file in CodeWarrior.................................................................................................... 45

4.2.2.2 Timeline view.......................................................................................................................................... 45

4.2.2.2.1 Timeline.................................................................................................................................. 46

4.2.2.2.2 Toolbar....................................................................................................................................46

4.2.2.2.3 Timeline plot...........................................................................................................................47

4.2.2.2.4 Edit Groups dialog.................................................................................................................. 47

4.2.2.2.4.1 Adding or removing function............................................................................. 49

4.2.2.2.4.2 Editing address range of function.......................................................................49

4.2.2.2.4.3 Changing color................................................................................................... 49

4.2.2.2.4.4 Adding or removing group................................................................................. 49

4.2.2.2.4.5 Merging groups or functions.............................................................................. 50

4.2.3 Viewing Point-to-point profile data....................................................................................................................... 51

4.2.3.1 Point to Point Profiler markers.................................................................................................................52

4.2.3.2 Point to Point Profiler trace file............................................................................................................... 53

4.2.3.3 Point to Point Profiler standalone command-line tool............................................................................. 55

4.2.3.4 Report Viewer.......................................................................................................................................... 55

4.2.3.4.1 Report formats........................................................................................................................ 56

4.2.3.5 Working with Point to Point Profiler tool................................................................................................57

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

4 Freescale Semiconductor, Inc.

Page 5: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Section number Title Page

4.2.3.6 Point to Point Profiler advanced settings................................................................................................. 58

4.2.4 Viewing GCov data................................................................................................................................................59

4.2.4.1 Viewing coverage data.............................................................................................................................59

4.2.4.1.1 Viewing coverage details for selected source file...................................................................60

4.2.4.1.2 Viewing coverage details for all files..................................................................................... 61

4.2.4.2 gcov view................................................................................................................................................. 62

4.3 Viewing data generated by hardware................................................................................................................................63

4.3.1 Viewing Trace data................................................................................................................................................ 64

4.3.2 Viewing Timeline data...........................................................................................................................................64

4.3.3 Viewing Code Coverage data................................................................................................................................ 64

4.3.4 Viewing Performance data.....................................................................................................................................67

4.3.5 Viewing Call Tree data.......................................................................................................................................... 70

4.3.6 Viewing GCov data................................................................................................................................................71

Chapter 5AIOP decoder

5.1 Usage.................................................................................................................................................................................73

5.2 Remarks............................................................................................................................................................................ 75

5.3 Example............................................................................................................................................................................ 75

Chapter 6Tarmac2gcda

6.1 Usage.................................................................................................................................................................................77

6.2 Remarks............................................................................................................................................................................ 78

6.3 Example............................................................................................................................................................................ 79

Chapter 7Debug Print

7.1 Components...................................................................................................................................................................... 81

7.1.1 Debug Print target server....................................................................................................................................... 82

7.1.2 Debug Print library.................................................................................................................................................83

7.1.3 Debug Print probe.................................................................................................................................................. 84

7.1.4 Debug Print view................................................................................................................................................... 84

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 5

Page 6: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Section number Title Page

7.2 Configuring Remote Systems Explorer (RSE)................................................................................................................. 86

7.3 Using Debug Print.............................................................................................................................................................89

7.3.1 Debug Print for AIOP............................................................................................................................................ 94

Chapter 8AIOP Statistical Profiler

8.1 Running AIOP Statistical Profiler.................................................................................................................................... 98

8.2 Statistical Profiler results.................................................................................................................................................. 101

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

6 Freescale Semiconductor, Inc.

Page 7: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 1Introduction

Tracing is a technique to obtain diagnostic and performance information about aprogram's execution. This information is typically used for debugging purposes, andadditionally, depending on the type and detail of information contained in a trace log, todiagnose common problems with the software.

This manual explains how to use the CodeWarrior Tracing and Analysis tool set todevelop software for Freescale APP processors.

This chapter explains:• Release notes• About this Guide• Accompanying Documentation

1.1 Release notes

Release notes include information about new features, last-minute changes, bug fixes,incompatible elements, or other sections that may not be included in this manual.

You should read release notes before using the CodeWarrior IDE.

NOTEThe release notes for specific components of the CodeWarriorIDE are located in the Release_Notes folder in the CodeWarriorinstallation directory.

1.2 About this Guide

Each chapter of this manual describes a different area of software development.

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 7

Page 8: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The table below lists each chapter in the manual.

Table 1-1. Chapters in this Guide

Chapter Description

Introduction (this chapter)

Getting Started Describes the analysis tool and the trace and profiling data.

Collecting Data Describes how to collect the data from simulator and AIOPtargets.

Viewing data Describes how to view data for simulator and hardwaretargets.

AIOP decoder Describes AIOP decoder standalone tool and its usage.

Tarmac2gcda Describes tarmac2gcda standalone tool and its usage.

Debug Print Describes how to use the Linux Debug Print tool and itsexecution flow.

AIOP Statistical Profiler Describes how to use the AIOP Statistical Profiler tool toestimate the time spent on AIOP cores and acceleratorsduring an AIOP run.

1.3 Accompanying Documentation

The Documentation Roadmap page describes the documentation included in this versionof CodeWarrior Development Studio for Advanced Packet Processing.

You can access the Documentation Roadmap by:• a shortcut link on the Desktop that the installer creates by default, or• opening the START_HERE.html web page in the <CWInstallDir>\CW_APP\LS\Help folder.

Accompanying Documentation

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

8 Freescale Semiconductor, Inc.

Page 9: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 2Getting Started

CodeWarrior Tracing and Analysis Tools provide visibility into an application as it runson the simulator and the AIOP targets. This visibility can help you understand how yourapplication runs, as well as identify operational problems.

Tracing and analysis results are accurate for O0 optimization level. For an optimizationlevel higher than O0, the results that are provided by this tool can be affected. Theaffected results depends on the type of code and its optimization, whereas the results thatare based on asm code, analysis are not affected by optimization level. The results basedon source code and name of symbols can be affected by optimization level. For anaccurate analysis of the libraries linked to your project, make sure to generate debugginginformation for them so that all the debug symbols are found and included in thestatistics.

This chapter explains the CodeWarrior interface and data collection in the following twotopics:

• About CodeWarrior interface• About data collection

2.1 About CodeWarrior interface

The CodeWarrior Development Studio provides a common interface for developing,debugging, and analyzing your applications. The project-oriented Workbench windowprovides numerous perspectives containing views, editors, and controls that appear inmenus and tool bars.

After creating a project, build your application, define a launch configuration, and thenwait for data collection and data display.

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 9

Page 10: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 2-1. Workbench window

The perspective is a collection of views within the Workbench window used by theTracing and Analysis tools.

Standard perspective views:• CodeWarrior Projects view provides a hierarchical view of the project resources in

the Workbench. Right-click context menus provide file-management controls.• Console view shows the process output including actions, messages, and errors. It

display messages indicating when data collection is enabled, in process, andcomplete.

• Analysis Results view provides a hierarchical view of the project's data sources, datafiles, and data sets of the simulator.

2.2 About data collection

This section lists the types of data collected for an application when it runs on thesimulator and AIOP targets.

You can collect the following types of data for an application:• Trace data

About data collection

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

10 Freescale Semiconductor, Inc.

Page 11: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Timeline data• Code Coverage data• Performance data• Call Tree data• Point-to-point profiler data• GCov data

2.2.1 Trace data

The Trace view displays the trace data collected by the simulator and the targets. Thefeatures available for the Trace view include:

• Export trace data to an Excel file• Configure Timestamp column of the trace data as absolute or delta values in decimal

or hexadecimal format• Set CPU frequency and convert the clock cycles into real time in milliseconds,

microseconds, or nanoseconds, displayed in the Timestamp column• Copy and paste a cell or a line of the trace data• Auto resize the column width or a row• Quick navigation through trace using navigation buttons• Expand the trace lines for more detailed information on the events• Search capability

2.2.2 Timeline data

The Timeline view displays the timeline data in a graphical view of the functions that areexecuted in the application and the number of cycles each function takes when theapplication is run. The Timeline view displays the evolution of the execution in real-time.It allows the user to calculate the time spent on each function or group and easily see howthe execution passed from one function to another. The view supports multi-source andmulti-context traces, displaying each source in its own tab.

2.2.3 Code Coverage data

The code coverage data is generated based on the trace data. The Code Coverage viewdisplays name, start address, number of times each instruction is executed, and code sizeof each function in the program. The Code Coverage data view displays the detailedinformation of every instruction traced in the data.

Chapter 2 Getting Started

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 11

Page 12: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The features available for the Code Coverage data viewer include:• Statistics at function level• Statistics at source line and asm instruction level• Code view in specialized source editor• Column ordering and sorting and filtering for both function and source line/

instruction level• Graphics available to the source or asm lines, for a large variety of the data, showing

visually the percentage compared to the line with the largest value• Export to .csv or .html formats at function level or source line/asm instruction level

2.2.4 Performance data

The performance data includes the metric and invocation information for each functionthat executes in the application. The performance data during measurement enables youto compare the relative efficiencies of various portions of your target program. Bothexclusive and inclusive timing measurements are provided in the performance data. Theparent-child calling relationships between your program's functions are also provided.Each function pair consists of a caller and a callee with data provided for each.

The features available for performance data viewer:• statistics af function level• statistics at call site level• column ordering, sorting and filtering at source and call site level• export to .csv at function or call site level

2.2.5 Call Tree data

The Call Tree data shows the general application flow in a hierarchical tree in whichstatistics are displayed for each function.

Call Tree Data can be exported to .dot format and displayed graphically in aspecialized .dot viewer (for example, http://www.webgraphviz.com ).

2.2.6 Point-to-point profiler data

Point-to-point profiler data displays the gathered statistics and reports in CodeWarrior forthe supported AIOP counters.

About data collection

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

12 Freescale Semiconductor, Inc.

Page 13: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

2.2.7 GCov data

GCov data shows the identified source lines based on their execution. The tool can alsoidentify the number of times a particular line has been executed, making it useful forperformance profiling and help discover the optimization efforts that will best affect thecode.

Chapter 2 Getting Started

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 13

Page 14: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

About data collection

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

14 Freescale Semiconductor, Inc.

Page 15: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 3Collecting Data

This chapter explains how the program runs on the simulator and AIOP targets to collectthe data.

This chapter contains the following topics:• Process for collecting data• Creating new project• Configuring launcher• Collecting trace

3.1 Process for collecting data

This section describes the process for setting up the tools for data collection.

To collect data, you have to perform the following steps:1. Create and configure a project2. Set up the debugger launch configuration to collect the analysis data3. Run the application to collect data

3.2 Creating new project

You can use the CodeWarrior Bareboard Project Wizard to create new projects. Thistopic explains the process to create new projects for both simulator and hardwareprofiling in the following sections:

• Creating simulator project• Creating hardware project

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 15

Page 16: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

3.2.1 Creating simulator project

This section describes the process to create a simulator project for collecting the tracedata.

To create a new bareboard project using simulator, follow the step listed below:

1. Start the CodeWarrior IDE.2. Select File > New > CodeWarrior Bareboard Project Wizard, from the

CodeWarrior IDE menu bar.

The CodeWarrior Bareboard Project Wizard launches and the Create aCodeWarrior Bareboard Project page appears.

3. Specify a name for the new project in the Project name text box.For example, enter the project name as simulator_project.

Figure 3-1. Create a CodeWarrior Bareboard Project page4. If you do not want to create your project in the default workspace:

a. Clear the Use default location checkbox.b. Click Browse and select the desired location from the Browse For Folder

dialog box.c. In the Location text box, append the location with the name of the directory in

which you want to create your project.

NOTEAn existing directory cannot be specified for theproject location.

Creating new project

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

16 Freescale Semiconductor, Inc.

Page 17: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

5. Click Next.

The Processor page appears.

6. Select the target processor for the new project, from the Processor list.7. Select Application from the Project Output group, to create an application

with .elf extension, that includes information required to debug the project.

Figure 3-2. Processor page8. Click Next.

The Debug Target Settings page appears.

9. Select Simulator from the Debugger Connection Types group. Your selectiondetermines the launch configurations that you can include in your project.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 17

Page 18: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-3. Debug Target Settings page10. Select the simulator you plan to use from the Board drop-down list.

NOTESimulator(s) that supports the target processor selected onthe Processors page are only available for selection.

11. Select the launch configurations, that you want to include in your project and thecorresponding connection.

12. Select the interface to communicate with the hardware, from the Connection Typedrop-down list.

13. Specify the IP address of the TAP device in the TAP address text box.

NOTEThis option is disabled and cannot be edited for thesimulator connection.

14. Specify the IP address of the remote Linux 64-bit machine, CCSSIM2 is started on,in the Simulator remote IP text box.

15. Specify the port number that the debugger will use to communicate with thesimulator, launched on the remote Linux 64-bit machine, in the Simulator portnumber text box.

16. Click Next.The Build Settings page appears.

Creating new project

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

18 Freescale Semiconductor, Inc.

Page 19: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-4. Build Settings page17. Select the programming language, you want to use, from the Language group.

The language you select determines the libraries that are linked with your programand the contents of the main source file that the wizard generates.

18. Select a toolchain from the Toolchain group.

Selected toolchain sets up the default compiler, linker, and libraries used to build thenew project. Each toolchain generates code targeted for a specific platform.

19. Select an option from the Floating Point drop-down list, to prompt the compiler tohandle the floating-point operations by generating instructions for the selectedfloating-point unit.

20. Click Next.The Configurations page appears.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 19

Page 20: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-5. Configurations page21. Select a processing model option from the Processing Model group.

NOTECurrently only the AMP (One project per core) option isavailable. This option generates a separate project for eachselected core and it also sets the core index for each projectbased on the core selection.

The SMP and AMP (One build configuration per core)options are disabled and cannot be selected in the currentrelease.

22. Select the processor core that executes the project, from the Core index list.23. Click Next.

The Software Analysis page appears.

24. Select Enable Coverage Support.

NOTEIf this option is not enabled, the GCov coverage data willnot be available, but it can be enabled manually later.

Creating new project

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

20 Freescale Semiconductor, Inc.

Page 21: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-6. Software Analysis page - Enable Coverage Support option25. Click Finish.

The wizard creates an application project according to your specifications. You canaccess the newly created project from the CodeWarrior Projects view.

3.2.2 Creating hardware project

This section describes the process to create a bareboard project for collecting the tracedata.

To create a new project using hardware board, follow the step listed below:

1. Start the CodeWarrior IDE.2. Select File > New > CodeWarrior Bareboard Project Wizard, from the

CodeWarrior IDE menu bar.

The CodeWarrior Bareboard Project Wizard launches and the Create aCodeWarrior Bareboard Project page appears.

3. Specify a name for the new project in the Project name text box.For example, enter the project name as project_AIOP.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 21

Page 22: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-7. Create a CodeWarrior Bareboard Project page4. If you do not want to create your project in the default workspace:

a. Clear the Use default location checkbox.b. Click Browse and select the desired location from the Browse For Folder

dialog box.c. In the Location text box, append the location with the name of the directory in

which you want to create your project.

NOTEAn existing directory cannot be specified for theproject location.

5. Click Next.

The Processor page appears.

6. Select the target processor for the new project, from the Processor list.7. Select Application from the Project Output group, to create an application

with .elf extension, that includes information required to debug the project.

Creating new project

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

22 Freescale Semiconductor, Inc.

Page 23: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-8. Processor page8. Click Next.

The Debug Target Settings page appears.

9. Select Hardware from the Debugger Connection Types group. Your selectiondetermines the launch configurations that you can include in your project.

Figure 3-9. Debug Target Settings page10. Select the hardware board you plan to use from the Board drop-down list.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 23

Page 24: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

NOTEHardware board(s) that supports the target processorselected on the Processors page are only available forselection.

11. Select the launch configurations, that you want to include in your project and thecorresponding connection.

12. Select the interface to communicate with the hardware, from the Connection Typedrop-down list.

13. Specify the IP address of the TAP device in the TAP address text box for theCodeWarrior TAP (over Ethernet) connection.

NOTEThis option is disabled and cannot be edited for theCodeWarrior TAP (over USB) connection.

14. Click Next.The Build Settings page appears.

Figure 3-10. Build Settings page15. Select the programming language, you want to use, from the Language group.

The language you select determines the libraries that are linked with your programand the contents of the main source file that the wizard generates.

16. Select a toolchain from the Toolchain group.

Creating new project

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

24 Freescale Semiconductor, Inc.

Page 25: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Selected toolchain sets up the default compiler, linker, and libraries used to build thenew project. Each toolchain generates code targeted for a specific platform.

17. Select an option from the Floating Point drop-down list, to prompt the compiler tohandle the floating-point operations by generating instructions for the selectedfloating-point unit.

18. Click Next.The Configurations page appears.

Figure 3-11. Configurations page19. Select a processing model option from the Processing Model group.

NOTECurrently only the AMP (One project per core) option isavailable. This option generates a separate project for eachselected core and it also sets the core index for each projectbased on the core selection.

The SMP and AMP (One build configuration per core)options are disabled and cannot be selected in the currentrelease.

20. Select the processor core that executes the project, from the Core index list.21. Click Next.

The Software Analysis page appears.

22. Select Enable Coverage Support.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 25

Page 26: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

NOTEIf this option is not enabled, the GCov coverage data willnot be available, but it can be enabled manually later.

Figure 3-12. Software Analysis page - Enable Coverage Support option23. Click Finish.

The wizard creates an application project according to your specifications. You canaccess the newly created project from the CodeWarrior Projects view.

3.3 Configuring launcher

You need to configure the launcher for both simulator and hardware profiling, beforedebugging your application.

To configure the launcher for your project follow the steps in the sections listed below:• Configuring simulator project• Configuring hardware project

3.3.1 Configuring simulator project

Configuring launcher

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

26 Freescale Semiconductor, Inc.

Page 27: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Before debugging your application, you need to generate the code coverage files andconfigure the launcher for simulator tracing, as described in the following topics:

• Launching simulator• Generating code coverage files• Setting launch configuration

3.3.1.1 Launching simulator

In order to collect trace, you need to launch the software simulator. Currently, the LSsimulator is supported only on Linux 64-bit operating system.

To launch the software simulator on a Linux PC:

1. Copy and extract the contents of the LS_SIM_RELEASE_<version>.tgz archive to a LinuxPC (64-bit).

For Windows hosts, the LS_SIM_RELEASE_<version>.tgz archive is available in the<CWInstallDir>\Common\CCSSim folder, where <CWInstallDir> is the path where you haveinstalled your CodeWarrior software.

For Linux hosts, the simulator is available in the <CWInstallDir>\Common\CCSSim folder,where <CWInstallDir> is the path where you have installed your CodeWarrior software.

2. Navigate to the <path_to_sim>/dtsim_release/linux64 folder, where <path_to_sim> is thepath where you have extracted the APP simulator package.

3. Start ccssim2 in a terminal window.

. /ccssim2 -port <port_num>

NOTEFor more information about the optional flags supported byccssim2, see QorIQ LS Series Simulator User Guideavailable in the <CWInstallDir>\CW_APP\LS\Help\PDF folder,where <CWInstallDir> is the path where you have installedyour CodeWarrior software.

3.3.1.2 Generating code coverage files

To generate the files required to run code coverage analysis and profiling tools:

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 27

Page 28: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

1. Select the newly created project or an existing project from the CodeWarriorProjects view.

2. Right-click on the selected project and select Properties.

The Properties for <project> dialog appears.

3. In the left panel of this dialog, expand the C/C++ Build group and select Settings.

A set of tabbed configuration panels appears in the right panel of the dialog box.

4. Select Tool Settings.5. Expand the Compiler group and select Processor.6. Check Generate Code Coverage Files.7. Click OK to save the updates and close the Properties for <project> dialog.8. From the IDE menu bar, select Project > Build Project.

The Build Project dialog box appears. The build tools generate an executableprogram and a .gcno file is created for each source file in the project.

Figure 3-13. Generating .gcno files

3.3.1.3 Setting launch configuration

You need to define the trace configuration before debugging the application.

NOTEThis section documents debugger features that are specific totrace. For more information on other debugger features ofCodeWarrior Development Studio for Advanced PacketProcessing, see CodeWarrior for Advanced Packet Processing

Configuring launcher

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

28 Freescale Semiconductor, Inc.

Page 29: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Targeting Manual available in the <CWInstallDir>\CW_APP\LS\Help\PDF folder, where <CWInstallDir> is the path where you haveinstalled your CodeWarrior software.

To define a trace configuration:

1. From the IDE menu bar, select Run > Debug Configurations.

The Debug Configurations dialog appears.

2. In the left panel of this dialog, expand the CodeWarrior tree control.3. Select the launch configuration corresponding to your project.

A set of tabbed configuration panels appears in the right pane of the dialog box.

4. Click the Trace and Profile tab.

The trace configuration options appear.

Figure 3-14. Trace and Profile tab5. Check Enable Code Coverage checkbox for the trace session to start immediately

on launch.6. Click Apply to save the updates.

3.3.2 Configuring hardware project

This section explains how to configure the launcher to collect the trace data for hardwareboard project.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 29

Page 30: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

NOTETo enable the GCov coverage tool for hardware trace, you needto generate the code coverage files. For more information, seeGenerating code coverage files.

For configuring the AIOP hardware project, follow the steps listed below:1. Select Run > Debug Configurations from the IDE file menu.

The Debug Configurations dialog appears.

2. Expand the CodeWarrior group from the left panel and select the desired launchconfigurations.

3. Select the Trace and Profile tab from the right panel.4. From the Basic tab page, check the Enable Trace and Profile checkbox.

The figure below shows the Enable Trace and Profile option.

Figure 3-15. Enable Trace and Profile option5. Click Edit.

The Trace Configurations dialog appears.

The figure below shows the Trace Configurations dialog.

Configuring launcher

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

30 Freescale Semiconductor, Inc.

Page 31: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-16. Trace Configurations dialog

6. Check the Enable Trace checkbox from the right panel to enable trace on individualAIOP and MC cores.

7. Select the desired trace scenario from the Trace Scenarios group. You can select anyof the below listed scenerio:

• Simple Task Trace - Monitors the basic AIOP task lifecycle and acceleratorusage.

• Program Trace - Inspects the program execution flow.• Data Trace - Monitors the data accesses. You can select the range of trace data

using the Start Address and Range Size options.• Full Task Trace - Monitors the task lifecycle and accelerator usage and

monitors every change in the task states.• Custom - Allows the user-defined scenarios.

8. Select Trace Location from the left panel.

The figure below shows the Trace Location option.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 31

Page 32: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-17. Trace Configurations dialog box - Trace Location option9. Select the desired buffer location form the Trace collection location group. The

options are as follows:• On-chip buffer - Internal buffer (small 64KB buffed but non-intrusive)• DDR - User specified memory area (may be larger but more intrusive than On-

chip buffer)10. Select the desired mode from the Trace collection mode group. The options are as

follows:• One buffer mode - Trace collection stops when buffer is full• Overwrite mode - Trace is collected continuously in a circular buffer

11. Click OK.

The Trace Configurations dialog box closes.

12. Click Apply to save the settings.

3.4 Collecting trace

Tracing is a technique to obtain diagnostic and performance information about aprogram's execution. This information is typically used for debugging purposes, andadditionally, depending on the type and detail of information contained in a trace log, todiagnose common problems with the software.

Collecting trace

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

32 Freescale Semiconductor, Inc.

Page 33: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

This topic explains the trace collection methods for hardware and simulator basedprojects in the following sections:

• Using simulator• Using hardware

3.4.1 Using simulator

This section explains the trace collection methods for simulator projects.

To collect trace data, follow the steps listed below:

NOTEBefore proceeding, ensure that you followed the steps listed inthe Creating simulator project and Configuring simulatorproject sections.

1. Select your project in the CodeWarrior Projects view.2. Click Debug ( ) from the IDE toolbar.

The Debug perspective appears displaying the debugging progress. A progressmonitor indicating the status of the server, appears in the bottom-right corner of theIDE.

3. When the application suspends, click Resume ( ) in the Debug view to start thetrace collection.

4. Click Suspend to halt the system.5. Click Terminate ( ) to stop the trace collection.

A progress monitor indicating the progress of data received from simulator and thestatus of Tarmac to GCDA translation, appears in the bottom-right corner of the IDE.

The trace data is downloaded and the Analysis Results view appears. For moreinformation about the Analysis Results view, see Analysis Results view.

A trace file and .gcda file for each source file are generated.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 33

Page 34: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-18. Generating trace and .gcda files

3.4.2 Using hardware

This section explains the trace collection methods for hardware projects.

To collect trace data, follow the steps listed below:

NOTEBefore proceeding, ensure that you followed the steps listed inthe Creating hardware project and Configuring hardwareproject sections.

1. Select your project in the CodeWarrior Projects view.2. Click Debug ( ) from the IDE toolbar.

The Debug perspective appears displaying the debugging progress. A progressmonitor indicating the status of the server, appears in the bottom-right corner of theIDE.

3. When the application suspends, click Resume ( ) in the Debug view to start thetrace collection.

NOTEThe trace collection is activated at the first Resume duringa debug session, as follows:

• For a Download configuration, the PC stops at themain() function or the entry point, which is the defaulttrace collection start point. If you need a different start

Collecting trace

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

34 Freescale Semiconductor, Inc.

Page 35: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

point, you have to specify a custom function name inthe User specified text box, after selecting the Stop onstartup at checkbox from the Debugger tab.

• For an Attach configuration, your program attaches toa running process. In order to start the trace, you needto first suspend the subsystem by clicking the Suspendor Multicore Suspend button from the Debug view.Alternatively, set a breakpoint to stop the AIOPsubsystem. After the target is suspended, click Resumeor Multicore Resume to mark the starting point of thetrace session.

4. Click Suspend or set a breakpoint to halt the system.

NOTEThe trace is collected from the target when the AIOPsystems are halted.

5. Click Terminate ( ) to stop the trace collection.

The trace data is downloaded and the Analysis Results view appears. For moreinformation about the Analysis Results view, see Analysis Results view.

6. Click the Trace link from the Trace column of your project.

The trace is decoded and appears in the Trace viewer.

The figure below shows the decoded trace in the Trace viewer.

Chapter 3 Collecting Data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 35

Page 36: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 3-19. Decoded trace in Trace viewer

Collecting trace

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

36 Freescale Semiconductor, Inc.

Page 37: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 4Viewing data

You can view various types of data collected on an application using the AnalysisResults view.

On resuming the application, the measurement starts and the trace, timeline, codecoverage, performance, and call tree data is generated.

Profiling data is not available during debug session, it is available only when youterminate the application. The hyperlinks of profiling results of Analysis Results vieware disabled during debug session. Also, if trace collection is stopped before debugsession gets terminated, the hyperlinks from Software Analysis view for profilingfeatures will be disabled. Click Refresh button in the Analysis Results view to updatethe hyperlinks to view the profiling trace data.

The simulator or hardware generated data can be viewed as listed in the followingsections:

• Analysis Results view• Viewing data generated by simulator• Viewing data generated by hardware

4.1 Analysis Results view

The collected trace, generated reports, Timeline results, and GCov coverage for bothsimulator and hardware can be opened using the Analysis Results view. You can accessthis view by following these steps:

1. Select Window > Show View > Other from the IDE menu bar.

The Show View dialog appears.

2. Expand the Software Analysis group and select Analysis Results.

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 37

Page 38: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-1. Show View dialog - Analysis Result option3. Click OK.

The Analysis Results view appears in the IDE.

Figure 4-2. Analysis Results view

NOTEAlternatively, press Alt+Shift+Q, Q. This view is also displayedautomatically, after a successful trace collection is finished.

Using this view you can rename, save or delete results, add notes or clear GCov’s gcdafiles. It highlights the last collected results in all projects with a green icon ( ) and thelast collected results for each project with blue icon ( ) on the left of your project namein the Name column.

Analysis Results view

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

38 Freescale Semiconductor, Inc.

Page 39: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The table below lists and describes the Analysis Results view toolbar buttons.

Table 4-1. Analysis Results view - Tolbar buttons

Button tooltip Icon Description

Refresh the displayed data Refreshes the view. The view is refereshedautomatically for scanning, when the view isopen state and a new folder is added. Youhave to refersh the view manually, when theresults are collected in the view's open state.

Expands all nodes Expands all nodes in the view.

Collapses all nodes Collapses all nodes in the view.

Select custom results folder Opens a dialog that enables you to select theadditional folders to be scanned for results.

NOTE: The IDE uses the .AnalysisDatafolder, available in the workspace asthe default location to scan and savethe collected results.

In addition to the above described toolbar actions, the context-menu also allows toperform the following actions for a selected trace result:

• Rename: Renames the selected trace result.• Save: Saves the selected trace result. The save function creates a copy of the selected

trace results with an index appended to the name. When a new trace is collected, bydefault it receives the name of the project from where it was collected. If there isalready a trace with that name, it overrides the same.

• Delete: Deletes the selected trace result.

The Analysis Results view can also show the results from more folders. Each platformconfiguration available in .metadata/.plugins/com.freescale.sa/platformConfig/ folder ischecked for the path specified towards the set of results. All sets of trace and profilingresults found in those paths appears in the Analysis Results view. All the trace resultsavailable in workspace/.AnalysisData are displayed in Analysis Results view.

To configure the view to display trace data of another custom results folder that does notbelong to any platform configuration inside the workspace, follow these steps:

1. Click Select custom results folder option available on the Analysis Results viewtoolbar.

The Custom results folder dialog appears.

2. Click Add.

The SA Results Folder Selection dialog opens.

3. Browse the location of the required custom folder.4. Click Ok.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 39

Page 40: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The path to the custom folder for which the trace needs to be collected gets addedunder the Path field.

Figure 4-3. Custom results folder dialog

4.2 Viewing data generated by simulator

This section describes how to view trace data for a simulator project in the AnalysisResults view.

The following data can be viewed for the simulator target:• Viewing trace data• Viewing timeline data• Viewing Point-to-point profile data• Viewing GCov data

4.2.1 Viewing trace data

The Trace view functionality not only offers a fast access to the meaningful informationstored into the binary trace, but it also allows the user to visualize already decoded tracefiles (e.g. decoded by using command line stand-alone decoders).

The figure below shows the logical structure of the components that are involved in theTrace view functionality. It is implemented as an Eclipse plugin that extends the basicfunctionalities by allowing the user to visualize hardware trace files.

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

40 Freescale Semiconductor, Inc.

Page 41: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-4. AIOP Trace view infrastructure

The AIOP Trace view relies on AIOP Standalone Decoder or Tarmac StandaloneDecoder to extract trace events from a binary trace and store them into a commaseparated values file (CSV). All the information shown in the UI is taken from this file.The decoding process will not be started if the CSV file already exists and it is up-to-date. This will avoid the time consuming decoding process to be run at each time thetrace file is opened.

The following topics describes how to view the trace data:• Opening trace file in CodeWarrior• Trace view

4.2.1.1 Opening trace file in CodeWarrior

This operation is similar to opening any other file in the CodeWarrior IDE. Perform anyone of the following methods to open a trace file in the CodeWarrior IDE:

• Click Trace from the Analysis Results view.

--OR--

• Select File > Open File or File > Open path and specify the filename or path of thetrace file, that can be:

• Binary, the following extensions are supported:

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 41

Page 42: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• .dat – standard ATB formatted trace, decoded by APP decoder• .tarmac – tarmac trace generated by APP simulator, decoded by Tarmac

decoder.• Already decoded text files with .csv extension.

--OR--

• Drag and drop the trace file in the CodeWarrior IDE.

The trace view interface appears in the editor area of CodeWarrior IDE displaying thetrace file.

4.2.1.2 Trace view

The following figure shows the Trace view:

Figure 4-5. Trace view

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

42 Freescale Semiconductor, Inc.

Page 43: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The below table lists the various columns available in the Trace view:

Table 4-2. Trace view columns

Field Description

Index Displays the order number of the instructions.

Source Displays source of trace event.

Type Displays type of trace event.

Description Displays description of trace event.

Address Displays the starting address of the target function.

Destination Displays the end address of the target function.

Timestamp Displays the value of platform global timestamp generator (64-bit wide). Time stamping isuseful for correlating multiple trace sources.

The following table shows the available trace view events:

Table 4-3. Trace view events

Trace events Description

Branch It reports a branch instruction from a source function to a destination function.

Source Displays source of trace event.

Linear It reports a linear instruction.

Interrupt Used for interrupt contexts, this can be useful when you want to construct an accurate callstack.

Return It reports a return instruction from a source function to a destination function.

Data It reports data address, data value, data size information or read/write transaction type.

Info It reports the Trace Source’s run status or other information related to the status of theHardware or of the trace itself. The semantic of the info code is specific to the Trace Sourceso it can only be interpreted by a specialized trace consumer.

Error It reports an error instruction.

Custom The following information can be provided by this event:• Label - A data label, which indicates the “channel” the data value is associated with.• Data - The custom data value.

The trace events are displayed in a table form, each row showing the informationbelonging to one event. Some events have extra information that can be available byexpanding the tree, alternatively, click .

NOTEIn large traces, for viewer performance reasons, all trace eventsare expanded by default.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 43

Page 44: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-6. Tree events

Expand the Branch events to view the assembly instructions that issue the change offlow associated with an event. You can expand and collapse all the nodes individually inorder to show and hide particular details from a trace event.

A context-menu allows the user to perform the following operations:

• Hide column - hides the column from view• Show all columns – shows all columns that were hidden• Rename column – change column name• Hexadecimal Display – is a check-box that is available only for numeric columns.

When checked, it switches the representation from decimal to hexadecimal. Fornonnumeric columns this option is grayed out.

• Delta Display – is a check-box that is available only for numeric columns. Whenchecked the arithmetic subtraction (delta) between the current and the previouscolumn cell is shown. For nonnumeric columns this option is grayed out.

• Collapse All – collapse all tree nodes• Expand All – expand all tree nodes.

NOTESearching for a string in the trace viewer can be performed bythe using the standard CTRL-F keyboard shortcut.

4.2.2 Viewing timeline data

The following topics describes how to view the timeline data:• Opening .timeline file in CodeWarrior• Timeline view

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

44 Freescale Semiconductor, Inc.

Page 45: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

4.2.2.1 Opening .timeline file in CodeWarrior

The .timeline file can be opened in CodeWarrior IDE that supports the Timeline view.The .timeline file is obtained after CodeWarrior calls either the APP Standalone Decoderor Tarmac Standalone Decoder, post the completion of trace collection process.The .timeline file is generated using any of the following methods, and is available in thesame location with the decoded trace:

• Click the Timeline link from the Analysis Results view.

Figure 4-7. Open .timeline file from Analysis Results view• Select File > Open File or File > Open path and specify the filename or path of

the .timeline file.

Figure 4-8. Find and Open File dialog• Drag and drop the .timeline file in the CodeWarrior IDE.

4.2.2.2 Timeline view

The figure below shows the Timeline view in CodeWarrior.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 45

Page 46: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-9. Timeline view

NOTEThere can be more than one Timeline view for thesame .timeline file and each can have different custom groupsand time units.

The Timeline view contains the following features:• Timeline• Toolbar• Timeline plot• Edit Groups dialog

4.2.2.2.1 Timeline

Timeline is a tabbed interface. A tab for each source (usually a core) is createdautomatically. Each tab has its independent timeline plot with its own setup of groups andtime unit.

The timeline data displays the functions that are executed in the application and thenumber of cycles each function takes when the application runs. The Timeline viewershows a timeline graph in which the functions appear on y-axis and the number of cyclesappear on x-axis. The green-colored bars show the time and cycles taken by the function.

4.2.2.2.2 Toolbar

The Timeline viewer can be controlled using the toolbar. Following is a list of controlsavailable on the toolbar:

• Selection Mode - Allows you to mark points in the function bars to measure thedifference of cycles between those points. To mark a point in the bar:

a. Click Selection Mode.b. Select the bar where you want to mark the point.

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

46 Freescale Semiconductor, Inc.

Page 47: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

A yellow vertical line appears displaying the number of cycles at that point.

c. Right-click on an another point in the bar.

A red vertical line appears displaying the number of cycles at that point alongwith the difference of cycles between two marked points.

• Zoom Mode - Allows you to zoom-in and zoom-out in the timeline graph. Zoomingcan be performed using the mouse wheel (even if this mode is not selected).

• Full View - Resets the view to the default zoom that allows the visibility of the fulltimeline.

• Edit Groups - Allows you to customize the timeline according to the requirements.You can change the default color of the line bars representing the functions todifferentiate. You can add/remove a function to/from the timeline. To perform thesefunctions, click Edit Groups. The Edit Groups dialog appears.

4.2.2.2.3 Timeline plot

The Timeline plot is divided into two frames.

• The left panel of the plot displays the list of groups, separated in contexts. By defaultthe groups are the functions specific to a context. If for a certain event a group/function cannot be determined, then a special group <no debug info> is associatedwith it.

• The right panel of the plot contains bars that represent time/cycles intervals and showwhen a specific function/group was executed. The color can be configured usingEdit Groups dialog.

4.2.2.2.4 Edit Groups dialog

The Edit Groups dialog is used to view the current list of groups displayed or hiddenfrom the Timeline plot. A group is one or more address intervals. By default, when youopen a timeline file, the list of groups is constructed from functions.

The Edit Groups dialog is opened from the Timeline toolbar. If the trace collectedcontains more than one context there is a menu that permits the selection of a singlecontext to edit. In the other case, when the trace has only one context the dialog is openeddirectly by clicking the Edit Groups button on the toolbar.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 47

Page 48: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-10. Launch Edit Groups dialog

A full list of groups is displayed for the selected context containing all the groups visibleor hidden. The hidden state of a group can be changed with the help of the checkboxbefore its name. The color can be changed with the help of the Color dialog, launched byclicking on the Color column.

Figure 4-11. Edit Groups dialog

A context menu allows the user to perform the following operations:

• Insert Group (Ctrl-G): inserts a new custom group. The user must choose a nameand an address range. The restriction to not have overlapped intervals applies here.

• Insert Function (Ctrl-F): choose a function to be displayed. A list with all thefunctions appears and the user can choose from there.

• Delete Selected (Del): deletes the selected group/function• Move Up/Move Down (Ctrl-Up/Down): move the group in the list• Merge Selected (Drag&Drop): more groups can be merged so that they are

displayed on the same line on the timeline plot. In this case the created group willhave all the address intervals separated by comma.

You can perform the following operations using the Edit Groups dialog:• Adding or removing function• Editing address range of function• Changing color• Adding or removing group• Merging groups or functions

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

48 Freescale Semiconductor, Inc.

Page 49: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

4.2.2.2.4.1 Adding or removing function

This section explains how to add or remove a function from the Edit Groups dialog box.Right-click on the function name in the Name column, and select Insert Function orpress Ctrl+F to add a function. Select Delete Selected from the context-menu to deletethe function from the graph. You can disable a function from the graph by clearing thecorresponding checkbox in the Name column. Check it again to include it in the graph.

4.2.2.2.4.2 Editing address range of function

This section explains how to edit the address range of a function from the Edit Groupsdialog box. Perform the following steps:

1. Select the function of which you want to change the address range.2. Double-click on the cell of the Addresses column of the selected function.

The cell becomes editable.

3. Type an address range for the group or function in the cell.

NOTEYou can specify multiple address ranges to a functionseparated by a comma. The address ranges must notoverlap with themselves nor with any other group.

4.2.2.2.4.3 Changing color

This section explains how to change the color of a function in the timeline graph. Thecolor appears as a horizontal bar in the graph. Click on the Color column of thecorresponding function, and select the color of your choice from the Color window thatappears.

4.2.2.2.4.4 Adding or removing group

This section explains how to add or remove a group from Edit Groups dialog box. Agroup is a range of addresses. In case, you want to view trace of a part of a function only,for example, for loop, you can find the addresses of the loop and create a group for thoseaddresses. Perform the following steps to add a group:

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 49

Page 50: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

1. Right-click on the row, in the Edit Groups dialog box, where you want to insert agroup, and select Insert Group from the context menu. Alternatively, press the Ctrl+G key.

A row is added to the table with new as function name.

Figure 4-12. Edit Group dialog2. Double-click on the new group cell.

The cell becomes editable.

3. Type a name for the group, for example, MyGroup.4. Double-click on the cell of the corresponding Addresses column and edit the address

range according to requirements (ensure that the groups address ranges must notoverlap), for example, 0x1fff0330-0x1fff035f.

5. Change the color of the group.

Figure 4-13. Edit Group dialog displaying new group with changed color

To delete a group, select it, right-click on the Edit Groups dialog box, and select theDelete Selected option from the context menu. You can also remove a group from thegraph by clearing the corresponding checkbox in the Name column. Check it again toinclude it in the graph.

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

50 Freescale Semiconductor, Inc.

Page 51: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

4.2.2.2.4.5 Merging groups or functions

This section explains how to merge the groups or functions available. Merging is usefulin case there are many functions and you do not want to view the trace of each and everyfunction. You cannot undo this operation, that is you cannot separate the mergedfunctions or groups. To view the original trace data, reopen the Trace Data viewer.Perform the following steps to merge the group or function:

1. In the Edit Groups dialog box, select the function or group to be merged.2. Drag and drop it in the function or group with which you want it to get merged with.3. Both the functions or groups merge into a single function or group that covers both

address ranges, where the function, main is merged with the group, MyGroup.

Figure 4-14. Edit Groups dialog displaying merged functions4. Click OK.

The Edit Group dialog closes.

4.2.3 Viewing Point-to-point profile data

To view the Point-to-point profile data, click the Point-to-point link in the AnalysisResults view.

Point-to-Point profiler is a user-friendly and flexible way to gather statistics and visualizereports in CodeWarrior for the supported AIOP counters. Point-to-Point profilergenerates reports for AIOP counters gathered between performance mark points(markers). It also generates reports with the counters organized on a per task base.

The following sections describes the Point-to-Point Profiler in detail:• Point to Point Profiler markers• Point to Point Profiler trace file• Point to Point Profiler standalone command-line tool• Report Viewer

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 51

Page 52: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Working with Point to Point Profiler tool• Point to Point Profiler advanced settings

4.2.3.1 Point to Point Profiler markersPoint to Point Profiler markers are employed to gather statistics for certain regions ofcode. A marked portion of code is termed as a region, across this document. The syntaxfor defining a marker is

#pragma perfmark<start|stop|abort><name>

The table below describes the #pragma perfmark parameters.

Table 4-4. #pragma perfmark parameters

Parameter Description

start used to mark the beginning of a region

stop used to mark the end of a region

abort when an abort marker is encountered and its region isopened, the data collection for it is stopped and not added tothe reports.

The markers are added by the user into the code and are taken into account by thecompiler only if the -perfmarks flag is set. To set the flag in a project, perform thefollowing:

1. Select the project in the CodeWarrior Projects view.2. Right-click and select Properties. The Properties for <project> dialog appears.3. Expand the C/C++ Build tree and select Settings.4. Click the Tool Settings tab.5. Expand the Compiler tree and select Processor.6. Check the Enable user-defined performance markers option.

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

52 Freescale Semiconductor, Inc.

Page 53: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-15. Compiler flags settings for Point to Point Profiler

4.2.3.2 Point to Point Profiler trace file

The Point to Point Profiler trace file is generated by the simulator and is downloadedautomatically from the Linux 64-bit machine, running the simulator, when debuggingstops.

The Point to Point Profiler data is gathered when an AIOP project is running on aSimulator. Perform any one of the following to enable trace for a project:

• Using the Debug Configuration dialog.a. Select Run > Debug Configuration. The Debug Configurations dialog

appears.b. Select the project launch configuration and click Trace and Profile tab.c. Select Enable Point to Point Profiler.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 53

Page 54: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-16. Trace and Profile tab - Enable Point to Point Profiler option

d. Click Apply to save.• Using the CodeWarrior Bareboard Project Wizard.

a. Select File > New > CodeWarrior Bareboard Project. The CodeWarriorBareboard Project Wizard appears.

b. Specify new project related details, until you reach the Software Analysis page.c. On the Software Analysis page, select Enable Point to Point Profiler.

Figure 4-17. New CodeWarrior Bareboard Project Wizard - Software Analysis page

d. Click Finish to create a new trace-enabled CodeWarrior bareboard project.• Manually, using the Simulator configuration file.

The trace can also be enabled manually from the simulator configuration file byadding the following line, to the file:

sim.e_dni_performance_marker=true

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

54 Freescale Semiconductor, Inc.

Page 55: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

4.2.3.3 Point to Point Profiler standalone command-line toolThe Poin to Point Profiler (P2PProf) standalone command-line tool parses the Point toPoint Profiler trace file and generates various reports based on the counter values. Thetool is called automatically by CodeWarrior, if Point to Point Profiler is enabled.However, the tool can also be called from command-line as a standalone application.

NOTEThe p2pprof standalone command-line tool is available in<CWinstalldir>/CW_APP/LS/sa_ls/bin folder. Where <CWinstalldir> isthe path to the CodeWarrior installation.

Usage

p2pprof [options]

The table below lists the p2pprof options and their description:

Table 4-5. p2pprof options

Option Description

-h[--help] Displays help information

-t[--trace-file] arg Input trace file. This is generated by the simulator.

-e[--elf-file] arg .elf file used. Can be used to obtain the symbols generatedfrom markers.

-i[--region-instance] arg File name for the report containing statistics for regions,organized instance by instance.

-u[--region-summary] arg File name for the region summary report.

-a[--task-accelerators] arg File name for the task accelerators report.

-k[--task-instance] arg File name for the task instance report.

-v[--version] Displays product version.

Remarks

The tool, when called automatically from CodeWarrior, generates all report types andlabels them in a meaningful way. However, while using the tool as standalone, from acommand-line, you must have a trace and .elf file specified as input and at least onereport specified as output.

4.2.3.4 Report ViewerThe CodeWarrior editor is capable of opening and displaying the generated report files.The reports are generated, each in a seperate comma-seperated (.csv) file. The report filescan be opened by:

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 55

Page 56: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Clicking the Point-to-Point link from the Analysis Results view.• Dragging-and-droping the file over CodeWarrior interface.• Double-clicking the file in the Project Explorer view.• Selecting File > Open menu.

The following topic describes the report formats:• Report formats

4.2.3.4.1 Report formats

The Point to Point Profiler tool can generate four kinds of reports. The following sectionsdiscuss each one of them.

Region Instances Report

The Region Instances Report presents the data collected for each region, instance byinstance. A region can be hit multiple times, from multiple cores/tasks, during a singleexecution. This report presents each of this runs individually.

The table below describes each column generated in the Region instances report.

Table 4-6. Region Instances Report format

Column Description

Region Displays the region name.

Counter Displays the counter name.

Delta The variation of the counter while the region was active (thetassk running it was not suspended).

Total The total variation of the counter. Contains data gatheredwhile the task running that region was suspended.

Region Summary Report

The Region Summary Report presents a summary for each region. It gathers data acrosscores/tasks and can be viewed as a summary of the regions instance report with averagescalculated and results summed up.

The table below describes each column generated in the the Region Summary Report.

Table 4-7. Region Summary Report format

Column Description

Region Displays the region name.

Counter Displays the counter name.

Count Number of times the instance executed (exclusive count).

Table continues on the next page...

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

56 Freescale Semiconductor, Inc.

Page 57: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Table 4-7. Region Summary Report format (continued)

Column Description

Minimum Minimum variation of the counter in a task region delta(exclusive minimum).

Maximum Maximum variation of the counter in a task region delta(exclusive maximum)

Mean Average variation of the counter for region instances deltas(exclusive mean)

Total count Total count of the region execution (inclusive count)

Total minimum Minimum variation of the counter in task region total (inclusiveminimum)

Total maximum Maximum variation of the counter in task region total(inclusive maximum)

Total mean Average variation of the region instance totals (inclusivemean)

Task Instances Report

The Task Instances Report is similar to the Region instances report. However, thecollected data is for an entire task and not for a region. The columns generated by thereport are similar to the ones generated in the Region Instances Report.

Task Accelerators Report

Task Instances Report displays the number of times each accelerator produced a taskswitch for each task.

4.2.3.5 Working with Point to Point Profiler tool

Point to Point Profiler generates reports for AIOP counters gathered betweenperformance mark points (markers). It also generates reports with the counters organizedon a per task base.

Perform the following to run code with Point to Point Profiler tool:

1. Create a new project by selecting the Point to Point Profiler option in the SoftwareAnalysis page.

2. Launch Simulator on a Linux 64-bit PC.3. Add the Point to Point Profiler tool markers to gather statistics for selected regions of

code.4. Select Project > Build Project from the CodeWarrior IDE menu bar to build and

compile the project.5. Select Run > Debug from the CodeWarrior IDE menu bar to debug the project.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 57

Page 58: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

6. Click Stop and wait for the trace file to be downloaded and the Point to Point Profilertool to execute automatically. Alternatively, you can also execute the Point to PointProfiler tool manually, as a standalone command-line utility.

NOTEYou will require the .elf file from your project and the tracefile from the simulator's folder on the remote Linux 64-bitmachine to execute the Point to Point Profiler toolmanually.

7. After successful execution, view the results in the CodeWarrior Report Viewerview.

4.2.3.6 Point to Point Profiler advanced settings

You can configure the Point to Point Profiler advance settings using the Advancedsettings group in the Trace and Profile tab. This section is common for both Point toPoint Profiler and Code Coverage (GCov) advanced settings.

To access the Advanced settings group, follow these steps:1. Select Run > Debug Configurations from the IDE menu bar to open Debug

Configurations dialog.2. Click the Trace and Profile tab.3. Select Enable Point to Point Profiler option from the Simulator Trace Settings

group.4. Click Advanced settings group to display the options.

Figure 4-18. Point to Point Profiler - Advanced settings

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

58 Freescale Semiconductor, Inc.

Page 59: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The table below lists and describes the options available in the Advanced settings group.

Table 4-8. Advanced settings option

Option Description

Communication settings

Communication port number Allows the modification of the port used for sending thefiles from the Simulator. It automatically sends thesettings to the simulator and no other changes in thesimulator configuration files are needed.

Processing scenario

Simulator Enables the processing through simulator without savingthe performance trace file. There is a 64 bit version ofthe Point to Point Profiler added to the simulator packageand for this option it is started in a named pipe with thesimulator. When stopped, sends the generated reports toCodeWarrior.

CodeWarrior Enables the simulator to sends the entire trace toCodeWarrior for processing. The trace is stored in a filein this case.

Compatibility mode Allows using old simulators that does not have the newtransmission protocol used in the first two cases. Thisalso affects the sending of the code coverage file.

4.2.4 Viewing GCov data

To view the GCov data, click the GCov link in the Analysis Results view.

GCov is a source code coverage analysis and profiling tool. It monitors an applicationunder execution and identifies source lines based on their execution. The tool can alsoidentify the number of times a particular line has been executed, making it useful forperformance profiling and help discover the optimization efforts that will best affect thecode.This section explains the following topics:

The sections below describe how to view GCov data:

• Viewing coverage data• gcov view

4.2.4.1 Viewing coverage data

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 59

Page 60: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The GCov utility requires three files: the source file, the .gcno file and the .gcda file todisplay the code coverage information. Once the project is compiled and executed,several .gcno and .gcda files are generated. These files are available under the projectSources and Lib folders.

• Viewing coverage details for selected source file• Viewing coverage details for all files

4.2.4.1.1 Viewing coverage details for selected source file

To view coverage details only for the file that generated the .gcno or the .gcda file:

1. Double click on one of the .gcno or the .gcda files to open the Gcov - Open coverageresults dialog.

Figure 4-19. Gcov - Open coverage results2. Select Show coverage details for <file> only. Where <file> is the name of the file

that generated the selected .gcno or the .gcda file.3. Click OK.

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

60 Freescale Semiconductor, Inc.

Page 61: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-20. Code coverage information

4.2.4.1.2 Viewing coverage details for all files

To view coverage details for all .gcno or .gcda files, which are part of source files used ina binary executable:

1. Use the Analysis Results view, alternatively, double click on either the .gcno orthe .gcda file. to open the Gcov - Open coverage results dialog.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 61

Page 62: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-21. Gcov - Open coverage results2. Select Show coverage the whole selected binary file.3. Click OK.

The GCov view appears displaying an overview of coverage information for thewhole project.

4.2.4.2 gcov view

The gcov view displays an overview of coverage information for the whole project.Double-clicking on a function or a source file, in the view, will open the source file,annotated with the coverage information.

To view the GCov data, click the GCov link from the Analysis Results view. The GCovview appears as shown below.

Viewing data generated by simulator

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

62 Freescale Semiconductor, Inc.

Page 63: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-22. GCov view

The table below lists and describes the toolbar buttons that help work with the gcov view.

Table 4-9. GCov view toolbar buttons

Button Tooltip Description

Expand All Click to expand all the groups.

Collapse Click to collapse the selected group.

Show/Hide Columns Click to display the Show/Hide Columns dialog. Use the Show/HideColumns dialog to configure the visibility of columns displayed in theview.

Export to CSV Click to export the gcov results as a CSV text file.

Sorting Click to sort the results in Ascending or Descending order

Sort coverage per folder Click to display GCov result sorted by folder.

Sort coverage per file Click to display GCov result sorted by file.

Sort coverage per function Click to display GCov result sorted by function.

Create chart Click to create a BIRT chart, with the lines selected in the GCov resultview.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 63

Page 64: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

4.3 Viewing data generated by hardware

The following section describes the trace data generated by a hardware project:• Viewing Trace data• Viewing Timeline data• Viewing Code Coverage data• Viewing Performance data• Viewing Call Tree data• Viewing GCov data

4.3.1 Viewing Trace data

For information on how to view trace data, see Viewing trace data.

4.3.2 Viewing Timeline data

For information on timeline data, see Viewing timeline data.

4.3.3 Viewing Code Coverage data

To view the Code Coverage data, click the Code Coverage link from the AnalysisResults view.

The following figure shows an example of code coverage data.

Viewing data generated by hardware

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

64 Freescale Semiconductor, Inc.

Page 65: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-23. Code Coverage view

The Code Coverage data displays the summarized data of a function in a tabular form.The columns are movable; you can drag and drop the columns to move them according toyour requirements.

The Code Coverage view displays data into two views; the top view displays thesummary of the functions, and the bottom view displays the statistics for all theinstructions executed in a particular function. Click on a hyperlinked function in the topview of the Code Coverage view to display the corresponding statistics for theinstructions executed in that function. For example, the statistics of the cdma.c function isshown in figure above.

The below table explains the various fields of the Summary table.

Table 4-10. Code Coverage Summary Table fields description table

Field Description

File/Function Displays the name of the function that has executed.

Address Displays the start address of the function.

Covered ASM % Displays the percentage of number of assembly instructionsexecuted from the total number of assembly instructions perfunction or per source file

Not Covered ASM % Displays the percentage of number of assembly instructionsnot executed from the total number of assembly instructionsper function or per source file.

Total ASM instructions Displays the total number of assembly instructions perfunction and per source file.

ASM Decision Coverage % Displays the decision coverage computed for direct andindirect conditional branches. It is the mean value of theindividual decision coverages. So if a function has twoconditional instructions, one with 100% and another with 50%decision coverage, the decision coverage would be (100 +

Table continues on the next page...

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 65

Page 66: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Table 4-10. Code Coverage Summary Table fields description table (continued)

Field Description

50) / 2 = 75% . It is calculated only for assembly instructionsand not for C source code.

Time (Microsecond) Displays the total number of clock cycles that the functiontakes

Size Displays the number of bytes required by each function.

The below table describes the fields of the statistics of the code coverage data.

Table 4-11. Code Coverage Details Table fields description table

Field Description

Line/Address Displays either the line number for each instruction in thesource code or the address for the assembly code.

Instruction Displays all the instructions executed in the selected function.

Coverage % For C source lines, displays the percentage of number ofassembly instructions executed from the total number ofassembly instructions corresponding to the source line. Forassembly source lines, it shows if the instructions wereexecuted or not.

ASM Decision Coverage Displays the decision coverage computed for direct andindirect conditional branches. It is the mean value of theindividual decision coverages. So if a function has twoconditional instructions, one with 100% and another with 50%decision coverage, the decision coverage would be (100 +50) / 2 = 75% . It is calculated only for assembly instructionsand not for C source code.

ASM Count Displays the number of times each instruction is executed.

Time (CPU Cycles) Displays the total time taken by each instruction in thefunction.

NOTEIn the Code Coverage viewer, all functions in all filesassociated with the project are displayed irrespective ofcoverage percentage. However, the 0% coverage functions donot appear in the Performance and Call Tree viewers becausethese functions are not considered to be computed and are not apart of caller-called pair.

Click on the column header to sort the code coverage data by that column. However, youcan only sort the code coverage data available on the top view. The icons available in thesummary view of the Code Coverage tab allow you to perform the following actions:

• Previous function- Lets you view the details of the previous function that wasselected in the Summary table before the currently selected function. Click it to viewthe details of the previous function.

Viewing data generated by hardware

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

66 Freescale Semiconductor, Inc.

Page 67: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Next function- Lets you view the details of the next function that was selected in theSummary table.

NOTEThe Previous and Next buttons are contextual and go toprevious/next function according to the history ofselections. So if you select a single line in the view, thesebuttons will be disabled because there is no history.

• Export - Lets you export the code coverage data in a CSV or html format. Click thebutton to choose between Export to CSV or Export to HTML options. The Exportto CSV option lets you export data of both Summary and Details tables. Theexported html file contains the statistics for all the source files/functions from theSummary table along with the statistics of source, assembly or mixed instructions.

• Configure Table - Lets you show and hide column(s) of the code coverage data.Click and select the Configure Columns for Summary Table option to show/hidecolumns in the Summary table (top view) or the Configure Columns for Detailstable option to show/hide columns of the Details table (bottom view). The Drag anddrop to order columns dialog appears in which you can check/uncheck thecheckboxes corresponding to the available columns to show/hide them in the CodeCoverage viewer. The option also allows you to set CPU frequency and set time incycles, milliseconds, microseconds, and nanoseconds.

• Collapse/Expand all files - Lets you expand or collapse all files in the Summarytable.

• Filter Files - Allows you to choose the list of files to be displayed in the Summarytable.

• Switch to executable source lines statistics/Switch to ASM instructions statistics- Lets you switch between source lines or ASM instructions to be displayed in theSummary table.

You can perform the following actions on the Details table:• Search - Lets you search for a particular text in the Details table. In the Search text

box, type the data that you want to search and click the Search button.• Graphics - Lets you display the histograms in two colors for the ASM Count and

Time columns in the bottom view of the code coverage data. Click the button andselect the Assembly/Source > ASM Count or Assembly/Source > Time option todisplay histograms in the ASM Count or Time column. The colors in these columnsdifferentiate source code with the assembly code.

• Show code - Lets you display the assembly, source or mixed code in the statistics ofthe Code Coverage data.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 67

Page 68: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

4.3.4 Viewing Performance data

To view performance data, click on the Performance link. The Performance viewappears as shown below.

Figure 4-24. Performance view

The Performance viewer is divided into two views:

• The top view presents function performance data in the Summary table. It displaysthe count and invocation information for each function that executes during themeasurement, enabling you to compare the relative data for various portions of yourtarget program. The information in the Summary table can be sorted by column inascending or descending order. Click the column header to sort the correspondingdata.

The following table explains the fields of the Summary table.

Table 4-12. Field description of Summarytable

Field Description

Function Name Name of the function that has executed.

Num Calls Number of times the function has executed.

Inclusive Cumulative metric count during execution time spentfrom function entry to exit.

Min Inclusive Minimum metric count during execution time spentfrom function entry to exit.

Max Inclusive Maximum metric count during execution time spentfrom function entry to exit.

Avg Inclusive Average metric count during execution time spentfrom function entry to exit.

Table continues on the next page...

Viewing data generated by hardware

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

68 Freescale Semiconductor, Inc.

Page 69: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Table 4-12. Field description of Summary table(continued)

Field Description

Percent Inclusive Percentage of total metric count spent from functionentry to exit.

Exclusive Cumulative metric count during execution time spentwithin function.

Min Exclusive Minimum metric count during execution time spentwithin function.

Max Exclusive Maximum metric count during execution time spentwithin function.

Avg Exclusive Average metric count during execution time spentwithin function.

Percent Exclusive Percentage of total metric count spent withinfunction.

Percent Total Calls Percentage of the calls to the function compared tothe total calls.

Code Size Number of bytes required by each function.

• The bottom view or the Details table presents call pair data for the function selectedin the Summary table. It displays call pair relationships for the selected function thatshows which function called the another function. Each function pair consists of acaller and a callee. The percent caller and percent callee data is also displayedgraphically. The functions are represented in different colors in the pie chart, you canmove the mouse cursor over the color to see the corresponding function.

The below table describes the fields of the Details table. You cannot sort thecolumns of this table.

Table 4-13. Field description of Detailstable

Field Description

Caller Name of the calling function.

Callee Name of the function that is called by the callingfunction.

Num Calls Number of times the caller called the callee.

Inclusive Cumulative metric count during execution time spentfrom function entry to exit.

Min Inclusive Minimum metric count during execution time spentfrom function entry to exit.

Max Inclusive Maximum metric count during execution time spentfrom function entry to exit.

Avg Inclusive Average metric count during execution time spentfrom function entry to exit.

Table continues on the next page...

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 69

Page 70: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Table 4-13. Field description of Details table(continued)

Field Description

Percent Callee Percent of total metric count during the time theselected function is the caller of a specific callee.The data is also shown in the Caller pie chart.

Percent Caller Percent of total metric count during the time theselected function is the callee of a specific caller.The data is also shown in the Callee pie chart.

Call Site Address from where the function was called.

The table below lists the buttons available in the Summary table of the Performanceviewer.

Table 4-14. Buttons Available in Summary Table of Performance Viewer

Name Button Description

Previous Function Allows you to view the details of the previous function that was selectedin the bottom view before the currently selected function. Click it to viewthe details of the previous function.

Next Function Allows you to view the details of the next function that was selected inthe bottom view. NOTE: The Previous and Next buttons are contextualand go to previous/next function according to the history of selections.So if you select a single line in the view, these buttons will be disabledbecause there is no history.

Export Allows you to export the performance data of both top and bottom viewsin a CSV file. Click the button and select the Export the statisticsabove option to export the details of the top view or the Export thestatistics below option to export the details of the bottom viewrespectively.

Configure Table Allows you to show and hide column(s) of the performance data. Clickthe button and select the Configure Columns for Summary Tableoption to show/hide columns of the top view or the Configure Columnsfor Details Table option to show/hide columns of the bottom view. TheDrag and drop to order columns dialog box appears in which you cancheck/clear the checkboxes corresponding to the available columns toshow/hide them in the Performance viewer.

4.3.5 Viewing Call Tree data

To view the call tree data, click the Call Tree link.

The Call Tree view appears as shown below.

Viewing data generated by hardware

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

70 Freescale Semiconductor, Inc.

Page 71: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 4-25. Call Tree view

In the Call Tree viewer, START is the root of the tree. You can click on “+” to expandthe tree and “-” to collapse the tree. It shows the biggest depth for stack utilization in CallTree and the functions on this call path are displayed in green color. The Call Tree nodesare synchronized with the source code. You can double-click on the node to view thesource code. The columns can be resized by moving the columns to the left or right ofanother column depending on your requirements by dragging and dropping.

The following table describe the fields of Call Tree data.

Table 4-15. Call Tree fields description table

Field Description

Function Name Name of function that has executed.

Num Calls Number of times function has executed.

% Total calls of Parent Percent of number of function calls from total number of callsin the application.

% Total times it was called Percent of number of times a function was called.

Inclusive Time Cumulative count during execution time spent from functionentry to exit.

4.3.6 Viewing GCov data

For information on how to view GCov data, see Viewing GCov data.

Chapter 4 Viewing data

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 71

Page 72: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Viewing data generated by hardware

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

72 Freescale Semiconductor, Inc.

Page 73: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 5AIOP decoder

The AIOP decoder is a standalone command line tool for trace decoding, that runs onboth Windows and Linux platforms. The tool is used to decode Nexus trace formatted inATB frames, collected from AIOP cores, to a comma-separated values (.csv) file.The .csv file, generated by the tool, helps understand the exact program execution flow(instruction by instruction).

This section contains the following topics:

• Usage• Remarks• Example

5.1 Usage

Listed below is the AIOP decoder syntax:

app.decoder [Options] <input_file> [output_file]

The table below lists the app.decoder parameters and their description:

Table 5-1. app.decoder - parameters

Parameter Description

-h [ --help ] Displays the help information.

-p [ --show-progress ] Shows the progress periodically.

-v [ --version ] Displays the product version.

-l[--lut]arg Entry point look-up table (required only for some AIOPspecific messages, such as Task Alocate). The argumentmust use the following format:

epid0:addr0[,epid1:addr1[,...]]

Table continues on the next page...

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 73

Page 74: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Table 5-1. app.decoder - parameters (continued)

Parameter Description

Where, epids are the decimal values and addrs arehexadecimal values, starting with 0x.

--aiop Outputs only the AIOP specific trace (task evolution andaccelerator usage).

--program Outputs only program - change of flow and the AIOP specifictrace.

<input_file> Specifies the name of the binary trace file containingcontroller transactions trace, generated by a QorIQ LS seriestarget. The trace format is Nexus encapsulated in ATBframes. The .elf and the .dat files must have a samefilename and should be available in the same directory. Forexample, while decoding the AIOPTraceData.dat file, thedecoder tool searches for the AIOPTraceData*.elf, in thesame folder location.

<output_file> Specifies the name of the .csv file, generated by the tool.

The table below lists the hidden app.decoder parameters and their description. Theseoptions are not displayed in the help information provided by the -h [ --help] parameter,they can be displayed using --HELP option:

Table 5-2. app.decoder - Hidden parameters

Parameter Description

-b[--big-endian] Specifies the Nexus trace data is in big endian format. If youdo not specify this option, the parser considers that the inputfile is in little endian format.

-f [ --output-format ] arg Specifies the output format. Supported formats are .txtand .csv and none (for unformatted, tarmac style output, tobe chained with other tools, for example, sa.tarmac2gcda).

-c [ --chunk-size ] arg (=1024) Specifies the processing chunk size in bytes. The defaultvalue is 1024 bytes.

-s [ --include-sync ] Specifies whether the formatted stream includessynchronization messages or not. If this option exists, theunformatting algorithm starts after the first synchronizationpacket. Once synchronized, all subsequent synchronizationpackets will be discarded.

-a [ --arch ] arg Specifies the architecture. Use the option to override thearchitecture type detected in the input trace file andautomatically select the proper Nexus format definition xml forthe tool.

-d <file_path> Specifies the Nexus trace format specification file name andpath. By default, this option is hidden and is not displayed inthe help information, generated by using the -h [ --help]option.

• NOTE: Use this option only when:

Table continues on the next page...

Usage

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

74 Freescale Semiconductor, Inc.

Page 75: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Table 5-2. app.decoder - Hidden parameters (continued)

Parameter Description

• all the files (executable, definition.xml file, inputfiles) required by the decoder, are not in the samedirectory. Do not use the option, if all the requiredfiles are available in the same directory.

• the default XML files (nexus_aiop.xml forAIOP) can't be used or are not available.

[--HELP] Displays all options (including hidden).

-x [ --app-xml ] arg Path to the APP platform configuration file, containing theATB IDs. Must be absolute path or relative to currentdirectory.

-T [--timeline] Enables the timeline event processor.

-H [ --hierarchical ] Enables hierarchical event processor.

-C [ --codecoverage ]

--codecoverage-options arg

Enables code coverage event processor.

Code Coverage processor specific options

-G [ --gcov ]

--gcov-options arg

Enables GCov event processor.

GCov processor specific options.

5.2 Remarks

The following decoder Nexus definition files are required to execute the decoder tool:

• nexus_aiop.xml - Nexus trace format definition for AIOP cores.

NOTEThe Nexus definition files are available in the <CWInstallDir>/CW_APP/LS/sa_ls/bin folder. Where <CWInstallDir> is theCodeWarrior installation path.

5.3 Example

This section provides instructions on executing the trace decoder tool on Windows andLinux operating systems, using a set of example files.

NOTEThe example files are available in the <CWInstallDir>/CW_APP/LS/CodeWarrior_Examples/Stda_APP_decoder folder. Where<CWInstallDir> is the CodeWarrior installation path.

Chapter 5 AIOP decoder

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 75

Page 76: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Executing the trace decoder on Windows:1. Open a command prompt and navigate to the example files folder. cd <CWInstallDir>

\CW_APP\LS\CodeWarrior_Examples\Stda_APP_decoder

2. Launch the trace decoder tool.• To generate AIOP - program trace only, execute the following command:

<CodeWarrior_install_dir>\LS\sa_ls\bin\app.decoder.exe -p --program

AIOPTraceDataExt.dat aiop_out.csv -x APP_Decoder.xml

• In order to fully decode some AIOP specific Task Trace messages such as TaskAllocate, we need the Entry Point ID (EPID) LookUp Table (LUT), which canbe entered in the command line by using the -l argument. The simulated EPIDLUT uses as entry points the start addresses of the procedures 'main' from thetwo elf files. These two addresses are 0x1002e0 and 0x81002e0 and can bedetermined by disassembling the elf files. To generate AIOP - program tracewith AIOP specific trace, execute the following command:

<CodeWarrior_install_dir>\LS\sa_ls\bin\app.decoder.exe -p --aiop -l

0:0x1002e0,1:0x81002e0 AIOPTraceDataExt.dat aiop_ext_out.csv -x APP_Decoder.xml

3. Open the output .csv file and observe the results.

Executing the trace decoder on Linux:1. Open a shell and navigate to the example files folder.2. At the shell prompt, add the binaries directory to the libraries search path.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<CodeWarrior_install_dir>/LS/sa_ls/bin

NOTEReplace <CodeWarrior_install_dir> with the correct path.

3. Launch the trace decoder tool.• To generate AIOP - program trace only, execute the following command:

CodeWarrior_install_dir/LS/sa_ls/bin/app.decoder -p AIOPTraceDataExt.dat

aiop_out.csv -x APP_Decoder.xml

• To generate AIOP - program trace with AIOP specific trace, execute thefollowing command:

CodeWarrior_install_dir/LS/sa_ls/bin/app.decoder -p -l 0:0x1002e0,1:0x81002e0

AIOPTraceDataExt.dat aiop_ext_out.csv -x APP_Decoder.xml

4. Open the output .csv file and observe the results.

Example

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

76 Freescale Semiconductor, Inc.

Page 77: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 6Tarmac2gcda

Tarmac2gcda is a standalone command-line tool for coverage information, that runs onboth Windows and Linux platforms. It is used to generate the .gcda (GCov data files)from a trace. The trace can be given in 3 formats: address list in a text file, tarmac formatinstruction trace and tarmac format program flow trace.

Tarmac is a trace file format specific to ARM. It can contain information aboutinstructions, program flow, registers, and events and can be extended to contain othertypes of information. It is organized in records that have a specific format.

The translator reads the trace generated by the APP software simulator and generatesthe .gcda files needed for the GCov plug-in to display the coverage analysis. In order todo so it gets as input the .gcno files obtained at compile time, the tarmac trace and theexecutable.

This chapter explains:

• Usage• Remarks• Example

6.1 Usage

sa.tarmac2gcda [-c <config_file>] [-x] [-r] [-d <dump_options>] ... [-a <addr2line>] [-f

<trace_format>] [-e <elf_file>] [-g <gcno_file>] ... [-t

<trace_file[:cluster:core:task:]>] ... [--] [--version] [-h]

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 77

Page 78: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The table below lists the sa.tarmac2gcda parameters and their description:

Table 6-1. sa.tarmac2gcda - parameters

Parameter Description

-c <config_file>,--config <config_file> Configuration file (overwrites all other options)

-x (--exclude) Excludes marked lines from GCNOs.

-r, --reset Resets the existing .gcda files

-d <dump_options>, --dump <dump_options>(accepted multiple times)

Enables dumping of .gcno data. Valid options are: all,functions, blocks, arcs

-a <addr2line>, --addr2line <addr2line> Addr2line tool

-f <trace_format>,--format <trace_format> Trace file format. Valid options are: addr_txt (default),tarmac_it, tarmac_pt.

-e <elf_file>, --elf <elf_file> ELF file name

g <gcno_file>, --gcno <gcno_file> (acceptedmultiple times)

gcno file name

-t <trace_file[:cluster:core:task:]>, --trace<trace_file[:cluster:core:task:]> (acceptedmultiple times)

The name of the trace file. It can be followed by cluster andcore info in the format trace:cluster:core:task: (example fortrace on cluster 0 core 0 task 0: auto.tarmac:0:0:0:)

--, --ignore_rest Ignores the rest of the labeled arguments following this flag.

--version Displays version information and exits.

-h, --help Displays usage information and exits.

6.2 Remarks

There can be multiple uses of the -g, -t and -d. For example, if the user has many .gcnofiles in one project he can specify each of them: -g source1.gcno -g source2.gcno. Thisapplies to trace files as well.

If many trace files are given, they are all combined in the same .gcda file and the numberof executions in the summary is set to the number of trace files.

The trace formats can be specified with the -f parameter, valid options are:

• addr_txt - a list of addresses (PC) in a text file• tarmac_it - Tarmac instruction trace• tarmac_pt - Tarmac program trace

NOTEFrom an instruction trace or program flow trace there canbe extracted only the lines for a certain cluster, core andtask, by adding the cluster, core and task number separated

Remarks

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

78 Freescale Semiconductor, Inc.

Page 79: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

by " :" at the end of the trace file name. A " :" will also beadded at the end.

6.3 Example

Take the trace for cluster 0, core 2 and task 3.

-t c:\Short\test24\auto.tarmac:0:2:3:

Make a conversion:

sa.tarmac2gcda -g c:\Short\test6\main_AIOP.gcno -d all -t c:\Short\test6\auto.tarmac

-e c:\Short\test6\test01-core02.elf

-f tarmac_it

Use a configuration file:

sa.tarmac2gcda -c "c:\Short\test24\cfg.txt"

where the cfg.txt file contains the following information:

gcno: c:\Short\test24\main_AIOP.gcno

gcno: c:\Short\test24\interrupt_AIOP.gcno

dump: all

trace: c:\Short\test24\auto.tarmac:0:0:0:

elf: c:\Short\test24\test01-core02.elf

format: tarmac_it

reset: 1

Multi-core support

In a multi-core SMP situation, the same trace file contains the instruction lines for all theclusters, cores and tasks. In SMP case only one elf is used. To obtain the .gcda files froma SMP multi-core trace file the translator can be used in two ways:

• Give the trace file without any source (cluster/core/task) specified. In this case, allthe sources will be taken into account.

• Specify the source (cluster:core:task:) after the trace name. The same trace file can begiven multiple times with different sources. For example: -t auto.tarmac:0:1:0 -t

Chapter 6 Tarmac2gcda

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 79

Page 80: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

auto.tarmac:0:2:0 will parse the trace file taking the instruction lines for core 1 and 2 incluster 0 and task 0.

Let's suppose we have in auto.tarmac information from cluster 0, task 0 and cores 0, 1 and2.

• To get the full coverage for all cores we execute the translator with the parameters:sa.tarmac2gcda -g c:\Short\test6\main_AIOP.gcno -d all -t c:\Short\test6\auto.tarmac -e

c:\Short\test6\test01-core02.elf -a c:\Short\addr2line.exe -f tarmac_it

• To get the coverage information only for core 1 and core 2 we execute the translatorwith the parameters: sa.tarmac2gcda -g c:\Short\test6\main_AIOP.gcno -d all -t c:\Short\test6\auto.tarmac:0:1:0: -t :\Short\test6\auto.tarmac:0:2:0: -e c:\Short\test6\test01-

core02.elf -a c:\Short\addr2line.exe -f tarmac_it

In case of AMP there will be multiple .elf files. The translator must be called multipletimes for each .elf with its corresponding source file.

Example

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

80 Freescale Semiconductor, Inc.

Page 81: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 7Debug Print

This section describes the Linux Debug Print tool and its execution flow. Using this tool,you can easily monitor the kernel and user space applications activity in the CodeWarriorconsole.The key features are as follows:

• On the target side:

• The target server collects the Kernel Ring Buffer log and the user spaceapplications message and sends them to the standard output.

• The dynamic library redirects the user space applications message from thestandard output to the target server.

• On the host side:• The CodeWarrior component, requests periodically the target log data from the

target server and displays it real time in a view, with the filter option.

This chapter contains the following topics:• Components• Configuring Remote Systems Explorer (RSE)• Using Debug Print

7.1 Components

The Debug Print tool consists of the following components:

• Debug Print target server : Reads the Kernel Ring Buffer and optionally clears it(default behavior is similar to dmesg -r -c), collects the redirected standard outputfrom the user space applications, and sends the log data to the clients using TCP/IP.

• Debug Print library : Redirects the user space applications messages from thestandard output to the target server.

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 81

Page 82: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Debug Print probe : The Debug Print server actual client, initiated by the DebugPrint view. When started, it reads periodically the log data from the server and sendsit to the view to be displayed.

• Debug Print view : Displays in a user friendly manner the log data and othercommunication messages, allowing the user to filter the displayed data by timestamp,module name / application path and pid, or a custom string contained by each logmessage.

7.1.1 Debug Print target server

The Debug Print target server is available in the following location of your CodeWarriorinstallation directory:

<CWInstalldir>/CW_APP/LS/sa_ls/linux.app.debugprint/bin

You have to copy the server on your target machine (for example, to your homedirectory), by either using the remote systems explorer (RSE) feature of yourCodeWarrior software (see section, listed below), or any other method like scp, directcopy to the nfs location, and so on.

To start the server, use the command listed below:

ls.target.server [PORT] [-k]

Where,• the PORT is the port number on which the server listens from the clients. If not

specified, the default value is 5000.• the –k option keeps the kernel buffer unaltered (same as dmesg), with a small server

processing overhead.

After starting the server in the ssh console, it displays the port it is listening on, as thefollowing figure shows:

Figure 7-1. ssh console displaying the port

The server works either as the root, or as the normal user with the root access providingmuch lower overhead on the system, as listed below:

Components

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

82 Freescale Semiconductor, Inc.

Page 83: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Root – This is the most efficient mode, from both the processing and thecommunication point of view. By default, it clears the kernel buffer after reading andsending to the host, and each time only the new messages generated by the kernel areread, with no additional processing overhead. Another advantage of running as rootis the timestamp synchronization between the kernel and the user space messages.

• User – This mode reads all the kernel messages and sends them to the host bydefault. It detects the new messages on the host, by keeping a history of the last fewmessages. This results in an overhead on the communication size, since all buffer issent to the host, but no other processing is done on the target.

• Both – You can use the –k option (stands for keep) to use user the server in bothmodes. It does not clear the kernel buffer, but uses an internal server logic fordetermining which are the newer messages, by keeping a history in the targetmemory. This mode has the same communication efficiency as if clearing the kernelbuffer, but adds a processing overhead on determining the newer messages.

7.1.2 Debug Print library

The Debug Print library is available in the following location of your CodeWarriorinstallation directory:

<CWInstalldir>/CW_APP/LS/sa_ls/linux.app.debugprint/lib

You have to copy the library on your target machine (for example, to your homedirectory), by either using the remote systems explorer (RSE) feature of yourCodeWarrior software (see section, listed below), or any other method like scp, directcopy to the nfs location, and so on

You must load the shell before the C runtime, when running the user space applicationsthat you need to monitor, by setting the environment variable LD_PRELOAD, as listed below:

# export LD_PRELOAD=~/libls.linux.debugprint.lib.so.1.0# ./<test_app>- Or -# LD_PRELOAD=~/libls.linux.debugprint.lib.so.1.0 ./<test_app>

After you set the LD_PRELOAD environment variable and the target server is started, the testapplication does not display anything to the standard output, but only to the standarderror or other custom files, as the following figure shows:

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 83

Page 84: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 7-2. Sever output

7.1.3 Debug Print probe

The Debug Print probe is started by the Debug Print view and communicates with theserver using the TCP/IP. When started, it reads periodically the kernel log data from theserver and displays it in the view.

7.1.4 Debug Print view

The Debug Print view displays the log data and other communication messages,allowing you to filter the displayed data by timestamp, module name / application pathand pid, or a custom string contained by each log message. The view has a powerfulfiltering engine which allows you to see only the information you need.

To open the Debug Print view, follow these steps:1. Select Window > Show View > Other from the IDE menu bar.

The Show View dialog appears.

Components

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

84 Freescale Semiconductor, Inc.

Page 85: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 7-3. Show View dialog2. From the Software Analysis group, select Debug Print.3. Click OK.

The Debug Print view appears.

Figure 7-4. Debug Print view

The following table lists and describes the Debug Print view toolbar buttons:

Button Icon Description

Clear Removes all text from the view.

Start Starts the Debug Print monitor task.

Stop Stops the Debug Print monitor task.

Scroll Lock Locks/unlocks the scrollbar. If thescrollbar is unlocked, it auto-scrolls tothe latest Debug Print message.

Configure Debug Print Opens the Configuration Debug Printdialog for entering the server addressand port.

Table continues on the next page...

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 85

Page 86: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Button Icon Description

Create Debug Print Filters Opens the Create Filters dialog forconfiguring what information is displayedin the view (related to timestamps,module name / application path and pid,other string patterns)

7.2 Configuring Remote Systems Explorer (RSE)

You can use the Remote Systems Explorer (RSE) to browse the target file system,transfer files to the target directly from the CodeWarrior, and start the ssh consoles. Yourtarget server must be connected to the host running the CodeWarrior software.

You can create either a Linux or an SSH Only connection to the target, by following thesteps listed below:

1. Select the Window > Show View > Other from the IDE menu bar.

The Show View dialog appears.

2. Expand the Remote Systems group and select Remote Systems.

Figure 7-5. Show View dialog3. Click OK.

The Remote Systems view appears in the IDE.

4. Click .

Configuring Remote Systems Explorer (RSE)

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

86 Freescale Semiconductor, Inc.

Page 87: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The New Connection dialog appears.

5. Expand the General group and select Linux.

Figure 7-6. New Connection wizard - Select Remote System Type page6. Click Next.

The Remote Linux System Connection page appears.

7. Create a Linux System, by entering the target IP or name, and select ssh.files,processes.shell.linux, ssh.shells, and ssh.terminals.

Figure 7-7. New Connection wizard - Remote Linux System Connection page

NOTEIf you do not have the Linux or SSH Only system typesavailable, to enable them, select Window > Preferences >General > Capabilities and check Remote SystemsExplorer. Then select Remote Systems from the left paneland set the system types Linux and SSH Only to true inthe Enabled column.

8. Click Finish.The IDE initiates the new connection process to the target.

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 87

Page 88: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 7-8. Enter Password dialog

If there is no Debug Print binary available on the target (server or user space library), youcan add them using the following two ways:

• Right click on the root home and select Add Debug Print support then refresh thedirectory tree.

Figure 7-9. Add Debug Print support option• Copy the Debug Print server and library binaries from the <CWInstallDir>/LS/sa_ls/

linux.app.debugprint/bin and <CWInstallDir>/LS/sa_ls/linux.app.debugprint/libdirectories, respectively and paste them on the target by using the context-menuPaste option of the root home directory in the Remote Systems view. Then set theexecutable permissions on the target server from the Properties context-menuoption for the file.

Configuring Remote Systems Explorer (RSE)

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

88 Freescale Semiconductor, Inc.

Page 89: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 7-10. Remote System view

Now, launch RSE ssh consoles by selecting the root home directory and then right-clickand select Launch Terminal from the context-menu. In these consoles you can start theserver or run other applications:

Figure 7-11. Launch terminal

7.3 Using Debug PrintThe ARM binaries have been compiled with the tool chain gcc-linaro-aarch64-linux-gnu-4.8.3 available in your CodeWarrior installation.

Before working on the Debug Print tool, make sure that the TCP/IP communication isestablished between the host and the target. To use the Debug Print tool, follow the stepslisted below:

1. Deploy the Software Analysis target binaries on the target, by using the Add DebugPrint support context-menu option in the Remote Systems view. Alternatively, ifyou have the target root filesystem on NFS, you can copy the ls.target.server andlibls.linux.debugprint.lib.so* to the host location [NFS_PATH]/home/root.

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 89

Page 90: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

2. Open an ssh console in the directory where the Software Analysis binaries have beendeployed, using the RSE or any other type of terminal and start the ls.target.serveron the default port, 5000:

# ./ls.target.server

3. Open the Debug Print view.4. Click Configure ( ) and enter the server address, port, and description.5. Click Start ( ) .

The kernel log messages appears in the view.

Figure 7-12. Debug Print view - Kernel log messages

Kernel space messages have the module name in blue color, and the user spacemessages have the module name colored in magenta.

NOTEFor more information on message log level in green color,see http://linux.die.net/man/2/syslog.

Using Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

90 Freescale Semiconductor, Inc.

Page 91: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

6. Open another console in the same directory, preload the Debug Print library and runthe test application.

# LD_PRELOAD=~/libls.linux.debugprint.lib.so.1.0 ./test-arm

The application messages get appended in the Debug Print view.

Figure 7-13. Debug Print view - Appended application messages7. Add some more messages to the view, both from kernel and the test app from the

same console where the test application was previously run:

# echo Hello World > /dev/kmsg# ./<test_app># echo Helloooooo > /dev/kmsg

The following image shows an example:

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 91

Page 92: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 7-14. Console displaying commands to add messages8. The following image shows an example, of the new messages displayed in the

Debug Print view text area as you enter them in the target shell:

Figure 7-15. Debug Print view - New messages from target shell9. Click Filter ( ).

The Create Debug Print Filters dialog appears.

Using Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

92 Freescale Semiconductor, Inc.

Page 93: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

10. Filter all messages from the server as follows:a. Clear PID.b. Select <test_app> from the Existing list.c. Click Add Filter.

11. Click OK.The IDE filters and the filtered messages appears in the view, as the following figureshows:

Figure 7-16. Debud Print view displaying filtered messages12. Click Filter ( ) again to open the Create Debug Print Filters dialog.13. Click Clear Filters.14. Select Other tab.15. Enter Hello in the Messages containing string text box.16. Click Qualify.17. Click OK.

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 93

Page 94: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The IDE filters the messages based on the Hello string and the filtered messagesappears in the view. The following image shows an example:

Figure 7-17. Debug Print view - String based filtered messages

7.3.1 Debug Print for AIOP

The following device driver of the Freescale Linux BSPs for QorIQ LS Series 2 (LS 20xxboards), extracts the log messages from the software running on AIOP:

• /dev/fsl_aiop_consolefor AIOP

You can use this device driver in conjunction with a console print tool such as cat or tail.

For Debug Print use tail, as it allows continuous polling of the driver output.

For AIOP, use the Reflector setup available in the Freescale Linux BSP for QorIQ LSSeries 2.

Deploy the Debug Print binaries on the target and start the target server. You must run ina SSH console tail–f /dev/fsl_aiop_console the same way as any other user spaceapplication:

# LD_PRELOAD=~/libls.linux.debugprint.lib.so.1.0 tail –f /dev/fsl_aiop_console

then let AIOP run as usual.

NOTEFor more information, see Using Debug Print.

For the Linux Container, run the tcpreplay application:

# tcpreplay -i eth4 /usr/aiop/traffic_files/reflector.pcap

The following figure shows the output in the Debug Print view:

Using Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

94 Freescale Semiconductor, Inc.

Page 95: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Figure 7-18. Debug Print view

The timestamp displayed in the Debug Print view corresponds to the time when tailpolled the driver’s output. It may be delayed from the real moment when the messagewas generated by the AIOP application.

NOTEFor busybox Linux distributions, tail is emulated by thebusybox process. For other Linux distribution, the string tailwill be shown instead of busybox.nosuid.

Chapter 7 Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 95

Page 96: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Using Debug Print

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

96 Freescale Semiconductor, Inc.

Page 97: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Chapter 8AIOP Statistical Profiler

The AIOP Statistical Profiler is a tool which estimates the time spent on AIOP cores andaccelerators during an AIOP run.

It is meant to be used to get an overview of the system execution, in cases when classictrace would generate files too large and would cover a too small amount of the executiontime.

The emphasis is on accelerator usage.

The tool runs realtime, with no limitations on the execution time or memory/disk spacerequirements, with close to zero impact on the target system execution.

It is based on sampling the AIOP task states and current PC, for each core, usingsnapshots generated by the hardware itself.

The snapshots contain data for both active tasks (executing on core) and backgroundtasks (waiting or running on accelerators). When no task is executing on a core, thehardware will set as active task for that core a task running on an accelerator and the PCof the last executed instruction.

The tool comes in two flavors:

• JTAG based• On-target Agent based.

The JTAG based solution triggers target snapshots and reads the snapshot data throughccs, during a normal CodeWarrior debug session. It is intended to be used on bareboardexecutions. The result is a profile file which can be viewed in the CodeWarrior CodeCoverage editor.

The Agent based solution consists of a Linux application which triggers and reads thesnapshots, processes the data and generates a profile similar to the JTAG solution.

The Agent based solution has a much bigger execution speed and precision of the profile,being able to gather tens to hundred times more snapshot data than the JTAG solution.

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 97

Page 98: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

The following topics describes the Statistical Profiler in details:• Running AIOP Statistical Profiler• Statistical Profiler results

8.1 Running AIOP Statistical Profiler

To run AIOP statistical profiler, follow the steps listed below:1. JTAG Statistical Profiler

a. Create or import a bareboard project and build it. Alternatively, import an elf.b. Open the Trace and Profile debug configuration tab, and check Enable

Statistical Profiling. Then expand Advanced settings and check the cores youwant to analyze.

Figure 8-1. Debug Configurations settingsc. Click Apply.d. Click Debug.e. For Download launch configurations, wait for the application to suspend in the

entrypoint (normally main), then click Resume.f. For Attach launch configurations, wait for the debugger to finish attaching to the

target, then click Suspend and Resume.

Running AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

98 Freescale Semiconductor, Inc.

Page 99: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

g. Let the application run for several more minutes, then click Terminate ordetach. A small progress monitor appears in the right part of the status bar(Processing Sampling Data), and when the IDE completes the processingAnalysis Results view appears. Click Refresh, a set of results named StatisticalProfile displays.

Figure 8-2. Analysis Results viewh. Click Statistical Profile, a .flatprofiler file will open.

2. On-target Statistical Profilera. Configure the QorIQ LS2085 target as listed in the AIOP SDK Applications

Debug Application Note (document AN5165) to make a functional AIOPreflector setup. In Linux, test that the # ping 6.6.6.10 command is working onyour target.

b. Configure the LS2085A eth0 interface from Linux to make the target accessiblefrom your machine.

c. Using a telnet connection to serial output of the CWTAP or an ssh connection tothe target, start a flood ping (or more, in background) from the command promptof the console:

# ping -fq 6.6.6.10 &

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 99

Page 100: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

d. Connect to the linux target running Linux using ssh, and create a directory in alocation with enough space:

# mkdir -p /run/satest # cd /run/satest

e. Copy the statistical profiler cross-compiled elf on target from CodeWarrior (pathfrom CodeWarrior), together with the AIOP elf running on target. Use –P withscp if ssh uses a port different than 22.

Windows: from a new cmd prompt, using Cygwin:

Linux: from a new terminal:

f. Update the sampling profiler agent permissions to make it executable:

g. Run the sampling profile agent specifying the cores to be sampled, the elf, andthe output file. The format is:

# ls.linux.aiopsampling [0] [1] … [15] -elf <elf_file> <out_file>

0 – 15 are the cores to be sampled. If no core is specified in command line, bydefault all cores are sampled. The <out_file> will always have theextension .flatprofile.

Running AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

100 Freescale Semiconductor, Inc.

Page 101: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

h. Copy the .flatprofiler file on host, to the reflector project folder:

i. Drag and drop the newly copied file into you CodeWarrior IDE.

8.2 Statistical Profiler results

It contains following two tables:• Summary Table• Details Table

The Summary Table contains a function execution statistics grouped by the source fileand non-function statistics, under <no source> group. The later are referred as pseudo-functions.

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 101

Page 102: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

1. CodeWarrior Attach results (for a bareboard application):

Statistical Profiler results

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

102 Freescale Semiconductor, Inc.

Page 103: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

2. Linux agent Results (for modified AIOP Reflector application):

The function statistics correspond to active tasks, executing on cores, while the non-function information refers to background tasks, which can be either idle (no workassigned), running on an accelerator, waiting for CPU for another task, inhibited(suspended) from execution.

The table has three columns: File/Function Name, Samples and Percent Samples.

The Samples columns contains the number of samples (counting by tasks) assigned to thecorresponding function or pseudo-function. Usually the number of samples reported for<inhibited> or <unassigned> pseudo-functions is much bigger the others, because thereare more than one task in a snapshot timeframe which are not doing any work, compared

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 103

Page 104: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

to active tasks which are at most one per core. Also, the number of samples reported foraccelerating pseudo-symbols can be larger than for functions, since each accelerator canservice multiple tasks in parallel.

Normally a high usage of the accelerators mean a good parallelization of the executionand usage of the hardware resources. Available accelerators are: TMAN (TimerManager), A-ACL (Algorithmic Access Control List), SEC (Security Engine), PC-CTLU(Parse-Classify Classifier and Table Lookup Unit), TL-CTLU (Table Lookup Classifierand Table Lookup Unit), Stat-Eng (Statistical Engine), P-FDMA (Presentation FrameDMA), CDMA (Context DMA), O-FDMA (Output Frame DMA).

The Details table contains disassembly and source location information for acceleratingpseudo-functions, but gathered only for the snapshots where active task was running onaccelerator rather than running on the core. This represents the instructions from wherethe acceleration started.

Since the cases when active task is not running on a core are less then cases when activetask is running on a core, the samples values reported in the details table will be smallerthan the ones in the Summary table.

The Details table does not display disassembly information for PCs sampled forfunctions, since the goal is not to generate a coverage of the executed code, but only ofthe accelerator calls.

Double clicking on a row in the Details table will open the corresponding source file andselect the line corresponding to the accelerator call.

Functions displaying 0 samples have been calling accelerators, but they were not sampledwhile executing themselves.

Statistical Profiler results

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

104 Freescale Semiconductor, Inc.

Page 105: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

If the source file is not found, the user is prompted to browse for the source file:

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 105

Page 106: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Click Locate File:

Select the file then click Open.

The Code Coverage Editor supports the following functions:

• Flat View / Tree view

Statistical Profiler results

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

106 Freescale Semiconductor, Inc.

Page 107: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Navigation (backwards, forward) in the history of selections inside the editor ( )

• Configure columns displayed in the Summary and Details Table ( )

• Filter the (pseudo-) functions displayed in Summary table by source file ( )

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 107

Page 108: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Collapse/Expand all ( ; )

Statistical Profiler results

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

108 Freescale Semiconductor, Inc.

Page 109: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Export to CSV and Export to HTML ( )

• Sort by column (ascending, descending, unsorted)• Copy cell or line

There are four tabs in the Code Coverage editor for Statistical profiler:

• All States - display statistics for all task states, including tasks executing on core(function statistics), tasks waiting for core access, unassigned and inhibited tasks, aswell as tasks accessing accelerators. This allows a full AIOP system overview.

• Cores and Accelerators - display statistics only for tasks executing on core (functionstatistics) or accessing accelerators. This allows to see the balance between coreusage and accelerator usage.

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 109

Page 110: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Cores - display statistics only for tasks executing on core. This allows to compareexecution time of various functions, and to spot bottlenecks (most useful on flatview)

Statistical Profiler results

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

110 Freescale Semiconductor, Inc.

Page 111: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

• Accelerators – display statistics only for tasks accessing accelerators. This allows tosee a clean overview of the accelerator usage alone.

Chapter 8 AIOP Statistical Profiler

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

Freescale Semiconductor, Inc. 111

Page 112: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Statistical Profiler results

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide,Rev. 10.2, 01/2016

112 Freescale Semiconductor, Inc.

Page 113: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Index

A

Adding or removing function 49Add or Remove Group 49

C

Changing color 49Components 81Configuring Remote Systems Explorer 86Creating New Project and Defining LaunchConfiguration 57

D

Debug Print 81Debug Print library 83Debug Print probe 84Debug Print server 82Debug Print view 84Display coverage details for all files 61Display coverage details for a selected source file60

E

Editing address range of function 49Example 75, 79

G

gcov view 62Generating code coverage files 27

L

Launching software simulator 27lDecoding trace data 73

M

Merging groups or functions 51

R

Remarks 75, 78

T

Tarmac2gcda 77

U

Usage 73, 77

V

Viewing trace 59

Index

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide

Freescale Semiconductor, Inc. 113

Page 114: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

Index

CodeWarrior Development Studio for Advanced Packet Processing Tracing and Profiling User Guide

114 Freescale Semiconductor, Inc.

Page 115: CodeWarrior Development Studio for Advanced Packet ...€¦ · 2.2.3 Code Coverage data The code coverage data is generated based on the trace data. The Code Coverage view displays

How to Reach Us:

Home Page:freescale.com

Web Support:freescale.com/support

Information in this document is provided solely to enable system andsoftware implementers to use Freescale products. There are no expressor implied copyright licenses granted hereunder to design or fabricateany integrated circuits based on the information in this document.Freescale reserves the right to make changes without further notice toany products herein.

Freescale makes no warranty, representation, or guarantee regardingthe suitability of its products for any particular purpose, nor doesFreescale assume any liability arising out of the application or use ofany product or circuit, and specifically disclaims any and all liability,including without limitation consequential or incidental damages.“Typical” parameters that may be provided in Freescale data sheetsand/or specifications can and do vary in different applications, andactual performance may vary over time. All operating parameters,including “typicals,” must be validated for each customer application bycustomer's technical experts. Freescale does not convey any licenseunder its patent rights nor the rights of others. Freescale sells productspursuant to standard terms and conditions of sale, which can be foundat the following address: freescale.com/SalesTermsandConditions.

Freescale, the Freescale logo, and CodeWarrior are trademarks ofFreescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. QorIQ istrademark of Freescale Semiconductor, Inc. All other product or servicenames are the property of their respective owners. ARM, Cortex,Cortex-A53, Cortex-A57, and TrustZone are registered trademarks ofARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rightsreserved.

© 2013–2016 Freescale Semiconductor, Inc. All rights reserved.

Document Number CWAPPSWAUGRevision 10.2, 01/2016