1
0
mirror of https://github.com/henrydcase/nobs.git synced 2024-11-22 23:28:57 +00:00

makefile: tools for profiling

This commit is contained in:
Henry Case 2018-10-25 15:52:49 +01:00
parent 4e26b56002
commit 9d0050cbee

View File

@ -16,6 +16,10 @@ ifeq ($(NOASM),1)
OPTS+=$(OPTS_TAGS)
endif
ifeq ($(PPROF),1)
BENCH_OPTS+= -cpuprofile=cpu.out -memprofile=mem0.out
endif
TARGETS= \
dh \
drbg \
@ -41,7 +45,7 @@ cover:
bench: clean $(addprefix prep-,$(TARGETS))
cd $(GOPATH_LOCAL); GOCACHE=$(GOCACHE) GOPATH=$(GOPATH_LOCAL) $(GO) test \
$(BENCH_OPTS) ./...
$(BENCH_OPTS) $(TEST_PATH)
clean:
rm -rf $(GOPATH_LOCAL)
@ -51,3 +55,9 @@ vendor-sidh-for-tls: clean
mkdir -p $(VENDOR_DIR)/github_com/henrydcase/nobs/
rsync -a . $(VENDOR_DIR)/github_com/henrydcase/nobs/ --exclude=$(VENDOR_DIR) --exclude=.git --exclude=.travis.yml --exclude=README.md
find $(VENDOR_DIR) -type f -print0 -name "*.go" | xargs -0 sed -i 's/github\.com/github_com/g'
pprof-cpu:
$(GO) tool pprof $(GOPATH_LOCAL)/cpu.out
pprof-mem:
$(GO) tool pprof $(GOPATH_LOCAL)/mem0.out