Skip to content

Feature Request: Support thread/process ordering in protobuf trace format #6126

@g122622

Description

@g122622

Problem

The Perfetto SDK provides legacy_sort_index field in ThreadDescriptor and ProcessDescriptor protobuf messages, but the trace processor does not parse these fields. As a result, SDK users cannot control thread/process display order in the UI when using protobuf format.

Currently, thread_sort_index_hint / process_sort_index_hint args (used by UI for sorting) can only be set through JSON trace format via thread_sort_index / process_sort_index metadata.

Use Case

Image

In a game engine with many threads (render, audio, physics, network, etc.), developers want to pin important threads at the top of the trace view for easier analysis. For example:

auto desc = perfetto::ThreadTrack::Current().Serialize();
desc.mutable_thread()->set_thread_name("GameMainThread");
desc.mutable_thread()->set_legacy_sort_index(1);  // Should appear first
perfetto::TrackEvent::SetTrackDescriptor(perfetto::ThreadTrack::Current(), desc);

Current Behavior

Setting legacy_sort_index in protobuf traces has no effect on UI ordering.

Expected Behavior

Threads/processes should be ordered by legacy_sort_index (or equivalent) in the UI, similar to how thread_sort_index works in JSON traces.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions