Browse Prior Art Database

Using traceback "stepping stones" to solve branch displacement limitations for executable instrumentation Disclosure Number: IPCOM000109161D
Original Publication Date: 2005-Mar-23
Included in the Prior Art Database: 2005-Mar-23
Document File: 1 page(s) / 30K

Publishing Venue



Immediate branch displacements in the PowerPC* architecture are limited to +/- 32MB; a 32MB program is now not all that uncommon, a case in point is the Oracle database program as compiled for aix on the powerPC, which is around a 100MB executable file size and almost 64MB .text (instruction) section. A branch immediate instruction at the beginning of a program of this size cannot reach the end of the executable. Compilers deal with this limitation by generating multiple instructions that build a 32 or 64bit branch target into a register, or load it from a data area, and then branch to the contents of that register. This works fine when generating code as does a compiler. However, when modifying an existing executable, a common performance analysis methodology used today for tools such as Feedback Directed Program Restructuring (FDPR), it is not possible to inject instrumentation code at a specific location in the code that branches to the end of a large executable to an instrumentation routine since immediate branches can not reach the destination (and no free registers can be assumed to build target addresses into registers for branch to register). Instrumenting an existing executable greater than 32MB in size for the purpose of performance analysis and tuning is not possbile without difficult complete reordering of the executable.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 60% of the total text.

Page 1 of 1

Using traceback "stepping stones" to solve branch displacement limitations for executable instrumentation

The solution proposed here utilizes the traceback entries present by default at the end of each procedure as "stepping stones" to reach the end of the executable where instrumentation code is appended and then the same method to return to the original instrumentation point. Traceback entries are appended by default to the end of all procedures for the purpose of identifying the procedure location and end; they are not typically necessary during program execution except to determine the routine name of a fault if a program error occurs; they can in fact be eliminated from a program by using a compiler option. The traceback entries can be overwritten with immediate branch instructions to facilitate reaching the end of a larger than 32MB executable by hopping from one traceback entry to the next.

The executable instrumentation technique described here includes replacing the instruction at a target address, which delineates the beginning or end instruction for which performance data is desired, with an immediate branch instruction to the end of the executable where instrumentation code has been appended. The instrumentation code saves any used registers to the stack, performs the performance data collection (such as saving the instruction address register (IAR), timebase, and performance monitor registers to a trace buffer), restores used registers, performs the...