Skip to main content

Performance trace format

Turn a trace stream into tables you can inspect.

The Perfetto loader reads protobuf Trace packets, tracks sequence state and descriptors, and projects supported TrackEvent data into typed Apache Arrow tables for browser-side analysis.

loaders.gl support​

The trace projection

Preserve the event relationships that matter.

Perfetto traces contain more than isolated events. The projection keeps tracks, processes, threads, timestamps, and open slices connected while exposing a compact table-oriented result.

Input

TracePacket messages in a protobuf envelope

State

Descriptors, interned names, and sequence resets

Output

Tracks, slices, processes, and threads tables

Stream

Incremental packet parsing with bounded state

Perfetto's native format is a protobuf Trace envelope containing repeated TracePacket messages. The traces module projects Perfetto's stable TrackEvent model into typed Apache Arrow tables.

Detailed guide

Perfetto projection and boundaries

The sections below document supported TrackEvent fields, Arrow table schemas, timestamp semantics, streaming behavior, and unsupported packet families.

Supported TrackEvent Data​

The loader handles:

  • TrackDescriptor messages, including parent tracks, process ownership, thread ownership, and counter-track classification
  • embedded and legacy standalone process and thread descriptors
  • packet-sequence TrackEventDefaults, including default track UUIDs
  • per-sequence interned event names and incremental-state resets
  • TrackEvent slice begin/end pairs and instant events
  • legacy B, E, I, i, and complete X phases represented inside TrackEvent
  • events that begin and end in different packet sequences but refer to the same global track UUID

Track descriptors are keyed by globally unique UUID. Process and thread tables retain the latest descriptor for each numeric PID or TID.

Arrow Tables​

tracks​

ColumnArrow typeNullableDescription
track_uuidUint64noGlobally unique Perfetto track UUID.
parent_track_uuidUint64yesParent track UUID.
typeUtf8noprocess, thread, counter, or slice.
nameUtf8yesLatest track name.
pidInt32yesAssociated process ID.
tidInt32yesAssociated thread ID.

slices​

ColumnArrow typeNullableDescription
track_uuidUint64noTrack containing the event.
tsUint64noRaw TracePacket.timestamp.
durUint64noEnd minus begin; zero for instant events.
nameUtf8noInline or interned event name.

processes​

ColumnArrow typeNullableDescription
pidInt32noProcess ID.
nameUtf8yesProcess name.

threads​

ColumnArrow typeNullableDescription
tidInt32noThread ID.
pidInt32yesOwning process ID.
nameUtf8yesThread name.

Timestamp Semantics​

The loader preserves raw unsigned packet timestamps and durations. Perfetto timestamps use nanoseconds by default, but traces can define other clock domains, units, and delta encodings. This projection does not currently normalize clock snapshots or convert timestamps between clock domains. Consumers that require globally normalized trace time should use Perfetto Trace Processor.

Streaming Envelope​

parseInBatches incrementally tokenizes repeated TracePacket fields. Input chunks can split a protobuf tag, length varint, packet payload, or any combination of them. The parser retains only the incomplete packet, incremental sequence state, descriptors, and currently open slices; it does not buffer the complete input file before emitting Arrow batches.

Scope and Limitations​

The four-table result is a TrackEvent projection, not a replacement for Perfetto Trace Processor. Packet families such as ftrace, process stats, heap profiles, GPU events, counters, state events, clock snapshots, compressed packet groups, custom extensions, debug annotations, and flow metadata are skipped unless represented by the supported TrackEvent fields above.

PerfettoTraceWriter writes this projection back as canonical protobuf packets. Data skipped by the loader cannot be recreated by the writer.