Execution Time view

This view provides you with valuable decision-making capabilities in that it helps you identify those functions that clearly consume the most CPU time, making them candidates for optimization. This type of instrumentation is the most effective way of optimizing bottlenecks in a single application. This data-collection technique lets you gather precise information about the duration of time that the processor spends in each function, and provides stack trace and Call Count information at the same time.

Execution Time view

Figure 1. The Execution Time view in the Application Profiler perspective.

Using a call tree, you can see exactly where the application spends its time, and which functions are used in the process.

By default, the selected preferences provide you with the basic columns containing valuable profiling data; however, you can specify additional columns and display settings (see Column descriptions and Toolbar options), if desired.

The Execution time view supports the following tree views and graph:

  • Show Table mode — shows a list of functions.
  • Show Calls — shows root node(s), and usually what this node calls or what is inside it.
  • Show Reverse Calls — shows root function(s), and functions calling it, including grouping where possible.
  • Show Call Graphs — shows the calling functions, and the functions called by this function, in a graphical mode.
  • Show Source — shows the source for the selected function, where possible.

Column descriptions

Name
The name of the function. In addition, you can view who called the function, and how much time each function took to execute in the context of a caller.
Deep Time
The time it took to execute the function and all of its descendants. It is the pure real time interval from the time function starts until it ends, which includes the shallow time of this function, the sum of the children's deep times, and all time in which the thread isn't running while blocked in this function. For sampling mode, it's not used. It's also referred as the Total Function Time. When this function is called more than once, it's the sum of all the times it's called from a particular stack frame, or from a particular function.
Shallow Time
For Function Instrumentation mode, it's the deep function time minus the sum of total for its children's calculated times. It roughly represents the time that the processor spent in a particular function only; however, for this type of analysis, it also includes the time for kernel calls, the time for instrumented library calls, and the time for profiling the code. For Sampling mode, it's an estimated time, calculated by multiplying an interval time for the count of all samples with a given function.
Count
The number of times the function was called.
Location
The location in the code where the function can be found.
Percent
The percentage of Deep Time compared to the Total Time (or compared to the Root node time).
Average
The average time spent in the function.
Max
The maximum time spent in the function.
Min
The minimum time spent in the function.
Time Stamp
A time stamp assigned to the function, if any (the last time the function was called).
Binary
The file name for the binary.

Interpret Tree mode column information by profiling type

The following table describes the meanings for time columns for all data source combinations with visual modes:

Mode Node Deep Time Shallow Time Count Average Max (Min)
Sampling and/or Call Count Function (All) Same as Shallow Time, invisible The sum of all probes for a given function The sum of Count for all Call Samples where given function is to Shallow Time / Count, or Shallow Time if count is 0 N/A
Sampling and/or Call Count Addressable (All) Same as Shallow Time, invisible The sum of all probes for a given address, or 0 if there are no probes for a given address (but it exists in the Call Counts tree) The sum of Count for all Call Samples where given function is to Shallow Time / Count, or Shallow Time if count is 0 N/A
Sampling and/or Call Count Line Probe (Call Tree mode) Same as Shallow Time, invisible The sum of all probes for a given address 0 Same as Shallow Time N/A
Sampling and/or Call Count Call Pair (Call Tree mode, Reverse Call Tree mode) N/A N/A The sum of Call Counts a for given pair N/A N/A
Sampling and/or Call Count, Function Instr. Group Node (Reverse Call Tree Mode, Table Mode) Same as Shallow Time The sum of Shallow Time for the children The sum of Count for the children Deep Time / Count Max (Min) of children
Function Instr. Function (All) The sum of the Total Deep Function Time for each occurrence of this function in a timed call tree, excluding inner recursive frames The sum of the Shallow Function Time for all occurrences of this function in a call tree. The Shallow Function Time for the call tree is the Total Deep Function Time minus the sum of the Total Deep Function Time for all descendants. The sum of all counts to this function in the call tree (Deep Time + Rec. Time) / Count The Max (Min) of the Total Deep Function Time between all occurrences
Function Instr. Thread (Call Tree mode) The sum of the total for entry functions (only one entry, but there might be some unattached calls) Same as Total 1 N/A N/A
Function Instr. Call Pair (Call Tree mode) The sum of the Total Deep Function Time for all occurrences of this call pair for a given parent backtrace N/A Call Count of this call pair for a given parent backtrace Deep Time / Count Max (Min) of this call pair's Total Deep Time for a given parent backtrace
Function Instr. Self (Call Tree mode) Same as Shallow Time The parent Total minus the sum of the Total for the siblings Count of a parent Shallow Time / Count Max (Min) of this call pair's Shallow Time for a given parent backtrace
Function Instr. Recursive Call Pair (Reverse Call Tree mode) N/A N/A The sum of Call Counts for a given pair N/A N/A
Function Instr. Call Pair, Thread, Process (Reverse Call Tree mode) The sum of Total Call Pair time for the Root function for a given stackframe (the child in this tree represents the parent in the call stack) N/A The sum of Call Counts for the Root function for a given stackframe Deep Time / Count N/A

Toolbar options

Icon Name Description

Icon: Scroll Lock

Scroll Lock Pauses the current view of the data to show the results to you in a frozen state until you unlock the window.

Icon: Refresh

Refresh Updates the current view to show the most recent profiling information.

Icon: Take Snapshot and Watch Difference

Take Snapshot and Watch Difference Take Snapshot and Watch Difference

Icon: Go Back

Go Back Moves up one level in the tree view hierarchy.

Icon: Go Forward

Go Forward Moves down one level in the Tree view hierarchy.

Icon: Show Threads Tree

Show Threads Tree Show Threads Tree

Icon: Show Table

Show Table Show Table mode

Icon: Menu

Menu Shows the menu of options for this window.

Context menu navigation options

An easy to use context navigation menu is available for each node of the tree, table, or call graph. The options available from the context menu are:

  • Show Calls shows the functions that are called by the selected function.
  • Show Reverse Calls lists the functions that called the selected function.
  • Show Call Graph shows an illustration of the runtime call graph.

Take Snapshot and Watch Difference

Use the Take Snapshot and Watch Difference icon to create another profiler session that's a snapshot of your program. Later, you can use the Compare profiles feature to compare the profile session data, and then continue to monitor the results as your application runs in another pane.

To access this feature:

  1. From the toolbar menu in the Execution Time view, click the Take Snapshot and Watch Difference icon.

Show Threads Tree

The Show Threads Tree option lets you show a graphical representation of the threads and calling functions within your application. You can drill down to see the detail of the lowest function calls.

To access this tree:

  1. From the toolbar menu in the Execution Time view, click the Show Threads Tree icon.

Show Threads Tree

Figure 2. The Show Threads Tree view.

You can use this information to:

  • identify which threads are the most and least active
  • determine the appropriate size of your application's thread pool. (If there are idle threads, you might want to reduce the size of the pool.)

To view quantitative profiling values:

  1. In the annotated source editor, let the pointer hover over a colored bar. The CPU usage appears, and shows as percentage and time values.

Show Table mode

This mode shows a list of functions from the applications in your project.

In Function Instrumentation mode, it doesn't show calls to functions, such as printf, in the C library.

To access this table:

  1. From the toolbar menu in the Execution Time view, click the Show Table icon.

Icon: Show Table

A list of functions for the selected profile is displayed in the Execution Time view.

Show Table mode

Figure 3. The Show Table Mode view.

From this table, select a function a right-click to Show Calls.

Show Calls

The Call Tree mode shows you a list of all of the functions called by the selected function. This call tree view lets you drill into specific call traces to analyze which ones have the greatest performance impact. You can set the starting point of the call tree view by drilling down from a thread entry function to see how the actual time is distributed for each of its function descendants.

To show a table containing a list of functions and its descendants for the selected profile:

  1. In the Execution Time view, right-click on a function and select Show Calls from the menu.

Column Descriptions

Name
The name of the group or function, or self name and decorator, if applicable.
Deep Time
The duration of time that the thread spends from the moment it enters, until it exits, the function (the sum for all occurrences, by context). The Time column can contain time bar and percent values.
Shallow Time
The time spent in the function, excluding only descendants.
Count
The number of time function calls (the calls count).
Location
The file or line location for the function.
Percent
The value of the result of: (Deep Time/Current Total Time×100)
Average
The Deep Time column divided by the Count column.
Min
The minimum time in the function.
Max
The maximum time in the function.
Timestamp
The timestamp of the last entry to the function.
Binary
The name of the executable for the function.

Time columns contain the following features, which you can customize using the Preferences menu option:

Time %
The value of Root Ratio for Time based columns, and the value of Total Ratio for the Own Time based columns.
Timebar
A visual bar occupying a percentage of the column equal to the total amount of time that a thread spends in a function.

Additional columns:

Own Total Ratio
The value of the result of: (Own Time/Total App. Time×100)
Parent Ratio
The percentage of time for a child node compared to the parent node; not the total time.
Root Ratio
The value of the result of: Time/Root Time×100
Binary
The name of the binary container.

Show Reverse Calls

A reverse call tree shows you what is calling a specific function, and how its time was distributed for each of those callers. You can use a reverse call tree to either drill up or down the stack to view the callers and their contribution time, until you encounter a thread entry function.

To show the source code for a function:

  1. In the Execution Time view, right-click on a function and select Show Reverse Calls from the menu.

Show Call Graphs

A call graph shows a visual representation of how the functions are called within the project.

To create a call graph for the selected profile:

  1. In the Execution Time view, right-click on a function and select Show Call Graphs from the menu.

Simple call graph example

Figure 4. A simple example of a call graph.

This call graph shows a pictorial representation of the function calls. The selected function appears in the middle, in blue. On the left, in orange, are all of the functions that called this function. On the right, also in orange, are all of the functions that this function called.

To see the calls to and from a function:

  1. Click on a function directly in the call graph.

You can show the call graph only for functions that were compiled with profiling enabled.

If you position your cursor over a function in the graph, you will see Deep Time, Percent, and Count information for that function, if any.

For descriptions about these fields, see Column descriptions.

Show Source

Occasionally, you'll want to view the source code for a particular function that might require further investigation. You can easily jump to the source code and compare the profiling results against the actual code to determine if the data is acceptable, or if it's a candidate for further optimization.

To show the source code for a function:

  1. In the Execution Time view, right-click on a function and select Show Source from the menu.

Context menu navigation options

An easy to use context navigation menu is available for each node of the tree, table, or call graph. The options available from the context menu are:

  • Show Calls — shows the functions that are called by the selected function.
  • Show Reverse Calls — lists the functions that called the selected function.
  • Show Call Graph — shows an illustration of the runtime call graph.

Duplicate a view

You can create a second Execution Time view to see data side-by-side in another window using the menu option Duplicate View. The new view is disconnected from Profiler Sessions view; however, it maintains its own history. You can use this feature to observe a snapshot of your program, and then continue to monitor the results as your application runs in another pane.

To duplicate a view:

  1. In the Execution Time view, click the Menu icon from the toolbar and select Duplicate View.

View history

The Execution Time view keeps track and maintains a record of where have been. You can use the Go Back and Go Forward icons from the toolbar, or select a particular entry in the navigation history. You can set the navigation history size in the preferences for the view.

Grouping

The grouping feature helps for the organization of large function tables, and for improved navigation and analysis. This is the most efficient method to observe aggregated time results for each software component (binary or file).

To access data grouping:

  1. In the Execution Time view, click the Menu icon from the toolbar and select Group By.

Screen showing menu options for grouping.

Set preferences

You can use the Execution Time View Preference Page to customize the number of columns you want to have in the view, their order, and the format of the data they show in the view.

To set preferences:

  1. In the Execution Time view, click the Menu icon from the toolbar and select Preferences.

Screen showing setting user preferences.

For example, you might want to select more columns to add more detail information to your view:

Screen showing additional columns selected for the view.

Filter

When grouping doesn't help reduce the amount of profiling data from the results, you can use filters to remove some rows from the table. Component filtering lets you see only those records related to the specified component, or you can use Data filtering to filter based on timing values.

When filtering is applied, the <filtered> element remains in the view as a remainder of the filtered elements, and the total number of these elements is visible in the Count column.

To filter results:

  1. In the Execution Time view, click the Menu icon from the toolbar and select Filters.

Screen showing the Filters dialog box.

Search

You can perform a text search on the data results from the profile. The Find feature includes a Find bar at the bottom of the Execution Time view. The view automatically expands and highlights the nodes in the tree when the search locates results matching the search criteria.

To search results:

  1. In the Execution Time view, click the Menu icon from the toolbar and select Search.

Last modified: 2013-12-21

comments powered by Disqus