skip to main content
10.1145/1596655.1596672acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Parallelizing calling context profiling in virtual machines on multicores

Published:27 August 2009Publication History

ABSTRACT

The Calling Context Tree (CCT) is a prevailing datastructure for calling context profiling. As generating a complete CCT reflecting every method call is expensive, recent research has focused on efficiently approximating the CCT with sampling techniques. However, for tasks such as debugging, testing, and reverse engineering, complete and accurate CCTs are often needed. In this paper, we introduce the ParCCT, a novel approach to parallelizing application code and CCT generation on multicores. Each thread maintains a shadow stack and generates "packets" of method calls and returns that correspond to partial CCTs. Each packet includes a copy of the shadow stack, indicating the calling context of the first method call in the packet. Hence, packets are independent of each other and can be processed out-of-order and in parallel in order to update the CCT. Our portable and extensible implementation targets standard Java Virtual Machines, thanks to instrumentation techniques that ensure complete bytecode coverage and efficiently support custom calling context representations. The ParCCT is more than 110% faster than a primitive, non-parallel approach to CCT construction, when more than two cores are available. This speedup stems both from reduced contention and from parallelization.

References

  1. B. Alpern, C. R. Attanasio, J. J. Barton, B. 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, N. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño virtual machine. IBM Systems Journal, 39(1):211--238, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. Ammons, T. Ball, and J. R. Larus. Exploiting hardware performance counters with flow and context sensitive profiling. In PLDI '97: Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation, pages 85--96. ACM Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Arnold and B. G. Ryder. A framework for reducing the cost of instrumented code. In SIGPLAN Conference on Programming Language Design and Implementation, pages 168--179, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Arnold and P. F. Sweeney. Approximating the calling context tree via sampling. Research report, IBM, July 2000.Google ScholarGoogle Scholar
  5. S. Artzi, S. Kim, and M. D. Ernst. ReCrash: Making Software Failures Reproducible by Preserving Object States. In J. Vitek, editor, ECOOP '08: Proceedings of the 22th European Conference on Object-Oriented Programming, volume 5142 of Lecture Notes in Computer Science, pages 542--565, Paphos, Cyprus, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. W. Binder, J. Hulaas, and P. Moret. Advanced Java Bytecode Instrumentation. In PPPJ'07: Proceedings of the 5th International Symposium on Principles and Practice of Programming in Java, pages 135--144, New York, NY, USA, 2007. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. W. Binder, J. Hulaas, P. Moret, and A. Villazón. Platform-independent profiling in a virtual execution environment. Software: Practice and Experience, 39(1):47--79, 2009. http://dx.doi.org/10.1002/spe.890. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In OOPSLA '06: Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications, New York, NY, USA, Oct. 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. D. Bond and K. S. McKinley. Probabilistic calling context. In OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object oriented programming, systems and applications, pages 97--112, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Detlefs, C. Flood, S. Heller, and T. Printezis. Garbage-first garbage collection. In ISMM '04: Proceedings of the 4th International Symposium on Memory Management, pages 37--48, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Gosling, B. Joy, G. L. Steele, and G. Bracha. The Java Language Specification, Third Edition. The Java Series. Addison-Wesley, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In J. L. Knudsen, editor, Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP-2001), volume 2072 of Lecture Notes in Computer Science, pages 327--353, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-Oriented Programming. In M. Aksit and S. Matsuoka, editors, Proceedings of European Conference on Object-Oriented Programming, volume 1241, pages 220--242. Springer-Verlag, Berlin, Heidelberg, and New York, 1997.Google ScholarGoogle Scholar
  14. C.-K. Luk, R. Cohn, R. Muth, H. Ptil, A. Klauser, G. Lowney, S. Wallace, V. Reddi, and K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In PLDI 2005: Proceedings of the ACM SIGPLAN 2005 conference on Programming Language Design and Implementation, pages 191--200. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Manson, W. Pugh, and S. V. Adve. The Java Memory Model. In POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 378--391, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Marlow, T. Harris, R. P. James, and S. P. Jones. Parallel generational-copying garbage collection with a block-structured heap. In ISMM '08: Proceedings of the 7th international symposium on Memory management, pages 11--20, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Moret, W. Binder, and A. Villazon. CCCP: Complete calling context profiling in virtual execution environments. In PEPM '09: Proceedings of the 2009 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, pages 151--160, Savannah, GA, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. T. Moseley, A. Shye, V. J. Reddi, D. Grunwald, and R. Peri. Shadow Profiling: Hiding Instrumentation Costs with Parallelism. In CGO '07: Proceedings of the International Symposium on Code Generation and Optimization, pages 198--208, Washington, DC, USA, 2007. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. M. Spivey. Fast, accurate call graph profiling. Softw. Pract. Exper., 34(3):249--264, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Sun Microsystems, Inc. JVM Tool Interface (JVMTI) version 1.1. Web pages at http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html, 2006.Google ScholarGoogle Scholar
  21. A. Villazón, W. Binder, and P. Moret. Aspect Weaving in Standard Java Class Libraries. In PPPJ '08: Proceedings of the 6th International Symposium on Principles and Practice of Programming in Java, pages 159--167, New York, NY, USA, Sept. 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Villazón, W. Binder, and P. Moret. Flexible Calling Context Reification for Aspect-Oriented Programming. In AOSD '09: Proceedings of the 8th International Conference on Aspect-oriented Software Development, pages 63--74, Charlottesville, Virginia, USA, Mar. 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Whaley. A portable sampling-based profiler for Java Virtual Machines. In Proceedings of the ACM 2000 Conference on Java Grande, pages 78--87. ACM Press, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. X. Zhuang, M. J. Serrano, H. W. Cain, and J.-D. Choi. Accurate, efficient, and adaptive calling context profiling. In PLDI '06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 263--271, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Parallelizing calling context profiling in virtual machines on multicores

        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
          PPPJ '09: Proceedings of the 7th International Conference on Principles and Practice of Programming in Java
          August 2009
          200 pages
          ISBN:9781605585987
          DOI:10.1145/1596655

          Copyright © 2009 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: 27 August 2009

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate29of58submissions,50%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader