The Source Tab

The Source tab shows the source file that contains the selected function, source line or instruction. Each line in the source file for which instructions have been generated is annotated with performance metrics. If compiler commentary is available, it appears above the source line to which it refers.

Lines with high metric values have the metrics highlighted. A high metric value is one that exceeds a threshold percentage of the largest value of that metric on any line in the file.

If the selected object is a function, the display is positioned at the first line of the function. If the selected object is a source line, the display is positioned at that source line. If the selected object is an instruction, the display is positioned at the source line containing that instruction.

If you select a line in the Source tab, the source line becomes the selected object, which determines where the display is positioned when you switch tabs.

You can view annotated source code for a non-Java function that was dynamically compiled if you provide information on the function using the collector API, but you only see non-zero metrics for the selected function, even if there are more functions in the source file.

The source window sometimes displays lines in red italics with text in angle brackets. These special index lines indicate where alternate source contexts are located.

<Function: inc_func, instructions from source file inc_func.h>

Double-clicking on an index line that refers to another source context opens the file containing that source context at the location associated with the indexed function.

Most index lines do not reference an external file; the first instructions of the function referenced in the index line are in the file currently displayed. For C and C++ source files, the first instructions correspond to the opening brace of the function.

To search for lines with high metric values:

  1. Choose High Metric Value from the combo box in the Find tool in the toolbar.
  2. Click one of the up or down arrows to search.

To search for text in the source code:

  1. Enter the search text in the text box of the Find tool in the toolbar.
  2. Click one of the up or down arrows to search.
tip To change the highlighting threshold, compiler commentary and metrics displayed, choose View and choose Set Data Presentation and click the Source/Disassembly tab.
tip You can copy lines as text by dragging through them and pressing Copy or Ctrl-C.
warning annotated source metrics are always summed over all functions that come from the module (.o file).
See also
Interpreting Annotated Source Code
Where the Analyzer Looks for Source Files
Metric Value Meanings in the Source and Disassembly Tabs
Setting Data Presentation Preferences

Can't find what you are looking for? Submit your comments at http://www.sun.com/hwdocs/feedback.
Legal Notices