-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (22 loc) · 906 Bytes
/
Makefile
File metadata and controls
28 lines (22 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
DOCKER_IMAGE := mro-app
SHORT_COMMIT ?= $(shell git rev-parse --short=5 HEAD)
TIMESTAMP=$(shell date +%s)
all-docker: build-docker run-docker analyze-capture
build-docker: ## Build docker image
@echo "==> Build docker image"
@docker build . -t $(DOCKER_IMAGE):$(SHORT_COMMIT) --file Dockerfile
run-docker:
@echo "==> Run docker image"
@rm -fr tmp
@mkdir -p tmp
@docker run -v ./tmp:/tmp $(DOCKER_IMAGE):$(SHORT_COMMIT)
analyze-capture:
@mkdir -p results/$(TIMESTAMP)
@memray flamegraph ./tmp/capture.bin -o ./results/$(TIMESTAMP)/capture.html
@memray transform --leaks gprof2dot ./tmp/capture.bin -o ./results/$(TIMESTAMP)/memray-gprof2dot-capture.json
@gprof2dot -f json ./results/$(TIMESTAMP)/memray-gprof2dot-capture.json | dot -Tpng -o ./results/$(TIMESTAMP)/capture.png
all: run analyze-capture
run:
@rm -fr tmp
@mkdir -p tmp
@memray run --native --output ./tmp/capture.bin main.py