From b856f645a2f58a3e224976167b4b1fb030d7967b Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 11 Jul 2016 20:50:34 -0400 Subject: Update to new binary file-based trace file. In order to not lose records, or need to guess ahead of time how many records you need, this switches to a mmap'd file for the trace buffer, and grows it as needed. The trace2dat perl script is replaced with a trace2wl C++ program that runs a lot faster and can handle the binary format. --- malloc/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'malloc/Makefile') diff --git a/malloc/Makefile b/malloc/Makefile index 30248e47da..4146c2a9b4 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -50,13 +50,22 @@ libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes)) libmtracectl-routines = mtrace-ctl libmtracectl-inhibit-o = $(filter-out .os,$(object-suffixes)) -others: $(objpfx)trace_run -install-bin = trace_run -install-bin-script = trace2dat +others: $(objpfx)trace_run $(objpfx)trace2wl +install-bin = trace_run trace2wl $(objpfx)trace_run: $(objpfx)trace_run.o $(LINK.o) -o $@ $(objpfx)trace_run.o -lpthread +ifeq (${CXX},) +CXX = g++ +endif + +$(objpfx)trace2wl: $(objpfx)trace2wl.o + $(CXX) -g -std=gnu++11 -o $@ $(objpfx)trace2wl.o + +$(objpfx)trace2wl.o: trace2wl.cc + $(CXX) $(CXXFLAGS) -g -o $@ -c $< $(compile-mkdep-flags) -std=gnu++11 + $(objpfx)tst-malloc-backtrace: $(shared-thread-library) $(objpfx)tst-malloc-thread-exit: $(shared-thread-library) $(objpfx)tst-malloc-thread-fail: $(shared-thread-library) @@ -154,9 +163,6 @@ tst-malloc-usable-ENV = MALLOC_CHECK_=3 sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,') -$(objpfx)trace2dat: trace2dat - cp $^ $@ && chmod +x $@ - $(objpfx)mtrace: mtrace.pl rm -f $@.new sed -e 's|@PERL@|$(PERL)|' -e 's|@XXX@|$(address-width)|' \ -- cgit v1.2.3