Viewing source code with performance data

Opening the Performance Source Viewer

From the Hotspots Browser right click a function and select Open Source. (Double clicking the function has the same effect.)

Examining Source Level Data

The Performance Source Viewer shows line-level performance data. Line-level data is not available for JIT-compiled Java methods.

The ruler to the left of the source code shows how much time each source line takes from the profile.

The percentages are always relative to the Whole System filter. This is due to a limitation with the low level performance tools, they do not identify the thread or process associated with the line-level data.

You can select several source lines and the total time for those lines is added up and shown at the top of the viewer.

Sometimes ticks cannot be mapped accurately back to the exact source line they come from. This happens because the compiler can move around instructions when performing optimizations like function inlining. When ticks cannot be accurately mapped a heuristic algorithm is used to make a best guess of the source code line. A warning will be displayed at the top of the viewer and the lines that are based on the heuristic will show the performance data in italics with yellow highlighting.

Outline View

The Outline view can be used to drill down and examine the code by looking at blocks and lexical scopes of C/C++ code or paragraphs of COBOL code. This can be useful to identify hot blocks or loops.

Editing the code

The Performance Source Viewer shows the application source code in read-only mode. This restriction is to ensure that the line-level performance data always correctly lines up with the source code.

To edit the code you must open the file in the regular C/C++ editor. The easiest way to do this is to click the Switch To Editor button at the top right corner of the viewer.


Feedback