Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

A framework for reducing the cost of instrumented code

Published: 01 May 2001 Publication History

Abstract

Instrumenting code to collect profiling information can cause substantial execution overhead. This overhead makes instrumentation difficult to perform at runtime, often preventing many known offline feedback-directed optimizations from being used in online systems. This paper presents a general framework for performing instrumentation sampling to reduce the overhead of previously expensive instrumentation. The framework is simple and effective, using code-duplication and counter-based sampling to allow switching between instrumented and non-instrumented code.
Our framework does not rely on any hardware or operating system support, yet provides a high frequency sample rate that is tunable, allowing the tradeoff between overhead and accuracy to be adjusted easily at runtime. Experimental results are presented to validate that our technique can collect accurate profiles (93-98% overlap with a perfect profile) with low overhead (averaging 6% total overhead with a naive implementation). A Jalape~ no-specific optimization is also presented that reduces overhead further, resulting in an average total overhead of 3%.

References

[1]
A.-R. Adl-Tabatabai, M. Cierniak, C.-Y. Lueh, V. M. Parikh, and J. M.Stichnoth. Fast, effective code generation in a Just-in- Time Java compiler. In Proceedings of the ACM SIGPLAN'98 Conference onProgramming Language Design and Implementation (PLDI), pages 280-290, Montreal, Canada, 17-19 June 1998. SIGPLAN Notices 33(5), May 1998.]]
[2]
B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeno virtual machine. IBM Systems Journal, 39(1), 2000.]]
[3]
G. Ammons, T. Ball, and J. Larus. Exploiting hardware performance counters with ow and context sensitive profiling. In SIGPLAN '97 Conf. on Programming Language Design and Implementation, 1997.]]
[4]
J. M. Andersen, L. M. Berc, J. Dean, S. Ghemawat, M. R. Henzinger, S.-T. A. Leung, R. L. Sites, M. T. Vandevoorde, C. A. Waldspurger, and W. E. Weihl. Continuous profiling: Where have all the cycles gone? Technical Note 1997-016a, Digital Systems Research Center, www.research.digital.com/SRC, Sept. 1997.]]
[5]
M. Arnold, S. Fink, D. Grove, M. Hind, and P. Sweeney. Adaptive optimization in the Jalape~ no JVM. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2000.]]
[6]
M. Arnold, S. Fink, V. Sarkar, and P. Sweeney. A comparative study of static and dynamic heuristics for inlining. In ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization, 2000.]]
[7]
M. Arnold, M. Hind, and B. G. Ryder. An empirical study of selective optimization. In 13th International Workshop on Languages and Compilers for Parallel Computing, Aug. 2000.]]
[8]
M. Arnold and P. F.Sweeney. Approximating the calling context tree via sampling. Technical Report RC 21789, IBM T.J. Watson Research Center, July 2000.]]
[9]
V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A transparent dynamic optimization system. In SIGPLAN 2000 Conference onProgramming Language Design and Implementation, June 2000.]]
[10]
T. Ball and J. R. Larus. Optimally profiling and tracing programs. ACM Transactions on Programming Languages and Systems, 16(4):1319-1360, July 1994.]]
[11]
T. Ball and J. R. Larus. Efficient path profiling. In Proceedings of the 29th Annual International Symposium on Microarchitecture, pages 46-57. ACM Press, 1996.]]
[12]
S. Baylor, M. Devarakonda, S. Fink, E. Gluzberg, M. Kalantar, P. Muttineni, E. Barsness, R. Arora, R. Dimpsey, and S. Munroe. Java server benchmarks. IBM Systems Journal, 39(1), 2000.]]
[13]
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 1999 Java Grande Conference, pages 129-141, June 1999.]]
[14]
M. Burrows, U. Erlingson, S.-T. A. Leung, M. T. Vandevoorde, C. A. Waldspurger, K. Walker, and W. E. Weihl. Efficient and exible value sampling. In Ninth International Conference on Architectural Support for Programming Languages and Operating Systems, Nov. 2000.]]
[15]
B. Calder, P. Feller, and A. Eustace. Value profiling. In the 30th International Symposium on Microarchitecture, pages 259-269, Dec. 1997.]]
[16]
B. Calder, P. Feller, and A. Eustace. Value profiling and optimization. Journal of Instruction Level Parallelism, Vol 1, Mar. 1999.]]
[17]
B. Calder, C. Krintz, S. John, and T. Austin. Cache-conscious data placement. In Proceedings of the Eighth International Conference on Architectural Support for Programming Languages and Operating Systems, pages 139-149, San Jose, California, Oct. 1998. ACM SIGARCH, SIGOPS, SIGPLAN, and the IEEE Computer Society.]]
[18]
C. Chambers and D. Ungar. Making pure object-oriented languages practical. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 1-15, Nov. 1991. SIGPLAN Notices 26(11).]]
[19]
P. P. Chang, S. A. Mahlke, W. Y. Chen, and W. mei W. Hwu. Profile-guided automatic inline expansion for C programs. Software - Practice and Experience, 22(5):349-369, May 1992.]]
[20]
T. M. Chilimbi, B. Davidson, and J. R. Larus. Cache-conscious structure definition. In Proceedings of SIGPLAN'99 Conference on Programming Languages Design and Implementation, ACM SIGPLAN Notices, pages 13-24, Atlanta, May 1999. ACM Press.]]
[21]
T. M. Chilimbi and J. R. Larus. Using generational garbage collection to implement cache-conscious data placement. In Proceedings of the International Symposium on Memory Management (ISMM-98), volume 34, 3 ofACM SIGPLAN Notices, pages 37-48, New York, Oct. 17-19 1999. ACM Press.]]
[22]
M. Cierniak, G.-Y. Lueh, and J. M. Stichnoth. Practicing JUDO: Java Under Dynamic Optimizations. In SIGPLAN 2000 Conference onProgramming Language Design and Implementation, June 2000.]]
[23]
T. S. P. E. Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98, 1998.]]
[24]
L. P. Deutsch and A. M. Schiffman. Efficient implementation of the Smalltalk-80 system. In 11th Annual ACM Symposium on the Principles of Programming Languages, pages 297-302, Jan. 1984.]]
[25]
E. Duesterwald and V. Bala. Software profiling for hot path prediction: Less is more. In Ninth International Conference on Architectural Support for Programming Languages and Operating Systems, Nov. 2000.]]
[26]
P. T. Feller. Value profiling for instructions and memory locations. Masters Thesis CS98-581, University of California, San Diego, Apr. 1998.]]
[27]
D. Grove, J. Dean, C. Garrett, and C. Chambers. Profileguided receiver class prediction. In ACM Conference on Object- Oriented Programming Systems, Languages, and Applications, pages 108-123, Oct. 1995.]]
[28]
J. K. Hollingsworth, B. P. Miller, M. J. R. Goncalves, O. Naim, Z. Xu, and L. Zheng. MDL: A language and compiler for dynamic program instrumentation. In Proceedings of the 1997 International Conference on Parallel Architectures and Compilation Techniques (PACT '97), pages 201-212, San Francisco, California, Nov. 10-14, 1997. IEEE Computer Society Press.]]
[29]
U. Holzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN'92 Conference on Programming Language Design and Implementation (PLDI), pages 32-43, San Francisco, California, 17-19 June 1992. SIGPLAN Notices 27(7), July 1992.]]
[30]
U. Holzle and D. Ungar. Reconciling responsiveness with performance in pure object-oriented languages. ACM Transactions on Programming Languages and Systems, 18(4):355-400, July 1996.]]
[31]
The Java Hotspot performance engine architecture. White paper available at http://java.sun.com/products/hotspot/whitepaper.html, Apr. 1999.]]
[32]
T. P. Kistler. Continuous Program Optimization. PhD thesis, University of California, Irvine, 1999.]]
[33]
A. Krall. Efficient JavaVM Just-in-Time compilation. In J.-L. Gaudiot, editor, International Conference on Parallel Architectures and Compilation Techniques, pages 205-212, Oct. 1998.]]
[34]
S. Sastry, R. Bodik, and J. E. Smith. Rapid profiling via stratified sampling. In To appear in 28th International Symposium on Computer Architecture, 2001.]]
[35]
T. Suganama, T. Ogasawara, M. Takeuchi, T. Yasue, M. Kawahito, K. Ishizaki, H. Komatsu, and T. Nakatani. Overview of the IBM Java Just-in-Time compiler. IBM Systems Journal, 39(1), 2000.]]
[36]
O. Traub, S. Schechter, and M. D. Smith. Ephemeral instrumentation for lightweight program profiling. Technical report, Harvard University, 1999.]]
[37]
D. Viswanathan and S. Liang. Java Virtual Machine Profiler Interface. IBM Systems Journal, 39(1):82-95, 2000.]]
[38]
VolanoMark 2.1. http://www.volano.com/benchmarks.html.]]
[39]
J. Whaley. A portable sampling-based profiler for Java virtual machines. In ACM 2000 Java Grande Conference, June 2000.]]
[40]
B.-S. Yang, S.-M. Moon, S. Park, J. Lee, S. Lee, J. Park, Y. C. Chung, S. Kim, K. Ebcioglu, and E. Altman. LaTTe: A Java VM Just-in-Time compiler with fast and efficient register allocation. In International Conference onParallel Architectures and Compilation Techniques, Oct. 1999.]]

Cited By

View all
  • (2023)Exploiting Partially Context-sensitive Profiles to Improve Performance of Hot CodeACM Transactions on Programming Languages and Systems10.1145/361293745:4(1-64)Online publication date: 13-Sep-2023
  • (2023)Toward More Efficient Statistical Debugging with Abstraction RefinementACM Transactions on Software Engineering and Methodology10.1145/354479032:2(1-38)Online publication date: 30-Mar-2023
  • (2023)Advancements in Compiler Design and Optimization TechniquesE3S Web of Conferences10.1051/e3sconf/202339904047399(04047)Online publication date: 12-Jul-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 36, Issue 5
May 2001
330 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/381694
Issue’s Table of Contents
  • cover image ACM Conferences
    PLDI '01: Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
    June 2001
    331 pages
    ISBN:1581134142
    DOI:10.1145/378795
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: 01 May 2001
Published in SIGPLAN Volume 36, Issue 5

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)29
  • Downloads (Last 6 weeks)9
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Exploiting Partially Context-sensitive Profiles to Improve Performance of Hot CodeACM Transactions on Programming Languages and Systems10.1145/361293745:4(1-64)Online publication date: 13-Sep-2023
  • (2023)Toward More Efficient Statistical Debugging with Abstraction RefinementACM Transactions on Software Engineering and Methodology10.1145/354479032:2(1-38)Online publication date: 30-Mar-2023
  • (2023)Advancements in Compiler Design and Optimization TechniquesE3S Web of Conferences10.1051/e3sconf/202339904047399(04047)Online publication date: 12-Jul-2023
  • (2021)A Logging Overhead Optimization Method Based on Anomaly Detection ModelHuman Centered Computing10.1007/978-3-030-70626-5_37(349-359)Online publication date: 12-Mar-2021
  • (2020)Testing Relative to Usage ScopeACM Transactions on Software Engineering and Methodology10.1145/338912629:3(1-24)Online publication date: 1-Jun-2020
  • (2020)Guiding log revisions by learning from software evolution historyEmpirical Software Engineering10.1007/s10664-019-09757-y25:3(2302-2340)Online publication date: 1-May-2020
  • (2019)Profile-guided code identification and hardening using return oriented programmingJournal of Information Security and Applications10.1016/j.jisa.2019.10236448(102364)Online publication date: Oct-2019
  • (2019)ADLER: Adaptive Sampling for Precise MonitoringLanguages and Compilers for Parallel Computing10.1007/978-3-030-35225-7_7(86-100)Online publication date: 15-Nov-2019
  • (2018)LogtrackerProceedings of the 26th Conference on Program Comprehension10.1145/3196321.3196328(178-188)Online publication date: 28-May-2018
  • (2017)Flexible Page-level Memory Access Monitoring Based on Virtualization HardwareACM SIGPLAN Notices10.1145/3140607.305075152:7(201-213)Online publication date: 8-Apr-2017
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media