Rapid development of extensible profilers for the Java virtual machine with aspect-oriented programming

Many profilers for Java applications are implemented with low-level bytecode instrumentation techniques, which is tedious, error-prone, and complicates maintenance and extension of the tools. In order to reduce development time and cost, we promote building Java profilers using high-level aspect-oriented programming (AOP). We show that the use of aspects yields concise profilers that are easy to develop, extend, and maintain, because low-level instrumentation details are hidden from the tool developer. Our profiler relies on inter-advice communication, an extension to common AOP languages that enables efficient data passing between advice woven into the same method. We illustrate our approach with two case studies. First, we show that an existing, instrumentation-based tool for listener latency profiling can be easily recast as an aspect. Second, we present an aspect for comprehensive calling context profiling. In order to reduce profiling overhead, our aspect parallelizes application execution and profile creation.

[1]  Walter Binder,et al.  Aspect weaving in standard Java class libraries , 2008, PPPJ '08.

[2]  Walter Binder,et al.  Platform‐independent profiling in a virtual execution environment , 2009, Softw. Pract. Exp..

[3]  Jong-Deok Choi,et al.  Accurate, efficient, and adaptive calling context profiling , 2006, PLDI '06.

[4]  Matthias Hauswirth,et al.  Measuring the performance of interactive applications with listener latency profiling , 2008, PPPJ '08.

[5]  Walter Binder,et al.  Flexible calling context reification for aspect-oriented programming , 2009, AOSD '09.

[6]  Paul H. J. Kelly,et al.  Profiling with AspectJ , 2007, Softw. Pract. Exp..

[7]  Walter Binder,et al.  Advanced runtime adaptation for Java , 2009, GPCE '09.

[8]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[9]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.

[10]  Walter Binder,et al.  Advanced Java bytecode instrumentation , 2007, PPPJ.

[11]  Walter Binder,et al.  CCCP: complete calling context profiling in virtual execution environments , 2009, PEPM '09.

[12]  James R. Larus,et al.  Exploiting hardware performance counters with flow and context sensitive profiling , 1997, PLDI '97.

[13]  Mikhail Dmitriev Profiling Java applications using code hotswapping and dynamic call graph revelation , 2004, WOSP '04.

[14]  J. Michael Spivey,et al.  Fast, accurate call graph profiling , 2004, Softw. Pract. Exp..

[15]  Jim Hugunin,et al.  Advice weaving in AspectJ , 2004, AOSD '04.

[16]  Martin Schoeberl,et al.  Cross-Profiling for Embedded Java Processors , 2008, 2008 Fifth International Conference on Quantitative Evaluation of Systems.

[17]  Walter Binder,et al.  Flexible and efficient measurement of dynamic bytecode metrics , 2006, GPCE '06.

[18]  Laurie J. Hendren,et al.  *J: a tool for dynamic analysis of Java programs , 2003, OOPSLA '03.

[19]  Walter Binder,et al.  Parallelizing calling context profiling in virtual machines on multicores , 2009, PPPJ '09.

[20]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[21]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.