scispace - formally typeset
Search or ask a question
Journal Articleā€¢DOIā€¢

An API for Runtime Code Patching

01 Nov 2000-Vol. 14, Iss: 4, pp 317-329
TL;DR: The authors present a postcompiler program manipulation tool called Dyninst, which provides a C++ class library for program instrumentation that permits machine-independent binary instrumentation programs to be written.
Abstract: The authors present a postcompiler program manipulation tool called Dyninst, which provides a C++ class library for program instrumentation. Using this library, it is possible to instrument and modify application programs during execution. A unique feature of this library is that it permits machine-independent binary instrumentation programs to be written. The authors describe the interface that a tool sees when using this library. They also discuss three simple tools built using this interface: a utility to count the number of times a function is called, a program to capture the output of an already running program to a file, and an implementation of conditional breakpoints. For the conditional breakpoint example, the authors show that by using their interface compared with gdb, they are able to execute a program with conditional breakpoints up to 900 times faster.

Content maybe subject toĀ copyrightĀ Ā Ā  Report

Citations
More filters
Journal Articleā€¢DOIā€¢
12 Jun 2005
TL;DR: The goals are to provide easy-to-use, portable, transparent, and efficient instrumentation, and to illustrate Pin's versatility, two Pintools in daily use to analyze production software are described.
Abstract: Robust and powerful software instrumentation tools are essential for program analysis tasks such as profiling, performance evaluation, and bug detection. To meet this need, we have developed a new instrumentation system called Pin. Our goals are to provide easy-to-use, portable, transparent, and efficient instrumentation. Instrumentation tools (called Pintools) are written in C/C++ using Pin's rich API. Pin follows the model of ATOM, allowing the tool writer to analyze an application at the instruction level without the need for detailed knowledge of the underlying instruction set. The API is designed to be architecture independent whenever possible, making Pintools source compatible across different architectures. However, a Pintool can access architecture-specific details when necessary. Instrumentation with Pin is mostly transparent as the application and Pintool observe the application's original, uninstrumented behavior. Pin uses dynamic compilation to instrument executables while they are running. For efficiency, Pin uses several techniques, including inlining, register re-allocation, liveness analysis, and instruction scheduling to optimize instrumentation. This fully automated approach delivers significantly better instrumentation performance than similar tools. For example, Pin is 3.3x faster than Valgrind and 2x faster than DynamoRIO for basic-block counting. To illustrate Pin's versatility, we describe two Pintools in daily use to analyze production software. Pin is publicly available for Linux platforms on four architectures: IA32 (32-bit x86), EM64T (64-bit x86), ItaniumĀ®, and ARM. In the ten months since Pin 2 was released in July 2004, there have been over 3000 downloads from its website.

4,019Ā citations


Cites methods from "An API for Runtime Code Patching"

  • ...Example probe-ba s d systems include Dyninst [7], Vulcan [29], and DTrace [9]....

    [...]

  • ...Example probe-based systems include Dyninst [7], Vulcan [29], and DTrace [9]....

    [...]

Journal Articleā€¢DOIā€¢
01 May 2006
TL;DR: This paper presents the TAU (Tuning and Analysis Utilities) parallel performance sytem and describes how it addresses diverse requirements for performance observation and analysis.
Abstract: The ability of performance technology to keep pace with the growing complexity of parallel and distributed systems depends on robust performance frameworks that can at once provide system-specific performance capabilities and support high-level performance problem solving Flexibility and portability in empirical methods and processes are influenced primarily by the strategies available for instrmentation and measurement, and how effectively they are integrated and composed This paper presents the TAU (Tuning and Analysis Utilities) parallel performance sytem and describe how it addresses diverse requirements for performance observation and analysis

1,092Ā citations


Cites methods from "An API for Runtime Code Patching"

  • ...Our approach for TAU uses the DyninstAPI to construct calls to the TAU measurement library and then insert these calls into the executable code....

    [...]

  • ...Dynaprof (Mucci) is another tool that uses DyninstAPI for instrumentation....

    [...]

  • ...For DyninstAPI to be useful with a measurement strategy, calls to a measurement library (or the measurement code itself) must be correctly constructed in the code snippets....

    [...]

  • ...The selective instrumentation mechanism is being used in TAU for all automatic instrumentation methods, including PDT source instrumentation, DyninstAPI executable instrumentation, and component instrumentation....

    [...]

  • ...DyninstAPI is a dynamic instrumentation package that allows a tool to insert code snippets into a running program using a portable C++ class library....

    [...]

Journal Articleā€¢DOIā€¢
TL;DR: An overview of HPCTOOLKIT is provided and its utility for performance analysis of parallel applications is illustrated.
Abstract: SUMMARY HPCTOOLKIT is an integrated suite of tools that supports measurement, analysis, attribution, and presentation of application performance for both sequential and parallel programs. HPCTOOLKIT can pinpoint and quantify scalability bottlenecks in fully-optimized parallel programs with a measurement overhead of only a few percent. Recently, new capabilities were added to HPCTOOLKIT for collecting call path profiles for fully-optimized codes without any compiler support, pinpointing and quantifying bottlenecks in multithreaded programs, exploring performance information and source code using a new user interface, and displaying hierarchical space-time diagrams based on traces of asynchronous call stack samples. This paper provides an overview of HPCTOOLKIT and illustrates its utility for performance analysis of parallel applications.

536Ā citations

Proceedings Articleā€¢DOIā€¢
23 Mar 2003
TL;DR: This work provides an interface for building external modules, or clients, for the DynamoRIO dynamic code modification system by restricting optimization units to linear streams of code and using adaptive levels of detail for representing instructions.
Abstract: Dynamic optimization is emerging as a promising approach to overcome many of the obstacles of traditional static compilation. But while there are a number of compiler infrastructures for developing static optimizations, there are very few for developing dynamic optimizations. We present a framework for implementing dynamic analyses and optimizations. We provide an interface for building external modules, or clients, for the DynamoRIO dynamic code modification system. This interface abstracts away many low-level details of the DynamoRIO runtime system while exposing a simple and powerful, yet efficient and lightweight API. This is achieved by restricting optimization units to linear streams of code and using adaptive levels of detail for representing instructions. The interface is not restricted to optimization and can be used for instrumentation, profiling, dynamic translation, etc. To demonstrate the usefulness and effectiveness of our framework, we implemented several optimizations. These improve the performance of some applications by as much as 40% relative to native execution. The average speedup relative to base DynamoRIO performance is 12%.

523Ā citations


Cites background from "An API for Runtime Code Patching"

  • ...Dyninst is based on dynamic instrumen- tation technology [20] developed as part of the Paradyn Par- allel Performance Tools project [29]....

    [...]

  • ...Both Dyninst [6] and Vulcan [35] can insert code into running processes....

    [...]

  • ...Both Dyninst [6] and Vulcan [35] can insert code into running processes....

    [...]

Journal Articleā€¢DOIā€¢
TL;DR: Valgrind is a programmable framework for creating program supervision tools such as bug detectors and profilers that executes supervised programs using dynamic binary translation, giving it total control over their every part without requiring source code, and without the need for recompilation or relinking prior to execution.

512Ā citations

References
More filters
Proceedings Articleā€¢DOIā€¢
01 Jun 1994
TL;DR: ATOM as mentioned in this paper is a single framework for building a wide range of customized program analysis tools, including block counting, profiling, dynamic memory recording, instruction and data cache simulation, pipeline simulation, evaluating branch prediction, and instruction scheduling.
Abstract: ATOM (Analysis Tools with OM) is a single framework for building a wide range of customized program analysis tools. It provides the common infrastructure present in all code-instrumenting tools; this is the difficult and time-consuming part. The user simply defines the tool-specific details in instrumentation and analysis routines. Building a basic block counting tool like Pixie with ATOM requires only a page of code.ATOM, using OM link-time technology, organizes the final executable such that the application program and user's analysis routines run in the same address space. Information is directly passed from the application program to the analysis routines through simple procedure calls instead of inter-process communication or files on disk. ATOM takes care that analysis routines do not interfere with the program's execution, and precise information about the program is presented to the analysis routines at all times. ATOM uses no simulation or interpretation.ATOM has been implemented on the Alpha AXP under OSF/1. It is efficient and has been used to build a diverse set of tools for basic block counting, profiling, dynamic memory recording, instruction and data cache simulation, pipeline simulation, evaluating branch prediction, and instruction scheduling.

982Ā citations

Journal Articleā€¢DOIā€¢
TL;DR: Dynamic instrumentation lets us defer insertion until the moment it is needed (and remove it when it is no longer needed); Paradyn's Performance Consultant decides when and where to insert instrumentation.
Abstract: Paradyn is a tool for measuring the performance of large-scale parallel programs. Our goal in designing a new performance tool was to provide detailed, flexible performance information without incurring the space (and time) overhead typically associated with trace-based tools. Paradyn achieves this goal by dynamically instrumenting the application and automatically controlling this instrumentation in search of performance problems. Dynamic instrumentation lets us defer insertion until the moment it is needed (and remove it when it is no longer needed); Paradyn's Performance Consultant decides when and where to insert instrumentation. >

864Ā citations


"An API for Runtime Code Patching" refers background in this paper

  • ...The underlying work that makes this possible is the dynamic instrumentation technology (Hollingsworth, Miller, and Cargille, 1994) developed as part of the Paradyn Parallel Performance Tools project (Miller et al., 1995)....

    [...]

  • ...The underlying work that makes this possible is the dynamic instrumentation technology[8] developed as part of the Paradyn Parallel Performance Tools project [12]....

    [...]

Proceedings Articleā€¢DOIā€¢
01 Jun 1995
TL;DR: EEL supports a machine- and system-independent editing model that enables tool builders to modify an executable without being aware of the details of the underlying architecture or operating system or being concerned with the consequences of deleting instructions or adding foreign code.
Abstract: EEL (Executable Editing Library) is a library for building tools to analyze and modify an executable (compiled) program. The systems and languages communities have built many tools for error detection, fault isolation, architecture translation, performance measurement, simulation, and optimization using this approach of modifying executables. Currently, however, tools of this sort are difficult and time-consuming to write and are usually closely tied to a particular machine and operating system. EEL supports a machine- and system-independent editing model that enables tool builders to modify an executable without being aware of the details of the underlying architecture or operating system or being concerned with the consequences of deleting instructions or adding foreign code.

500Ā citations


"An API for Runtime Code Patching" refers methods in this paper

  • ...One area of research that is similar to our Dyninst work is the area of binary editing tools (Larus and Schnarr, 1995; Romer et al., 1997; Srivastava and Eustace, 1994)....

    [...]

  • ...Our approach differs from other postcompiler instrumentation tools such as EEL (Larus and Schnarr, 1995), ATOM (Srivastava and Eustace, 1994), or Etch (Romer et al., 1997) that permit code to be inserted into a binary before it starts to execute....

    [...]

Proceedings Articleā€¢
11 Aug 1997
TL;DR: Etch is a general-purpose tool for rewriting arbitrary Win32/x86 binaries without requiring source code and some of the tools that are built using it are described, including a hierarchical call graph profiler and an instruction layout optimization tool.
Abstract: Etch is a general-purpose tool for rewriting arbitrary Win32/x86 binaries without requiring source code. Etch provides a framework for modifying executables for both measurement and optimization. Etch handles the complexities of the Win32 executable file format and the x86 instruction set, allowing tool builders to focus on specifying transformations. Etch also handles the complexities of the Win32 execution environment, allowing tool users to focus on performing experiments. This paper describes Etch and some of the tools that we have built using Etch, including a hierarchical call graph profiler and an instruction layout optimization tool.

225Ā citations


"An API for Runtime Code Patching" refers methods in this paper

  • ...Eel and Etch also differ from our approach in that their programming interface is at the level of assembly language rather than a machine-independent level....

    [...]

  • ...One area of research that is similar to our Dyninst work is the area of binary editing tools (Larus and Schnarr, 1995; Romer et al., 1997; Srivastava and Eustace, 1994)....

    [...]

  • ...Our approach differs from other postcompiler instrumentation tools such as EEL (Larus and Schnarr, 1995), ATOM (Srivastava and Eustace, 1994), or Etch (Romer et al., 1997) that permit code to be inserted into a binary before it starts to execute....

    [...]

Proceedings Articleā€¢DOIā€¢
23 May 1994
TL;DR: This work presents a new technique called 'dynamic instrumentation' that provides efficient, scalable, yet detailed data collection for large-scale parallel applications and includes recommendations to operating system designers, compiler writers, and computer architects about the features necessary to permit efficient monitoring of large- scale parallel systems.
Abstract: Presents a new technique called 'dynamic instrumentation' that provides efficient, scalable, yet detailed data collection for large-scale parallel applications. Our approach is unique because it defers inserting any instrumentation until the application is in execution. We can insert or change instrumentation at any time during execution by modifying the application's binary image. Only the instrumentation required for the currently selected analysis or visualization is inserted. As a result, our technique collects several orders of magnitude less data than traditional data collection approaches. We have implemented a prototype of our dynamic instrumentation on the CM-5, and present results for several real applications. In addition, we include recommendations to operating system designers, compiler writers, and computer architects about the features necessary to permit efficient monitoring of large-scale parallel systems. >

205Ā citations


"An API for Runtime Code Patching" refers background in this paper

  • ...Complete details about the implementation are available in other papers (Hollingsworth, Miller, and Cargille, 1994; Hollingsworth et al., 1997)....

    [...]

  • ...The underlying work that makes this possible is the dynamic instrumentation technology (Hollingsworth, Miller, and Cargille, 1994) developed as part of the Paradyn Parallel Performance Tools project (Miller et al., 1995)....

    [...]