A staged static program analysis to improve the performance of runtime monitoring

Author: Eric Bodden.
Date: August 2007
ECOOP 2007: Technical presentation at the European Conference on Object-Oriented Programming, Berlin, Germany.

Abstract

In runtime monitoring, a programmer specifies a piece of code to execute when a trace of events occurs during program execution. Our work is based on tracematches, an extension to AspectJ, which allows programmers to specify traces via regular expressions with free variables. In this paper we present a staged static analysis which speeds up trace matching by reducing the required runtime instrumentation.

The first stage is a simple analysis that rules out entire tracematches, just based on the names of symbols. In the second stage, a points-to analysis is used, along with a flow-insensitive analysis that eliminates instrumentation points with inconsistent variable bindings. In the third stage the points-to analysis is combined with a flow-sensitive analysis that also takes into consideration the order in which the symbols may execute.

To examine the effectiveness of each stage, we experimented with a set of nine tracematches applied to the DaCapo benchmark suite. We found that about 25% of the tracematch/benchmark combinations had instrumentation overheads greater than 10%. In these cases the first two stages work well for certain classes of tracematches, often leading to significant performance improvements. Somewhat surprisingly, we found the third, flow-sensitive, stage did not add any improvements.

(PPTX - Powerpoint 2007)

Collaborative runtime verification with tracematches

Author: Eric Bodden.
Date: March 2007
RV 2007: Technical presentation at the 7th Workshop on Runtime Verification at the 6th International Conference on Aspect-Oriented Software Development, March 13th 2007, Vancouver, Canada.

Abstract

Perfect pre-deployment test coverage is notoriously difficult to achieve for large applications. With enough end users, many more test cases will be encountered during an application's deployment than during testing. The use of runtime verification after deployment would enable developers to detect and report on unexpected situations. Unfortunately, the prohibitive performance cost of runtime monitors prevents their use in deployed code.

In this work we study the feasibility of collaborative runtime verification, a verification approach which distributes the burden of runtime verification onto multiple users. Each user executes a partially instrumented program and therefore suffers only a fraction of the instrumentation overhead.

We focus on runtime verification using tracematches. Tracematches are a specification formalism that allows users to specify runtime verification properties via regular expressions with free variables over the dynamic execution trace. We propose two techniques for soundly partitioning the instrumentation required for tracematches: spatial partitioning, where different copies of a program monitor different program points for violations, and temporal partitioning, where monitoring is switched on and off over time. We evaluate the relative impact of partitioning on a user's runtime overhead by applying each partitioning technique to a collection of benchmarks that would otherwise incur significant instrumentation overhead.

Our results show that spatial partitioning almost completely eliminates runtime overhead (for any particular benchmark copy) on many of our test cases, and that temporal partitioning scales well and provides runtime verification on a ``pay as you go'' basis.

(PPTX - Powerpoint 2007)

Adding Open Modules to AspectJ

Author: Neil Ongkingco.
Date: March 2006
AOSD 2006: Technical presentation at the International Conference on Aspect-Oriented Software Development, Bonn, Germany.

Abstract

AspectJ does not provide a mechanism to hide implementation details from advice. As a result, aspects are tightly coupled to the implementation of the code they advise, while the behaviour of the base code is impossible to determine without analysing all advice that could modify its behaviour.

The concept of open modules is proposed by Aldrich to solve the problems that arise from unrestricted advice. Defined for a small functional language, it provides an encapsulation construct that allows an implementation to limit the set of points to which external advice may apply.

We present an adaptation of open modules for AspectJ. We expand open modules to encompass the full set of pointcut primitives for AspectJ, extend its method of module composition to include the ability to open up a module, and describe the implementation of the design as an extension of the AspectBench compiler. We also provide an example of the use of open modules on a substantial AspectJ program to show how it would fit into existing AspectJ projects.

(PDF, Open Document)

Efficient temporal pointcuts through dynamic advice deployment

Author: Eric Bodden.
Date: March 2006
ODAL 2006: Technical presentation at 1st Joint Workshop on Open and Dynamic Aspect Languages, Bonn, Germany.

Abstract

In previous work we and others have studied the applica- bility of various trace based matching approaches such as tracematches [2], tracecuts [15] and tracechecks [6, 14, 5] (through our prototype tool J-LO, the Java Logical Ob- server). Such formalisms provide users with an expressive matching language that gives explicit and well-defined access to an application's execution history. In some approaches, even free variables in expressions can dynamically be bound to objects on the execution trace. This avoids having to use data structures such as hash maps or sets in oder to implement such object-related properties.

In this work we demonstrate that besides the aforemen- tioned issues of more convenient programming, such tempo- ral pointcuts yield a large potential for possible optimiza- tions through runtime deployment of aspects, due to their well-defined structure. Functionally equivalent code in pure AspectJ would not necessarily yield such a potential. This feature of trace languages adds well to static optimizations such as control flow and dataflow analysis as it has been proposed in [2]. We do not want to give a fully fledged end- to-end solution here, which may restrict us to a certain spec- ification formalism or runtime weaving approach. Instead, we show up general potential for optimizations through dy- namic deployment as a pointer to future research on the field.

(PDF)

Adding Trace Matching with Free Variables to AspectJ

Author: The abc team, talk by Damien Sereni.
Date: October 2005
OOPSLA 2005: Technical presentation at the International Conference on Object-Oriented Programming Systems, Languages and Applications, San Diego, USA

Abstract

An aspect observes the execution of a base program; when certain actions occur, the aspect runs some extra code of its own. In the AspectJ language, the observations that an aspect can make are confined to the current action: it is not possible to directly observe the history of a computation.

Recently there have been several interesting proposals for new history-based language features, most notably by Douence et al. and also by Walker and Viggers. In this paper we present a new history-based language feature called tracematches, where the programmer can trigger the execution of extra code by specifying a regular pattern of events in a computation trace. We have fully designed and implemented tracematches as a seamless extension to AspectJ.

A key innovation in our tracematch approach is the introduction of free variables in the matching patterns. This enhancement enables a whole new class of applications where events can be matched not only by the event kind, but also by the values associated with the free variables. We provide several examples of applications enabled by this feature.

After introducing and motivating the idea of tracematches via examples, we present a detailed semantics of our language design, and we derive an implementation from that semantics. The implementation has been realised as an extension of the abc compiler for AspectJ.

(PPT), (PDF)

abc: the AspectBench Compiler for AspectJ

Author: Oege de Moor.
Date: September 2005
GPCE 2005: invited talk

Abstract

We give a brief overview of aspect-oriented programming through some small examples in the AspectJ language. Next, we turn to the question of compiling aspect-oriented programs. The AspectBench Compiler abc is a research compiler for AspectJ, which aims to make it easy to experiment with new language features, and also with novel optimisations and analyses. It is shown how abc's architecture achieves these goals. In particular, we review the new language feature of tracematches, which allows extra code to be triggered by a regular pattern over traces of the program.

(PPT)

abc: an extensible AspectJ compiler

Author: Oege de Moor.
Date: March 2005
AOSD 2005: Technical presentation at the international conference on Aspect-Oriented Software Development, Chicago, USA

Abstract

Research in the design of aspect-oriented programming languages requires a workbench that facilitates easy experimentation with new language features and implementation techniques. In particular, new features for AspectJ have been proposed that require extensions in many dimensions: syntax, type checking and code generation, as well as data flow and control flow analyses.

The AspectBench Compiler abc is an implementation of such a workbench. The base version of abc implements the full AspectJ language. Its frontend is built, using the Polyglot framework, as a modular extension of the Java language. The use of Polyglot gives flexibility of syntax and type checking. The backend is built using the Soot framework, to give modular code generation and analyses. In this paper, we outline the design of abc, focusing mostly on how the design supports extensibility. We then provide a general overview of how to use abc to implement an extension. Finally, we illustrate the extension mechanisms of abc through a number of small, but non-trivial, examples. abc is freely available under the GNU LGPL.

(PDF)

abc: a workbench for aspect-oriented language and compiler research

Author: The abc team.
Date: March 2005
AOSD 2005: Tutorial at the international conference on Aspect-Oriented Software Development, Chicago, USA

Abstract

The proliferation of new features, analyses and optimizations for aspect-oriented programming languages necessitates a workbench for realistic experiments. The AspectBench Compiler (abc for short) provides such a workbench. The base compiler is a full implementation of the AspectJ 1.2 language. abc has been designed to disentangle the implementation of new, experimental features from the base compiler. abc has also been designed to enable the implementation of advanced analyses, for the purpose of optimization, but also to enable static detection of bugs.

The tutorial will first give a brief overview of the architecture of abc. It will explain the details of abc in three parts: in the first part, attendees will implement an extension to AspectJ that only requires changes in the frontend. In the second part, we cover a new type of join point, which also requires changes in the backend. In the third part, attendees will learn how to implement aggressive optimizations for features such as cflow. All the examples will be selected from papers by others that were presented at previous AOSD conferences.

Each part of the tutorial will include a hands-on problem solving session, in which attendees will be provided with a concrete task such as defining new kinds of join points and pointcuts. By working through concrete examples from the literature, and also by actually implementing small language extensions, attendees will learn how to integrate their own language extensions, analyses and optimizations into abc.

(PDF)

Optimising AspectJ

Author: Oege de Moor.
Date: December 8, 2004
Seminar at the Computer Laboratory, Cambridge, United Kingdom

Abstract

Aspects are a set of language features that assist with three kinds of application. First, to write "probes" that measure properties of an existing system. Second, to perform scattered tasks that pollute an otherwise clean design, such as caching or resource pooling. Finally, to extend third-party systems in unforeseen ways, for example by adding new members to a class in the middle of an existing inheritance hierarchy. Indeed, aspects can be understood as a highly disciplined form of metaprogramming. The most popular implementation of aspects is an extension of Java, called AspectJ.

Aspects pose new challenges for programming language research, ranging from language design to efficient implementation. In this presentation, I will highlight a number of such opportunities, through some example aspects. I shall then introduce abc, the AspectBench Compiler, an extensible compiler for AspectJ that has been designed as a workbench for researchers in aspect-oriented programming. In first experiments, code generated by abc outperforms the official AspectJ compiler, often by a factor of 3, and sometimes by a factor of 45.

(PDF)

abc: the AspectBench Compiler for AspectJ

Author: Laurie Hendren.
Date: September 2004
CASCON 2004: Third Workshop on Compiler-Driven Performance, Toronto, Canada

Abstract
The Sable research group from McGill University and the Programming Tools Group from Oxford University have recently developed abc, a research framework for the AspectJ programming language. The abc compiler is publicly-avaliable under the GNU LGPL license. The toolkit has been designed with research in mind, for both experimentation with new aspect-oriented language features and research into optimizations for aspect-oriented languages.

This talk introduces AspectJ language, presents the highlights of the abc compiler framework, and discusses some preliminary experimental data comparing the performance of the existing ajc compiler with the abc compiler.

(PDF)

abc: An extensible AspectJ compiler.

Author: The abc team.
Date: September 2004
Visit to ajc design team, September 2004, IBM Hursley, UK

Abstract
abc is a joint project between the Programming Tools group at the University of Oxford and the Sable Research team at McGill University, as well as the University of Aarhus. It is an implementation of AspectJ, an aspect-oriented extension of Java. A series of talks were given at a meeting with the development team of ajc, introducing and describing the architecture of abc.

(PDF: Introduction, architecture, scanner and parser, Polyglot frontend, soot backend, advice weaver, around advice weaving, extending abc, current status. Alternatively, get all the talks as a single file.)

abc: An implementation of AspectJ

Author: Oege de Moor (Oxford University)
Date: July 2004
Briefing to C# design team, July 2004, Microsoft Redmond, USA

Abstract
Aspects are a set of language features that assist with three kinds of application. First, to write "probes" that measure properties of an existing system. Second, to perform scattered tasks that pollute an otherwise clean design, such as caching or resource pooling. Finally, to extend third-party systems in unforeseen ways, for example by adding new members to a class in the middle of an existing inheritance hierarchy. Indeed, aspects can be understood as a highly disciplined form of metaprogramming. The most popular implementation of aspects is an extension of Java, called AspectJ.

Aspects pose new challenges for programming language research, ranging from language design to efficient implementation. In this presentation, I will highlight a number of such opportunities, through some example aspects. I shall then introduce abc, the "AspectBench Compiler", an extensible compiler for AspectJ that has been designed as a workbench for researchers in aspect-oriented programming. In first experiments, code generated by abc outperforms the official AspectJ compiler (maintained by IBM), often by a factor of 3, and sometimes by a factor of 13.

abc is a joint project between the Programming Tools group at the University of Oxford and the Sable Research team at McGill University, as well as the University of Aarhus.

(powerpoint - with full text in notes)

abc: Programming language research and aspect-oriented programming

Author: Oege de Moor (Oxford University)
Date: July 2004
WAOP 2004, July 2004, Trento, Italy

Abstract
AOP poses new challenges for programming language research, ranging from the design of new pointcut features to the efficient implementation of existing languages such as AspectJ. In this presentation, I will highlight a number of such opportunities. I shall then introduce abc, the "AspectBench Compiler", a compiler for AspectJ that has been designed as a platform for research in AOP. The frontend of abc is written using Polyglot, an extensible compiler framework from Cornell that lends itself to experimentation with new language features. The backend is based on Soot, which is a testbed from McGill for new analyses and optimisations. abc is a joint project between the Programming Tools Group at Oxford (UK) and the Sable Research team at McGill (Canada), as well as the university of Aarhus (Denmark).

(powerpoint - with full text in notes)