From 17865f45b709f5b8adf86acff50dd5d05ea4a4f0 Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 20 Jan 2006 12:28:01 +0000 Subject: [PATCH] ant script for running profiling tests against aspectj with ajc source compile, binary weaving, load-time weaving, and AJDT simulation. Can configure target application and source of compiler (workspace or pre-built jars). --- tests/profiling/.cvsignore | 4 + tests/profiling/aspects/readme.txt | 8 + .../aspects/simple-suite/src/META-INF/aop.xml | 5 + .../org/aspectj/profiling/WorkTheWeaver.aj | 21 + tests/profiling/build.properties | 98 ++++ tests/profiling/build.xml | 418 ++++++++++++++++++ .../tools/ant/taskdefs/AjcTask$1$Args.class | Bin 0 -> 1621 bytes .../tools/ant/taskdefs/AjcTask$1.class | Bin 0 -> 536 bytes .../tools/ant/taskdefs/AjcTask$2.class | Bin 0 -> 660 bytes .../taskdefs/AjcTask$AntMessageHandler.class | Bin 0 -> 2231 bytes .../ant/taskdefs/AjcTask$GuardedCommand.class | Bin 0 -> 4039 bytes .../aspectj/tools/ant/taskdefs/AjcTask.class | Bin 0 -> 40664 bytes .../tools/ant/taskdefs/AjcTaskTest$1.class | Bin 0 -> 740 bytes .../ant/taskdefs/AjcTaskTest$Holder.class | Bin 0 -> 1121 bytes .../ant/taskdefs/AjcTaskTest$InfoHolder.class | Bin 0 -> 975 bytes .../AjcTaskTest$MessageHolderChecker.class | Bin 0 -> 2997 bytes .../tools/ant/taskdefs/AjcTaskTest.class | Bin 0 -> 22332 bytes tests/profiling/classes/readme.txt | 6 + tests/profiling/ltw-app/META-INF/aop.xml | 5 + .../src/org/aspectj/profiling/LTWApp.java | 74 ++++ tests/profiling/readme.txt | 8 + tests/profiling/spring-1.2.6.xml | 62 +++ .../tools/AjdeInteractionTestbed.java | 10 +- .../tools/AjdeInteractionTestbedLauncher.java | 48 ++ .../tools/MultiProjectIncrementalTests.java | 4 +- 25 files changed, 767 insertions(+), 4 deletions(-) create mode 100644 tests/profiling/.cvsignore create mode 100644 tests/profiling/aspects/readme.txt create mode 100644 tests/profiling/aspects/simple-suite/src/META-INF/aop.xml create mode 100644 tests/profiling/aspects/simple-suite/src/org/aspectj/profiling/WorkTheWeaver.aj create mode 100644 tests/profiling/build.properties create mode 100644 tests/profiling/build.xml create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTask$1$Args.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTask$1.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTask$2.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTask$AntMessageHandler.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTask$GuardedCommand.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTask.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTaskTest$1.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTaskTest$Holder.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTaskTest$InfoHolder.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTaskTest$MessageHolderChecker.class create mode 100644 tests/profiling/classes/org/aspectj/tools/ant/taskdefs/AjcTaskTest.class create mode 100644 tests/profiling/classes/readme.txt create mode 100644 tests/profiling/ltw-app/META-INF/aop.xml create mode 100644 tests/profiling/ltw-app/src/org/aspectj/profiling/LTWApp.java create mode 100644 tests/profiling/readme.txt create mode 100644 tests/profiling/spring-1.2.6.xml create mode 100644 tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbedLauncher.java diff --git a/tests/profiling/.cvsignore b/tests/profiling/.cvsignore new file mode 100644 index 000000000..189c180cf --- /dev/null +++ b/tests/profiling/.cvsignore @@ -0,0 +1,4 @@ +results +gc.txt +java.hprof.txt +project.properties diff --git a/tests/profiling/aspects/readme.txt b/tests/profiling/aspects/readme.txt new file mode 100644 index 000000000..c7409545d --- /dev/null +++ b/tests/profiling/aspects/readme.txt @@ -0,0 +1,8 @@ +Some sample aspects that will by default be woven with the +target application. + +Designed to make sure that ajc has plenty of work to do!! + +Only the "simple-suite" has been defined so far, but you could +define other aspect suites to exercise different workloads, and +use them by setting the test.aspects.src.dir property diff --git a/tests/profiling/aspects/simple-suite/src/META-INF/aop.xml b/tests/profiling/aspects/simple-suite/src/META-INF/aop.xml new file mode 100644 index 000000000..6378d9301 --- /dev/null +++ b/tests/profiling/aspects/simple-suite/src/META-INF/aop.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tests/profiling/aspects/simple-suite/src/org/aspectj/profiling/WorkTheWeaver.aj b/tests/profiling/aspects/simple-suite/src/org/aspectj/profiling/WorkTheWeaver.aj new file mode 100644 index 000000000..9321decee --- /dev/null +++ b/tests/profiling/aspects/simple-suite/src/org/aspectj/profiling/WorkTheWeaver.aj @@ -0,0 +1,21 @@ +package org.aspectj.profiling; + +public aspect WorkTheWeaver { + + before() : execution(* set*(..)) { + System.out.println("before setter..."); + } + + after() returning : execution(* set*(..)) { + System.out.println("after returning from setter..."); + } + + // using "call" on an interface type will cause us to chase + // all the way up the inheritance hierarchies of any type we + // call. + // it also means we have to crack open methods when weaving... + declare warning : call(* java.lang.Runnable+.*(..)) + : "call to a subtype of runnable"; + + +} \ No newline at end of file diff --git a/tests/profiling/build.properties b/tests/profiling/build.properties new file mode 100644 index 000000000..2718ca584 --- /dev/null +++ b/tests/profiling/build.properties @@ -0,0 +1,98 @@ +# Version controlled properties for profiling ant script +# You can locally override properties defined here by placing +# them in a project.properties file in the same directory. +# +# Do not check your project.properties file into CVS! + +# directory containing aspectj libraries (aspectj[tools|weaver|rt].jar) +aspectj.lib.dir=../../aj-build/dist/tools/lib + +# root directory of your workspace containing the aspectj tree (if +# using head for profiling as opposed to a built version of aspectj) +aspectj.workspace.root=../.. + +# set this property to false in your project.properties to use the contents of your workspace +# for compilation, as opposed to the jars in aspectj.lib.dir +use.aspectjtools.jar=true + +# the iajc task that ships with 1.5.0 or any prior release does +# not support the need nested attribute that this +# profiling script needs. To profile AspectJ versions < 1.5.1, +# use the local copy of AjcTask in the "classes" folder by +# defining the following property +use.local.iajc.task.class=true + +# directory in which results will be placed +results.dir=results + +# source and target levels for compilation +source.level=1.5 +target.level=1.5 + +# the maximum memory to make available for the compilation/weaving +ajc.maxmem=768m + +# the name of the file containing the path definitions needed to compile +# a particular target application as the subject of the profiling +# we profile the compilation and weaving of spring 1.2.6 by default. +target.application.definitions.file=./spring-1.2.6.xml + +# target application name, used as the subdirectory under results to store +# profiling results +target.application.name=spring-1.2.6 + +# source root directory for the aspects you want to compile and weave alongside +# the target application (unless it contains sufficient aspects on its own...) +test.aspects.src.dir=./aspects/simple-suite/src + +# installation dir of a spring-1.2.6 distribution. you will need to set this +# in project.properties unless you point the target.application.definitions.file +# to compile a different target application altogether. +spring.install.dir=must-set-spring.install.dir-property-in-project.properties + +# for binary and loadtime weaving, the location of the jar file that will be +# woven into +weave.injar=${spring.install.dir}/dist/spring.jar + +# location of aop.xml file to be included when load-time weaving +# use this to control the set of types exposed to the weaver so as to +# match the set of types woven in the other modes for fair comparisons +# across weave times +ltw.aop.xml=./ltw-app/META-INF/aop.xml + +# args to pass to vm for hprof run +# +# hprof usage: java -agentlib:hprof=[help]|[