Profiling Execution Performance. AOpen MK86-L


Add to my manuals
157 Pages

advertisement

Profiling Execution Performance. AOpen MK86-L | Manualzz

Profiling Execution Performance

About Profiling with the Nios II IDE

The GNU profiler (gprof) collects information about which functions call other functions during program execution, and tracks the time spent in each function. Profiling provides information about the efficiency of your program by showing you where and how your program spends its time.

Profiling can help you determine where to optimize your code to improve execution

performance.

The Profiling perspective in the Nios II IDE provides a convenient and useful way to analyze the GNU profiling data. The display features of the perspective's views make the data much easier to read and analyze, compared to reading the standard gprof text output.

Related Nios II IDE Help Topics

Profiling C Code

Profiling Perspective

Related Topics on the Web

AN 391: Profiling Nios II Systems at www.altera.com/literature/an/an391.pdf

The GNU Profiler —GNU gprof documentation from the Free Software Foundation

72

Profiling Execution Performance

Profiling C Code

To use the GNU profiler, you must compile and link your program with the profiling library, execute the program to generate a gmon.out profile data file, and run gprof to parse the profile data. The following sections describe how to accomplish the tasks.

To collect profiling data:

1. Switch to the Nios II C/C++ perspective, if necessary.

2. Right-click your project in the Nios II C/C++ Projects view, and then click System

Library Properties.

3. In the Properties dialog box, click System Library.

4. Turn on Link with profiling library.

5.

6. Click OK.

7. Right-click your project in the Nios II C/C++ Projects view, point to Run As, and then click Nios II Hardware.

After program execution completes, the file <project directory>/<build configuration

directory>/gmon.out contains the profiling information.

Note: Execution must return from main() to create the file; if you terminate the run or debug session, all profiling information is lost.

To analyze profiling data:

The nios2-elf-gprof utility converts the binary gmon.out data file and displays the profiling information in a readable format. You can run the nios2-elf-gprof utility automatically with the Profiling perspective in the Nios II IDE.

To view the profiling data, perform the following steps:

1. In the Nios II C/C++ Projects view, locate the generated gmon.out file in the

<build configuration directory> (typically Release or Debug) .

2. Double-click the gmon.out file to automatically switch to the Profiling perspective and display the gmon.out data.

You can also run the nios2-elf-gprof utility from the command line.

Related Nios II IDE Help Topics

About Profiling with the Nios II IDE

Profiling Perspective

Call Hierarchy View (Profiling Perspective)

Editor View (Profiling Perspective)

73

Nios II IDE Help System

Samples —Function Total View (Profiling Perspective)

Samples —Line By Line View (Profiling Perspective)

Related Topics on the Web

AN 391: Profiling Nios II Systems at www.altera.com/literature/an/an391.pdf

The GNU Profiler —GNU gprof documentation from the Free Software Foundation

74

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents