Repository navigation
v0.8.0
-
Releases: GitHub Actions CI (Windows + Ubuntu: format check, build with warnings as errors, tests) and a tag-triggered
release workflow publishingperfetto-mcp-<version>-win-x64.zipandperfetto-mcp-<version>-linux-x64.tar.gz. -
scripts/install.ps1/scripts/install.shwithout a source download and install the latest release (-Version/
--versionfor a specific one;GITHUB_TOKENfor a private repository); local archives and publish directories still work. -
Repository layout for publishing:
docs/,tests/e2e/(stdio smoke and hot-update scripts),scripts/build-tp.sh,
tools/README.md(provenance and checksums of the bundled trace_processor_shell), Apache-2.0 license, README in
English and Chinese. -
Review fixes (docs/04, fourth round):
record_trace/record_boot/unload_tracealso hold back default-trace calls;
the supervisor retries a crash restart whose new worker died at startup; the logcat bundle is reused only for the
same files and built only when loaded; the host logcat stream never throws in cleanup and leaves the adb server
alone;process_cpu_pctresolves owners once per thread;process_churn/important_killspre-filter
android_logsonce;supervisor.logrotates while running; the user-build logcat hint names the right format. -
Build:
AnalysisLevel=latest-recommendedandEnforceCodeStyleInBuild(0 warnings). Code comments trimmed. -
Fix: a tool called without
trace_idin the same batch as aload_tracecould resolve the default trace before the
load registered it and silently query the previous trace (requests are dispatched concurrently). The transport now
notes arrival order; such calls wait for every earlierload_traceto finish. -
record_trace: on user builds (android.log gets nothing: SELinux denies traced_probes the logdr socket)adb logcat
runs on the host during the recording and is merged into<trace>+logcat.zip, which is loaded (logcat
auto / on / off).config_texttakes an inline TraceConfig, so the caller can compose the data sources. -
load_tracelogcat: merge a logcat text file (-v threadtime -v year) into a trace's timeline. -
New tool
profile_threads: simpleperf call-stack sampling of chosen threads on the device (process / comm prefix /
kernel thread / tid), self and inclusive hot functions and samples per thread; sets and restores kptr_restrict. -
load_traceoverview: a hint when the config asked forandroid.logbut no logcat line arrived (user builds deliver
nothing; log-derived sections are then empty).dex_reverifyalso lists a single runtime verify >= 200 ms of a platform
dex (an APEX app still run-from-apk before its first background dexopt). -
load_traceoverview:process_churn(apps started >= 3 times, average life, kills by lmkd / am_kill / UniStab) with a
kill / restart loop hint and restart sources (am_proc_starttype "restart", UNIPNPrestart by unipnp);dex_reverify(platform dex verified >= 3 times, i.e. opened through a private class loader);
app_compactions(CachedAppOptimizeram_compactper process with the app's own GC time, hint for >= 2 s);
noisy_log_tags(lines/s per tag and level, Unisoc[Ttid@Ccpu]kernel prefixes folded, hint for >= 50 lines/s).
vsync_consumers(app main threads woken by SurfaceFlinger's vsync thread vs RenderThread runs; hint for >= 20/s
with little drawing: an animation running in a stopped activity or with the screen off).
important_kills(apps that died at oom_adj 100-899 with the killer: lmkd, UniStab or am_kill; hint up to the
previous app, adj 700). -
io_summary: blocked-function familyworkqueue_wait(__flush_work/flush_workqueue, e.g. eswap read-back). -
Capture config
scenarioalso records the kernel log (LID_KERNEL): driver log floods show up innoisy_log_tags. -
Fix (supervisor): a failed hot swap left the new worker running; one long-running supervisor leaked one worker per
1.5 s poll (184 processes) becauseJsonValue<T>'s type initializer had failed once in that process and every
JsonValue.CreatethrewTypeInitializationException. Supervisor JSON-RPC messages are now built as text; a failed
worker is killed, the version is not retried for a minute, a worker dying during startup no longer triggers a crash
restart, polling survives exceptions, and non-JSON worker stdout is dropped. The supervisor log is mirrored to
state/supervisor.log(Claude Code keeps only a server's startup stderr). Needs a/mcpreconnect. -
boot_timeline:slow_init_commands(initCommand '...' took N mslines >= 500 ms, with trigger and rc source)
and a hint for >= 2 s (e.g.swapon_allbuilding a 12 GB swap file: 29.4 s). Matches the number, as long kernel lines are cut ("29449m"). -
Fix:
sf_composition.gpu_pctcounts client composition bydrawLayerson SurfaceFlinger's main thread; RenderEngine
renders for region sampling (nav-bar luma) are reported separately asregion_sampling_renders(a camera trace
read 124 % before). -
compare_traces:process_cpu_pctverdicts use a 0.1 percentage-point floor (idle processes are far below 1 % of a CPU). -
Built-in capture config
idle(record_trace config=idle) for standby / power: sched, wakeups, frequency, idle,
suspend, wakeup sources and IRQs; process list once, memory counters every 5 s, logcat >= I in its own buffer.
Capture CPU in a 30 s screen-off trace drops 60-77 % vsscenario. The overview's capture-overhead hint points to it. -
compare_traceswithoutprocess_name:system.cpu_pct/system.sched_slices_per_s(normalized by the window) and
process_cpu_pct, the processes behind the CPU difference (two devices or traces of different length compare). -
Fix:
record_tracewaited for perfetto with a device-sidesleep 1loop that forked a process every second
(~57 ms CPU each on ums9230, 5.7 % of a CPU, a third of a screen-off idle trace). It now waits on the host while
recording and polls the device only for the final flush.record_bootwaits on the host for the boot trace's
planned end (perfetto start time + duration) and polls boot_completed every 3 s instead of every second. -
load_traceoverview:sf_composition(frames composited, GPU / client-composed share, RenderEngine ms) with a hint
when >= 30% of >= 100 frames are GPU-composed. -
load_traceoverview:nameless_processes+ hint when >= 20 processes that ran have no name (start-of-trace process
scan lost, e.g. a log burst wrapped the ring buffer holding it); the missing_services hint no longer starts with an
empty process name. -
Capture configs (
scenario,boot): logcat gets its own 32 MB buffer so a log burst cannot overwrite the process
scan.capture_camera_ops.sh: the Capture tab is at x=228 once Video is selected (360 left the app in Slow motion). -
Fix (review):
event_latencynumbers anchors by (ts, label) so ties are stable and windows never collapse to 0,
leavesdone_msnull for slices still open at trace end, and resolves shadow processes beforetarget_process;
thread_churn.unnameduses task_rename'spidarg (the renamed thread, not the renaming one). -
smoke_calls_v07.jsoncoversevent_latencyand the startup rule (third trace: settings_cold); passed on Ubuntu 18.04. -
android_startups: info findingREPORT_FULLY_DRAWN_EARLYwhen the app calls reportFullyDrawn() before its first frame
(the stdlib then clamps TTFD to TTID, so TTFD == TTID hides that the metric measures nothing). -
event_latency: the summary is split byanchor_kind(anchor label with numbers normalized) when the anchors
differ, e.g. app launches vs going home, shutter vs camera switch. -
event_latency:done_ms(when the target slice ended, e.g. panel on = end ofsetPowerMode(ON)) per hit and
done min / avg / max in the summary. -
New tool
event_latency: trigger -> response latency. Anchors are logcat lines containinganchor_log(optionally
oneanchor_tag) or slices matchinganchor_slice; for each anchor the first slice matching everytarget_globs
entry before the next anchor (maxwindow_ms) is reported with process / thread, plus per-target hits and
min / avg / max.anchor_sourcesshows which tags matched (adbd logs the shell commands it runs).