Interpreting annotated source code is usually straightforward, but there are some situations where the metrics for the source line are not due to execution of the instructions that are derived from that source line. The uncertainty comes from the way metrics are assigned to source lines.
When the call stack for each event is processed, exclusive metrics are assigned to the leaf PC, which is the address of the next instruction to be executed. Each instruction is tagged with the number of the source line from which it was derived, and the exclusive metrics for a source line are summed over all instructions belonging to that line.
If the instruction being executed when an event is recorded comes from the same source line as the leaf PC, the metrics can be interpreted as due to execution of that source line. However, if the leaf PC comes from a different source line from the instruction being executed, at least some of the metrics for the source line that the leaf PC belongs to must be interpreted as "metrics accumulated while this line was waiting to be executed". An example is when a value that is computed on a source line is used on the next source line, or when there is a transfer of control to another source line.
The issue of how to interpret the metrics matters most when there is a substantial delay in execution, such as at a cache miss or a resource queue stall, or when an instruction is waiting for a result from a previous instruction. In such cases the metrics for the source lines can seem to be unreasonably high, and you should look at other lines in the code to find the line responsible for the high metric value.
See also | |
---|---|
The Source Tab Interpreting Annotated Disassembly Code |