Patent ID: 7735067

Claim:
A computer readable medium comprising software instructions for tracing an instrumented program, the software instructions executable on a processor and comprising functionality for: transferring control of the instrumented program from a kernel to a trap handler when a probe in the instrumented program is triggered; obtaining, by the trap handler, an original instruction associated with the probe; loading, by the trap handler, the original instruction into a scratch space; beginning, by the trap handler, execution of the original instruction in the scratch space using a thread; detecting a state of a signal received by a signal handler during the execution of the original instruction, by the trap handler, in the scratch space; and if the state of the signal is asynchronous: suspending, by the signal handler, execution of a second instruction corresponding to the signal; inserting, by the signal handler, the signal in the instrumented program after the original instruction; executing, by the trap handler, the original instruction in the scratch space using the thread; returning the control of the instrumented program to the kernel; and executing the second instruction corresponding to the signal after executing the original instruction; if the state of the signal is synchronous, executing a third instruction corresponding to the signal and resetting a program counter to a location of the original instruction where the probe in the instrumented program was triggered.