From 3f173d0b6c85ce5fffdcbe3da3b01eef8192033e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 29 Sep 2019 15:31:28 +0200 Subject: 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 --- src/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Makefile') 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 $@ $< -- cgit v1.2.3