IP Library Granted Patent US 9,336,001
Granted Patent B2
US 9,336,001 · App. 14/324,073 · Granted May 10, 2016

Dynamic instrumentation

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 9,336,001
App. No.
14/324,073
Granted
May 10, 2016
Kind
B2
Abstract

Techniques for dynamic instrumentation are provided. A method for instrumentation preparation may include obtaining address data of an original instruction in an original instruction stream, obtaining kernel mode data comprising a kernel breakpoint handler, obtaining user mode data comprising a user breakpoint handler, allocating a page of a process address space, creating a trampoline, associating the trampoline with a breakpoint instruction, and replacing the original instruction with the breakpoint instruction. A method for instrumentation may include detecting the breakpoint instruction, calling the kernel breakpoint handler, modifying an instruction pointer via the kernel breakpoint handler such that the instruction pointer points to the trampoline, and executing the trampoline. The system for instrumentation may include a breakpoint setup module and a breakpoint execution module for respectively setting up and completing instrumentation involving the trampoline.

Claims (35)

1. A method comprising:

creating a trampoline associated with a breakpoint instruction, the trampoline comprising a copy of an original instruction in an original instruction stream, a set of instructions for saving register states and stack data of the original instruction, and a set of instructions for restoring the register states and the stack data of the original instruction;

detecting the breakpoint instruction;

calling a kernel breakpoint handler;

modifying an instruction pointer via the kernel breakpoint handler such that the instruction pointer points to the trampoline; and

executing the trampoline by operation of one or more processors, wherein executing the trampoline comprises executing the original instruction.

2. The method according to claim 1 , wherein executing the trampoline further comprises at least one of saving the register states and the stack data of the original instruction and restoring the register states and the stack data of the original instruction.

3. The method according to claim 1 , wherein executing the trampoline further comprises jumping to a next instruction following the original instruction in the original instruction stream.

4. The method according to claim 1 , further comprising:

allocating a page of a process address space; and

storing the trampoline in the page.

5. The method according to claim 4 , wherein allocating the page comprises mapping the page to the process address space.

6. The method according to claim 1 , wherein the trampoline further comprises at least one of a set of instructions for performing a call to a user breakpoint handler and a set of instructions for performing a jump to a next instruction following the original instruction in the original instruction stream.

7. A system comprising:

a breakpoint setup module configured to allocate memory of a process address space, configure instrumentation data associated with an original instruction in an original instruction stream, store the instrumentation data in the allocated memory of the process address space, and associate the instrumentation data with a breakpoint instruction, wherein the instrumentation data includes a trampoline comprising a copy of the original instruction, a set of instructions for saving register states and stack data of the original instruction, and a set of instructions for restoring the register states and the stack data of the original instruction; and

a breakpoint execution module configured to execute a kernel breakpoint handler that modifies an instruction pointer such that the instruction pointer points to the trampoline and further configured to execute the trampoline, wherein the breakpoint execution module includes one or more processors, and wherein executing the trampoline comprises executing the original instruction.

8. The system according to claim 7 , wherein the trampoline comprises at least one of a set of instructions for performing a call to a user breakpoint module and a set of instructions for performing a jump to a next instruction following the original instruction in the original instruction stream.

9. The system according to claim 7 , wherein the breakpoint setup module is further configured to store at least one of a user breakpoint handler and user mode instructions in the allocated memory of the process address space.

10. The system according to claim 7 , wherein the breakpoint setup module is further configured to associate the instrumentation data with the breakpoint instruction by registering a kernel breakpoint handler.

11. The system according to claim 7 , wherein the breakpoint setup module is further configured to allocate memory of the process address space by mapping a page to the process address space.

12. The system according to claim 7 , wherein executing the trampoline further comprises at least one of saving the register states and the stack data of the original instruction and restoring the register states and the stack data of the original instruction.

13. The system according to claim 7 , wherein executing the trampoline further comprises jumping to a next instruction following the original instruction in the original instruction stream.

14. A computer program product including a non-transitory computer readable medium having program code instructions embodied therewith, the program code instructions executable by a computing device to perform an operation comprising:

creating a trampoline associated with a breakpoint instruction, the trampoline comprising a copy of an original instruction in an original instruction stream, a set of instructions for saving register states and stack data of the original instruction, and a set of instructions for restoring the register states and the stack data of the original instruction;

detecting the breakpoint instruction;

calling a kernel breakpoint handler;

modifying an instruction pointer via the kernel breakpoint handler such that the instruction pointer points to the trampoline; and

executing the trampoline by operation of one or more processors, wherein executing the trampoline comprises executing the original instruction.

15. The computer program product according to claim 14 , wherein executing the trampoline further comprises at least one of saving the register states and the stack data of the original instruction and restoring the register states and the stack data of the original instruction.

16. The computer program product according to claim 14 , wherein executing the trampoline further comprises jumping to the next instruction following the original instruction in the original instruction stream.

17. The computer program product according to claim 14 , further comprising:

allocating a page of a process address space; and

storing the trampoline in the page.

18. The computer program product according to claim 17 , wherein allocating the page comprises mapping the page to the process address space.

19. The computer program product according to claim 14 , wherein the trampoline further comprises at least one of a set of instructions for performing a call to a user breakpoint handler and a set of instructions for performing a jump to a next instruction following the original instruction in the original instruction stream.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 6, 2019
From: LENOVO ENTERPRISE SOLUTIONS (SINGAPORE) PTE LTD.
To: LENOVO INTERNATIONAL LIMITED
Reel/Frame 050301/0494 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 30, 2016
From: LENOVO ENTERPRISE SOLUTIONS (SINGAPORE) PTE. LTD.
To: LENOVO INTERNATIONAL LIMITED
Reel/Frame 039872/0136 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 10, 2014
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: LENOVO ENTERPRISE SOLUTIONS (SINGAPORE) PTE. LTD.
Reel/Frame 034194/0111 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 3, 2014
From: SINGH, BALBIR; SONI, MANEESH
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 033278/0424 →