Utilities
Convert a Perfetto trace to JSON
Convert a supplied local trace into native Chrome trace-event JSON with Perfetto traceconv.
overview
What perfetto-trace-json does
Convert a supplied local trace into native Chrome trace-event JSON with Perfetto traceconv.
The adapter first asks the pinned native processor for import error statistics and rejects a trace with reported errors before publishing output. The output retains native traceEvents and metadata. Timing statistics in metadata can vary between runs. Conversion does not record a trace, symbolize an APK, connect to a device, or prove that a trace contains every event you expected.
The input must be a nonempty regular file of at most 20 MiB. Native import-stat validation and the query or conversion share a 90-second deadline. Each artifact/log has a 4 MiB check after its native process exits; these checks do not contain peak memory or disk use.
source hub.docker.com/r/nenadzaric/skills-android-perfetto-trace-json
use cases
Where perfetto-trace-json fits
Feed a trace-event JSON consumer
Export a separately collected trace to a JSON FILE for downstream tools that consume Chrome trace events.
Keep file processing separate from recording
Supply an existing trace FILE. This node exposes no recording, daemon, device, remote URL, credentials or caller-written SQL.
Distinguish a valid empty trace from a parse failure
The adapter checks native import error statistics before producing output. Native fixtures cover valid-empty and malformed traces; the owned positive trace also passed a three-node platform workflow.
reference
perfetto-trace-json inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| trace | FILE | --trace | Existing local trace FILE, nonempty and at most 20 MiB. |
Showing key inputs. perfetto-trace-json exposes 1 inputs in total.
example
Run perfetto-trace-json
perfetto-trace-json --trace owned.pftrace -o trace.json{"traceEvents":[
{"args":{"name":"swapper"},"cat":"__metadata","name":"thread_name","ph":"M","pid":0,"tid":0,"ts":0},
{"args":{"name":"owned"},"cat":"__metadata","name":"thread_name","ph":"M","pid":42,"tid":42,"ts":0},
{"args":{},"cat":"owned","dur":2000,"name":"CounterWork","ph":"X","pid":42,"tid":42,"ts":1000}],"metadata":guidance
Choosing perfetto-trace-json
Choose this conversion job when your downstream consumer needs individual native trace events. Choose perfetto-slice-summary for grouped completed-slice counts and duration sums.
perfetto-slice-summary
Sibling offline trace job. Event JSON preserves events for inspection; grouped CSV summarizes completed slices by name.
faq
perfetto-trace-json questions
related
More Utilities tools
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
dnsgen
Wordlist and mined-word subdomain permutation.
duckdb
In-process SQL on CSV, JSON, and Parquet. No server.
edge-tts
Microsoft Edge neural speech from text or a script file. No API key.
Run perfetto-trace-json yourself
Opening excerpt of native Chrome trace-event JSON from the owned trace, also verified in a platform run. CounterWork lasts 2,000 microseconds; additional native metadata is omitted here and timing metadata can vary between runs.
Facts on this page come from the live Trickest tool library.