skip to main content
10.1145/1065010.1065034acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Pin: building customized program analysis tools with dynamic instrumentation

Published:12 June 2005Publication History

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.

References

  1. AMBER home page. http://amber.scripps.edu/.]]Google ScholarGoogle Scholar
  2. Fluent home page. http://www.fluent.com/.]]Google ScholarGoogle Scholar
  3. LS-DYNA home page. http://www.lstc.com/.]]Google ScholarGoogle Scholar
  4. RenderMan home page. http://RenderMan.pixar.com/.]]Google ScholarGoogle Scholar
  5. A.-R. Adl-Tabatabai, J. Bharadwaj, D.-Y. Chen, A. Ghuloum, V. Menon, B. Murphy, M. Serrano, and T. Shpeisman. The StarJIT compiler: A dynamic compiler for managed runtime environments. Intel Technology Journal, 7(1):19--31, Feb 2003.]]Google ScholarGoogle Scholar
  6. D. L. Bruening. Efficient, Transparent, and Comprehensive Runtime Code Manipulation. PhD thesis, M.I.T. (http://www.cag.lcs.mit.edu/dynamorio/), September 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. R. Buck and J. Hollingsworth. An api for runtime code patching. Journal of High Performance Computing Applications, 14(4):317--329, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. G. Burke, J.-D. Choi, S. Fink, D. Grove, M. Hind, V. Sarkar, M. J. Serrano, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeno dynamic optimizing compiler for java. In ACM Java Grande Conference, pages 129--141, June 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. M. Cantrill, M. W. Shapiro, and A. H. Leventhal. Dynamic instrumentation of production systems. In Proceedings of the 6th Symposium on Operating Systems Design and Implementation, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. K.D. Cooper, M.W. Hall, and K. Kennedy. A methodology for procedure cloning. Computer Languages, 19(2), April 1993.]]Google ScholarGoogle Scholar
  11. J. L. Henning. SPEC CPU2000: measuring cpu performance in the new millennium. IEEE Computer, 33(7):28--35, July 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Intel. Pin User Manual. http://rogue.colorado.edu/Pin.]]Google ScholarGoogle Scholar
  13. Intel. Intel Itanium Architecture Software Developer's Manual Vols 1-4, Oct. 2002.]]Google ScholarGoogle Scholar
  14. Intel. IA-32 Intel Architecture Software Developer's Manual Vols 1-3, 2003.]]Google ScholarGoogle Scholar
  15. Intel. Intel Extended Memory 64 Technology Software Developer's Guide Vols 1-2, 2004.]]Google ScholarGoogle Scholar
  16. Intel. Intel PXA27x Processor Family Developer's Manual, April 2004.]]Google ScholarGoogle Scholar
  17. H.-S. Kim and J. Smith. Hardware support for control transfers in code caches. In Proceedings of the 36th Annual ACM/IEEE International Symposium on Microarchitecture, Dec 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Larus and E. Schnarr. EEL: Machine-independent executable editing. In Proceedings of the ACM SIGPLAN 95 Conference on Programming Language Design and Implementation, pages 291--300, June 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Geoffrey Lowney, Stefan M. Freudenberger, Thomas J. Karzes, W. D. Lichtenstein, Robert P. Nix, John S. O'Donnell, and John C. Ruttenberg. The Multiflow Trace Scheduling compiler. The Journal of Supercomputing, 7(1-2):51--142, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Chi-Keung Luk, Robert Muth, Harish Patil, Robert Cohn, and Geoff Lowney. Ispike: A Post-link Optimizer for the Intel Itanium Architecture. In Proceedings of the 2nd Conference on Code Generation and Optimization, pages 15--26, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. Maebe, M. Ronsse, and K. De Bosschere. Diota: Dynamic instrumentation, optimization and transformation of applications. In Compendium of Workshops and Tutorials held in conjunction with PACT'02, 2002.]]Google ScholarGoogle Scholar
  22. N. Nethercote and J. Seward. Valgrind: A program supervision framework. In Proceedings of the 3rd Workshop on Runtime Verification. http://valgrind.kde.org/, 2003.]]Google ScholarGoogle Scholar
  23. H. Patil, R. Cohn, M. Charney, R. Kapoor, A. Sun, and A. Karunanidhi. Pinpointing representative portions of large intel itanium progams with dynamic instrumentation. In Proceedings of the 37th Annual ACM/IEEE International Symposium on Microarchitecture, Dec 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Poletto and V. Sarkar. Linear scan register allocation. ACM Transactions. on Programming Languages and Systems, 21(5):895--913, Sept 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. Romer, G. Voelker, D. Lee, A. Wolman, W. Wong, H. Levy, B. Bershad, and B. Chen. Instrumentation and optimization of win32/intel executables using Etch. In Proceedings of the USENIX Windows NT Workshop, pages 1--7, August 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. H. Saito, G. Gaertner, W. Jones, R. Eigenmann, H. Iwashita, R. Liberman, M. van Waveren, and B. Whitney. Large system performance of spec omp2001 benchmarks. In Proceedings of the 2002 Workship on OpenMP: Experiences and Implementation, 2002.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. Scott, N. Kumar, S. Velusamy, B. Childers, J. Davidson, and M. L. Soffa. Reconfigurable and retargetable software dynamic translation. In Proceedings of the 1st Conference on Code Generation and Optimization, pages 36--47, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. T. Sherwood, E. Perelman, G. Hamerly, and B. Calder. Automatically characterizing large scale program behavior. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems, Oct 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Srivastava, A. Edwards, and H. Vo. Vulcan: Binary transformation in a distributed environment. Technical Report MSR-TR-2001-50, Microsoft Research, April 2001.]]Google ScholarGoogle Scholar
  30. A. Srivastava and A. Eustace. Atom: A system for building customized program analysis tools. In Proceedings of the ACM SIGPLAN 94 Conference on Programming Language Design and Implementation, pages 196--205, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. X. Zhang, Z. Wang, N. Gloy, J. B. Chen, and M. D. Smith. System support for automatic profiling and optimization. In Proceedings of the 16th Symposium on Operating System Principles, October 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Pin: building customized program analysis tools with dynamic instrumentation

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
          June 2005
          338 pages
          ISBN:1595930566
          DOI:10.1145/1065010
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 40, Issue 6
            Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
            June 2005
            325 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1064978
            Issue’s Table of Contents

          Copyright © 2005 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 12 June 2005

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          Overall Acceptance Rate406of2,067submissions,20%

          Upcoming Conference

          PLDI '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader