Commit 08c1f905 authored by Danilo Ansaloni's avatar Danilo Ansaloni
Browse files

Moved the following analyses:

*) jp2
*) jraf2
*) map
*) senseo
from the test to the examples directory.
Warning: these analyses are provided as are. Respective authors should check the code.
parent a1d385d6
user.runtime.jar.name=senseo-runtime.jar
\ No newline at end of file
<project name="disl-test" default="compile" basedir=".">
<property file="../../disl.version"/>
<property file="../../build.properties"/>
<property file="build.properties"/>
<property name="disl.jar.path" value="../../build/disl-${disl.version}.jar"/>
<path id="buildpath">
<pathelement location="${disl.jar.path}"/>
<pathelement location="../../${asm.path}"/>
<pathelement location="../../${jborat.path}"/>
<pathelement location="../../${jborat-runtime.path}"/>
<pathelement location="lib/stp.jar"/>
</path>
<target name="check-disl-jar">
<available file="${disl.jar.path}" property="disl.jar.present"/>
</target>
<target name="report-missing-jar" depends="check-disl-jar" unless="disl.jar.present">
<fail message="DiSL jar not found at ${disl.jar.path}. Build DiSL first!" />
</target>
<target name="compile" depends="report-missing-jar">
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin" debug="true" includeAntRuntime="false">
<classpath refid="buildpath"/>
<compilerarg value="-Xbootclasspath/p:lib/Thread_test.jar"/>
</javac>
</target>
<target name="agent" description="create simple agent jar file" >
<mkdir dir="build"/>
<jar jarfile="build/agent-light.jar">
<manifest>
<attribute name="Premain-Class" value="ch.usi.dag.disl.test.agent.Agent"/>
</manifest>
</jar>
</target>
<target name="check-test-property">
<condition property="test.set">
<isset property="test.name"/>
</condition>
</target>
<target name="report-missing-property" depends="check-test-property" unless="test.set">
<fail message="Property test.name is not set. Set it using -Dtest.name=value" />
</target>
<property name="test.path" value="ch/usi/dag/disl/example/${test.name}"/>
<target name="package" depends="report-missing-property,compile" description="create instrumentation package for specified test">
<mkdir dir="build"/>
<jar jarfile="./build/${user.runtime.jar.name}"
basedir="./bin"
includes="${test.path}/runtime/**">
</jar>
<jar jarfile="../../build/${instr.jar.name}"
basedir="./bin"
includes="${test.path}/*"
excludes="${test.path}/runtime ${test.path}/TargetClass*.class ${test.path}/MANIFEST.MF"
manifest="./src/${test.path}/MANIFEST.MF">
</jar>
</target>
<target name="clean">
<delete dir="bin"/>
<delete dir="build"/>
</target>
</project>
# This is a sample configuration with relative paths
# you can use full path using file:/// format
../../lib/asm-debug-all-4.0.jar
../../test/lib/remote-jborat.jar
../../lib/jborat.jar
# This is a sample configuration with relative paths
# you can use full path using file:/// format
../../lib/asm-debug-all-4.0.jar
../../build/disl-unspec.jar
../../build/dislinstr.jar
# /bin/sh
EXPECTED_ARGS=1
if [ $# -gt $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` [pkg]"
exit
fi
SERVER_FILE=.server.pid
export SERVER_FILE
if [ -e ${SERVER_FILE} ]
then
kill -KILL `cat ${SERVER_FILE}`
rm .server.pid
fi
DISL_CLASS="./bin/ch/usi/dag/disl/example/jp2/DiSLClass.class"
TARGET_CLASS="ch.usi.dag.disl.example.jp2.TargetClass"
if [ "$1" = "pkg" ]
then
# start server and take pid
ant package -Dtest.name=jp2
./runServer.sh
else
# start server and take pid
./runServer.sh -Ddisl.classes=${DISL_CLASS}
fi
# wait for server startup
sleep 5
# run client
./runClient.sh ${TARGET_CLASS}
# kill server
kill -KILL `cat ${SERVER_FILE}`
rm .server.pid
#!/bin/bash
OS=`uname`
ARCH_RAW=`uname -m`
ARCH="unspec"
if [ "${ARCH_RAW}" = "i686" -o "${ARCH_RAW}" = "x86_32" ]; then
ARCH="x32"
elif [ "${ARCH_RAW}" = "x86_64" ]; then
ARCH="x64"
else
echo "Unknow architecture...."
exit -1
fi
if [ "${OS}" = "Darwin" ]; then
JBORAT_AGENT="macosx/${ARCH}/"libjboratagent.jnilib
elif [ "${OS}" = "Linux" ]; then
JBORAT_AGENT="linux/${ARCH}/"libjboratagent.so
else
echo "Unknow platform..."
exit -1
fi
# shared memory is the default communication
# to enable socket, add ",ipc.socket" to the options
JBORAT_AGENT_OPTS="1234,localhost"
java -XX:MaxPermSize=128m \
-Xmx2G \
-javaagent:../../test/lib/agent.jar \
-Xbootclasspath/p:../../test/lib/remote-runtime.jar:../../lib/jborat-runtime.jar:./build/jp2-runtime.jar \
-agentpath:../../test/lib/${JBORAT_AGENT}=${JBORAT_AGENT_OPTS} \
-cp ./bin \
$*
#!/bin/sh
OS=`uname`
ARCH_RAW=`uname -m`
ARCH="unspec"
if [ "${ARCH_RAW}" = "i686" -o "${ARCH_RAW}" = "x86_32" ]; then
ARCH="x32"
elif [ "${ARCH_RAW}" = "x86_64" ]; then
ARCH="x64"
else
echo "Unknow architecture.."
exit -1
fi
if [ "${OS}" = "Darwin" ]; then
JBORAT_AGENT_PATH="macosx/${ARCH}"
elif [ "${OS}" = "Linux" ]; then
JBORAT_AGENT_PATH="linux/${ARCH}"
else
echo "Unknow platform..."
exit -1
fi
CLASSPATH=../../lib/jborat-agent.jar:../../lib/jborat-runtime.jar:../../lib/jborat-interface.jar:../../test/lib/remote-server.jar
java -Dch.usi.dag.jborat.instrumented="instrumented" \
-Djborat.debug \
-Ddisl.dynbypass=false \
-Ddisl.debug \
-Djava.library.path=../../test/lib/${JBORAT_AGENT_PATH} \
-Dch.usi.dag.jborat.instrumentation="ch.usi.dag.disl.DiSL" \
-Dch.usi.dag.jborat.codemergerList="../../test/conf/codemerger.lst" \
-Dch.usi.dag.jborat.liblist="./conf/lib.lst" \
-Dch.usi.dag.jborat.udiliblist="./conf/udilib.lst" \
-Dch.usi.dag.jborat.exclusionList="../../test/conf/exclusion.lst" \
$* \
-cp ${CLASSPATH} \
ch.usi.dag.jborat.remote.server.Server \
&
echo $! > ${SERVER_FILE}
package ch.usi.dag.disl.test.jp2;
package ch.usi.dag.disl.example.jp2;
public abstract class AbstractTargetClass {
public abstract void hoo(int i);
}
package ch.usi.dag.disl.test.jp2;
package ch.usi.dag.disl.example.jp2;
import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.Before;
......@@ -11,7 +11,7 @@ import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.staticcontext.BasicBlockSC;
import ch.usi.dag.disl.staticcontext.BytecodeSC;
import ch.usi.dag.disl.staticcontext.MethodSC;
import ch.usi.dag.disl.test.jp2.runtime.CCTNode;
import ch.usi.dag.disl.example.jp2.runtime.CCTNode;
public class DiSLClass {
......
package ch.usi.dag.disl.test.jp2;
package ch.usi.dag.disl.example.jp2;
import java.util.*;
......
Manifest-Version: 1.0
DiSL-Classes: ch/usi/dag/disl/example/jp2/DiSLClass.class
\ No newline at end of file
package ch.usi.dag.disl.test.jp2;
package ch.usi.dag.disl.example.jp2;
public class TargetClass extends AbstractTargetClass {
......
package ch.usi.dag.disl.test.jp2.runtime;
package ch.usi.dag.disl.example.jp2.runtime;
/**
* Copyright (c) 2010 Aibek Sarimbekov, Philippe Moret, Walter Binder, Andreas
......
package ch.usi.dag.disl.test.jp2.runtime;
package ch.usi.dag.disl.example.jp2.runtime;
import java.io.PrintStream;
import java.util.List;
......
user.runtime.jar.name=jp2-runtime.jar
\ No newline at end of file
<project name="disl-test" default="compile" basedir=".">
<property file="../../disl.version"/>
<property file="../../build.properties"/>
<property file="build.properties"/>
<property name="disl.jar.path" value="../../build/disl-${disl.version}.jar"/>
<path id="buildpath">
<pathelement location="${disl.jar.path}"/>
<pathelement location="../../${asm.path}"/>
<pathelement location="../../${jborat.path}"/>
<pathelement location="../../${jborat-runtime.path}"/>
<pathelement location="lib/stp.jar"/>
</path>
<target name="check-disl-jar">
<available file="${disl.jar.path}" property="disl.jar.present"/>
</target>
<target name="report-missing-jar" depends="check-disl-jar" unless="disl.jar.present">
<fail message="DiSL jar not found at ${disl.jar.path}. Build DiSL first!" />
</target>
<target name="compile" depends="report-missing-jar">
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin" debug="true" includeAntRuntime="false">
<classpath refid="buildpath"/>
<compilerarg value="-Xbootclasspath/p:lib/Thread_test.jar"/>
</javac>
</target>
<target name="agent" description="create simple agent jar file" >
<mkdir dir="build"/>
<jar jarfile="build/agent-light.jar">
<manifest>
<attribute name="Premain-Class" value="ch.usi.dag.disl.test.agent.Agent"/>
</manifest>
</jar>
</target>
<target name="check-test-property">
<condition property="test.set">
<isset property="test.name"/>
</condition>
</target>
<target name="report-missing-property" depends="check-test-property" unless="test.set">
<fail message="Property test.name is not set. Set it using -Dtest.name=value" />
</target>
<property name="test.path" value="ch/usi/dag/disl/example/${test.name}"/>
<target name="package" depends="report-missing-property,compile" description="create instrumentation package for specified test">
<mkdir dir="build"/>
<jar jarfile="./build/${user.runtime.jar.name}"
basedir="./bin"
includes="${test.path}/runtime/**">
</jar>
<jar jarfile="../../build/${instr.jar.name}"
basedir="./bin"
includes="${test.path}/*"
excludes="${test.path}/runtime ${test.path}/TargetClass*.class ${test.path}/MANIFEST.MF"
manifest="./src/${test.path}/MANIFEST.MF">
</jar>
</target>
<target name="clean">
<delete dir="bin"/>
<delete dir="build"/>
</target>
</project>
# This is a sample configuration with relative paths
# you can use full path using file:/// format
../../lib/asm-debug-all-4.0.jar
../../test/lib/remote-jborat.jar
../../lib/jborat.jar
# This is a sample configuration with relative paths
# you can use full path using file:/// format
../../lib/asm-debug-all-4.0.jar
../../build/disl-unspec.jar
../../build/dislinstr.jar
# /bin/sh
EXPECTED_ARGS=1
if [ $# -gt $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` [pkg]"
exit
fi
SERVER_FILE=.server.pid
export SERVER_FILE
if [ -e ${SERVER_FILE} ]
then
kill -KILL `cat ${SERVER_FILE}`
rm .server.pid
fi
DISL_CLASS="./bin/ch/usi/dag/disl/example/jraf2/DiSLClass.class"
TARGET_CLASS="ch.usi.dag.disl.example.jraf2.TargetClass"
if [ "$1" = "pkg" ]
then
# start server and take pid
ant package -Dtest.name=jraf2
./runServer.sh
else
# start server and take pid
./runServer.sh -Ddisl.classes=${DISL_CLASS}
fi
# wait for server startup
sleep 5
# run client
./runClient.sh ${TARGET_CLASS}
# kill server
kill -KILL `cat ${SERVER_FILE}`
rm .server.pid
#!/bin/bash
OS=`uname`
ARCH_RAW=`uname -m`
ARCH="unspec"
if [ "${ARCH_RAW}" = "i686" -o "${ARCH_RAW}" = "x86_32" ]; then
ARCH="x32"
elif [ "${ARCH_RAW}" = "x86_64" ]; then
ARCH="x64"
else
echo "Unknow architecture...."
exit -1
fi
if [ "${OS}" = "Darwin" ]; then
JBORAT_AGENT="macosx/${ARCH}/"libjboratagent.jnilib
elif [ "${OS}" = "Linux" ]; then
JBORAT_AGENT="linux/${ARCH}/"libjboratagent.so
else
echo "Unknow platform..."
exit -1
fi
# shared memory is the default communication
# to enable socket, add ",ipc.socket" to the options
JBORAT_AGENT_OPTS="1234,localhost"
java -XX:MaxPermSize=128m \
-Xmx2G \
-javaagent:../../test/lib/agent.jar \
-Xbootclasspath/p:../../test/lib/remote-runtime.jar:../../lib/jborat-runtime.jar:./build/jraf2-runtime.jar \
-agentpath:../../test/lib/${JBORAT_AGENT}=${JBORAT_AGENT_OPTS} \
-cp ./bin \
$*
#!/bin/sh
OS=`uname`
ARCH_RAW=`uname -m`
ARCH="unspec"
if [ "${ARCH_RAW}" = "i686" -o "${ARCH_RAW}" = "x86_32" ]; then
ARCH="x32"
elif [ "${ARCH_RAW}" = "x86_64" ]; then
ARCH="x64"
else
echo "Unknow architecture.."
exit -1
fi
if [ "${OS}" = "Darwin" ]; then
JBORAT_AGENT_PATH="macosx/${ARCH}"
elif [ "${OS}" = "Linux" ]; then
JBORAT_AGENT_PATH="linux/${ARCH}"
else
echo "Unknow platform..."
exit -1
fi
CLASSPATH=../../lib/jborat-agent.jar:../../lib/jborat-runtime.jar:../../lib/jborat-interface.jar:../../test/lib/remote-server.jar
java -Dch.usi.dag.jborat.instrumented="instrumented" \
-Djborat.debug \
-Ddisl.dynbypass=false \
-Ddisl.debug \
-Djava.library.path=../../test/lib/${JBORAT_AGENT_PATH} \
-Dch.usi.dag.jborat.instrumentation="ch.usi.dag.disl.DiSL" \
-Dch.usi.dag.jborat.codemergerList="../../test/conf/codemerger.lst" \
-Dch.usi.dag.jborat.liblist="./conf/lib.lst" \
-Dch.usi.dag.jborat.udiliblist="./conf/udilib.lst" \
-Dch.usi.dag.jborat.exclusionList="../../test/conf/exclusion.lst" \
$* \
-cp ${CLASSPATH} \
ch.usi.dag.jborat.remote.server.Server \
&
echo $! > ${SERVER_FILE}
package ch.usi.dag.disl.test.jraf2;
package ch.usi.dag.disl.example.jraf2;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BasicBlockMarker;
......
Manifest-Version: 1.0
DiSL-Classes: ch/usi/dag/disl/example/jraf2/DiSLClass.class
\ No newline at end of file
package ch.usi.dag.disl.test.jraf2;
package ch.usi.dag.disl.example.jraf2;
public class Profiler {
public static void profile(Thread t, int count) {
......
package ch.usi.dag.disl.test.jraf2;
package ch.usi.dag.disl.example.jraf2;
public class TargetClass {
public void doit() {
......
user.runtime.jar.name=map-runtime.jar
\ No newline at end of file
<project name="disl-test" default="compile" basedir=".">
<property file="../../disl.version"/>
<property file="../../build.properties"/>
<property file="build.properties"/>
<property name="disl.jar.path" value="../../build/disl-${disl.version}.jar"/>
<path id="buildpath">
<pathelement location="${disl.jar.path}"/>
<pathelement location="../../${asm.path}"/>
<pathelement location="../../${jborat.path}"/>
<pathelement location="../../${jborat-runtime.path}"/>
<pathelement location="lib/stp.jar"/>
</path>
<target name="check-disl-jar">
<available file="${disl.jar.path}" property="disl.jar.present"/>
</target>
<target name="report-missing-jar" depends="check-disl-jar" unless="disl.jar.present">
<fail message="DiSL jar not found at ${disl.jar.path}. Build DiSL first!" />
</target>
<target name="compile" depends="report-missing-jar">
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin" debug="true" includeAntRuntime="false">
<classpath refid="buildpath"/>
<compilerarg value="-Xbootclasspath/p:lib/Thread_test.jar"/>
</javac>
</target>
<target name="agent" description="create simple agent jar file" >
<mkdir dir="build"/>
<jar jarfile="build/agent-light.jar">
<manifest>
<attribute name="Premain-Class" value="ch.usi.dag.disl.test.agent.Agent"/>
</manifest>
</jar>
</target>
<target name="check-test-property">
<condition property="test.set">
<isset property="test.name"/>
</condition>
</target>
<target name="report-missing-property" depends="check-test-property" unless="test.set">
<fail message="Property test.name is not set. Set it using -Dtest.name=value" />
</target>
<property name="test.path" value="ch/usi/dag/disl/example/${test.name}"/>
<target name="package" depends="report-missing-property,compile" description="create instrumentation package for specified test">
<mkdir dir="build"/>
<jar jarfile="./build/${user.runtime.jar.name}"
basedir="./bin"
includes="${test.path}/runtime/**">
</jar>
<jar jarfile="../../build/${instr.jar.name}"
basedir="./bin"
includes="${test.path}/*"
excludes="${test.path}/runtime ${test.path}/TargetClass*.class ${test.path}/MANIFEST.MF"
manifest="./src/${test.path}/MANIFEST.MF">
</jar>
</target>
<target name="clean">
<delete dir="bin"/>
<delete dir="build"/>
</target>
</project>
# This is a sample configuration with relative paths
# you can use full path using file:/// format
../../lib/asm-debug-all-4.0.jar
../../test/lib/remote-jborat.jar
../../lib/jborat.jar