[Soot-list] Execute several Soot runs in batch mode
Mario Mendez
mario at cs.unm.edu
Thu May 3 14:21:30 EDT 2007
Hi all,
I'm trying to execute several times the same Soot transformation, in
order to calculate an average of how much time does my compilation take.
I'm trying to do it with a Java program, a 'main' that given some
arguments and after adding my BodyTransformation invokes soot.Main in a
loop:
public static void main(String[] args) {
//get actual time
for (int i=1;i<5;i++){
PackManager.v().getPack("jtp").add(new
Transform("jtp.pl",CiaoGenerator.v()));
soot.Main.main(args);
CiaoGenerator.v().finalize();
}
//get actual time
}
This raises an error because of Options trying to parse the same 'args'
many times. Therefore, I took a look at soot.Main and changed the code
above to
public static void main(String[] args) {
//get actual time PackManager.v().getPack("jtp").add(new
Transform("jtp.pl",CiaoGenerator.v()));
soot.Main.main(args);
CiaoGenerator.v().finalize();
for (int i=1;i<5;i++){
PackManager.v().runPacks();
PackManager.v().writeOutput();
CiaoGenerator.v().finalize();
}
//get actual time
}
But this also raises an error
Exception in thread "main" java.lang.NullPointerException
at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:82)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:329)
at soot.PackManager.retrieveAllBodies(PackManager.java:958)
at soot.PackManager.runPacks(PackManager.java:328)
at soot.CiaoMain.main(Unknown Source)
I'm using Soot 2.2.4. Any idea about how to run Soot several times in a
row? I would really like to avoid using shell scripts to do it
Thanks!
More information about the Soot-list
mailing list