Basic Block Analysis

Basic block is a section of code that represents a serialized execution path that does not contain any types of control transfer instruction (i.e., jump or call). A basic block is usually begins with the destination of a single or multiple control transfer instructions and ending with a control transfer instruction.

Using the Module Data view, users can aggregate data by using basic block aggregation of samples. The user enables this mode of aggregation by selecting the Aggregate samples into basic blocks option in the CodeAnalyst Options dialog as shown in the following figure.

The following module data view of basic block aggregation is an example of how the functions appear.

In this mode, CodeAnalyst examines each function to identify basic blocks and aggregates samples accordingly. Each basic block is denoted by a range of addresses using the format [StartAddr, StopAddr ) : ( Number of Load / Number of store).The dialog also displays the number of load and store instructions within the basic block on the disassembly view (asm) tab (see following figure).

In Disassembly View, each basic block is shown by interleaving different background colors of white and gray. Users can navigate through code execution path from one basic block to the previous or to the next basic block.

Right-click at the beginning of a basic block and the pop-up menu lists the source addresses that are usually the destination address of a control transfer instruction in some basic blocks.

Right-click at the end of a basic block and the pop-up menu lists the destination address of the control transfer instruction (see following image).