Patent ID: 8037459
Filing Date: 2011-10-11
Classification: G06F

Abstract:
1. A method of instrumentation for a software instruction, the method comprising: identifying a location in the instruction to insert a probe, wherein the probe is a breakpoint; replacing the instruction with the probe by copying the instruction to a predefined location; executing, by a processor, the instruction in a kernel space; generating a first exception upon encountering the probe and calling a first exception handler, wherein the first exception handler is configured to call an instrumentation routine; saving a system register state as part of the first exception; executing the first exception handler; saving register contents of a first trampoline prior to executing the instrumentation routine; generating a second exception when the instrumentation routine encounters an error and calling a second exception handler; and responsive to determining that the second exception is due to code of the instrumentation routine that was executed in a context of the first exception, returning from the second exception handler to a second trampoline instead of returning to the instrumentation routine that generated the exception; recovering from the first and second exceptions and returning a system to a sane state to continue normal execution of the instruction, wherein the second trampoline restores the system to the sane state.