aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-09-29 15:31:28 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-09-29 15:35:53 +0200
commit3f173d0b6c85ce5fffdcbe3da3b01eef8192033e (patch)
tree0c57769fd4b584b260b31af5d79cb5c5c8eed734 /src/Makefile
parent059d263a6b944c4cfc5a5a0f2716e6a85116cfc1 (diff)
downloadallocbench-3f173d0b6c85ce5fffdcbe3da3b01eef8192033e.tar.gz
allocbench-3f173d0b6c85ce5fffdcbe3da3b01eef8192033e.zip
catch if cmd aborts
perf stat does not propagate if the measured cmd aborts. To solve thing in a universal way we register a SIGABRT handler which creates the file aborted
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index 2d94a9f..b0584b1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -13,7 +13,7 @@ LDFLAGS ?= -pthread -static-libgcc
MEMSIZE_KB=$(shell free -t | tail -1 | tr -s ' ' | cut -d ' ' -f 2)
MEMSIZE=$(shell echo $(MEMSIZE_KB)"* 1024" | bc)
-TOOLS = print_status_on_exit.so exec
+TOOLS = print_status_on_exit.so exec abort_handler.so
ALLOCS = chattymalloc.so bumpptr_alloc.so speedymalloc.so
TARGETS = $(addprefix $(OBJDIR)/allocators/,$(ALLOCS)) $(addprefix $(OBJDIR)/,$(TOOLS))
@@ -37,6 +37,10 @@ $(OBJDIR)/print_status_on_exit.so: print_status_on_exit.c Makefile
@if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
$(CC) $(LDFLAGS) -shared $(CFLAGS) -o $@ $<
+$(OBJDIR)/abort_handler.so: abort_handler.c Makefile
+ @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
+ $(CC) $(LDFLAGS) -shared $(CFLAGS) -o $@ $<
+
$(OBJDIR)/exec: exec.c Makefile
@if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<