11 Commits
Author SHA1 Message Date
Sandiv Dathunarachchi d1499c8abd tools: run the selected local trace engine by filename 2026-11-07 11:47:58 +11:00
xbsheng 97dd9fb0e6 tools: trace_report.py judges its --engine path before Perfetto starts
tools/trace.md hands out --engine PATH to a reader who downloaded
trace_processor_shell themselves, and nothing read the path: an empty value, a
typo, a folder or a file without its execute bit went into
TraceProcessor(trace=..., config=...), the first thing that starts the engine.
Perfetto answers the first three with a bare Exception('Path to binary is not
valid (<path>)') and the fourth with PermissionError out of subprocess - each a
traceback, exit 1 (the status a run that read a trace and failed returns), and
a message naming neither --engine nor tools/trace.md.

opener() now judges the path first, so flamechart.py (which opens its traces
with the same opener) answers the same way: exit 2, the path named, and the two
ways out (download one, or leave --engine out). A path that is a runnable file
still reaches Perfetto, and no --engine still means download one.
2026-10-29 21:58:20 +08:00
Sandiv Dathunarachchi bb7ea5db3a tools: use nearest-rank P90 in trace_report.py 2026-10-28 18:01:39 +11:00
Sandiv Dathunarachchi 55e68a47ab tools: handle non-object sidecars in trace_report.py 2026-10-27 13:04:43 +11:00
SlivenRed a4cd87bcd8 tools: leave incomplete trace durations unavailable 2026-10-23 11:22:26 +08:00
Gathin23 8f23bcdece Merge PR #953: tools: keep unavailable FrameTimeline metrics out of reports
Conflict on merge: the FrameTimeline guard from this PR wraps the missed-deadline count, and the function keeps returning (out, anchor, end) as #951's flame chart needs.
2026-10-22 21:31:32 +05:30
Gathin23 622fcbf936 Merge PR #955: tools: reject incompatible trace scenarios in reports 2026-10-22 21:31:00 +05:30
SlivenRed 1c89073a97 tools: reject incompatible trace scenarios in reports 2026-10-22 21:02:11 +08:00
SlivenRed 30f34b9937 tools: keep unavailable FrameTimeline metrics out of reports 2026-10-22 20:56:24 +08:00
simandClaude Opus 5.5 21282c6f96 tools: flamechart.py, a before/after flame chart from tools/trace.py traces
The second of the performance tools proposed in #564: a PNG for a pull request that shows where a
change's time went.

- One panel per trace, one lane per thread, every slice on the same time scale, so the faster run is
  visibly shorter. Slices matching --highlight are magenta and totalled, a match's children once,
  with the change against the first panel.
- A folder draws its median run (by time to the first frame, or the median frame time for nav), not
  its best, and the panel says which run it is.
- --window first-frame (start to first frame drawn), start:MS, or all; --threads picks the lanes.
- It reuses trace_report.py's queries: start_window() now returns the start and first-frame times
  the report already worked out.
- Pillow joins perfetto in the optional tools/requirements-perf.txt. Drawing uses Pillow's own font,
  so it renders the same on any system.
- tools/flamechart.md says how to draw the two charts a Home change usually needs, and how to read
  one honestly.

Tests run without the query engine and, apart from the one drawing test, without Pillow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 22:44:15 +10:00
simandClaude Opus 5.5 eec8a918c3 tools: trace.py and trace_report.py, Perfetto traces of the launcher and the numbers from them
The first of the performance tools proposed in #564. tools/bench.py gives the headline numbers;
these show where the launcher's time goes:

- trace.py records a Perfetto trace on the TV around a scenario (home, cold, coldsys, nav, or your
  own setup and steps). Setup runs before the recording starts, so it stays out of the trace. A
  force-stop's accessibility helpers are put back after the last run with bench.py's own helpers.
  Recording needs nothing beyond tools/requirements.txt.
- trace_report.py reports each run, the median and range, and with --vs the change in each median:
  start to first frame drawn and the lifecycle steps inside it, frames and missed deadlines after
  it, and for nav the frame and GPU times. --markdown prints tables for a pull request; a run over
  twice the median is starred.
- tools/requirements-perf.txt holds the one optional dependency, perfetto. tools/requirements.txt is
  unchanged, and nothing under launcher/ changes.
- tools/trace.md is the guide: when to use which tool, the one download and how to avoid it, the
  scenarios, and what can mislead.

The tests run offline. trace_report's SQL is plain SQLite, so it runs against an in-memory table
laid out like a trace; the one test that needs the real query engine skips unless it is installed
and CLEANYOURTV_TRACE names a trace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:51:44 +10:00