Repository navigation
Record and analyze Android benchmark runs under Perfetto in one command - #37
Merged
Merged
Conversation
Android drops app trace sections from release apps that are neither debuggable nor profileable, so Perfetto saw none of the library's slices in an optimized build.
scripts/android_perf.py builds the dev app as release, runs its benchmark turn while the phone records a Perfetto trace, and writes the trace, logcat and benchmark_report summary to output/android-perf. scripts/perfetto_analysis.py then reads the trace with trace_processor: render thread slices, submit pacing, thread states per CPU cluster, clocks, memory and world load, over the benchmark slice's window.
The skill runs the two scripts and says how to read each signal for the Vulkan renderer. .claude/skills/ is now tracked while the rest of .claude/ stays local.
Xget7
added this pull request to stack #38
October 20, 2026 04:17
Xget7
marked this pull request as ready for review
October 20, 2026 04:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One command records a release benchmark run under Perfetto on a phone and summarizes it, and an agent skill says how to read and compare runs.
Evidence
Physical Xiaomi Mi 9 (Adreno 640, Vulkan 1.1.128, Android 11), release build,
--seconds 20.After:
python3 scripts/android_perf.py --seconds 20ends with:The run is GPU-bound (21.8 ms against a 16.7 ms budget), so pacing alternates between one and two display periods.
<pre-initialized>because Perfetto read its/procentry before the zygote rename, and matching by package name found nothing.The analysis now matches the pid the recorder passes, and an earlier trace still analyzes identically by name.
python3 -m unittest discover -s scripts/tests: 45 tests pass, including the new config, launch, percentile, cluster, pacing and breakdown tests.Merge Danger
Door: two-way
Blast Radius: tooling
The library is unchanged; the dev app's release build becomes profileable from a shell, which the dev app never ships.
The
.gitignorechange starts tracking.claude/skills/, while the rest of.claude/stays ignored.The first analysis downloads trace_processor through the pinned perfetto package.