From 006c8c4a34827bcbd89db1c1f7568670ed701bf4 Mon Sep 17 00:00:00 2001 From: 4DBug Date: Fri, 23 Oct 2026 22:32:53 -0500 Subject: [PATCH] tools/test: prof.py finds run.py's linemap in $TMPDIR (tempfile.mkdtemp), not only /tmp --- tools/test/prof.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/test/prof.py b/tools/test/prof.py index c8bdf19..0ab0708 100644 --- a/tools/test/prof.py +++ b/tools/test/prof.py @@ -2,7 +2,8 @@ # Summarise profile.out from `run.py --profile`: top functions by self and inclusive samples, mapped to source file lines import collections, json, os, re, sys, glob path = sys.argv[1] if len(sys.argv) > 1 else "profile.out" -tmp = max(glob.glob("/tmp/imgui_test_*/ImGui.linemap.json"), key=os.path.getmtime) +import tempfile # run.py uses tempfile.mkdtemp, i.e. $TMPDIR (not always /tmp) +tmp = max(glob.glob(os.path.join(tempfile.gettempdir(), "imgui_test_*/ImGui.linemap.json")) + glob.glob("/tmp/imgui_test_*/ImGui.linemap.json"), key=os.path.getmtime) lm = json.load(open(tmp)) def loc(n): if not n.isdigit(): return "C"