perfetto-performance-analysis
Analyze Android, Linux, and Chromium Perfetto traces with local trace_processor_shell evidence. Use for startup, scrolling or jank, input latency, ANR, CPU scheduling, memory or GC, Binder or IO, GPU or SurfaceFlinger, power or thermal, rendering-pipeline identification, trace ca
Install
npx skills add https://github.com/Gracker/Perfetto-Skills/tree/main/skills/perfetto-performance-analysis
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install gracker-perfetto-skills@llmmart
git clone https://github.com/Gracker/Perfetto-Skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole gracker/perfetto-skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Perfetto Performance Analysis
License: AGPL-3.0-or-later. Source: Perfetto Skills.
Analyze traces from evidence instead of guessing from symptom names. Use the bundled scripts for deterministic queries and load only the references needed for the selected workflow.
Requirements
Use Python 3.11+, local filesystem and terminal access, and a checksum-verified
Perfetto trace_processor_shell. Run independently after installation; neither
SmartPerfetto nor an upstream Perfetto checkout is required.
Operating contract
- Resolve the Skill root as the directory containing this
SKILL.md. Convert script and reference paths to absolute paths before executing them; do not assume a client-specific environment variable exists. - Record every input trace path, SHA-256, requested process/thread, time range, and trace side before analysis.
- Run
scripts/perfetto_probe.pybefore domain queries. Treat unavailable tables, modules, tracks, or trace signals as limitations, not negative evidence. - Select one primary workflow below. Load its Markdown file directly, then follow its availability gate and evidence sequence.
- Execute a complete exported Skill through
scripts/perfetto_skill.py run, or one manifest query throughscripts/perfetto_query.py --query-id. Keep query source, parameters, trace identity, timestamps, durations, units, and returned row bounds with every saved result. - Before executing authored or modified SQL, run the SQL guardrail script. Resolve blocking findings and review advisories using the SQL guardrail contract.
- Separate observations, correlations, mechanisms, and verified root causes. Do not promote a hypothesis without evidence that supports the claimed process, thread, time window, and trace.
- For comparisons, analyze each trace independently before computing deltas. Never use a missing metric on one side as proof that the other side regressed.
- Emit the structure in
assets/report-schema.json. List missing evidence and unresolved alternatives underlimitations.
Read the evidence contract, then use identity rules, missing-data rules, and claim verification before writing conclusions.
Workflow routing
- Trace health, bounds, identity, and broad triage: trace overview
- Cold, warm, hot, and first-frame startup: startup
- Frame production, presentation, scrolling, and jank: scrolling
- Touch, click, input dispatch, response, and navigation: interaction
- ANR, Binder, locks, futex, and blocking chains: ANR and blocking
- CPU load, topology, frequency, idle, IRQ, and scheduler latency: CPU scheduling
- RSS, heap, GC, LMK, DMA-BUF, and allocation: memory
- GPU, SurfaceFlinger, fences, VRR, and frame composition: GPU rendering
- Rails, wakelocks, battery, thermal, and throttling: power and thermal
- Filesystem, block IO, network, modem, media, and WebView: IO, network, and media
- Compose, Flutter, React Native, games, and vendor signals: frameworks and games
- Rendering architecture detection and teaching: rendering pipeline
- Cross-domain event sequence reconstruction: scene reconstruction
- Two or more traces or saved result sets: trace comparison
Use the machine-readable workflow index when selecting or validating workflow IDs.
Runtime commands
List or run a deterministic portable Skill graph:
python3 <skill-root>/scripts/perfetto_skill.py list
python3 <skill-root>/scripts/perfetto_skill.py run /absolute/trace.pftrace \
--skill startup_analysis --param 'package="com.example"' \
--output-dir /absolute/output/run
Pass only the Skill's declared inputs through --param; the runner rejects
any other name before touching the trace. A Skill with a process identity gate
also accepts its identity aliases (package, process_name, ...): the gate
verifies the named process with the process_identity_resolver Skill and
rewrites the alias to the verified process.name. An unverified or ambiguous
target is refused with the reason (identity_blocked); pick an exact process
name from that Skill's candidates instead of retrying the same name. A
verified upid (or a pid with one UPID) runs the Skill on exactly that
process; a Skill whose SQL cannot run that way is refused with the Skills that
can.
Complete Skill runs and --query-id runs verify the selected processor's
commit, RPC API, platform, and SHA-256 against the release lock before
executing SQL. Inspect that
identity independently with:
python3 <skill-root>/scripts/perfetto_doctor.py
Use --allow-unsupported-processor only for an explicitly labeled canary; it
does not turn the result into verified evidence. A capability-gated query runs
only after an automatic probe for the same trace proves its required schema;
the gate result remains in the evidence sidecar. --allow-unverified is a
separate opt-in only for a query explicitly classified as unverified and never
bypasses a missing capability.
Probe a trace:
python3 <skill-root>/scripts/perfetto_probe.py /absolute/path/to/trace.pftrace \
--output /absolute/path/to/output/probe.json
Run a referenced SQL asset:
python3 <skill-root>/scripts/perfetto_query.py /absolute/path/to/trace.pftrace \
--sql-file <skill-root>/references/generated/sql/<query>.sql \
--format json --output /absolute/path/to/output/query.json
Bind SmartPerfetto DSL placeholders through the public wrapper instead of
editing SQL text. --param NAME=JSON safely binds scalar inputs and JSON
arrays (rendered as SQL literal lists for IN (...)),
--module android.example.module loads declared prerequisites, and
--result NAME=/path/prior.json exposes a non-empty saved row array as a
relation for a dependent step. Pipeline expressions such as
${prior_step.data[0].upid} select a scalar field from those rows. A
placeholder ${name|default} uses its default when name is omitted,
resolves to JSON null, or indexes past the rows of a saved result, so a
defaulted path to an empty prior step needs no --result:
python3 <skill-root>/scripts/perfetto_query.py /absolute/trace.pftrace \
--sql-file <skill-root>/references/generated/sql/<skill>/<step>.sql \
--module android.frames.timeline \
--param 'package="com.example"' --param start_ts=123 \
--result prior_step=/absolute/output/prior-step.json \
--output /absolute/output/current-step.json
The runtime rejects unresolved placeholders and caps trace-processor stdout and
stderr at 16 MiB by default. Lower the bound with --max-output-bytes; increase
it only for a reviewed, explicitly bounded query.
For comparison, first write one side-summary file per independently analyzed
trace using assets/comparison-input-schema.json, then run
scripts/perfetto_compare.py --side baseline=a.json --side candidate=b.json --baseline baseline.
If trace_processor_shell is unavailable, run
scripts/bootstrap_trace_processor.py or provide a locked executable through
--trace-processor or PERFETTO_TRACE_PROCESSOR.
Reference discovery
Generated references are numerous. Find a SmartPerfetto Skill, SQL step, table, or signal without loading the whole catalog:
rg -n "<skill-id|table|signal>" <skill-root>/references/generated
Load the directly linked result and its source provenance. Do not infer step semantics from a filename alone.
Compatibility
Require Python 3.11+, filesystem access, terminal execution, and a compatible
Perfetto trace_processor_shell. The portable instructions work in Codex,
Claude Code, OpenCode, and other clients that implement Agent Skills and expose
those capabilities. Cloud-only agents without local file or terminal access can
use the methodology references but cannot execute trace queries.
Files (perfetto-skills)
-
agents
-
openai.yaml 244 B
Loading…
-
-
assets
-
comparison-input-schema.json 1.9 KB
Loading… -
report-schema.json 3.2 KB
Loading…
-
-
references
-
evidence
-
claim-verification.md 1.3 KB
Loading… -
evidence-contract.md 1.6 KB
Loading… -
identity.md 2.5 KB
Loading… -
missing-data.md 1.5 KB
Loading… -
sql-guardrails.md 2.3 KB
Loading…
-
-
generated
-
knowledge
-
knowledge-binder-ipc.template.md 5.8 KB
Loading… -
knowledge-cpu-scheduler.template.md 5 KB
Loading… -
knowledge-data-sources.template.md 22.4 KB
Loading… -
knowledge-evidence-provenance.template.md 3.9 KB
Loading… -
knowledge-gc-dynamics.template.md 4.4 KB
Loading… -
knowledge-harmonyos-rendering.template.md 2.9 KB
Loading… -
knowledge-harmonyos-tools.template.md 2.6 KB
Loading… -
knowledge-lock-contention.template.md 4.9 KB
Loading… -
knowledge-network-evidence.template.md 4.6 KB
Loading… -
knowledge-observability-diagnostics.template.md 5.4 KB
Loading… -
knowledge-pipeline-anchors.template.md 2.9 KB
Loading… -
knowledge-pipeline-fences.template.md 3 KB
Loading… -
knowledge-rendering-pipeline.template.md 5.3 KB
Loading… -
knowledge-startup-root-causes.template.md 46 KB
Loading… -
knowledge-thermal-throttling.template.md 9.3 KB
Loading… -
knowledge-thread-state-blocked-reason.template.md 10 KB
Loading…
-
-
pipelines
-
docs
-
S01_rendering_types_overview.md 69.3 KB
Loading… -
S02_aosp_standard_type.md 61.6 KB
Loading… -
S03_surfaceview_type.md 53.9 KB
Loading… -
S04_textureview_type.md 42.4 KB
Loading… -
S05_mixed_rendering_type.md 42 KB
Loading… -
S06_multi_window_type.md 42.1 KB
Loading… -
S07_software_offscreen_type.md 27.9 KB
Loading… -
S08_native_graphics_type.md 27.8 KB
Loading… -
S09_webview_type.md 25.1 KB
Loading… -
S10_flutter_type.md 22.3 KB
Loading… -
S11_camera_type.md 15.3 KB
Loading… -
S12_video_overlay_hwc_type.md 17.8 KB
Loading… -
S13_game_type.md 16.1 KB
Loading… -
S14_react_native_type.md 17 KB
Loading…
-
-
-
runtime
-
android
-
ams_module.json 7.7 KB
Loading… -
android_app_background_power_state.json 12.1 KB
Loading… -
android_bitmap_memory_per_process.json 8.4 KB
Loading… -
android_dvfs_counter_stats.json 3.4 KB
Loading… -
android_gpu_work_period_track.json 3.4 KB
Loading… -
android_heap_dominator_path_extract.json 6.8 KB
Loading… -
android_heap_graph_class_growth.json 11.7 KB
Loading… -
android_heap_graph_leak_candidates.json 5.3 KB
Loading… -
android_heap_graph_summary.json 10.1 KB
Loading… -
android_job_scheduler_events.json 8.6 KB
Loading… -
android_kernel_wakelock_summary.json 3.4 KB
Loading… -
android_memory_v57_ai_diagnostics.json 9.2 KB
Loading… -
android_process_state_residency.json 10.1 KB
Loading… -
anr_analysis.json 24 KB
Loading… -
anr_context_in_range.json 1.8 KB
Loading… -
anr_detail.json 35.2 KB
Loading… -
anr_main_thread_blocking.json 12.5 KB
Loading… -
app_frame_production.json 3.8 KB
Loading… -
app_lifecycle_in_range.json 2.1 KB
Loading… -
app_process_starts_summary.json 3.5 KB
Loading… -
art_module.json 10.5 KB
Loading… -
battery_charge_timeline.json 3.4 KB
Loading… -
battery_doze_state_timeline.json 5.1 KB
Loading… -
battery_drain_attribution.json 10 KB
Loading… -
battery_drain_rate_summary.json 3.4 KB
Loading… -
binder_analysis.json 18.1 KB
Loading… -
binder_blocking_in_range.json 1.8 KB
Loading… -
binder_detail.json 9.8 KB
Loading… -
binder_in_range.json 1.8 KB
Loading… -
binder_module.json 7.3 KB
Loading… -
binder_pool_saturation_in_range.json 6.7 KB
Loading… -
binder_root_cause.json 5 KB
Loading… -
binder_storm_detection.json 8.3 KB
Loading… -
blocking_chain_analysis.json 8.5 KB
Loading… -
block_io_analysis.json 14.8 KB
Loading… -
buffer_transaction_lifecycle.json 7.2 KB
Loading… -
cache_miss_impact.json 1.8 KB
Loading… -
callstack_analysis.json 11.5 KB
Loading… -
camera_trace_evidence.json 12.2 KB
Loading… -
choreographer_module.json 13.4 KB
Loading… -
chrome_scroll_jank_frame_timeline.json 8.8 KB
Loading… -
click_response_analysis.json 20 KB
Loading… -
click_response_detail.json 21.8 KB
Loading… -
code_pinpoint.json 5 KB
Loading… -
compose_recomposition_hotspot.json 10.5 KB
Loading… -
consumer_jank_detection.json 10.3 KB
Loading… -
cpu_analysis.json 20.9 KB
Loading… -
cpu_anomalous_threads_in_range.json 3.6 KB
Loading… -
cpu_cluster_load_in_range.json 4.1 KB
Loading… -
cpu_cluster_mapping_view.json 3.4 KB
Loading… -
cpu_frequency_limit_attribution.json 15.4 KB
Loading… -
cpu_frequency_limit_episode.json 14.8 KB
Loading… -
cpu_freq_limit_timeline.json 10 KB
Loading… -
cpu_freq_residency_summary.json 3.6 KB
Loading… -
cpu_freq_timeline.json 5.8 KB
Loading… -
cpu_idle_analysis.json 1.8 KB
Loading… -
cpu_idle_state_residency.json 3.4 KB
Loading… -
cpu_load_in_range.json 6.8 KB
Loading… -
cpu_module.json 9.8 KB
Loading… -
cpu_process_utilization_period.json 3.5 KB
Loading… -
cpu_profiling.json 15.6 KB
Loading… -
cpu_slice_analysis.json 4.3 KB
Loading… -
cpu_system_context_in_range.json 1.9 KB
Loading… -
cpu_thread_utilization_period.json 3.5 KB
Loading… -
cpu_throttling_in_range.json 5.9 KB
Loading… -
cpu_time_per_frame.json 3.7 KB
Loading… -
cpu_topology_detection.json 7.3 KB
Loading… -
cpu_topology_view.json 10.1 KB
Loading… -
cpu_utilization_per_period.json 3.4 KB
Loading… -
cpu_workload_attribution_in_range.json 5.3 KB
Loading… -
device_state_snapshot.json 5.4 KB
Loading… -
device_state_timeline.json 8.5 KB
Loading… -
dmabuf_analysis.json 14.7 KB
Loading… -
fence_wait_decomposition.json 8.5 KB
Loading… -
filesystem_module.json 12.3 KB
Loading… -
flutter_scrolling_analysis.json 12.3 KB
Loading… -
fpsgo_analysis.json 2.1 KB
Loading… -
frame_blocking_calls.json 2.2 KB
Loading… -
frame_overrun_summary.json 3.7 KB
Loading… -
frame_pipeline_variance.json 2.1 KB
Loading… -
frame_production_gap.json 5.5 KB
Loading… -
frame_ui_time_breakdown.json 3.7 KB
Loading… -
futex_wait_distribution.json 1.8 KB
Loading… -
game_fps_analysis.json 7 KB
Loading… -
game_main_loop_jank.json 5.5 KB
Loading… -
gc_analysis.json 15 KB
Loading… -
gc_events_in_range.json 1.8 KB
Loading… -
global_trace_sanity_check.json 14.1 KB
Loading… -
gl_standalone_swap_jank.json 5.2 KB
Loading… -
gpu_analysis.json 15.1 KB
Loading… -
gpu_compute_kernel_analysis.json 10 KB
Loading… -
gpu_frequency_analysis.json 1.8 KB
Loading… -
gpu_freq_in_range.json 1.8 KB
Loading… -
gpu_metrics.json 10.4 KB
Loading… -
gpu_module.json 9 KB
Loading… -
gpu_power_state_analysis.json 1.8 KB
Loading… -
gpu_render_in_range.json 2.1 KB
Loading… -
gpu_v57_ai_diagnostics.json 14.9 KB
Loading… -
input_events_in_range.json 2 KB
Loading… -
input_module.json 7.6 KB
Loading… -
input_to_frame_latency.json 10.4 KB
Loading… -
io_pressure.json 13.8 KB
Loading… -
irq_analysis.json 17.1 KB
Loading… -
jank_frame_detail.json 36.2 KB
Loading… -
launcher_module.json 15.9 KB
Loading… -
linux_irq_summary.json 3.5 KB
Loading… -
linux_perf_counter_hotspots.json 3.4 KB
Loading… -
linux_process_rss_swap_timeline.json 3.4 KB
Loading… -
linux_runqueue_depth_timeline.json 5.3 KB
Loading… -
linux_sched_latency_distribution.json 3.6 KB
Loading… -
linux_systemd_journald_analysis.json 1.8 KB
Loading… -
lmk_analysis.json 14.8 KB
Loading… -
lmk_kill_attribution.json 3.4 KB
Loading… -
lock_binder_wait.json 4.1 KB
Loading… -
lock_contention_analysis.json 24.8 KB
Loading… -
lock_contention_in_range.json 8.5 KB
Loading… -
lock_contention_module.json 14.2 KB
Loading… -
logcat_analysis.json 1.9 KB
Loading… -
longest_process_slices.json 1.9 KB
Loading… -
main_thread_file_io_in_range.json 1.8 KB
Loading… -
main_thread_frame_work.json 12.9 KB
Loading… -
main_thread_handler_callback_slices.json 3.6 KB
Loading… -
main_thread_sched_latency_in_range.json 1.8 KB
Loading… -
main_thread_slices_in_range.json 1.8 KB
Loading… -
main_thread_states_in_range.json 1.8 KB
Loading… -
mali_gpu_power_state.json 3.4 KB
Loading… -
media_codec_activity.json 5.3 KB
Loading… -
memory_analysis.json 21.4 KB
Loading… -
memory_growth_detector.json 3.4 KB
Loading… -
memory_module.json 15.9 KB
Loading… -
memory_pressure_in_range.json 3.7 KB
Loading… -
memory_rss_high_watermark.json 3.5 KB
Loading… -
modem_network_correlation_summary.json 3.5 KB
Loading… -
multi_trace_result_comparison.json 1.5 KB
Loading… -
native_heap_breakdown.json 5.3 KB
Loading… -
navigation_analysis.json 22.7 KB
Loading… -
network_analysis.json 22.8 KB
Loading… -
oom_adjuster_score_timeline.json 3.5 KB
Loading… -
page_fault_in_range.json 1.8 KB
Loading… -
pipeline_4feature_scoring.json 9.5 KB
Loading… -
pipeline_android_pip_freeform.json 1.5 KB
Loading… -
pipeline_android_view_mixed.json 1.5 KB
Loading… -
pipeline_android_view_multi_window.json 1.5 KB
Loading… -
pipeline_android_view_software.json 1.5 KB
Loading… -
pipeline_android_view_standard_blast.json 1.5 KB
Loading… -
pipeline_android_view_standard_legacy.json 1.5 KB
Loading… -
pipeline_angle_gles_vulkan.json 1.5 KB
Loading… -
pipeline_camera_pipeline.json 1.5 KB
Loading… -
pipeline_chrome_browser_viz.json 1.5 KB
Loading… -
pipeline_compose_standard.json 1.5 KB
Loading… -
pipeline_flutter_surfaceview_impeller.json 1.5 KB
Loading… -
pipeline_flutter_surfaceview_skia.json 1.5 KB
Loading… -
pipeline_flutter_textureview.json 1.5 KB
Loading… -
pipeline_game_engine.json 1.5 KB
Loading… -
pipeline_hardware_buffer_renderer.json 1.5 KB
Loading… -
pipeline_imagereader_pipeline.json 1.5 KB
Loading… -
pipeline_key_slices_overlay.json 3.5 KB
Loading… -
pipeline_opengl_es.json 1.5 KB
Loading… -
pipeline_rn_new_arch.json 1.5 KB
Loading… -
pipeline_rn_old_arch.json 1.5 KB
Loading… -
pipeline_rn_skia.json 1.5 KB
Loading… -
pipeline_software_compositing.json 1.5 KB
Loading… -
pipeline_surfaceview_blast.json 1.5 KB
Loading… -
pipeline_surface_control_api.json 1.5 KB
Loading… -
pipeline_textureview_standard.json 1.5 KB
Loading… -
pipeline_variable_refresh_rate.json 1.5 KB
Loading… -
pipeline_video_overlay_hwc.json 1.5 KB
Loading… -
pipeline_vulkan_native.json 1.5 KB
Loading… -
pipeline_webview_gl_functor.json 1.5 KB
Loading… -
pipeline_webview_surfaceview_wrapper.json 1.5 KB
Loading… -
pipeline_webview_surface_control.json 1.5 KB
Loading… -
pipeline_webview_textureview_custom.json 1.5 KB
Loading… -
power_consumption_overview.json 11.3 KB
Loading… -
power_module.json 14.4 KB
Loading… -
power_rails_energy_breakdown.json 3.4 KB
Loading… -
present_fence_timing.json 3.8 KB
Loading… -
process_identity_resolver.json 2.8 KB
Loading… -
process_slice_cpu_hotspots.json 1.9 KB
Loading… -
process_thread_wait_sources_in_range.json 11.8 KB
Loading… -
rendering_pipeline_detection.json 16 KB
Loading… -
render_pipeline_latency.json 2.1 KB
Loading… -
render_thread_slices.json 3.5 KB
Loading… -
rn_bridge_to_frame_jank.json 4 KB
Loading… -
rn_fabric_render_jank.json 4 KB
Loading… -
runnable_cpu_occupancy_in_range.json 2 KB
Loading… -
scene_device_state_changes.json 5.1 KB
Loading… -
scene_reconstruction.json 44.2 KB
Loading… -
scene_response_markers.json 5.1 KB
Loading… -
scheduler_module.json 8.2 KB
Loading… -
scheduling_analysis.json 1.8 KB
Loading… -
sched_latency_in_range.json 1.8 KB
Loading… -
screen_off_background_cpu_attribution.json 3.6 KB
Loading… -
scrolling_analysis.json 53.4 KB
Loading… -
scroll_response_latency.json 2.3 KB
Loading… -
scroll_session_analysis.json 14.3 KB
Loading… -
selection_range_cpu_sched_summary.json 9.3 KB
Loading… -
sf_composition_in_range.json 2.1 KB
Loading… -
sf_frame_consumption.json 3.8 KB
Loading… -
sf_layer_count_in_range.json 5.3 KB
Loading… -
startup_analysis.json 15 KB
Loading… -
startup_binder_in_range.json 2 KB
Loading… -
startup_binder_pool_analysis.json 1.8 KB
Loading… -
startup_breakdown_in_range.json 2.2 KB
Loading… -
startup_class_loading_in_range.json 2 KB
Loading… -
startup_cpu_placement_timeline.json 1.9 KB
Loading… -
startup_critical_tasks.json 2 KB
Loading… -
startup_detail.json 25.1 KB
Loading… -
startup_events_in_range.json 2.2 KB
Loading… -
startup_freq_rampup.json 1.9 KB
Loading… -
startup_gc_in_range.json 2 KB
Loading… -
startup_hot_slice_states.json 1.8 KB
Loading… -
startup_jit_analysis.json 2.1 KB
Loading… -
startup_main_thread_binder_blocking_in_range.json 2 KB
Loading… -
startup_main_thread_file_io_in_range.json 2 KB
Loading… -
startup_main_thread_slices_in_range.json 2 KB
Loading… -
startup_main_thread_states_in_range.json 2 KB
Loading… -
startup_main_thread_sync_binder_in_range.json 2 KB
Loading… -
startup_sched_latency_in_range.json 2 KB
Loading… -
startup_slow_reasons.json 5.8 KB
Loading… -
startup_thread_blocking_graph.json 2 KB
Loading… -
state_timeline.json 18.9 KB
Loading… -
surfaceflinger_analysis.json 18.7 KB
Loading… -
surfaceflinger_module.json 9.3 KB
Loading… -
suspend_wakeup_analysis.json 21.3 KB
Loading… -
systemui_module.json 19.4 KB
Loading… -
system_load_in_range.json 1.8 KB
Loading… -
task_migration_in_range.json 4.3 KB
Loading… -
textureview_producer_frame_timing.json 5.7 KB
Loading… -
thermal_cooling_device_timeline.json 8.5 KB
Loading… -
thermal_module.json 12.3 KB
Loading… -
thermal_predictor.json 1.8 KB
Loading… -
thermal_throttling.json 22 KB
Loading… -
thermal_throttling_chain.json 7.6 KB
Loading… -
third_party_module.json 9.2 KB
Loading… -
thread_affinity_violation.json 2 KB
Loading… -
thread_cpu_placement_timeline.json 2 KB
Loading… -
thread_preemption_handoffs_in_range.json 1.9 KB
Loading… -
thread_system_summary_in_range.json 1.9 KB
Loading… -
touch_to_display_latency.json 2 KB
Loading… -
trace_state_track_summary.json 1.8 KB
Loading… -
util_tracking_analysis.json 2 KB
Loading… -
vrr_detection.json 6.7 KB
Loading… -
vsync_alignment_in_range.json 1.9 KB
Loading… -
vsync_config.json 3.7 KB
Loading… -
vsync_period_detection.json 3.7 KB
Loading… -
vsync_phase_alignment.json 6.9 KB
Loading… -
wakelock_tracking.json 8.4 KB
Loading… -
wakeup_frequency_summary.json 3.4 KB
Loading… -
wattson_app_startup_power.json 3.4 KB
Loading… -
wattson_rails_power_breakdown.json 3.4 KB
Loading… -
wattson_thread_power_attribution.json 3.5 KB
Loading… -
webview_drawfunctor_jank_chain.json 6.5 KB
Loading… -
webview_v8_analysis.json 8.7 KB
Loading… -
wms_module.json 11 KB
Loading…
-
-
fragments
-
actor_class_labels.sql 1.5 KB · in bundle
-
android_input_delivery_roles.sql 3.9 KB · in bundle
-
android_input_events_normalized.sql 4.3 KB · in bundle
-
android_input_scoped_deliveries.sql 1.9 KB · in bundle
-
android_input_target_deliveries.sql 977 B · in bundle
-
anr_classified.sql 2.7 KB · in bundle
-
anr_matched.sql 2.2 KB · in bundle
-
art_gc_names.sql 2.9 KB · in bundle
-
binder_pool_activity.sql 7.2 KB · in bundle
-
buffer_tx_frame_production.sql 2.2 KB · in bundle
-
cpu_cluster_load.sql 4.2 KB · in bundle
-
effective_target_processes.sql 616 B · in bundle
-
file_io_slice_names.sql 3.7 KB · in bundle
-
flutter_process_identity.sql 2.1 KB · in bundle
-
gpu_descriptor_frequency_tracks.sql 947 B · in bundle
-
gpu_frequency_by_ugpu.sql 978 B · in bundle
-
gpu_frequency_intervals.sql 2.4 KB · in bundle
-
gpu_frequency_summary.sql 1.3 KB · in bundle
-
gpu_frequency_window.sql 1.4 KB · in bundle
-
heap_graph_dump_scope.sql 2.4 KB · in bundle
-
heap_graph_selected_dumps.sql 1.4 KB · in bundle
-
heap_profile_scope.sql 1.7 KB · in bundle
-
heap_target_process.sql 2.9 KB · in bundle
-
io_blocked_function_families.sql 1.5 KB · in bundle
-
main_thread_work.sql 11.8 KB · in bundle
-
main_thread_work_cadence.sql 2.8 KB · in bundle
-
main_thread_work_tasks.sql 12 KB · in bundle
-
memory_gc_events.sql 1.8 KB · in bundle
-
observed_data_bounds.sql 805 B · in bundle
-
process_state_scoped_intervals.sql 1.5 KB · in bundle
-
root_cause_sample_cap.sql 920 B · in bundle
-
scene_device_state_facts.sql 2.9 KB · in bundle
-
scene_input_facts.sql 10.5 KB · in bundle
-
scene_input_window.sql 989 B · in bundle
-
scene_response_marker_facts.sql 2.2 KB · in bundle
-
scene_screen_facts.sql 2 KB · in bundle
-
sleep_wake_source.sql 2.1 KB · in bundle
-
sleep_wake_source_labels.sql 3.9 KB · in bundle
-
system_cpu_big_freq_coverage.sql 3.2 KB · in bundle
-
system_cpu_frequency_spans.sql 1.8 KB · in bundle
-
system_cpu_freq_limit_episodes.sql 10.4 KB · in bundle
-
system_cpu_freq_limit_episode_verdicts.sql 22.8 KB · in bundle
-
system_cpu_freq_limit_frame_binding.sql 13.5 KB · in bundle
-
system_cpu_freq_limit_spans.sql 7.2 KB · in bundle
-
system_sched_spans.sql 3.1 KB · in bundle
-
system_target_threads.sql 1.3 KB · in bundle
-
system_thread_state_spans.sql 1.7 KB · in bundle
-
target_threads.sql 1.9 KB · in bundle
-
thermal_cdev_policy_association.sql 5.7 KB · in bundle
-
thermal_cooling_spans.sql 3.6 KB · in bundle
-
thermal_sample_quality.sql 3.2 KB · in bundle
-
thermal_signal_signatures.sql 7.2 KB · in bundle
-
thread_role.sql 4.2 KB · in bundle
-
thread_states_quadrant.sql 2.1 KB · in bundle
-
vsync_config.sql 3.3 KB · in bundle
-
-
queries
-
ams_module.json 10 KB
Loading… -
android_app_background_power_state.json 23.2 KB
Loading… -
android_bitmap_memory_per_process.json 15.7 KB
Loading… -
android_dvfs_counter_stats.json 3.3 KB
Loading… -
android_gpu_work_period_track.json 3.7 KB
Loading… -
android_heap_dominator_path_extract.json 13.1 KB
Loading… -
android_heap_graph_class_growth.json 27.2 KB
Loading… -
android_heap_graph_leak_candidates.json 9.4 KB
Loading… -
android_heap_graph_summary.json 21.6 KB
Loading… -
android_job_scheduler_events.json 14.9 KB
Loading… -
android_kernel_wakelock_summary.json 3.4 KB
Loading… -
android_memory_v57_ai_diagnostics.json 16.5 KB
Loading… -
android_process_state_residency.json 19.5 KB
Loading… -
anr_analysis.json 43.6 KB
Loading… -
anr_context_in_range.json 4 KB
Loading… -
anr_detail.json 58.5 KB
Loading… -
anr_main_thread_blocking.json 23.4 KB
Loading… -
app_frame_production.json 4 KB
Loading… -
app_lifecycle_in_range.json 4.1 KB
Loading… -
app_process_starts_summary.json 3.8 KB
Loading… -
art_module.json 19.7 KB
Loading… -
battery_charge_timeline.json 3.3 KB
Loading… -
battery_doze_state_timeline.json 6.6 KB
Loading… -
battery_drain_attribution.json 86 B
Loading… -
battery_drain_rate_summary.json 3.3 KB
Loading… -
binder_analysis.json 33.6 KB
Loading… -
binder_blocking_in_range.json 4.1 KB
Loading… -
binder_detail.json 14.5 KB
Loading… -
binder_in_range.json 4 KB
Loading… -
binder_module.json 10.7 KB
Loading… -
binder_pool_saturation_in_range.json 16.9 KB
Loading… -
binder_root_cause.json 7.4 KB
Loading… -
binder_storm_detection.json 14.8 KB
Loading… -
blocking_chain_analysis.json 16.3 KB
Loading… -
block_io_analysis.json 26.5 KB
Loading… -
buffer_transaction_lifecycle.json 11.4 KB
Loading… -
cache_miss_impact.json 3.4 KB
Loading… -
callstack_analysis.json 21.4 KB
Loading… -
camera_trace_evidence.json 23.3 KB
Loading… -
choreographer_module.json 22.9 KB
Loading… -
chrome_scroll_jank_frame_timeline.json 14.1 KB
Loading… -
click_response_analysis.json 49.7 KB
Loading… -
click_response_detail.json 29.4 KB
Loading… -
code_pinpoint.json 7.1 KB
Loading… -
compose_recomposition_hotspot.json 19.6 KB
Loading… -
consumer_jank_detection.json 17.3 KB
Loading… -
cpu_analysis.json 41.9 KB
Loading… -
cpu_anomalous_threads_in_range.json 4.2 KB
Loading… -
cpu_cluster_load_in_range.json 3.6 KB
Loading… -
cpu_cluster_mapping_view.json 3.3 KB
Loading… -
cpu_frequency_limit_attribution.json 27.6 KB
Loading… -
cpu_frequency_limit_episode.json 32.6 KB
Loading… -
cpu_freq_limit_timeline.json 19.1 KB
Loading… -
cpu_freq_residency_summary.json 3.4 KB
Loading… -
cpu_freq_timeline.json 6.9 KB
Loading… -
cpu_idle_analysis.json 3.3 KB
Loading… -
cpu_idle_state_residency.json 3.3 KB
Loading… -
cpu_load_in_range.json 10.5 KB
Loading… -
cpu_module.json 13.2 KB
Loading… -
cpu_process_utilization_period.json 3.8 KB
Loading… -
cpu_profiling.json 29 KB
Loading… -
cpu_slice_analysis.json 3.8 KB
Loading… -
cpu_system_context_in_range.json 3.8 KB
Loading… -
cpu_thread_utilization_period.json 3.8 KB
Loading… -
cpu_throttling_in_range.json 7.4 KB
Loading… -
cpu_time_per_frame.json 3.3 KB
Loading… -
cpu_topology_detection.json 9.8 KB
Loading… -
cpu_topology_view.json 16.6 KB
Loading… -
cpu_utilization_per_period.json 3.3 KB
Loading… -
cpu_workload_attribution_in_range.json 8.4 KB
Loading… -
device_state_snapshot.json 7.2 KB
Loading… -
device_state_timeline.json 13.8 KB
Loading… -
dmabuf_analysis.json 29.2 KB
Loading… -
fence_wait_decomposition.json 15.1 KB
Loading… -
filesystem_module.json 23.4 KB
Loading… -
flutter_scrolling_analysis.json 25.6 KB
Loading… -
fpsgo_analysis.json 3.5 KB
Loading… -
frame_blocking_calls.json 3.7 KB
Loading… -
frame_overrun_summary.json 3.3 KB
Loading… -
frame_pipeline_variance.json 4 KB
Loading… -
frame_production_gap.json 7.8 KB
Loading… -
frame_ui_time_breakdown.json 3.3 KB
Loading… -
futex_wait_distribution.json 3.7 KB
Loading… -
game_fps_analysis.json 11.4 KB
Loading… -
game_main_loop_jank.json 8.7 KB
Loading… -
gc_analysis.json 29.6 KB
Loading… -
gc_events_in_range.json 3.7 KB
Loading… -
global_trace_sanity_check.json 24 KB
Loading… -
gl_standalone_swap_jank.json 7.9 KB
Loading… -
gpu_analysis.json 32.4 KB
Loading… -
gpu_compute_kernel_analysis.json 16.9 KB
Loading… -
gpu_frequency_analysis.json 4 KB
Loading… -
gpu_freq_in_range.json 4 KB
Loading… -
gpu_metrics.json 17 KB
Loading… -
gpu_module.json 13.3 KB
Loading… -
gpu_power_state_analysis.json 4 KB
Loading… -
gpu_render_in_range.json 4.3 KB
Loading… -
gpu_v57_ai_diagnostics.json 29.6 KB
Loading… -
input_events_in_range.json 4.6 KB
Loading… -
input_module.json 9.8 KB
Loading… -
input_to_frame_latency.json 19.7 KB
Loading… -
io_pressure.json 27.7 KB
Loading… -
irq_analysis.json 29.6 KB
Loading… -
jank_frame_detail.json 64.6 KB
Loading… -
launcher_module.json 29.8 KB
Loading… -
linux_irq_summary.json 3.2 KB
Loading… -
linux_perf_counter_hotspots.json 3.8 KB
Loading… -
linux_process_rss_swap_timeline.json 3.8 KB
Loading… -
linux_runqueue_depth_timeline.json 6.9 KB
Loading… -
linux_sched_latency_distribution.json 3.9 KB
Loading… -
linux_systemd_journald_analysis.json 3.4 KB
Loading… -
lmk_analysis.json 29.7 KB
Loading… -
lmk_kill_attribution.json 3.7 KB
Loading… -
lock_binder_wait.json 77 B
Loading… -
lock_contention_analysis.json 53.7 KB
Loading… -
lock_contention_in_range.json 15.5 KB
Loading… -
lock_contention_module.json 26.9 KB
Loading… -
logcat_analysis.json 3.5 KB
Loading… -
longest_process_slices.json 3.4 KB
Loading… -
main_thread_file_io_in_range.json 4.3 KB
Loading… -
main_thread_frame_work.json 21.8 KB
Loading… -
main_thread_handler_callback_slices.json 4 KB
Loading… -
main_thread_sched_latency_in_range.json 4.1 KB
Loading… -
main_thread_slices_in_range.json 3.9 KB
Loading… -
main_thread_states_in_range.json 4.1 KB
Loading… -
mali_gpu_power_state.json 3.3 KB
Loading… -
media_codec_activity.json 8.2 KB
Loading… -
memory_analysis.json 32.2 KB
Loading… -
memory_growth_detector.json 3.9 KB
Loading… -
memory_module.json 29.2 KB
Loading… -
memory_pressure_in_range.json 3.7 KB
Loading… -
memory_rss_high_watermark.json 3.8 KB
Loading… -
modem_network_correlation_summary.json 3.5 KB
Loading… -
multi_trace_result_comparison.json 90 B
Loading… -
native_heap_breakdown.json 8.7 KB
Loading… -
navigation_analysis.json 46.5 KB
Loading… -
network_analysis.json 43.8 KB
Loading… -
oom_adjuster_score_timeline.json 3.8 KB
Loading… -
page_fault_in_range.json 3.9 KB
Loading… -
pipeline_4feature_scoring.json 16 KB
Loading… -
pipeline_android_pip_freeform.json 90 B
Loading… -
pipeline_android_view_mixed.json 88 B
Loading… -
pipeline_android_view_multi_window.json 95 B
Loading… -
pipeline_android_view_software.json 91 B
Loading… -
pipeline_android_view_standard_blast.json 97 B
Loading… -
pipeline_android_view_standard_legacy.json 98 B
Loading… -
pipeline_angle_gles_vulkan.json 87 B
Loading…
-
-
android-index.json 18.2 KB
Loading… -
compiler-normalizations.json 119.1 KB
Loading… -
fixture-manifest.json 24.9 KB
Loading… -
perfetto-source-lock.json 2.2 KB
Loading…
-
-
catalog.json 12.9 KB
Loading…
-
-
-
SKILL.md 8.9 KB
--- name: perfetto-performance-analysis description: Analyze Android, Linux, and Chromium Perfetto traces with local trace_processor_shell evidence. Use for startup, scrolling or jank, input latency, ANR, CPU scheduling, memory or GC, Binder or IO, GPU or SurfaceFlinger, power or thermal, rendering-pipeline identification, trace capture guidance, scene reconstruction, and single- or multi-trace performance comparison. --- # Perfetto Performance Analysis License: AGPL-3.0-or-later. Source: [Perfetto Skills](https://github.com/Gracker/Perfetto-Skills). Analyze traces from evidence instead of guessing from symptom names. Use the bundled scripts for deterministic queries and load only the references needed for the selected workflow. ## Requirements Use Python 3.11+, local filesystem and terminal access, and a checksum-verified Perfetto `trace_processor_shell`. Run independently after installation; neither SmartPerfetto nor an upstream Perfetto checkout is required. ## Operating contract 1. Resolve the Skill root as the directory containing this `SKILL.md`. Convert script and reference paths to absolute paths before executing them; do not assume a client-specific environment variable exists. 2. Record every input trace path, SHA-256, requested process/thread, time range, and trace side before analysis. 3. Run `scripts/perfetto_probe.py` before domain queries. Treat unavailable tables, modules, tracks, or trace signals as limitations, not negative evidence. 4. Select one primary workflow below. Load its Markdown file directly, then follow its availability gate and evidence sequence. 5. Execute a complete exported Skill through `scripts/perfetto_skill.py run`, or one manifest query through `scripts/perfetto_query.py --query-id`. Keep query source, parameters, trace identity, timestamps, durations, units, and returned row bounds with every saved result. 6. Before executing authored or modified SQL, run [the SQL guardrail script](scripts/perfetto_sql_guardrails.py). Resolve blocking findings and review advisories using [the SQL guardrail contract](references/evidence/sql-guardrails.md). 7. Separate observations, correlations, mechanisms, and verified root causes. Do not promote a hypothesis without evidence that supports the claimed process, thread, time window, and trace. 8. For comparisons, analyze each trace independently before computing deltas. Never use a missing metric on one side as proof that the other side regressed. 9. Emit the structure in `assets/report-schema.json`. List missing evidence and unresolved alternatives under `limitations`. Read [the evidence contract](references/evidence/evidence-contract.md), then use [identity rules](references/evidence/identity.md), [missing-data rules](references/evidence/missing-data.md), and [claim verification](references/evidence/claim-verification.md) before writing conclusions. ## Workflow routing - Trace health, bounds, identity, and broad triage: [trace overview](references/workflows/trace-overview.md) - Cold, warm, hot, and first-frame startup: [startup](references/workflows/startup.md) - Frame production, presentation, scrolling, and jank: [scrolling](references/workflows/scrolling.md) - Touch, click, input dispatch, response, and navigation: [interaction](references/workflows/interaction.md) - ANR, Binder, locks, futex, and blocking chains: [ANR and blocking](references/workflows/anr-blocking.md) - CPU load, topology, frequency, idle, IRQ, and scheduler latency: [CPU scheduling](references/workflows/cpu-scheduling.md) - RSS, heap, GC, LMK, DMA-BUF, and allocation: [memory](references/workflows/memory.md) - GPU, SurfaceFlinger, fences, VRR, and frame composition: [GPU rendering](references/workflows/gpu-rendering.md) - Rails, wakelocks, battery, thermal, and throttling: [power and thermal](references/workflows/power-thermal.md) - Filesystem, block IO, network, modem, media, and WebView: [IO, network, and media](references/workflows/io-network-media.md) - Compose, Flutter, React Native, games, and vendor signals: [frameworks and games](references/workflows/frameworks-games.md) - Rendering architecture detection and teaching: [rendering pipeline](references/workflows/rendering-pipeline.md) - Cross-domain event sequence reconstruction: [scene reconstruction](references/workflows/scene-reconstruction.md) - Two or more traces or saved result sets: [trace comparison](references/workflows/trace-comparison.md) Use [the machine-readable workflow index](references/workflow-index.json) when selecting or validating workflow IDs. ## Runtime commands List or run a deterministic portable Skill graph: ```bash python3 <skill-root>/scripts/perfetto_skill.py list python3 <skill-root>/scripts/perfetto_skill.py run /absolute/trace.pftrace \ --skill startup_analysis --param 'package="com.example"' \ --output-dir /absolute/output/run ``` Pass only the Skill's declared inputs through `--param`; the runner rejects any other name before touching the trace. A Skill with a process identity gate also accepts its identity aliases (`package`, `process_name`, ...): the gate verifies the named process with the `process_identity_resolver` Skill and rewrites the alias to the verified `process.name`. An unverified or ambiguous target is refused with the reason (`identity_blocked`); pick an exact process name from that Skill's candidates instead of retrying the same name. A verified `upid` (or a `pid` with one UPID) runs the Skill on exactly that process; a Skill whose SQL cannot run that way is refused with the Skills that can. Complete Skill runs and `--query-id` runs verify the selected processor's commit, RPC API, platform, and SHA-256 against the release lock before executing SQL. Inspect that identity independently with: ```bash python3 <skill-root>/scripts/perfetto_doctor.py ``` Use `--allow-unsupported-processor` only for an explicitly labeled canary; it does not turn the result into verified evidence. A capability-gated query runs only after an automatic probe for the same trace proves its required schema; the gate result remains in the evidence sidecar. `--allow-unverified` is a separate opt-in only for a query explicitly classified as unverified and never bypasses a missing capability. Probe a trace: ```bash python3 <skill-root>/scripts/perfetto_probe.py /absolute/path/to/trace.pftrace \ --output /absolute/path/to/output/probe.json ``` Run a referenced SQL asset: ```bash python3 <skill-root>/scripts/perfetto_query.py /absolute/path/to/trace.pftrace \ --sql-file <skill-root>/references/generated/sql/<query>.sql \ --format json --output /absolute/path/to/output/query.json ``` Bind SmartPerfetto DSL placeholders through the public wrapper instead of editing SQL text. `--param NAME=JSON` safely binds scalar inputs and JSON arrays (rendered as SQL literal lists for `IN (...)`), `--module android.example.module` loads declared prerequisites, and `--result NAME=/path/prior.json` exposes a non-empty saved row array as a relation for a dependent step. Pipeline expressions such as `${prior_step.data[0].upid}` select a scalar field from those rows. A placeholder `${name|default}` uses its default when `name` is omitted, resolves to JSON `null`, or indexes past the rows of a saved result, so a defaulted path to an empty prior step needs no `--result`: ```bash python3 <skill-root>/scripts/perfetto_query.py /absolute/trace.pftrace \ --sql-file <skill-root>/references/generated/sql/<skill>/<step>.sql \ --module android.frames.timeline \ --param 'package="com.example"' --param start_ts=123 \ --result prior_step=/absolute/output/prior-step.json \ --output /absolute/output/current-step.json ``` The runtime rejects unresolved placeholders and caps trace-processor stdout and stderr at 16 MiB by default. Lower the bound with `--max-output-bytes`; increase it only for a reviewed, explicitly bounded query. For comparison, first write one side-summary file per independently analyzed trace using `assets/comparison-input-schema.json`, then run `scripts/perfetto_compare.py --side baseline=a.json --side candidate=b.json --baseline baseline`. If `trace_processor_shell` is unavailable, run `scripts/bootstrap_trace_processor.py` or provide a locked executable through `--trace-processor` or `PERFETTO_TRACE_PROCESSOR`. ## Reference discovery Generated references are numerous. Find a SmartPerfetto Skill, SQL step, table, or signal without loading the whole catalog: ```bash rg -n "<skill-id|table|signal>" <skill-root>/references/generated ``` Load the directly linked result and its source provenance. Do not infer step semantics from a filename alone. ## Compatibility Require Python 3.11+, filesystem access, terminal execution, and a compatible Perfetto `trace_processor_shell`. The portable instructions work in Codex, Claude Code, OpenCode, and other clients that implement Agent Skills and expose those capabilities. Cloud-only agents without local file or terminal access can use the methodology references but cannot execute trace queries.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.