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"