This bundle contains the template of the various exercises that compose the DiSL project. Please refer to the text of the DiSL project for more information on the the purpose of each exercise.
Each exercise is composed of two parts: 1) profiler and 2) observed application.
- Profiler code is located in the
src-profilerfolder. In each exercise, there is always a single DiSL class (i.e., the class containing DiSL snippets) which is calledInstrumentation. You can add as many profiler classes as you like to thesrc-profilerfolder. However, all DiSL snippets must be added to the existingInstrumentationclass. - Observed application code is located in the
src-appfolder. In each example, the main class of the observed application is always calledMain. - Both the profiler and the observed applications are contained in a package called
ex<i>(where is a progressive integer number). For example, both the profiler and the observed applications that refer to the first exercise are contained in packageex1.
Building requires the ant program.
You have to compile and build the sources each time you want to use a different profiler.
To run the build process, execute
ant -Ddislclass=<DiSL class>
in the root of the folder, where is the fully qualified name of the DiSL class corresponding to the profiler you want to run.
For example, if you want to use the profiler that refers to the first exercise, run:
ant -Ddislclass=ex1.Instrumentation.
The build process will generate the JARs build/profiler.jar, containing the profiler.
The observed application (without any profiler) can be normally run via:
bash ./run.sh <main class>
where
For example, to run the main class of the first exercise, run:
bash ./run.sh ex1.Main
To run the observed application instrumented with a profiler:
- First, start the DiSL Server by executing
bash ./startDiSLServer.sh. - Then, start the observed application (with the profiler attached) by executing
bash ./runInstrumented.sh <main class>where is the fully qualified name of the main class you want to run.
Note: the profiler that will be applied to the observed application is always the one corresponding to the DiSL class specified at build time!
You can run ant clean to discard generated profiler JAR.
To run e.g. the instrumented observed application of the first exercise, execute, in order:
ant cleanant -Ddislclass=ex1.Instrumentationbash ./startDiSLServer.shbash ./runInstrumented.sh ex1.Main