Repository navigation
Releases
v0.9.1
- Skill: playbooks for SurfaceFlinger-side jank (GPU composition vs the HWC's view), boot critical path and boot A/B,
early-boot HAL CPU, same-scenario A/B with runtime switches and side effects; pitfalls for idle present gaps at the
end of animations, mixed refresh rates, exited threads' CPU, andspeedwithout an app image starting slower than
verify.
v0.9.0
- Fix:
visible_jank(android_jank_frames,compare_traces) counted pure Buffer Stuffing frames, which Android 16
marks Late Present (631 instead of 74 visible of 934 SystemUI frames). It now also skips dropped buffers superseded
by a newer buffer of the same layer in the same display frame (new columnsdropped,dropped_superseded). android_jank_frames: present cadence of the main layer (stallsover 1.5 vsync,max_gap_ms,stall_ms),
vsync_ms/refresh_hzandvisible_jank_per_s;segment_by_log_tag/end_marker/merge_repeatsfor one row
per log-marked operation;group_by=layer;worst_visible_causeslists each frame token once with its layers and
the token's UI-thread (ui_ms) and RenderThread (rt_ms) time.compare_traces: several runs per side (traces_a/traces_b: medians, per-run values,separated),
align=marker(marker_tag,end_marker: window = the log-marked span,segmentsper operation), frame metrics
frames.visible_jank(_per_s),frames.stalls,frames.stall_ms,frames.max_gap_ms,frames.vsync_msand a warning
when the refresh rates differ.execute_sql trace_ids=[...]: the same query on several loaded traces, one result per trace.- Built-in capture configs (
scenario,idle,boot) recordlinux.system_info: cpu capacity / cluster ids.
cpu_top_threads split_by=cluster: CPU time per core cluster (from capacity, else cluster id, else peak frequency). android_logs summary=true: log volume per tag / process and repeated W / E / F lines grouped by pattern (numbers,
hex, hashes folded; Google apps apart). Overview:repeated_warnings,jit_activity(JIT compilations per process,
hint when a process runs without AOT code) and composite avg / p50 / p90 / p99 insf_composition(also matches the
pre-Android-16compositeslice name).server_statsreports the trace_processor_shell in use; the Linux installer links<prefix>/trace_processor_shell.record_trace:drive_script/drive_commandrun on the devicedrive_delay_s(default 2) after tracing starts
and are killed with their children at the trace end (output tail indrive);repeat/repeat_gap_srecord
several runs back to back and load them all.- New tool
syscall_stats(system-call count / rate / time, failed calls and the most common errno per thread,
process or syscall) and built-in capture configsyscalls(raw_syscalls enter / exit + sched). - Trace processors unused for 30 min are stopped (
PERFETTO_IDLE_UNLOAD_MIN, 0 = never); the trace reloads on next
use.execute_sqlnames the common traps (Buffer Stuffing, TTID table, vsync ids in SurfaceFlinger slice names).
v0.8.1
- Fix:
android_gcrunning / runnable / D-state times were 0 when the GC thread was split into a shadow utid (the
stdlib reads only the GC slice's utid); they are now summed over every utid of the thread. - Claude Code skill
perfetto-analysis(skills/): per-scenario playbooks, capture guidance and data pitfalls. Shipped in
the release archives; the installers install it with-AutoConfig/--auto-configor-Skill/--skill. - Server instructions cut to ~1.8 KB (Claude Code shows only the first 4096 characters): workflow and rules; the per-tool
list is already intools/listand the playbooks moved to the skill.
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).