From 5d28754e1b3b46ef8b6b595543d3bdefd2cf0979 Mon Sep 17 00:00:00 2001 From: Alwin Berger Date: Wed, 4 May 2022 22:56:40 +0200 Subject: [PATCH] add Makefile for benchmarks --- fuzzers/wcet_qemu_sys/Makefile | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 fuzzers/wcet_qemu_sys/Makefile diff --git a/fuzzers/wcet_qemu_sys/Makefile b/fuzzers/wcet_qemu_sys/Makefile new file mode 100644 index 0000000000..a6120ca39e --- /dev/null +++ b/fuzzers/wcet_qemu_sys/Makefile @@ -0,0 +1,50 @@ +BENCHDIR = target/bench +TARGET = tmr.axf +EXAMPLE = "\xff\05\x84\x84\x84\x84\x84\x84\x84\x84" +TARGET_TRACE = tmp/target_trace.ron +TARGET_EDGES = tmp/target_edges.ron + +$(BENCHDIR)/bin: + mkdir -p $@ + +$(BENCHDIR)/bin/fuzz_vanilla: $(BENCHDIR)/bin + cargo build --features feed_afl,sched_queue + cp target/debug/fuzzer $@ + +$(BENCHDIR)/bin/fuzz_state: $(BENCHDIR)/bin + cargo build --features feed_state,sched_state + cp target/debug/fuzzer $@ + +$(BENCHDIR)/bin/fuzz_graph: $(BENCHDIR)/bin + cargo build --features feed_graph,sched_graph + cp target/debug/fuzzer $@ + +$(BENCHDIR)/bin/fuzz_graph_snip: $(BENCHDIR)/bin + cargo build --features feed_graph,sched_graph,muta_snip + cp target/debug/fuzzer $@ + +$(BENCHDIR)/bin/fuzz_graph_afl: $(BENCHDIR)/bin + cargo build --features feed_graph,sched_graph,feed_afl + cp target/debug/fuzzer $@ + +$(BENCHDIR)/bin/fuzz_graph_all: $(BENCHDIR)/bin + cargo build --features feed_graph,sched_graph,feed_afl,muta_snip + cp target/debug/fuzzer $@ + +binaries: $(BENCHDIR)/bin/fuzz_vanilla $(BENCHDIR)/bin/fuzz_state $(BENCHDIR)/bin/fuzz_graph $(BENCHDIR)/bin/fuzz_graph_snip $(BENCHDIR)/bin/fuzz_graph_afl $(BENCHDIR)/bin/fuzz_graph_all + +# variants: vanilla, state, graph, graph_snip, graph_afl, graph_all +$(BENCHDIR)/bench_%.log: $(BENCHDIR)/bin/fuzz_% $(TARGET_TRACE) + for i in {1..5}; do ./fuzzer_bench.sh $< $(TARGET) --libafl-traces $(TARGET_TRACE) > $@_$$i; done + for i in $@_*; do tail -n 1 $$i >> $@; done + +benchmarks: target/bench/bench_vanilla.log target/bench/bench_state.log target/bench/bench_graph.log target/bench/bench_graph_snip.log target/bench/bench_graph_afl.log target/bench/bench_graph_all.log + +all: binaries + +clean_bench: + rm -rf $(BENCHDIR)/bench_* + +clean: + rm -rf target/bench + \ No newline at end of file