diff --git a/Makefile b/Makefile index 6f69a82..6f2454a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,16 @@ .PHONY: shaders-vulkan shaders-d3d12 shaders-metal shaders-all bake toad hello_sprite crowd camera_sandbox clips check test help +.PHONY: flame flame-build flame-record flame-svg flame-report flame-tools + +# Flamegraph profiling (needs: pacman -S perf). Example: make flame or make flame FLAME_EXAMPLE=toad +FLAME_EXAMPLE ?= crowd +FLAME_BIN := $(FLAME_EXAMPLE)_perf +FLAMEGRAPH_DIR ?= tools/FlameGraph +FLAME_OUT_DIR ?= flame +# One stamp per `make` invocation so svg/jpg/report share a name. +ifndef FLAME_STAMP +FLAME_STAMP := $(shell date +%Y%m%d-%H%M%S) +endif +FLAME_PREFIX := $(FLAME_OUT_DIR)/$(FLAME_EXAMPLE)-$(FLAME_STAMP) help: @echo "Targets:" @@ -14,6 +26,11 @@ help: @echo " crowd Many sprites, one Character_Data" @echo " camera_sandbox Pan camera / Space toggles follow" @echo " clips Keys 1/2 switch idle/walk" + @echo " flame Build+record+SVG+JPG+text report (FLAME_EXAMPLE=$(FLAME_EXAMPLE))" + @echo " flame-build Optimized debug binary ($(FLAME_BIN))" + @echo " flame-record perf record (play, then quit)" + @echo " flame-svg Convert perf.data -> $(FLAME_PREFIX).svg/.jpg" + @echo " flame-report Convert perf.data -> $(FLAME_PREFIX)-report.txt" bake: ./scripts/bake_all.sh @@ -31,6 +48,7 @@ shaders-all: shaders-vulkan shaders-d3d12 shaders-metal test: odin test engine + odin test assetbake check: odin check examples/toad -collection:pkg=. @@ -53,8 +71,6 @@ camera_sandbox: clips: odin run examples/clips -collection:pkg=. -<<<<<<< Updated upstream -======= flame-tools: @if [ ! -x "$(FLAMEGRAPH_DIR)/stackcollapse-perf.pl" ] || [ ! -x "$(FLAMEGRAPH_DIR)/flamegraph.pl" ]; then \ @@ -85,4 +101,3 @@ flame-report: flame: flame-record flame-svg flame-report @echo "Artifacts: $(FLAME_PREFIX).{svg,jpg} $(FLAME_PREFIX)-report.txt" ->>>>>>> Stashed changes diff --git a/crowd_perf b/crowd_perf index 3692de7..2e0533e 100755 Binary files a/crowd_perf and b/crowd_perf differ