IP Library Granted Patent US 6,931,632
Granted Patent B2
US 6,931,632 · App. 10/005,302 · Granted Aug 16, 2005

Instrumentation of code having predicated branch-call and shadow instructions

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 6,931,632
App. No.
10/005,302
Granted
Aug 16, 2005
Kind
B2
Abstract

Method and apparatus for instrumentation of an executable computer program that includes a predicated branch-call instruction followed by a call-shadow instruction. The predicated branch-call instruction and the call-shadow instruction is stored in a first bundle of instructions, which is followed by a second bundle. The predicated branch-call instruction is changed to a predicated branch instruction that targets a fifth bundle of instructions, and the predicate of the predicated branch instruction is the same as the predicate of the predicated branch-call instruction. Third, fourth, and fifth bundles are created to preserve program semantics. The third bundle is inserted following the first bundle and includes the call-shadow instruction. The fourth bundle is inserted following the third bundle and includes a branch instruction that targets the second bundle. The fifth bundle is inserted following the fourth bundle and includes a branch-call instruction that has a target address equal to the target address of the predicated branch-call instruction. Instrumentation instructions are then inserted.

Claims (42)

1. A computer-implemented method for instrumentation of an executable computer program that includes a first bundle of instructions followed by a second bundle, the first bundle having a predicated branch-call instruction followed by a call-shadow instruction, wherein the predicated branch-call instruction conditionally transfers control to a target address in response to a state of an associated predicate and returns control to the second bundle, comprising:

changing the predicated branch-call instruction to a predicated branch instruction that targets a fifth bundle, wherein the predicate of the predicated branch instruction is the predicate of the predicated branch-call instruction;

creating a third bundle and inserting the third bundle after the first bundle, the third bundle including the call-shadow instruction;

creating a fourth bundle and inserting the fourth bundle after the third bundle, the fourth bundle including a branch instruction that targets the second bundle;

creating the fifth bundle and inserting the fifth bundle after the fourth bundle, the fifth bundle including a branch-call instruction having a target address equal to the target address of the predicated branch-call instruction; and

inserting instrumentation instructions in selected ones of the bundles.

2. The method of claim 1 , further comprising:

identifying each instance of a predicated branch-call instruction followed by a call-shadow instruction;

creating respective sets of the third, fourth, and fifth bundles; and

changing each predicated branch-call instruction to a predicated branch instruction that targets the respective fifth bundle, wherein a predicate of the predicated branch instruction is the predicate of the predicated branch-call instruction.

3. The method of claim 2 , further comprising:

allocating relocation address space; and

storing the respective sets of the third, fourth, and fifth bundles in the relocation address space.

4. The method of claim 3 , further comprising:

identifying in selected functions of the executable program each instance of a predicated branch-call instruction followed by a call-shadow instruction; and

creating instrumented versions of the selected function in the relocation address space.

5. The method of claim 4 , wherein the executable program code occupies a first address space, the method further comprising replacing a first instruction of each of the selected functions in the first address space with a branch instruction to a corresponding instrumented version of the function in the relocation address space.

6. The method of claim 1 , further comprising:

allocating relocation address space; and

identifying in selected functions of the executable program each instance of a predicated branch-call instruction followed by a call-shadow instruction; and

creating instrumented versions of the selected function in the relocation address space.

7. The method of claim 6 , wherein the executable program code occupies a first address space, the method further comprising replacing a first instruction of each of the selected functions in the first address space with a branch instruction to a corresponding instrumented version of the function in the relocation address space.

8. An apparatus far instrumentation of an executable computer program that includes a first bundle of instructions followed by a second bundle, the first bundle having a predicated branch-call instruction followed by a call-shadow instruction, wherein the predicated branch-call instruction conditionally transfers control to a target address in response to a state of an associated predicate and returns control to the second bundle, comprising:

means for changing the predicated branch-call instruction to a predicated branch instruction that targets a fifth bundle, wherein the predicate of the predicated branch instruction is the predicate of the predicated branch-call instruction;

means for creating a third bundle and inserting the third bundle after the first bundle, the third bundle including the call-shadow instruction;

means for creating a fourth bundle and inserting the fourth bundle after the third bundle, the fourth bundle including a branch instruction that targets the second bundle;

means for creating the fifth bundle and inserting the fifth bundle after the fourth bundle, the fifth bundle including a branch-call instruction having a target address equal to the target address of the predicated branch-call instruction; and

means for inserting instrumentation instructions in selected ones of the bundles.

9. A computer-implemented method for instrumentation of an executable computer program that includes a first bundle of instructions having a predicated branch-call instruction followed by a call-shadow instruction, wherein the predicated branch-call instruction conditionally transfers control to a target address in response to a state of an associated predicate and returns control to a second bundle that follows the first bundle, comprising:

inserting in the executable program a trampoline code segment that includes a third bundle followed by a fourth bundle, the third bundle including an unpredicated branch-call instruction having the target address of the predicated branch-call instruction, and the fourth bundle having an unpredicated branch instruction having a target address that references the second bundle;

changing the target address of the predicated branch-call instruction to reference the third bundle; and

inserting instrumentation code in the program whereby the predicated branch-call instruction and the call shadow instruction are stored in different bundles.

10. The method of claim 9 , further comprising:

allocating relocation address space; and

storing the trampoline code segment in the relocation address space.

11. The method of claim 10 , further comprising:

identifying each instance of a predicated branch-call instruction followed by a call-shadow instruction; and

creating a respective trampoline code segment for each instance of a predicated branch-call instruction followed by a call-shadow instruction.

12. An apparatus for instrumentation of an executable computer program that includes a first bundle of instructions having a predicated branch-call instruction followed by a call-shadow instruction, wherein the predicated branch-call instruction conditionally transfers control to a target address in response to a state of an associated predicate and returns control to a second bundle that follows the first bundle, comprising:

means for inserting in the executable program a trampoline code segment that includes a third bundle followed by a fourth bundle, the third bundle including an unpredicated branch-call instruction having the target address of the predicated branch-call instruction, and the fourth bundle having an unpredicated branch instruction having a target address that references the second bundle;

means for changing the target address of the predicated branch-call instruction to reference the third bundle; and

means for inserting instrumentation code in the program whereby the predicated branch-call instruction and the call-shadow instruction are stored in different bundles.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 6, 2021
From: OT PATENT ESCROW, LLC
To: VALTRUS INNOVATIONS LIMITED
Reel/Frame 056157/0492 →
PATENT ASSIGNMENT, SECURITY INTEREST, AND LIEN AGREEMENT Recorded Jan 26, 2021
From: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP; HEWLETT PACKARD ENTERPRISE COMPANY
To: OT PATENT ESCROW, LLC
Reel/Frame 055269/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2015
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 037079/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 30, 2003
From: HEWLETT-PACKARD COMPANY
To: HEWLETT-PACKARD DEVELOPMENT COMPANY L.P.
Reel/Frame 014061/0492 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 15, 2002
From: RAMASAMY, VINODHA; TSAI, JENN-YUAN
To: HEWLETT-PACKARD COMPANY
Reel/Frame 012716/0804 →