class TrackRegistry
Defined at line 510 of file ../../third_party/perfetto/include/perfetto/tracing/track.h
Keeps a map of uuids to serialized track descriptors and provides a
thread-safe way to read and write them. Each trace writer keeps a TLS set of
the tracks it has seen (see TrackEventIncrementalState). In the common case,
this registry is not consulted (and no locks are taken). However when a new
track is seen, this registry is used to write either 1) the default
descriptor for that track (see *Track::Serialize) or 2) a serialized
descriptor stored in the registry which may have additional metadata (e.g.,
track name).
TODO(eseckler): Remove PERFETTO_EXPORT_COMPONENT once Chromium no longer
calls TrackRegistry::InitializeInstance() directly.
Public Methods
void TrackRegistry ()
void ~TrackRegistry ()
void InitializeInstance (std::optional<uint64_t> process_uuid)
void ResetForTesting ()
uint64_t ComputeProcessUuid ()
void EraseTrack (Track )
TrackRegistry * Get ()
Defined at line 525 of file ../../third_party/perfetto/include/perfetto/tracing/track.h
template <typename TrackType>
uint64_t SerializeTrack (const TrackType & track, protozero::MessageHandle<protos::pbzero::TracePacket> packet)
If |track| exists in the registry, write out the serialized track
descriptor for it into |packet|. Otherwise just the ephemeral track object
is serialized without any additional metadata.
Returns the parent track uuid.
Defined at line 538 of file ../../third_party/perfetto/include/perfetto/tracing/track.h
std::optional<TrackInfo> FindTrackInfo (uint64_t uuid)
If saved in the registry, returns the serialize track descriptor and parent
uuid for `uuid`.
Defined at line 558 of file ../../third_party/perfetto/include/perfetto/tracing/track.h
void UpdateTrack (Track , const std::string & serialized_desc)
This variant lets the user supply a serialized track descriptor directly.
void WriteTrackDescriptor (const SerializedTrackDescriptor & desc, protozero::MessageHandle<protos::pbzero::TracePacket> packet)