skillfed

perfetto

Python APIs and bindings for Perfetto (perfetto.dev)

perfetto v0.57.2 1.3M downloads/30d#4,027 on PyPI6,346
Permissive license apache-2.0 Active released

What it is and what it does

Perfetto is a Python interface to Perfetto's trace processor, enabling programmatic analysis of system and application performance traces. It lets you load trace files and query them using SQL, making it possible to automate trace analysis, extract custom metrics, and integrate trace inspection into Python workflows. The package is built on top of Perfetto's production-grade tracing infrastructure, which is the default system for Android and Chromium.

The package depends only on protobuf and installs as a pure Python wheel, making it lightweight to add to existing projects. It's designed for developers, performance engineers, and SREs who need to analyze traces captured by Perfetto daemons or other compatible tools—such as Linux perf, Chrome JSON traces, or macOS Instruments—without manually parsing binary formats.

Use it for:

  • Automate analysis of Android app performance traces to detect slow startups, dropped frames, or memory issues
  • Query Linux kernel traces to analyze scheduling behavior, syscalls, and CPU performance bottlenecks
  • Extract custom metrics from Chromium browser traces for performance regression detection
  • Batch-process multiple trace files to generate performance reports and SRE dashboards
  • Integrate trace analysis into CI/CD pipelines to flag performance regressions automatically

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Perfetto is a Python binding for Perfetto's trace processor, allowing programmatic access to system and application traces via SQL queries and trace analysis APIs.

Yes, if you need to programmatically analyze Perfetto traces or other compatible trace formats. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. The alpha status means the API may change, so pin the version in production. Not necessary if you only need the browser-based UI or one-off manual trace inspection.

Install

perfetto on PyPI

pip

pip install perfetto

uv

uv add perfetto

poetry

poetry add perfetto

Installing perfetto

Before you install

Low install friction with a single runtime dependency (protobuf). Active maintenance with recent releases; last commit 2026-08-14 and version 0.57.2 released 2026-07-07. Alpha status indicates the API may still evolve.

License in practice

Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install perfetto

import perfetto
# Load and query a trace file
processor = perfetto.TraceProcessor(trace_file='trace.perfetto-trace')
result = processor.query('SELECT * FROM sched_slice LIMIT 10')

Verify before relying

  • Whether the Python package provides direct access to all Perfetto trace processor features or a subset
  • Whether traces must be pre-captured by Perfetto daemons or if the package can initiate tracing
  • Performance characteristics when querying large multi-GB trace files
  • Whether the package works on Windows, macOS, and Linux or has platform-specific limitations

Package facts

License apache-2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — protobuf
Maintenance actively maintained — 38 days since the last release
Last repo commit
First released
Downloads 1,341,501/month — #4,027 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: perfetto-0.57.2-py3-none-any.whl

Keywords: trace processor, tracing, perfetto

Development Status :: 3 - AlphaProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9

Tags

trace analysis pythonperfetto trace processorsystem profiling tracesperformance trace queryingtrace visualization datasql trace analysisandroid tracing python
performance-analysistrace-processingsystem-profiling

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

keke

Writes trace events in Perfetto/Chrome trace…

permissive · top 15,000 on PyPI

viztracer

VizTracer traces Python code execution and…

permissive · top 5,000 on PyPI

osprofiler

OSProfiler generates distributed request traces…

permissive · top 15,000 on PyPI

HolisticTraceAnalysis

Analyzes PyTorch Profiler traces to identify…

permissive · top 15,000 on PyPI

nvidia-nvtx

Provides a Python API for annotating events and…

unclear · top 1,000 on PyPI

mlflow-tracing

Instrument GenAI applications with distributed…

permissive · top 1,000 on PyPI

cupti-python

Provides Python bindings to NVIDIA's CUPTI…

unclear · top 15,000 on PyPI

nvidia-nvtx-cu12

Provides a C-based API for annotating events,…

permissive · top 1,000 on PyPI

google-cloud-trace

Sends application trace data to Google Cloud…

permissive · top 5,000 on PyPI

nvidia-nvtx-cu11

Provides a C-based API for annotating events,…

unclear · top 5,000 on PyPI