Flexible debugging with controllable overhead

This thesis is concerned with the problem of discovering bugs in a program. This crucial part of debugging is becoming ever more relevant as the complexity of software systems increases. Symbolic debuggers retain their relevance for bug diagnosis once a bug has been isolated in a development environment; however, instrumentation continues to grow in relevance because it allows the programmer to specify execution points of interest in advance and let the program run normally. Instrumentation’s has a strong appeal if the nature of the bug is uncertain: the programmer can add checks or logging for a variety of interesting events and let the program run, automating what would otherwise be a painstaking manual process. Instrumentation is widely-used in development environments; nearly every large software project has benefited from verbose logging or some kind of execution profiling. In fact, recently DTrace has brought instrumentation to system administrators as well, allowing them to diagnose performance problems and errors on production servers. However, particularly with the proliferation of consumer devices running full Unix software stacks, it is becoming more and more useful to be able to apply the same techniques that were available in development and system-administration environments remotely, in end-user environments with minimal user impact. In this thesis, we present a body of work that addresses this desire. We have developed a GCC-based instrumentation system called adb that leverages the compiler’s intermediate representation, which includes type, control-flow, and dominator information, to enable instrumentation at a variety of locations, called probes, in a program. A developer can ship a program with deactivated probes, and later develop small consumers that use the data at these probes and insert them into deployed copies of the program dynamically, with no end-user intervention required. We have also developed a novel overhead-management policy called SMCO that ensures that instrumentation incurs fixed overhead. In addition to presenting adb and evaluating its performance guarantees, we also discuss a GCC plug-in system that we developed and that is being adopted by the GCC community for inclusion in release 4.5. Finally, we also describe overhead-control approaches we developed before SMCO, which put the design decisions made for adb in context.

[1]  Nicholas Nethercote,et al.  Dynamic Binary Analysis and Instrumentation , 2004 .

[2]  Guy L. Steele,et al.  Common LISP: the language, 2nd Edition , 1990 .

[3]  Gene F. Franklin,et al.  Digital control of dynamic systems , 1980 .

[4]  P. Ramadge,et al.  Supervisory control of a class of discrete event processes , 1987 .

[5]  W. Wonham,et al.  Supervisory control of timed discrete-event systems , 1994, IEEE Trans. Autom. Control..

[6]  Orna Kupferman,et al.  Model Checking of Safety Properties , 1999, CAV.

[7]  M F Sanner,et al.  Python: a programming language for software integration and development. , 1999, Journal of molecular graphics & modelling.

[8]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[9]  Charles P. Roth,et al.  A programmer's view of performance monitoring in the PowerPC microprocessor , 1997, IBM J. Res. Dev..

[10]  Harish Patil,et al.  Pin: building customized program analysis tools with dynamic instrumentation , 2005, PLDI '05.

[11]  Christopher W. Fraser,et al.  A Retargetable C Compiler: Design and Implementation , 1995 .

[12]  H. Wong-Toi,et al.  The control of dense real-time discrete event systems , 1991, [1991] Proceedings of the 30th IEEE Conference on Decision and Control.

[13]  W. Wonham,et al.  The supervisory control of timed discrete-event systems , 1992, [1992] Proceedings of the 31st IEEE Conference on Decision and Control.

[14]  Amit Singh,et al.  Mac OS X Internals: A Systems Approach , 2006 .

[15]  John L. Henning SPEC CPU2006 benchmark descriptions , 2006, CARN.

[16]  Michael I. Jordan,et al.  Bug isolation via remote program sampling , 2003, PLDI.

[17]  Robert K. Brayton,et al.  Supervisory Control of Finite State Machines , 1995, CAV.

[18]  Matthew Arnold,et al.  A framework for reducing the cost of instrumented code , 2001, PLDI '01.

[19]  Jeffrey K. Hollingsworth,et al.  An API for Runtime Code Patching , 2000, Int. J. High Perform. Comput. Appl..

[20]  Susan L. Graham,et al.  Gprof: A call graph execution profiler , 1982, SIGPLAN '82.

[21]  Samuel P. Midkiff,et al.  Artemis: practical runtime monitoring of applications for execution anomalies , 2006, PLDI '06.

[22]  Michel Dagenais,et al.  Measuring and Characterizing System Behavior Using Kernel-Level Event Logging , 2000, USENIX Annual Technical Conference, General Track.

[23]  Rajeev Alur,et al.  A Theory of Timed Automata , 1994, Theor. Comput. Sci..

[24]  Scott A. Mahlke,et al.  The superblock: An effective technique for VLIW and superscalar compilation , 1993, The Journal of Supercomputing.

[25]  Yuanyuan Zhou,et al.  SafeMem: exploiting ECC-memory for detecting memory leaks and memory corruption during production runs , 2005, 11th International Symposium on High-Performance Computer Architecture.

[26]  Zhiwu Li,et al.  ON SUPERVISORY CONTROL OF A CLASS OF DISCRETE EVENT SYSTEMS , 2006 .

[27]  J. Wolfowitz,et al.  An Introduction to the Theory of Statistics , 1951, Nature.

[28]  S. Turner,et al.  Performance Analysis Using the MIPS R10000 Performance Counters , 1996, Proceedings of the 1996 ACM/IEEE Conference on Supercomputing.

[29]  Dawson R. Engler,et al.  A system and language for building system-specific, static analyses , 2002, PLDI '02.

[30]  Pierre Wolper,et al.  An Automata-Theoretic Approach to Automatic Program Verification (Preliminary Report) , 1986, LICS.

[31]  Diego Novillo Tree SSA A New Optimization Infrastructure for GCC , 2004 .

[32]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[33]  John Hawkes Lockmeter: Highly Informative Instrumentation for Spin Locks in the Linux Kernel , 2000, Annual Linux Showcase & Conference.

[34]  Bryan Cantrill,et al.  Dynamic Instrumentation of Production Systems , 2004, USENIX Annual Technical Conference, General Track.

[35]  Matthias Hauswirth,et al.  Low-overhead memory leak detection using adaptive statistical profiling , 2004, ASPLOS XI.

[36]  Joseph Boykin,et al.  Programming Under Mach , 1993 .

[37]  Jason Merrill Generic and gimple: A new tree represen-tation for entire functions , 2003 .

[38]  Barton P. Miller,et al.  Using Dynamic Kernel Instrumentation for Kernel and Application Tuning , 1999, Int. J. High Perform. Comput. Appl..

[39]  Susan L. Graham,et al.  OPTVIEW: a new approach for examining optimized code , 1998, PASTE '98.

[40]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[41]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[42]  William J. Bolosky,et al.  Mach: A New Kernel Foundation for UNIX Development , 1986, USENIX Summer.

[43]  Radu Grosu,et al.  Monte Carlo Model Checking , 2005, TACAS.

[44]  Jr. Guy L. Steele,et al.  Common LISP: the language (2nd ed.) , 1990 .

[45]  Susan L. Graham,et al.  Interactive transformation of java programs in eclipse , 2006, ICSE '06.

[46]  E. Zadok,et al.  Extending GCC with Modular GIMPLE Optimizations , .

[47]  Arthur J. Bernstein,et al.  Proving real-time properties of programs with temporal logic , 1981, SOSP.

[48]  Richard McDougall,et al.  Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture , 2006 .