UNPKG

perfetto-protos

Version:

Perfetto protos exposed via protobuf-es for browser and node

749 lines 26.9 kB
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; import type { DebugAnnotation } from "./debug_annotation_pb"; import type { LogMessage } from "./log_message_pb"; import type { TaskExecution } from "./task_execution_pb"; import type { ChromeActiveProcesses } from "./chrome_active_processes_pb"; import type { ChromeApplicationStateInfo } from "./chrome_application_state_info_pb"; import type { ChromeCompositorSchedulerState } from "./chrome_compositor_scheduler_state_pb"; import type { ChromeContentSettingsEventInfo } from "./chrome_content_settings_event_info_pb"; import type { ChromeFrameReporter } from "./chrome_frame_reporter_pb"; import type { ChromeHistogramSample } from "./chrome_histogram_sample_pb"; import type { ChromeKeyedService } from "./chrome_keyed_service_pb"; import type { ChromeLatencyInfo } from "./chrome_latency_info_pb"; import type { ChromeLegacyIpc } from "./chrome_legacy_ipc_pb"; import type { ChromeMessagePump } from "./chrome_message_pump_pb"; import type { ChromeMojoEventInfo } from "./chrome_mojo_event_info_pb"; import type { ChromeRendererSchedulerState } from "./chrome_renderer_scheduler_state_pb"; import type { ChromeUserEvent } from "./chrome_user_event_pb"; import type { ChromeWindowHandleEventInfo } from "./chrome_window_handle_event_info_pb"; import type { Screenshot } from "./screenshot_pb"; import type { SourceLocation } from "./source_location_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file protos/perfetto/trace/track_event/track_event.proto. */ export declare const file_protos_perfetto_trace_track_event_track_event: GenFile; /** * Trace events emitted by client instrumentation library (TRACE_EVENT macros), * which describe activity on a track, such as a thread or asynchronous event * track. The track is specified using separate TrackDescriptor messages and * referred to via the track's UUID. * * A simple TrackEvent packet specifies a timestamp, category, name and type: * ```protobuf * trace_packet { * timestamp: 1000 * track_event { * categories: ["my_cat"] * name: "my_event" * type: TYPE_INSTANT * } * } * ``` * * To associate an event with a custom track (e.g. a thread), the track is * defined in a separate packet and referred to from the TrackEvent by its UUID: * ```protobuf * trace_packet { * track_descriptor { * track_uuid: 1234 * name: "my_track" * * // Optionally, associate the track with a thread. * thread_descriptor { * pid: 10 * tid: 10 * .. * } * } * } * ``` * * A pair of TYPE_SLICE_BEGIN and _END events form a slice on the track: * * ```protobuf * trace_packet { * timestamp: 1200 * track_event { * track_uuid: 1234 * categories: ["my_cat"] * name: "my_slice" * type: TYPE_SLICE_BEGIN * } * } * trace_packet { * timestamp: 1400 * track_event { * track_uuid: 1234 * type: TYPE_SLICE_END * } * } * ``` * TrackEvents also support optimizations to reduce data repetition and encoded * data size, e.g. through data interning (names, categories, ...) and delta * encoding of timestamps/counters. For details, see the InternedData message. * Further, default values for attributes of events on the same sequence (e.g. * their default track association) can be emitted as part of a * TrackEventDefaults message. * * Next reserved id: 13 (up to 15). Next id: 52. * * @generated from message perfetto.protos.TrackEvent */ export type TrackEvent = Message<"perfetto.protos.TrackEvent"> & { /** * Names of categories of the event. In the client library, categories are a * way to turn groups of individual events on or off. * interned EventCategoryName. * * @generated from field: repeated uint64 category_iids = 3; */ categoryIids: bigint[]; /** * non-interned variant. * * @generated from field: repeated string categories = 22; */ categories: string[]; /** * Optional name of the event for its display in trace viewer. May be left * unspecified for events with typed arguments. * * Note that metrics should not rely on event names, as they are prone to * changing. Instead, they should use typed arguments to identify the events * they are interested in. * * @generated from oneof perfetto.protos.TrackEvent.name_field */ nameField: { /** * interned EventName. * * @generated from field: uint64 name_iid = 10; */ value: bigint; case: "nameIid"; } | { /** * non-interned variant. * * @generated from field: string name = 23; */ value: string; case: "name"; } | { case: undefined; value?: undefined; }; /** * @generated from field: optional perfetto.protos.TrackEvent.Type type = 9; */ type: TrackEvent_Type; /** * Identifies the track of the event. The default value may be overridden * using TrackEventDefaults, e.g., to specify the track of the TraceWriter's * sequence (in most cases sequence = one thread). If no value is specified * here or in TrackEventDefaults, the TrackEvent will be associated with an * implicit trace-global track (uuid 0). See TrackDescriptor::uuid. * * @generated from field: optional uint64 track_uuid = 11; */ trackUuid: bigint; /** * A new value for a counter track. |track_uuid| should refer to a track with * a CounterDescriptor, and |type| should be TYPE_COUNTER. For a more * efficient encoding of counter values that are sampled at the beginning/end * of a slice, see |extra_counter_values| and |extra_counter_track_uuids|. * Counter values can optionally be encoded in as delta values (positive or * negative) on each packet sequence (see CounterIncrementalBase). * * @generated from oneof perfetto.protos.TrackEvent.counter_value_field */ counterValueField: { /** * @generated from field: int64 counter_value = 30; */ value: bigint; case: "counterValue"; } | { /** * @generated from field: double double_counter_value = 44; */ value: number; case: "doubleCounterValue"; } | { case: undefined; value?: undefined; }; /** * To encode counter values more efficiently, we support attaching additional * counter values to a TrackEvent of any type. All values will share the same * timestamp specified in the TracePacket. The value at * extra_counter_values[N] is for the counter track referenced by * extra_counter_track_uuids[N]. * * |extra_counter_track_uuids| may also be set via TrackEventDefaults. There * should always be equal or more uuids than values. It is valid to set more * uuids (e.g. via defaults) than values. If uuids are specified in * TrackEventDefaults and a TrackEvent, the TrackEvent uuids override the * default uuid list. * * For example, this allows snapshotting the thread time clock at each * thread-track BEGIN and END event to capture the cpu time delta of a slice. * * @generated from field: repeated uint64 extra_counter_track_uuids = 31; */ extraCounterTrackUuids: bigint[]; /** * @generated from field: repeated int64 extra_counter_values = 12; */ extraCounterValues: bigint[]; /** * Counter snapshots using floating point instead of integer values. * * @generated from field: repeated uint64 extra_double_counter_track_uuids = 45; */ extraDoubleCounterTrackUuids: bigint[]; /** * @generated from field: repeated double extra_double_counter_values = 46; */ extraDoubleCounterValues: number[]; /** * IDs of flows originating, passing through, or ending at this event. * Flow IDs are global within a trace. * * A flow connects a sequence of TrackEvents within or across tracks, e.g. * an input event may be handled on one thread but cause another event on * a different thread - a flow between the two events can associate them. * * The direction of the flows between events is inferred from the events' * timestamps. The earliest event with the same flow ID becomes the source * of the flow. Any events thereafter are intermediate steps of the flow, * until the flow terminates at the last event with the flow ID. * * Flows can also be explicitly terminated (see |terminating_flow_ids|), so * that the same ID can later be reused for another flow. * DEPRECATED. Only kept for backwards compatibility. Use |flow_ids|. * * @generated from field: repeated uint64 flow_ids_old = 36 [deprecated = true]; * @deprecated */ flowIdsOld: bigint[]; /** * TODO(b/204341740): replace "flow_ids_old" with "flow_ids" to reduce memory * consumption. * * @generated from field: repeated fixed64 flow_ids = 47; */ flowIds: bigint[]; /** * List of flow ids which should terminate on this event, otherwise same as * |flow_ids|. * Any one flow ID should be either listed as part of |flow_ids| OR * |terminating_flow_ids|, not both. * DEPRECATED. Only kept for backwards compatibility. Use * |terminating_flow_ids|. * * @generated from field: repeated uint64 terminating_flow_ids_old = 42 [deprecated = true]; * @deprecated */ terminatingFlowIdsOld: bigint[]; /** * TODO(b/204341740): replace "terminating_flow_ids_old" with * "terminating_flow_ids" to reduce memory consumption. * * @generated from field: repeated fixed64 terminating_flow_ids = 48; */ terminatingFlowIds: bigint[]; /** * Unstable key/value annotations shown in the trace viewer but not intended * for metrics use. * * @generated from field: repeated perfetto.protos.DebugAnnotation debug_annotations = 4; */ debugAnnotations: DebugAnnotation[]; /** * Typed event arguments: * * @generated from field: optional perfetto.protos.TaskExecution task_execution = 5; */ taskExecution?: TaskExecution; /** * @generated from field: optional perfetto.protos.LogMessage log_message = 21; */ logMessage?: LogMessage; /** * @generated from field: optional perfetto.protos.ChromeCompositorSchedulerState cc_scheduler_state = 24; */ ccSchedulerState?: ChromeCompositorSchedulerState; /** * @generated from field: optional perfetto.protos.ChromeUserEvent chrome_user_event = 25; */ chromeUserEvent?: ChromeUserEvent; /** * @generated from field: optional perfetto.protos.ChromeKeyedService chrome_keyed_service = 26; */ chromeKeyedService?: ChromeKeyedService; /** * @generated from field: optional perfetto.protos.ChromeLegacyIpc chrome_legacy_ipc = 27; */ chromeLegacyIpc?: ChromeLegacyIpc; /** * @generated from field: optional perfetto.protos.ChromeHistogramSample chrome_histogram_sample = 28; */ chromeHistogramSample?: ChromeHistogramSample; /** * @generated from field: optional perfetto.protos.ChromeLatencyInfo chrome_latency_info = 29; */ chromeLatencyInfo?: ChromeLatencyInfo; /** * @generated from field: optional perfetto.protos.ChromeFrameReporter chrome_frame_reporter = 32; */ chromeFrameReporter?: ChromeFrameReporter; /** * @generated from field: optional perfetto.protos.ChromeApplicationStateInfo chrome_application_state_info = 39; */ chromeApplicationStateInfo?: ChromeApplicationStateInfo; /** * @generated from field: optional perfetto.protos.ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40; */ chromeRendererSchedulerState?: ChromeRendererSchedulerState; /** * @generated from field: optional perfetto.protos.ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41; */ chromeWindowHandleEventInfo?: ChromeWindowHandleEventInfo; /** * @generated from field: optional perfetto.protos.ChromeContentSettingsEventInfo chrome_content_settings_event_info = 43; */ chromeContentSettingsEventInfo?: ChromeContentSettingsEventInfo; /** * @generated from field: optional perfetto.protos.ChromeActiveProcesses chrome_active_processes = 49; */ chromeActiveProcesses?: ChromeActiveProcesses; /** * @generated from field: optional perfetto.protos.Screenshot screenshot = 50; */ screenshot?: Screenshot; /** * This field is used only if the source location represents the function that * executes during this event. * * @generated from oneof perfetto.protos.TrackEvent.source_location_field */ sourceLocationField: { /** * Non-interned field. * * @generated from field: perfetto.protos.SourceLocation source_location = 33; */ value: SourceLocation; case: "sourceLocation"; } | { /** * Interned field. * * @generated from field: uint64 source_location_iid = 34; */ value: bigint; case: "sourceLocationIid"; } | { case: undefined; value?: undefined; }; /** * @generated from field: optional perfetto.protos.ChromeMessagePump chrome_message_pump = 35; */ chromeMessagePump?: ChromeMessagePump; /** * @generated from field: optional perfetto.protos.ChromeMojoEventInfo chrome_mojo_event_info = 38; */ chromeMojoEventInfo?: ChromeMojoEventInfo; /** * Deprecated. Use the |timestamp| and |timestamp_clock_id| fields in * TracePacket instead. * * Timestamp in microseconds (usually CLOCK_MONOTONIC). * * @generated from oneof perfetto.protos.TrackEvent.timestamp */ timestamp: { /** * Delta timestamp value since the last TrackEvent or ThreadDescriptor. To * calculate the absolute timestamp value, sum up all delta values of the * preceding TrackEvents since the last ThreadDescriptor and add the sum to * the |reference_timestamp| in ThreadDescriptor. This value should always * be positive. * * @generated from field: int64 timestamp_delta_us = 1; */ value: bigint; case: "timestampDeltaUs"; } | { /** * Absolute value (e.g. a manually specified timestamp in the macro). * This is a one-off value that does not affect delta timestamp computation * in subsequent TrackEvents. * * @generated from field: int64 timestamp_absolute_us = 16; */ value: bigint; case: "timestampAbsoluteUs"; } | { case: undefined; value?: undefined; }; /** * Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to * encode thread time instead. * * CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in * microseconds. * * @generated from oneof perfetto.protos.TrackEvent.thread_time */ threadTime: { /** * Delta timestamp value since the last TrackEvent or ThreadDescriptor. To * calculate the absolute timestamp value, sum up all delta values of the * preceding TrackEvents since the last ThreadDescriptor and add the sum to * the |reference_timestamp| in ThreadDescriptor. This value should always * be positive. * * @generated from field: int64 thread_time_delta_us = 2; */ value: bigint; case: "threadTimeDeltaUs"; } | { /** * This is a one-off absolute value that does not affect delta timestamp * computation in subsequent TrackEvents. * * @generated from field: int64 thread_time_absolute_us = 17; */ value: bigint; case: "threadTimeAbsoluteUs"; } | { case: undefined; value?: undefined; }; /** * Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to * encode thread instruction count instead. * * Value of the instruction counter for the current thread. * * @generated from oneof perfetto.protos.TrackEvent.thread_instruction_count */ threadInstructionCount: { /** * Same encoding as |thread_time| field above. * * @generated from field: int64 thread_instruction_count_delta = 8; */ value: bigint; case: "threadInstructionCountDelta"; } | { /** * @generated from field: int64 thread_instruction_count_absolute = 20; */ value: bigint; case: "threadInstructionCountAbsolute"; } | { case: undefined; value?: undefined; }; /** * @generated from field: optional perfetto.protos.TrackEvent.LegacyEvent legacy_event = 6; */ legacyEvent?: TrackEvent_LegacyEvent; }; /** * Describes the message perfetto.protos.TrackEvent. * Use `create(TrackEventSchema)` to create a new message. */ export declare const TrackEventSchema: GenMessage<TrackEvent>; /** * Apart from {category, time, thread time, tid, pid}, other legacy trace * event attributes are initially simply proxied for conversion to a JSON * trace. We intend to gradually transition these attributes to similar native * features in TrackEvent (e.g. async + flow events), or deprecate them * without replacement where transition is unsuitable. * * Next reserved id: 16 (up to 16). * Next id: 20. * * @generated from message perfetto.protos.TrackEvent.LegacyEvent */ export type TrackEvent_LegacyEvent = Message<"perfetto.protos.TrackEvent.LegacyEvent"> & { /** * Deprecated, use TrackEvent::name(_iid) instead. * interned EventName. * * @generated from field: optional uint64 name_iid = 1; */ nameIid: bigint; /** * @generated from field: optional int32 phase = 2; */ phase: number; /** * @generated from field: optional int64 duration_us = 3; */ durationUs: bigint; /** * @generated from field: optional int64 thread_duration_us = 4; */ threadDurationUs: bigint; /** * Elapsed retired instruction count during the event. * * @generated from field: optional int64 thread_instruction_delta = 15; */ threadInstructionDelta: bigint; /** * @generated from oneof perfetto.protos.TrackEvent.LegacyEvent.id */ id: { /** * @generated from field: uint64 unscoped_id = 6; */ value: bigint; case: "unscopedId"; } | { /** * @generated from field: uint64 local_id = 10; */ value: bigint; case: "localId"; } | { /** * @generated from field: uint64 global_id = 11; */ value: bigint; case: "globalId"; } | { case: undefined; value?: undefined; }; /** * Additional optional scope for |id|. * * @generated from field: optional string id_scope = 7; */ idScope: string; /** * Consider the thread timestamps for async BEGIN/END event pairs as valid. * * @generated from field: optional bool use_async_tts = 9; */ useAsyncTts: boolean; /** * Idenfifies a flow. Flow events with the same bind_id are connected. * * @generated from field: optional uint64 bind_id = 8; */ bindId: bigint; /** * Use the enclosing slice as binding point for a flow end event instead of * the next slice. Flow start/step events always bind to the enclosing * slice. * * @generated from field: optional bool bind_to_enclosing = 12; */ bindToEnclosing: boolean; /** * @generated from field: optional perfetto.protos.TrackEvent.LegacyEvent.FlowDirection flow_direction = 13; */ flowDirection: TrackEvent_LegacyEvent_FlowDirection; /** * @generated from field: optional perfetto.protos.TrackEvent.LegacyEvent.InstantEventScope instant_event_scope = 14; */ instantEventScope: TrackEvent_LegacyEvent_InstantEventScope; /** * Override the pid/tid if the writer needs to emit events on behalf of * another process/thread. This should be the exception. Normally, the * pid+tid from ThreadDescriptor is used. * * @generated from field: optional int32 pid_override = 18; */ pidOverride: number; /** * @generated from field: optional int32 tid_override = 19; */ tidOverride: number; }; /** * Describes the message perfetto.protos.TrackEvent.LegacyEvent. * Use `create(TrackEvent_LegacyEventSchema)` to create a new message. */ export declare const TrackEvent_LegacyEventSchema: GenMessage<TrackEvent_LegacyEvent>; /** * @generated from enum perfetto.protos.TrackEvent.LegacyEvent.FlowDirection */ export declare enum TrackEvent_LegacyEvent_FlowDirection { /** * @generated from enum value: FLOW_UNSPECIFIED = 0; */ FLOW_UNSPECIFIED = 0, /** * @generated from enum value: FLOW_IN = 1; */ FLOW_IN = 1, /** * @generated from enum value: FLOW_OUT = 2; */ FLOW_OUT = 2, /** * @generated from enum value: FLOW_INOUT = 3; */ FLOW_INOUT = 3 } /** * Describes the enum perfetto.protos.TrackEvent.LegacyEvent.FlowDirection. */ export declare const TrackEvent_LegacyEvent_FlowDirectionSchema: GenEnum<TrackEvent_LegacyEvent_FlowDirection>; /** * @generated from enum perfetto.protos.TrackEvent.LegacyEvent.InstantEventScope */ export declare enum TrackEvent_LegacyEvent_InstantEventScope { /** * @generated from enum value: SCOPE_UNSPECIFIED = 0; */ SCOPE_UNSPECIFIED = 0, /** * @generated from enum value: SCOPE_GLOBAL = 1; */ SCOPE_GLOBAL = 1, /** * @generated from enum value: SCOPE_PROCESS = 2; */ SCOPE_PROCESS = 2, /** * @generated from enum value: SCOPE_THREAD = 3; */ SCOPE_THREAD = 3 } /** * Describes the enum perfetto.protos.TrackEvent.LegacyEvent.InstantEventScope. */ export declare const TrackEvent_LegacyEvent_InstantEventScopeSchema: GenEnum<TrackEvent_LegacyEvent_InstantEventScope>; /** * Type of the TrackEvent (required if |phase| in LegacyEvent is not set). * * @generated from enum perfetto.protos.TrackEvent.Type */ export declare enum TrackEvent_Type { /** * @generated from enum value: TYPE_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Slice events are events that have a begin and end timestamp, i.e. a * duration. They can be nested similar to a callstack: If, on the same * track, event B begins after event A, but before A ends, B is a child * event of A and will be drawn as a nested event underneath A in the UI. * Note that child events should always end before their parents (e.g. B * before A). * * Each slice event is formed by a pair of BEGIN + END events. The END event * does not need to repeat any TrackEvent fields it has in common with its * corresponding BEGIN event. Arguments and debug annotations of the BEGIN + * END pair will be merged during trace import. * * Note that we deliberately chose not to support COMPLETE events (which * would specify a duration directly) since clients would need to delay * writing them until the slice is completed, which can result in reordered * events in the trace and loss of unfinished events at the end of a trace. * * @generated from enum value: TYPE_SLICE_BEGIN = 1; */ SLICE_BEGIN = 1, /** * @generated from enum value: TYPE_SLICE_END = 2; */ SLICE_END = 2, /** * Instant events are nestable events without duration. They can be children * of slice events on the same track. * * @generated from enum value: TYPE_INSTANT = 3; */ INSTANT = 3, /** * Event that provides a value for a counter track. |track_uuid| should * refer to a counter track and |counter_value| set to the new value. Note * that most other TrackEvent fields (e.g. categories, name, ..) are not * supported for TYPE_COUNTER events. See also CounterDescriptor. * * @generated from enum value: TYPE_COUNTER = 4; */ COUNTER = 4 } /** * Describes the enum perfetto.protos.TrackEvent.Type. */ export declare const TrackEvent_TypeSchema: GenEnum<TrackEvent_Type>; /** * Default values for fields of all TrackEvents on the same packet sequence. * Should be emitted as part of TracePacketDefaults whenever incremental state * is cleared. It's defined here because field IDs should match those of the * corresponding fields in TrackEvent. * * @generated from message perfetto.protos.TrackEventDefaults */ export type TrackEventDefaults = Message<"perfetto.protos.TrackEventDefaults"> & { /** * @generated from field: optional uint64 track_uuid = 11; */ trackUuid: bigint; /** * @generated from field: repeated uint64 extra_counter_track_uuids = 31; */ extraCounterTrackUuids: bigint[]; /** * @generated from field: repeated uint64 extra_double_counter_track_uuids = 45; */ extraDoubleCounterTrackUuids: bigint[]; }; /** * Describes the message perfetto.protos.TrackEventDefaults. * Use `create(TrackEventDefaultsSchema)` to create a new message. */ export declare const TrackEventDefaultsSchema: GenMessage<TrackEventDefaults>; /** * @generated from message perfetto.protos.EventCategory */ export type EventCategory = Message<"perfetto.protos.EventCategory"> & { /** * @generated from field: optional uint64 iid = 1; */ iid: bigint; /** * @generated from field: optional string name = 2; */ name: string; }; /** * Describes the message perfetto.protos.EventCategory. * Use `create(EventCategorySchema)` to create a new message. */ export declare const EventCategorySchema: GenMessage<EventCategory>; /** * @generated from message perfetto.protos.EventName */ export type EventName = Message<"perfetto.protos.EventName"> & { /** * @generated from field: optional uint64 iid = 1; */ iid: bigint; /** * @generated from field: optional string name = 2; */ name: string; }; /** * Describes the message perfetto.protos.EventName. * Use `create(EventNameSchema)` to create a new message. */ export declare const EventNameSchema: GenMessage<EventName>; //# sourceMappingURL=track_event_pb.d.ts.map