X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Ftools%2FMakefile;h=4dc5ceb0527f75febb027aebb70e26f45738db77;hp=7c459353a681e6bd1666c533a3977c71af17112a;hb=9cbb97f3ac06d717afe4ced2c4f624078bb88396;hpb=6d35d746f123291ba93a592997dcd5b6fe7828cf;ds=sidebyside diff --git a/ccan/tdb/tools/Makefile b/ccan/tdb/tools/Makefile index 7c459353..4dc5ceb0 100644 --- a/ccan/tdb/tools/Makefile +++ b/ccan/tdb/tools/Makefile @@ -1,8 +1,33 @@ -LDLIBS:=-lccan -CFLAGS:=-I../../.. -Wall -g -pg -O3 +LDLIBS:=../../tdb.o ../../hash.o +CFLAGS:=-I../../.. -Wall -O3 #-g -pg LDFLAGS:=-L../../.. -default: replay_trace tdbtorture +default: replay_trace tdbtorture tdbdump tdbtool starvation mktdb + +benchmark: replay_trace + @trap "rm -f /tmp/trace.$$$$" 0; for f in benchmarks/*.rz; do if runzip -k $$f -o /tmp/trace.$$$$ && echo -n "$$f": && ./replay_trace --quiet -n 5 replay.tdb /tmp/trace.$$$$ && rm /tmp/trace.$$$$; then rm -f /tmp/trace.$$$$; else exit 1; fi; done + +REPLAY_LIBS=$(LDLIBS) ../../str_talloc.o ../../grab_file.o ../../talloc.o ../../noerr.o +replay_trace: replay_trace.c keywords.c $(REPLAY_LIBS) + $(LINK.c) $< $(LOADLIBES) $(REPLAY_LIBS) -o $@ + +keywords.c: keywords.gperf + gperf $< > $@ + +check: replay_trace + @rm -f *.reduced_trace + @set -e; for f in tests/*.trace.tar.bz2; do \ + tar xvfj $$f; \ + ./replay_trace replay.tdb *.reduced_trace; \ + rm -f *.reduced_trace; \ + done + +# Usage: make mytest.trace.tar.bz2 TRACEFILES=*.trace +%.trace.tar.bz2: $(patsubst %.trace,%.reduced_trace,$(wildcard $(TRACEFILES))) + tar cvfj $@ $^ + +%.reduced_trace: %.trace + @sed 's/\(^[0-9]* traverse\) .*/\1fn/' < $^ > $@ clean: - rm -f replay_trace tdbtorture *.o + rm -f replay_trace tdbtorture tdbdump tdbtool *.o