64 lines
2.6 KiB
Makefile
64 lines
2.6 KiB
Makefile
BENCHDIR = target/bench
|
|
TARGET = tmr.axf
|
|
TARGET_TRACE = $(BENCHDIR)/traces/tmr_worst.ron
|
|
TARGET_EDGES = $(BENCHDIR)/edges/tmr_worst.ron
|
|
|
|
$(BENCHDIR)/bin:
|
|
mkdir -p $@
|
|
|
|
$(BENCHDIR)/target_known_edges: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_known_edges,sched_queue,obj_edges
|
|
|
|
$(BENCHDIR)/target_vanilla: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_afl,sched_mapmax
|
|
|
|
$(BENCHDIR)/target_state: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_state,sched_state
|
|
|
|
$(BENCHDIR)/target_graph: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_graph,sched_graph
|
|
|
|
$(BENCHDIR)/target_graph_snip: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_graph,sched_graph,muta_snip,muta_input,muta_suffix
|
|
|
|
$(BENCHDIR)/target_graph_afl: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_graph,sched_graph,feed_afl
|
|
|
|
$(BENCHDIR)/target_graph_all: $(BENCHDIR)/bin
|
|
cargo build --bin fuzzer --target-dir $@ --features benchmark,feed_graph,sched_graph,feed_afl,muta_snip,muta_input,muta_suffix
|
|
|
|
binaries: $(BENCHDIR)/target_known_edges $(BENCHDIR)/target_vanilla $(BENCHDIR)/target_state $(BENCHDIR)/target_graph $(BENCHDIR)/target_graph_snip $(BENCHDIR)/target_graph_afl $(BENCHDIR)/target_graph_all
|
|
|
|
# variants: vanilla, state, graph, graph_snip, graph_afl, graph_all
|
|
$(BENCHDIR)/bench_%.log: $(BENCHDIR)/target_% $(TARGET_TRACE)
|
|
for i in {1..10}; do \
|
|
CASE=$$(basename -s.log $@ | cut -d'_' -f 2- ); \
|
|
echo $$CASE Iteration $$i; \
|
|
./fuzzer_bench.sh $</debug/fuzzer $(TARGET) --libafl-traces $(TARGET_TRACE) \
|
|
--libafl-edges $(TARGET_EDGES) --libafl-exectimes $(BENCHDIR)/bench_$$CASE\_$$i.exec > $@_$$i; \
|
|
sed -i "1 i\\$$CASE " $(BENCHDIR)/bench_$$CASE\_$$i.exec; \
|
|
done
|
|
for i in $@_*; do tail -n 1 $$i >> $@; done
|
|
|
|
benchmarks: target/bench/bench_known_edges.log 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 benchmarks
|
|
|
|
clean_bench:
|
|
rm -rf $(BENCHDIR)/bench_*
|
|
|
|
clean:
|
|
rm -rf target/bench
|
|
|
|
%.case: %_inputs
|
|
mkdir -p $(BENCHDIR)/traces $(BENCHDIR)/edges
|
|
for i in $</*.case; do \
|
|
CASE=$$(basename -s.case $$i); echo $$CASE; \
|
|
PROG=$$(basename -s.case $@); \
|
|
./showmap.sh $(TARGET) --libafl-single $$i \
|
|
--libafl-edges $(BENCHDIR)/edges/$$PROG\_$$CASE.ron \
|
|
--libafl-traces $(BENCHDIR)/traces/$$PROG\_$$CASE.ron | \
|
|
grep "Qemu Ticks:"; \
|
|
done
|
|
|
|
$(TARGET_TRACE): tmr.case |