Method and System for Reducing Interrupts Overhead in Dynamic Instrumentation of Applications
Publication Date: 2010-Aug-30
The IP.com Prior Art Database
A method and system for reducing interrupts overhead in dynamic instrumentation of applications is disclosed. A trampoline is defined to save a breakpoint instruction, an original instruction and a jump instruction. Thereafter, the trampoline is copied to a non-shared per-process memory space so that the original instruction and the jump instruction can be executed out-of-line.
Method and System for Reducing Interrupts Overhead in Dynamic Instrumentation of
Disclosed is a method and system of reducing interrupts overhead in dynamic instrumentation of applications. Typically, in a multi-threaded environment instrumentation is performed by atomically replacing an original instruction with a breakpoint without stopping the threads executing in the process. As a result, interrupt overheads or exceptions may arise at one or more instrumentation points. For example, an exception may arise when an inserted breakpoint is reached or after an original instruction is single-stepped.
A user specifies a text address within the program or the application which is to be instrumented. Further, the user also defines a callback handler to collect data in kernel mode. The system checks for validity of the text address. If the text address is valid and when a request to instrument the application arrives, the system allocates a non-shared per-process memory space within a process address space.
The system then defines a trampoline, as illustrated in the flow chart depicted in Fig. 1. A trampoline is a memory area for saving a breakpoint instruction followed by a copy of an original instruction and a jump instruction. A jump instruction allows the control to pass to a subsequent instruction after a probed location. The system copies the trampoline to the non-shared per-process memory space.
Thereafter, the system registers the callback handler to be called when the breakpoint in the trampoline is executed, as illustrated in the flo...