Browse Prior Art Database

Method and System for Tracing a Program Execution Using Selective Code Instrumentation

IP.com Disclosure Number: IPCOM000202334D
Publication Date: 2010-Dec-14
Document File: 5 page(s) / 139K

Publishing Venue

The IP.com Prior Art Database

Abstract

A method and system for tracing a program execution using selective code instrumentation is disclosed. A scalable and customizable technique for tracing program execution is disclosed that allows a user to specify locations, functions and modules of interests in the program. The code instrumentation is performed only for specific locations, functions and modules of interests, which reduce runtime overhead, and results in improved scalability of tracing. In addition, a context sensitive data collection is performed based on a user specified contexts.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 01 of 5

Method and System for Tracing a Program Execution Using Selective Code Instrumentation

Disclosed is a method and system for tracing a program execution using selective code instrumentation. The program execution trace is performed for dynamically collecting execution trace data of the program during execution. In an initial step, in order to perform program execution trace, an additional fragment of code may be instrumented
(i.e., added) into the program code. This additional fragment of code may be instrumented to perform functions such as, error checking and reporting. The additional fragment of code is also called as an instrumented code. The additional fragment of code may be instrumented using a Source Code Instrumentation (SCI) or an Object Code Instrumentation (OCI) technique. Thereafter, to achieve tracing functionality, entry and exit points associated with all functions in the program are identified and the additional fragment of code is instrumented to these entry and exit points. Thereafter, once the program is executed, the instrumented code is called at entry and exit points associated with all functions for generating a runtime execution trace of the program.

As such, the method and system for tracing the program execution using selective code instrumentation may be performed in two phases. In the first phase, a user may specify interesting locations , which is a set of interesting modules and functions, in the form of regular expressions. These regular expressions may be traced to diagnose the problem in the program. In addition, an interesting context set may be set to a default value of "*" (i.e. a universal set). Using the interesting locations set, instrumentation (i.e. addition of additional fragment of code to the program) is performed only on modules and functions that match the regular expression. This reduces the scale of instrumentation. Fig. 1 illustrates an overview of instrumentation process flow.

1


Page 02 of 5

(This page contains 00 pictures or other non-text object)

Figure 1

Fig. 2 illustrates process flow of the "Perform Instrumentation" step of fig. 1 in a detailed manner. During instrumentation, calls to functions named "trace

" and "

            " are inserted at function entry and exit points respectively for all functions that match the interesting locations set. Due to the presence of these functions, trace data is emitted only for the specified functions, thereby reducing the amount of information to be processed. Thereafter, the user may examine the trace data to identify a small set of potentially problematic functions that may be used as interesting context set in the next phase.

_record

_record

_entry

trace

_exit

2


Page 03 of 5

(This page contains 00 pictures or other non-text object)

Figure 2

In the second phase, the user may further scrutinize the trace data generated during the first phase to identify problematic functions. This provides the user with an insight of control flow from the problema...