From 9d056ff64bf887e2c3479fe515bf7c95cb39e5b6 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 11 Aug 2019 22:28:38 +0200 Subject: Rework exec chain Originally the structure of the executed cmd was {measure cmd} {allocator cmd prefix} {cmd} with the parent environment except LD_PRELOAD was modified for the whole command chain. Unfortunatly perf causes segfaults with some allocators and measuring allocators cmd prefixes doesnt seem fair. So the new cmd chain looks like: {allocator cmd prefix} {measure cmd} run_cmd {cmd} without touching the environment in python. run_cmd sets LD_PRELOAD to the value it received in argv[1] and executes argv[2] with the rest of argv. This does also measure code not part of the actual benchmark but in a equal manner and not only for some allocators. --- src/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 47d0dd4..8a5e0a4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,7 +15,7 @@ MEMSIZE=$(shell echo $(MEMSIZE_KB)"* 1024" | bc) .PHONY: all clean -all: $(OBJDIR)/print_status_on_exit.so $(OBJDIR)/allocators/bumpptr_alloc.so +all: $(OBJDIR)/print_status_on_exit.so $(OBJDIR)/allocators/bumpptr_alloc.so $(OBJDIR)/run_cmd $(OBJDIR)/allocators/bumpptr_alloc.so: bumpptr_alloc.c Makefile | $(OBJDIR)/allocators @echo "Compiling $@..."; @@ -26,6 +26,10 @@ $(OBJDIR)/print_status_on_exit.so: print_status_on_exit.c Makefile | $(OBJDIR) @echo "Compiling $@..."; $(CC) $(LDFLAGS) -shared $(CFLAGS) -o $@ $< +$(OBJDIR)/run_cmd: run_cmd.c Makefile | $(OBJDIR) + @echo "Compiling $@..."; + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< + $(OBJDIR)/allocators: mkdir -p $@ -- cgit v1.2.3