Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
DiSL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DiSL
DiSL
Commits
62408d43
Commit
62408d43
authored
Oct 09, 2013
by
František Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completed dispatch tests
added evaluation server to disl.py added dispatch example
parent
ff824b3e
Changes
38
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1336 additions
and
797 deletions
+1336
-797
example/README
example/README
+8
-0
example/build.properties
example/build.properties
+2
-0
example/build.xml
example/build.xml
+2
-0
example/disl.py
example/disl.py
+173
-118
example/dispatch/app/build.xml
example/dispatch/app/build.xml
+23
-0
example/dispatch/app/src/Main.java
example/dispatch/app/src/Main.java
+12
-0
example/dispatch/build.xml
example/dispatch/build.xml
+25
-0
example/dispatch/instr/build.xml
example/dispatch/instr/build.xml
+33
-0
example/dispatch/instr/src/CodeExecuted.java
example/dispatch/instr/src/CodeExecuted.java
+156
-0
example/dispatch/instr/src/CodeExecutedRE.java
example/dispatch/instr/src/CodeExecutedRE.java
+90
-0
example/dispatch/instr/src/CodeLengthSC.java
example/dispatch/instr/src/CodeLengthSC.java
+29
-0
example/dispatch/instr/src/DiSLClass.java
example/dispatch/instr/src/DiSLClass.java
+29
-0
example/dispatch/instr/src/MANIFEST.MF
example/dispatch/instr/src/MANIFEST.MF
+2
-0
src-test/ch/usi/dag/disl/test2/suite/dispatch/instr/CodeExecuted.java
...usi/dag/disl/test2/suite/dispatch/instr/CodeExecuted.java
+55
-50
src-test/ch/usi/dag/disl/test2/suite/dispatch/instr/CodeExecutedRE.java
...i/dag/disl/test2/suite/dispatch/instr/CodeExecutedRE.java
+42
-38
src-test/ch/usi/dag/disl/test2/suite/dispatch/instr/DiSLClass.java
...ch/usi/dag/disl/test2/suite/dispatch/instr/DiSLClass.java
+12
-9
src-test/ch/usi/dag/disl/test2/suite/dispatch/junit/DispatchTest.java
...usi/dag/disl/test2/suite/dispatch/junit/DispatchTest.java
+29
-16
src-test/ch/usi/dag/disl/test2/suite/dispatch/junit/evaluation.out.resource
...g/disl/test2/suite/dispatch/junit/evaluation.out.resource
+19
-0
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/CodeExecuted.java
.../usi/dag/disl/test2/suite/dispatch2/app/CodeExecuted.java
+0
-57
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/CodeExecutedRE.java
...si/dag/disl/test2/suite/dispatch2/app/CodeExecutedRE.java
+0
-35
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/DiSLClass.java
.../ch/usi/dag/disl/test2/suite/dispatch2/app/DiSLClass.java
+0
-20
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/MANIFEST.MF
...est/ch/usi/dag/disl/test2/suite/dispatch2/app/MANIFEST.MF
+0
-2
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/TargetClass.java
...h/usi/dag/disl/test2/suite/dispatch2/app/TargetClass.java
+13
-12
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/test.out
src-test/ch/usi/dag/disl/test2/suite/dispatch2/app/test.out
+0
-0
src-test/ch/usi/dag/disl/test2/suite/dispatch2/instr/CodeExecuted.java
...si/dag/disl/test2/suite/dispatch2/instr/CodeExecuted.java
+21
-19
src-test/ch/usi/dag/disl/test2/suite/dispatch2/instr/CodeExecutedRE.java
.../dag/disl/test2/suite/dispatch2/instr/CodeExecutedRE.java
+13
-13
src-test/ch/usi/dag/disl/test2/suite/dispatch2/junit/Dispatch2Test.java
...i/dag/disl/test2/suite/dispatch2/junit/Dispatch2Test.java
+27
-18
src-test/ch/usi/dag/disl/test2/suite/dispatch2/junit/client.out.resource
.../dag/disl/test2/suite/dispatch2/junit/client.out.resource
+1
-0
src-test/ch/usi/dag/disl/test2/suite/dispatch2/junit/evaluation.out.resource
.../disl/test2/suite/dispatch2/junit/evaluation.out.resource
+5
-0
src-test/ch/usi/dag/disl/test2/suite/dispatchmp/app/TargetClass.java
.../usi/dag/disl/test2/suite/dispatchmp/app/TargetClass.java
+17
-16
src-test/ch/usi/dag/disl/test2/suite/dispatchmp/instr/CodeExecuted.java
...i/dag/disl/test2/suite/dispatchmp/instr/CodeExecuted.java
+19
-17
src-test/ch/usi/dag/disl/test2/suite/dispatchmp/instr/CodeExecutedRE.java
...dag/disl/test2/suite/dispatchmp/instr/CodeExecutedRE.java
+13
-13
src-test/ch/usi/dag/disl/test2/suite/dispatchmp/junit/DispatchMPTest.java
...dag/disl/test2/suite/dispatchmp/junit/DispatchMPTest.java
+27
-18
src-test/ch/usi/dag/disl/test2/suite/dispatchmp/junit/client.out.resource
...dag/disl/test2/suite/dispatchmp/junit/client.out.resource
+3
-0
src-test/ch/usi/dag/disl/test2/suite/dispatchmp/junit/evaluation.out.resource
...disl/test2/suite/dispatchmp/junit/evaluation.out.resource
+9
-0
src-test/ch/usi/dag/disl/test2/suite/scope/junit/ScopeTest.java
...st/ch/usi/dag/disl/test2/suite/scope/junit/ScopeTest.java
+19
-17
src-test/ch/usi/dag/disl/test2/utils/ClientServerEvaluationRunner.java
...si/dag/disl/test2/utils/ClientServerEvaluationRunner.java
+245
-190
src-test/ch/usi/dag/disl/test2/utils/ClientServerRunner.java
src-test/ch/usi/dag/disl/test2/utils/ClientServerRunner.java
+163
-119
No files found.
example/README
View file @
62408d43
...
...
@@ -84,6 +84,14 @@ values of local variables, object instance in member methods, method arguments
or current exceptions.
--------------------------------------------------------------------------------
-- dispatch
--------------------------------------------------------------------------------
This example shows how to evaluate instrumented code on evaluation jvm. For
more details try running this example directly using disl.py and supplying
'c_out' and 'e_out' options.
================================================================================
= HOW TO RUN THE EXAMPLE
================================================================================
...
...
example/build.properties
View file @
62408d43
lib.path
=
../../../build
dislserver.path
=
${lib.path}/disl-server.jar
dislre.server.path
=
${lib.path}/dislre-server.jar
dislre.dispatch.path
=
${lib.path}/dislre-dispatch.jar
asm.lib
=
asm-debug-all-4.0.jar
asm.path
=
${lib.path}/${asm.lib}
...
...
example/build.xml
View file @
62408d43
<project
name=
"disl-example"
default=
"run"
basedir=
"."
>
<target
name=
"clean"
>
<ant
antfile=
"dispatch/build.xml"
target=
"clean"
useNativeBasedir=
"true"
/>
<ant
antfile=
"dynamic/build.xml"
target=
"clean"
useNativeBasedir=
"true"
/>
<ant
antfile=
"guard/build.xml"
target=
"clean"
useNativeBasedir=
"true"
/>
<ant
antfile=
"marker/build.xml"
target=
"clean"
useNativeBasedir=
"true"
/>
...
...
@@ -9,6 +10,7 @@
</target>
<target
name=
"run"
>
<ant
antfile=
"dispatch/build.xml"
target=
"run"
useNativeBasedir=
"true"
/>
<ant
antfile=
"dynamic/build.xml"
target=
"run"
useNativeBasedir=
"true"
/>
<ant
antfile=
"guard/build.xml"
target=
"run"
useNativeBasedir=
"true"
/>
<ant
antfile=
"marker/build.xml"
target=
"run"
useNativeBasedir=
"true"
/>
...
...
example/disl.py
View file @
62408d43
...
...
@@ -30,31 +30,65 @@ def disl_home():
return
os
.
getenv
(
"DISL_HOME"
)
######################################################################
# LIB_SUFFIX
######################################################################
def
lib_suffix
():
if
platform
.
system
()
==
"Darwin"
:
return
".jnilib"
else
:
return
".so"
######################################################################
# GENERAL_PARSER
######################################################################
def
general_parser
(
parser
):
group
=
parser
.
add_argument_group
(
"GENERAL"
)
# positional variant of i for simplicity
# both cannot be set at once
group
.
add_argument
(
"instr"
,
parser
.
add_argument
(
"instr"
,
default
=
None
,
nargs
=
"?"
,
help
=
"path to jar containing disl instrumentation code, same as '-i'"
)
group
.
add_argument
(
"-i"
,
# positional variant of c_app for simplicity
# both cannot be set at once
parser
.
add_argument
(
"app"
,
default
=
None
,
nargs
=
"*"
,
help
=
"client jar or class and its arguments, same as '-c_app'"
)
parser
.
add_argument
(
"-d"
,
default
=
disl_home
(),
dest
=
"disl_home"
,
help
=
"disl home directory"
)
parser
.
add_argument
(
"-cs"
,
action
=
"store_true"
,
default
=
True
,
help
=
"set to start client and server"
)
parser
.
add_argument
(
"-cse"
,
action
=
"store_true"
,
default
=
False
,
help
=
"set to start client, server and remote evaluation"
)
parser
.
add_argument
(
"-i"
,
dest
=
"instrumentation"
,
default
=
None
,
metavar
=
"PATH"
,
help
=
"path to jar containing disl instrumentation code, same as 'instr'"
)
group
.
add_argument
(
"-t"
,
parser
.
add_argument
(
"-t"
,
dest
=
"test_dir"
,
default
=
None
,
metavar
=
"PATH"
,
help
=
"directory to run in, default=current"
)
#parser.add_argument("-p",
# action="store_true",
# default=False,
# dest="print_namespace",
# help="show all set options and default values")
return
...
...
@@ -62,21 +96,8 @@ def general_parser(parser):
# CLIENT_PARSER
######################################################################
def
client_parser
(
parser
):
parser
.
add_argument
(
"-c"
,
action
=
"store_true"
,
default
=
False
,
dest
=
"client"
,
help
=
"set to start the server"
)
group
=
parser
.
add_argument_group
(
"CLIENT"
)
# positional variant of c_app for simplicity
# both cannot be set at once
group
.
add_argument
(
"app"
,
default
=
None
,
nargs
=
"*"
,
help
=
"client jar or class and its arguments, same as '-c_app'"
)
group
.
add_argument
(
"-c_opts"
,
action
=
"append"
,
default
=
[],
...
...
@@ -91,21 +112,9 @@ def client_parser(parser):
nargs
=
"+"
,
help
=
"client jar or class and its arguments, same as 'app'"
)
if
platform
.
system
()
==
"Darwin"
:
group
.
add_argument
(
"-c_cagent"
,
default
=
VARIABLE_DISL_HOME
+
"/build/libdislagent.jnilib"
,
metavar
=
"PATH"
,
help
=
"path to c-agent library"
)
else
:
group
.
add_argument
(
"-c_cagent"
,
default
=
VARIABLE_DISL_HOME
+
"/build/libdislagent.so"
,
metavar
=
"PATH"
,
help
=
"path to c-agent library"
)
group
.
add_argument
(
"-c_jagent"
,
default
=
VARIABLE_DISL_HOME
+
"/build/disl-agent.jar"
,
metavar
=
"PATH"
,
help
=
"path to java-agent library"
)
#############################
# additional arguments follow
#############################
group
.
add_argument
(
"-c_out"
,
default
=
None
,
...
...
@@ -124,12 +133,6 @@ def client_parser(parser):
# SERVER_PARSER
######################################################################
def
server_parser
(
parser
):
parser
.
add_argument
(
"-s"
,
action
=
"store_true"
,
default
=
False
,
dest
=
"server"
,
help
=
"set to start the to be instrumented client application"
)
group
=
parser
.
add_argument_group
(
"SERVER"
)
group
.
add_argument
(
"-s_opts"
,
...
...
@@ -139,17 +142,26 @@ def server_parser(parser):
nargs
=
"+"
,
help
=
"java options of the server"
)
group
.
add_argument
(
'-s_jar'
,
default
=
VARIABLE_DISL_HOME
+
"/build/disl-server.jar"
,
metavar
=
"PATH"
,
help
=
"path to disl server jar"
)
group
.
add_argument
(
"-s_args"
,
action
=
"append"
,
default
=
[],
metavar
=
"A"
,
nargs
=
"+"
,
help
=
"arguments to the server application"
)
group
.
add_argument
(
"-s_out"
,
default
=
None
,
metavar
=
"PATH"
,
help
=
"file to save server stdout to"
)
group
.
add_argument
(
"-s_err"
,
default
=
None
,
metavar
=
"PATH"
,
help
=
"file to save server stderr to"
)
#############################
# additional arguments follow
#############################
group
.
add_argument
(
"-s_debug"
,
action
=
"store_true"
,
...
...
@@ -188,12 +200,6 @@ def server_parser(parser):
# EVALUATION_PARSER
######################################################################
def
evaluation_parser
(
parser
):
parser
.
add_argument
(
"-e"
,
action
=
"store_true"
,
default
=
False
,
dest
=
"evaluation"
,
help
=
"set to start the remote instrumentation evaluation server"
)
group
=
parser
.
add_argument_group
(
"EVALUATION"
)
group
.
add_argument
(
"-e_opts"
,
...
...
@@ -209,6 +215,20 @@ def evaluation_parser(parser):
nargs
=
"+"
,
metavar
=
"A"
,
help
=
"arguments to the evaluation server application"
)
group
.
add_argument
(
"-e_out"
,
default
=
None
,
metavar
=
"PATH"
,
help
=
"file to save evaluation stdout to"
)
group
.
add_argument
(
"-e_err"
,
default
=
None
,
metavar
=
"PATH"
,
help
=
"file to save evaluation stderr to"
)
#############################
# additional arguments follow
#############################
group
.
add_argument
(
"-e_debug"
,
action
=
"store_true"
,
...
...
@@ -234,9 +254,8 @@ def documentation_parser(parser):
This script is a DiSL client application, server and evaluation server starter.
By default a client application that will be instrumented and the server that
will instrument the application will be started. To specify what should be
started switch '-c', -'s and '-e' options. If any of these is switched then
default values are ignored and only specified module is started.
will instrument the application will be started. To start remote evaluation
server too. Specify '-cse' option.
To pass option like arguments (starting with dash) one must either use equal
sign or positional variant of the argument if it's present. For example
...
...
@@ -253,9 +272,9 @@ variable.
EXAMPLES:
To execute the example application run following:
./disl.py -s -c -i=instr/build/disl-instr.jar -c_app=-jar c_app=app/build/example-app.jar
or
./disl.py -- instr/build/disl-instr.jar -jar app/build/example-app.jar
or
./disl.py -cs -i=instr/build/disl-instr.jar -c_app=-jar c_app=app/build/example-app.jar
"""
######################################################################
...
...
@@ -263,18 +282,6 @@ or
######################################################################
def
make_parser
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"-p"
,
action
=
"store_true"
,
default
=
False
,
dest
=
"print_namespace"
,
help
=
"show all set options and default values"
)
parser
.
add_argument
(
"-d"
,
default
=
disl_home
(),
dest
=
"disl_home"
,
help
=
"disl home directory"
)
general_parser
(
parser
)
client_parser
(
parser
)
server_parser
(
parser
)
...
...
@@ -313,16 +320,6 @@ def flatten_all(object):
def
parse_arguments
(
parser
):
args
=
parser
.
parse_args
()
# substite ${DISL_HOME}
if
args
.
c_cagent
.
startswith
(
VARIABLE_DISL_HOME
):
args
.
c_cagent
=
args
.
c_cagent
.
replace
(
VARIABLE_DISL_HOME
,
args
.
disl_home
)
if
args
.
c_jagent
.
startswith
(
VARIABLE_DISL_HOME
):
args
.
c_jagent
=
args
.
c_jagent
.
replace
(
VARIABLE_DISL_HOME
,
args
.
disl_home
)
if
args
.
s_jar
.
startswith
(
VARIABLE_DISL_HOME
):
args
.
s_jar
=
args
.
s_jar
.
replace
(
VARIABLE_DISL_HOME
,
args
.
disl_home
)
args
.
c_opts
=
flatten_all
(
args
.
c_opts
)
args
.
c_app
=
flatten_all
(
args
.
c_app
)
args
.
app
=
flatten_all
(
args
.
app
)
...
...
@@ -360,52 +357,104 @@ def parse_arguments(parser):
parser
.
error
(
"-c_app and app set both"
)
if
args
.
app
is
not
None
:
args
.
c_app
=
args
.
app
# by default run client and server
if
args
.
client
is
False
and
args
.
server
is
False
and
args
.
evaluation
is
False
:
args
.
client
=
True
args
.
server
=
True
if
args
.
print_namespace
:
for
key
in
args
.
__dict__
:
value
=
args
.
__dict__
[
key
]
print
key
+
"="
+
str
(
value
)
#
if args.print_namespace:
#
for key in args.__dict__:
#
value = args.__dict__[key]
#
print key + "=" + str(value)
return
args
######################################################################
#
RUN_SERVER
#
TRY_KILL
######################################################################
def
run_server
(
args
,
parser
):
if
args
.
instrumentation
is
None
:
parser
.
error
(
"argument instr (-i) is required to run the client"
)
def
try_kill
(
pid_file_name
):
try
:
with
open
(
".server.pid"
,
"r"
)
as
pid_file
:
with
open
(
pid_file_name
,
"r"
)
as
pid_file
:
pid
=
pid_file
.
readline
()
kill
=
Popen
([
"kill"
,
pid
],
stdout
=
PIPE
,
shell
=
False
)
except
IOError
:
pass
######################################################################
# TRY_REMOVE_FILE
######################################################################
def
try_remove_file
(
file_name
):
if
os
.
path
.
isfile
(
file_name
):
os
.
remove
(
file_name
)
######################################################################
# RUN
######################################################################
def
run
(
cmd
,
out
,
err
):
out_f
=
None
err_f
=
None
if
out
is
not
None
:
out_f
=
open
(
out
,
"w"
)
if
err
is
not
None
:
err_f
=
open
(
err
,
"w"
)
process
=
Popen
(
cmd
,
stdout
=
out_f
,
stderr
=
err_f
,
shell
=
False
)
return
process
######################################################################
# RUN_SERVER
######################################################################
def
run_server
(
args
,
parser
):
if
args
.
instrumentation
is
None
:
parser
.
error
(
"argument instr (-i) is required to run the client"
)
try_kill
(
".server.pid"
)
s_jar
=
args
.
disl_home
+
"/build/disl-server.jar"
s_class
=
"ch.usi.dag.dislserver.DiSLServer"
s_cmd
=
[
"java"
]
s_cmd
+=
args
.
s_opts
s_cmd
+=
[
"-cp"
,
args
.
instrumentation
+
":"
+
args
.
s_jar
]
s_cmd
+=
[
"-cp"
,
args
.
instrumentation
+
":"
+
s_jar
]
s_cmd
+=
[
s_class
]
s_cmd
+=
args
.
s_args
#print s_cmd
server
=
Popen
(
s_cmd
,
shell
=
False
)
server
=
run
(
s_cmd
,
args
.
s_out
,
args
.
s_err
)
with
open
(
".server.pid"
,
"w"
)
as
pid_file
:
pid_file
.
write
(
str
(
server
.
pid
))
return
time
.
sleep
(
3
)
######################################################################
# RUN_EVALUATION
######################################################################
def
run_evaluation
(
args
,
parser
):
if
args
.
instrumentation
is
None
:
parser
.
error
(
"argument instr (-i) is required to run the client"
)
try_kill
(
".evaluation.pid"
)
e_jar
=
args
.
disl_home
+
"/build/dislre-server.jar"
e_class
=
"ch.usi.dag.dislreserver.DiSLREServer"
e_cmd
=
[
"java"
]
e_cmd
+=
args
.
s_opts
e_cmd
+=
[
"-Xms1G"
,
"-Xmx2G"
]
e_cmd
+=
[
"-cp"
,
args
.
instrumentation
+
":"
+
e_jar
]
e_cmd
+=
[
e_class
]
e_cmd
+=
args
.
e_args
#print e_cmd
evaluation
=
run
(
e_cmd
,
args
.
e_out
,
args
.
e_err
)
with
open
(
".evaluation.pid"
,
"w"
)
as
pid_file
:
pid_file
.
write
(
str
(
evaluation
.
pid
))
return
...
...
@@ -419,34 +468,36 @@ def run_client(args, parser):
if
args
.
instrumentation
is
None
:
parser
.
error
(
"argument instr (-i) is required to run the client"
)
cagent
=
args
.
disl_home
+
"/build/libdislagent"
+
lib_suffix
()
eagent
=
args
.
disl_home
+
"/build/libdislreagent"
+
lib_suffix
()
jagent
=
args
.
disl_home
+
"/build/disl-agent.jar"
dispatch
=
args
.
disl_home
+
"/build/dislre-dispatch.jar"
c_cmd
=
[
"java"
]
c_cmd
+=
args
.
c_opts
c_cmd
+=
[
"-agentpath:"
+
args
.
c_cagent
]
c_cmd
+=
[
"-javaagent:"
+
args
.
c_jagent
]
c_cmd
+=
[
"-Xbootclasspath/a:"
+
args
.
c_jagent
+
":"
+
args
.
instrumentation
]
c_cmd
+=
[
"-agentpath:"
+
cagent
]
if
args
.
cse
==
True
:
c_cmd
+=
[
"-agentpath:"
+
eagent
]
c_cmd
+=
[
"-javaagent:"
+
jagent
]
if
args
.
cse
==
True
:
c_cmd
+=
[
"-Xbootclasspath/a:"
+
jagent
+
":"
+
args
.
instrumentation
+
":"
+
dispatch
]
else
:
c_cmd
+=
[
"-Xbootclasspath/a:"
+
jagent
+
":"
+
args
.
instrumentation
]
c_cmd
+=
args
.
c_app
#print c_cmd
c_out_f
=
None
c_err_f
=
None
if
args
.
c_out
is
not
None
:
c_out_f
=
open
(
args
.
c_out
,
"w"
)
if
args
.
c_err
is
not
None
:
c_err_f
=
open
(
args
.
c_err
,
"w"
)
client
=
Popen
(
c_cmd
,
stdout
=
c_out_f
,
stderr
=
c_err_f
,
shell
=
False
)
client
=
run
(
c_cmd
,
args
.
c_out
,
args
.
c_err
)
client
.
wait
()
try
:
with
open
(
".server.pid"
,
"r"
)
as
pid_file
:
pid
=
pid_file
.
readline
()
kill
=
Popen
([
"kill"
,
pid
],
stdout
=
PIPE
,
shell
=
False
)
except
IOError
:
pass
os
.
remove
(
".server.pid"
)
try_kill
(
".server.pid"
)
try_kill
(
".evaluation.pid"
)
try_remove_file
(
".server.pid"
)
try_remove_file
(
".evaluation.pid"
)
return
...
...
@@ -461,10 +512,14 @@ def main():
if
args
.
test_dir
is
not
None
:
os
.
chdir
(
args
.
test_dir
)
if
args
.
server
==
True
:
if
args
.
cs
==
True
:
run_server
(
args
,
parser
)
if
args
.
cse
==
True
:
run_evaluation
(
args
,
parser
)
if
args
.
client
==
True
:
if
args
.
cs
==
True
or
args
.
cse
==
True
:
time
.
sleep
(
3
)
run_client
(
args
,
parser
)
return
...
...
example/dispatch/app/build.xml
0 → 100644
View file @
62408d43
<project
name=
"example-app"
default=
"package"
basedir=
"."
>
<target
name=
"compile"
>
<mkdir
dir=
"bin"
/>
<javac
srcdir=
"src"
destdir=
"bin"
debug=
"true"
includeAntRuntime=
"false"
>
</javac>
</target>
<target
name=
"package"
depends=
"compile"
>
<mkdir
dir=
"build"
/>
<jar
basedir=
"bin"
destfile=
"build/example-app.jar"
>
<manifest>
<attribute
name=
"Main-Class"
value=
"Main"
/>
</manifest>
</jar>
</target>
<target
name=
"clean"
>
<delete
dir=
"bin"
/>
<delete
dir=
"build"
/>
</target>
</project>
example/dispatch/app/src/Main.java
0 → 100644
View file @
62408d43
public
class
Main
{
public
void
empty
()
{
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"app: main"
);
Main
m
=
new
Main
();
m
.
empty
();
}
}
example/dispatch/build.xml
0 → 100644
View file @
62408d43
<project
name=
"disl-example"
default=
"prepare-all"
basedir=
"."
>
<target
name=
"prepare-all"
>
<ant
antfile=
"app/build.xml"
target=
"package"
useNativeBasedir=
"true"
/>
<ant
antfile=
"instr/build.xml"
target=
"package"
useNativeBasedir=
"true"
/>
</target>
<target
name=
"clean"
>
<ant
antfile=
"app/build.xml"
target=
"clean"
useNativeBasedir=
"true"
/>
<ant
antfile=
"instr/build.xml"
target=
"clean"
useNativeBasedir=
"true"
/>
</target>
<target
name=
"run"
depends=
"prepare-all"
>
<exec
executable=
"../disl.py"
>
<arg
value=
"-cse"
/>
<!-- <arg value="-c_out=client.out" /> -->
<!-- <arg value="-e_out=evaluation.out" /> -->
<arg
value=
"--"
/>
<arg
value=
"instr/build/disl-instr.jar"
/>
<arg
value=
"-jar"
/>
<arg
value=
"app/build/example-app.jar"
/>
</exec>
</target>
</project>
example/dispatch/instr/build.xml
0 → 100644
View file @
62408d43
<project
name=
"example-disl"
default=
"package"
basedir=
"."
>
<property
file=
"../../build.properties"
/>
<path
id=
"buildpath"
>
<pathelement
location=
"${asm.path}"
/>
<pathelement
location=
"${dislserver.path}"
/>
<pathelement
location=
"${dislre.server.path}"
/>
<pathelement
location=
"${dislre.dispatch.path}"
/>
</path>
<target
name=
"compile"
>
<mkdir
dir=
"bin"
/>
<javac
srcdir=
"src"
destdir=
"bin"
debug=
"true"
includeAntRuntime=
"false"
>
<classpath
refid=
"buildpath"
/>
</javac>
</target>
<target
name=
"package"
depends=
"compile"
description=
"create instrumentation package"
>
<mkdir
dir=
"build"
/>
<jar
jarfile=
"build/${instr.jar.name}"
basedir=
"bin"
excludes=
"MANIFEST.MF"
manifest=
"src/MANIFEST.MF"
>
</jar>
</target>
<target
name=
"clean"
>
<delete
dir=
"bin"
/>
<delete
dir=
"build"
/>
</target>
</project>
example/dispatch/instr/src/CodeExecuted.java
0 → 100644
View file @
62408d43
import
ch.usi.dag.dislreserver.remoteanalysis.RemoteAnalysis
;
import
ch.usi.dag.dislreserver.shadow.ShadowClass
;
import
ch.usi.dag.dislreserver.shadow.ShadowObject
;
import
ch.usi.dag.dislreserver.shadow.ShadowString
;
import
ch.usi.dag.dislreserver.shadow.ShadowThread
;
// NOTE that this class is not static anymore
public
class
CodeExecuted
extends
RemoteAnalysis
{
long
totalExecutedBytecodes
=
0
;
public
void
bytecodesExecuted
(
final
int
count
)
{
totalExecutedBytecodes
+=
count
;
}
// FIXME
//public void testingBasic(final boolean b, final byte by, final char c, final short s, final int i, final long l,
// final float f, final double d) {
public
void
testingBasic
(
final
boolean
b
,
final
byte
by
,
final
char
c
,
final
short
s
,
final
int
i
,
final
long
l
)
{
if
(
b
!=
true
)
{
throw
new
RuntimeException
(
"Incorect transfer of boolean"
);
}
if
(
by
!=
(
byte
)
125
)
{
throw
new
RuntimeException
(
"Incorect transfer of byte"
);
}
if
(
c
!=
's'
)
{