summaryrefslogtreecommitdiff
path: root/benchtests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/Makefile')
-rw-r--r--benchtests/Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/benchtests/Makefile b/benchtests/Makefile
index fd3036db93..78fd48f14a 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -44,8 +44,11 @@ benchset := $(string-bench-all) $(stdlib-bench)
CFLAGS-bench-ffs.c += -fno-builtin
CFLAGS-bench-ffsll.c += -fno-builtin
+bench-malloc := malloc-thread
+
$(addprefix $(objpfx)bench-,$(bench-math)): $(libm)
$(addprefix $(objpfx)bench-,$(bench-pthread)): $(shared-thread-library)
+$(objpfx)bench-malloc-thread: $(shared-thread-library)
@@ -60,6 +63,7 @@ include ../Rules
binaries-bench := $(addprefix $(objpfx)bench-,$(bench))
binaries-benchset := $(addprefix $(objpfx)bench-,$(benchset))
+binaries-bench-malloc := $(addprefix $(objpfx)bench-,$(bench-malloc))
# The default duration: 10 seconds.
ifndef BENCH_DURATION
@@ -82,7 +86,8 @@ endif
# This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
# for all these modules.
-cpp-srcs-left := $(binaries-benchset:=.c) $(binaries-bench:=.c)
+cpp-srcs-left := $(binaries-benchset:=.c) $(binaries-bench:=.c) \
+ $(binaries-bench-malloc:=.c)
lib := nonlib
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
@@ -99,9 +104,10 @@ timing-type := $(objpfx)bench-timing-type
bench-clean:
rm -f $(binaries-bench) $(addsuffix .o,$(binaries-bench))
rm -f $(binaries-benchset) $(addsuffix .o,$(binaries-benchset))
+ rm -f $(binaries-bench-malloc) $(addsuffix .o,$(binaries-bench-malloc))
rm -f $(timing-type) $(addsuffix .o,$(timing-type))
-bench: $(timing-type) bench-set bench-func
+bench: $(timing-type) bench-set bench-func bench-malloc
bench-set: $(binaries-benchset)
for run in $^; do \
@@ -109,6 +115,13 @@ bench-set: $(binaries-benchset)
$(run-bench) > $${run}.out; \
done
+bench-malloc: $(binaries-bench-malloc)
+ run=$(objpfx)bench-malloc-thread; \
+ for thr in 1 8 16 32; do \
+ echo "Running $${run} $${thr}"; \
+ $(run-bench) $${thr} > $${run}-$${thr}.out; \
+ done
+
# Build and execute the benchmark functions. This target generates JSON
# formatted bench.out. Each of the programs produce independent JSON output,
# so one could even execute them individually and process it using any JSON
@@ -134,7 +147,8 @@ bench-func: $(binaries-bench)
scripts/validate_benchout.py $(objpfx)bench.out \
scripts/benchout.schema.json
-$(timing-type) $(binaries-bench) $(binaries-benchset): %: %.o $(objpfx)json-lib.o \
+$(timing-type) $(binaries-bench) $(binaries-benchset) \
+ $(binaries-bench-malloc): %: %.o $(objpfx)json-lib.o \
$(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
$(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
$(+link)