From 3b92d432d82da30905a412cb0ef4f5e6f6c11fa6 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 12 Feb 2012 11:38:48 +0100 Subject: [PATCH] Add support for java (non-gcj), multiple runtimes This unfortunately makes it hard to directly exec a file. Bad, bad java! --- .gitignore | 1 + Makefile | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8debced..8832ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.[oa] *.cm[ixo] *.hi +*.class *~ /log diff --git a/Makefile b/Makefile index 1f6f5ce..1367d26 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,13 @@ METRICS = \ cycles,instructions,cache-references,cache-misses \ cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend +JAVA_VMS = server zero cacao jamvm +# see below for how this is called +JAVA_INVOCS = $(JAVA_VMS:%="java -cp java -% Null") + REPS = 100 -all: $(PROGS) +all: $(PROGS) java/Null.class $(PROGS): Makefile @@ -79,12 +83,15 @@ java/null-gcj: java/Null.java gcj-4.6 --main=Null -o $@ $< strip $@ -log: $(PROGS) $(SCRIPTS) Makefile +java/Null.class: java/Null.java Makefile + javac $< + +log: $(PROGS) $(SCRIPTS) java/Null.class Makefile rm -f log; \ - for prog in $(PROGS) $(SCRIPTS); do \ + for prog in $(PROGS:%=./%) $(SCRIPTS:%=./%) $(JAVA_INVOCS); do \ echo $$prog; \ for metric in $(METRICS); do \ - LC_ALL=C perf stat -e "$$metric" -r $(REPS) -o log --append ./$$prog; \ + LC_ALL=C perf stat -e "$$metric" -r $(REPS) -o log --append $$prog; \ done; \ done -- 2.39.5