summaryrefslogtreecommitdiff
path: root/tools/check_budgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/check_budgets.py')
-rw-r--r--tools/check_budgets.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/check_budgets.py b/tools/check_budgets.py
index 8b55a2b..8219a6d 100644
--- a/tools/check_budgets.py
+++ b/tools/check_budgets.py
@@ -7,6 +7,8 @@ Two kinds of lines are read from build/diag/<device>.log:
DIAG first_frame startup_ms=1 mem_used=6984 mem_total=781888
printed by the debug build (source/util/Diag.mc) after its first frame;
+ DIAG glance mem_used=12552 mem_total=65536
+ printed by the glance after its first draw (the simulator starts there);
HARNESS first_frame wall_ms=2310
added by app-diag.sh: wall-clock time from launching the app with
monkeydo until that DIAG line appeared, which includes loading the
@@ -52,7 +54,11 @@ def measure(kind: str, events: dict[str, dict[str, float]]) -> dict[str, float]:
values["first_frame_wall_ms"] = harness["wall_ms"]
return values
total = frame["mem_total"]
- return {"mem_used_fraction": frame["mem_used"] / total if total else 1.0}
+ values = {"mem_used_fraction": frame["mem_used"] / total if total else 1.0}
+ glance = events.get("DIAG.glance")
+ if glance is not None:
+ values["glance_mem_used_fraction"] = glance["mem_used"] / glance["mem_total"] if glance["mem_total"] else 1.0
+ return values
def main(argv: list[str] | None = None) -> int: