bench.mk 1008 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
bench_BIN := \
	bench_lru

# Dependencies
bench_DEPEND := $(libkres)
bench_LIBS :=  $(libkres_TARGET) $(libkres_LIBS)

# Make bench binaries
define make_bench
10
$(1)_CFLAGS := -fPIE
11 12 13 14 15 16 17 18
$(1)_SOURCES := bench/$(1).c
$(1)_LIBS := $(bench_LIBS)
$(1)_DEPEND := $(bench_DEPEND)
$(call make_bin,$(1),bench)
endef

$(foreach bench,$(bench_BIN),$(eval $(call make_bench,$(bench))))

19 20 21 22
# Targets
.PHONY: bench bench-clean
bench-clean: $(foreach bench,$(bench_BIN),$(bench)-clean)
bench: $(foreach bench,$(bench_BIN),bench/$(bench))
23
	@echo "Test LRU with increasing overfill, misses should increase ~ linearly" >&2
24 25 26 27 28
	$(preload_syms) ./bench/bench_lru 23 bench/bench_lru_set1.tsv - 65536 # fill ~ 1
	$(preload_syms) ./bench/bench_lru 23 bench/bench_lru_set1.tsv - 32768 # fill ~ 2
	$(preload_syms) ./bench/bench_lru 23 bench/bench_lru_set1.tsv - 16384 # fill ~ 4
	$(preload_syms) ./bench/bench_lru 23 bench/bench_lru_set1.tsv - 8192  # fill ~ 8
	$(preload_syms) ./bench/bench_lru 23 bench/bench_lru_set1.tsv - 4096  # fill ~ 16