US 7,568,185 B1
Mechanism for program-assisted tracing actions
Michael W. Shapiro, San Francisco, Calif. (US); Bryan M. Cantrill, San Francisco, Calif. (US); and Adam H. Leventhal, San Francisco, Calif. (US)
Assigned to Sun Microsystems, Inc., Santa Clara, Calif. (US)
Filed on Apr. 13, 2004, as Appl. No. 10/823,009.
Int. Cl. G06F 9/44 (2006.01)
U.S. Cl. 717—130 9 Claims
OG exemplary drawing
 
1. A method for tracing an instrumented application, comprising:
loading the instrumented application object file comprising a probe into a kernel level to obtain a corresponding instrumented process;
triggering, after loading the instrumented application object file, a hook in an initialization object file to load a helper object file into a kernel level for use by a tracing framework,
wherein the initialization object file is linked to the instrumented application object file,
wherein the helper object file comprises a helper action,
wherein the helper action is a stored procedure generated using an implementation specific detail associated with the instrumented application object file for obtaining a stack trace of the instrumented process,
wherein the helper object file is linked to the initialization object file,
wherein loading the helper object file comprises storing the helper action in a process helper data structure in the kernel level,
wherein the process helper data structure is accessible to the tracing framework;
registering the helper action with the tracing framework to associate the probe with the helper action loaded in the process helper data structure;
tracing the instrumented process using the tracing framework, wherein the probe is encountered during the tracing of the instrumented process;
upon encountering the probe, determining, by querying the process helper data structure, whether the helper action loaded in the process helper data structure is associated with the probe;
obtaining the helper action from the process helper data structure when the helper action is associated with the probe; and
performing the helper action to obtain the stack trace of the instrumented process when the helper action is associated with the probe.