summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 1accfd7abdb3afd26b8e4b4e98a2bbab7646e059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
LOOP_BINS := do_hvc.bin do_sgi.bin do_sysreg.bin do_fp_hvc.bin
MEMORY_BINS := do_fault_read.bin do_fault_write.bin do_fault_read_write.bin

BINS := $(LOOP_BINS) $(MEMORY_BINS)

PERF ?= perf
LKVM ?= lkvm
LKVM_ARGS ?=

%.bin : %.o
	objcopy -O binary $^ $@

all: $(BINS)

clean:
	rm -f $(BINS)

.PHONY: tests-gicv2 tests-gicv3 tests-memory

tests-gicv2:
	@echo GICv2:; for i in $(LOOP_BINS); do echo -n $$i: ; LANG='C' taskset -c 1 $(PERF) stat -e cycles:hk $(LKVM) run -c1 --firmware $$i --irqchip=gicv2 $(LKVM_ARGS) --pmu 2>&1 >/dev/null| grep cycles | awk '{print $$1 / 2^20}'; done

tests-gicv3:
	@echo GICv3:; for i in $(LOOP_BINS); do echo -n $$i: ; LANG='C' taskset -c 1 $(PERF) stat -e cycles:hk $(LKVM) run -c1 --firmware $$i --irqchip=gicv3 --pmu 2>&1 >/dev/null | grep cycles | awk '{print $$1 / 2^20}'; done

tests-memory:
	@echo Memory:; for i in $(MEMORY_BINS); do echo -n $$i: ; LANG='C' taskset -c 1 $(PERF) stat -e cycles:hk $(LKVM) run -c1 --firmware $$i -m 1024 2>&1 >/dev/null | grep elapsed; done

tests: $(BINS) tests-gicv2 tests-gicv3 tests-memory