xref: /aosp_15_r20/external/pigweed/third_party/perfetto/repo/protos/perfetto/trace/perfetto_trace.proto (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1// AUTOGENERATED - DO NOT EDIT
2// ---------------------------
3// This file has been generated by
4// AOSP://external/perfetto/tools/gen_merged_protos
5// merging the perfetto config protos.
6// This fused proto is intended to be copied in:
7//  - Android tree, for statsd.
8//  - Google internal repos.
9
10syntax = "proto2";
11
12package perfetto.protos;
13
14option go_package = "github.com/google/perfetto/perfetto_proto";
15
16// Begin of protos/perfetto/common/ftrace_descriptor.proto
17
18message FtraceDescriptor {
19  message AtraceCategory {
20    optional string name = 1;
21    optional string description = 2;
22  }
23
24  // Report the available atrace categories.
25  //
26  // Used by Traceur via `perfetto --query`.
27  repeated AtraceCategory atrace_categories = 1;
28}
29
30// End of protos/perfetto/common/ftrace_descriptor.proto
31
32// Begin of protos/perfetto/common/gpu_counter_descriptor.proto
33
34// Description of GPU counters.
35// This message is sent by a GPU counter producer to specify the counters
36// available in the hardware.
37message GpuCounterDescriptor {
38  // Logical groups for a counter.  This is used in the UI to present the
39  // related counters together.
40  enum GpuCounterGroup {
41    UNCLASSIFIED = 0;
42    SYSTEM = 1;
43    VERTICES = 2;
44    FRAGMENTS = 3;
45    PRIMITIVES = 4;
46    // Includes counters relating to caching and bandwidth.
47    MEMORY = 5;
48    COMPUTE = 6;
49  }
50
51  message GpuCounterSpec {
52    optional uint32 counter_id = 1;
53    optional string name = 2;
54    optional string description = 3;
55    // MeasureUnit unit (deprecated)
56    reserved 4;
57    oneof peak_value {
58      int64 int_peak_value = 5;
59      double double_peak_value = 6;
60    }
61    repeated MeasureUnit numerator_units = 7;
62    repeated MeasureUnit denominator_units = 8;
63    optional bool select_by_default = 9;
64    repeated GpuCounterGroup groups = 10;
65  }
66  repeated GpuCounterSpec specs = 1;
67
68  // Allow producer to group counters into block to represent counter islands.
69  // A capacity may be specified to indicate the number of counters that can be
70  // enable simultaneously in that block.
71  message GpuCounterBlock {
72    // required. Unique ID for the counter group.
73    optional uint32 block_id = 1;
74    // optional. Number of counters supported by the block. No limit if unset.
75    optional uint32 block_capacity = 2;
76    // optional. Name of block.
77    optional string name = 3;
78    // optional. Description for the block.
79    optional string description = 4;
80    // list of counters that are part of the block.
81    repeated uint32 counter_ids = 5;
82  }
83  repeated GpuCounterBlock blocks = 2;
84
85  // optional.  Minimum sampling period supported by the producer in
86  // nanoseconds.
87  optional uint64 min_sampling_period_ns = 3;
88
89  // optional.  Maximum sampling period supported by the producer in
90  // nanoseconds.
91  optional uint64 max_sampling_period_ns = 4;
92
93  // optional.  The producer supports counter sampling by instrumenting the
94  // command buffer.
95  optional bool supports_instrumented_sampling = 5;
96
97  // next id: 41
98  enum MeasureUnit {
99    NONE = 0;
100
101    BIT = 1;
102    KILOBIT = 2;
103    MEGABIT = 3;
104    GIGABIT = 4;
105    TERABIT = 5;
106    PETABIT = 6;
107
108    BYTE = 7;
109    KILOBYTE = 8;
110    MEGABYTE = 9;
111    GIGABYTE = 10;
112    TERABYTE = 11;
113    PETABYTE = 12;
114
115    HERTZ = 13;
116    KILOHERTZ = 14;
117    MEGAHERTZ = 15;
118    GIGAHERTZ = 16;
119    TERAHERTZ = 17;
120    PETAHERTZ = 18;
121
122    NANOSECOND = 19;
123    MICROSECOND = 20;
124    MILLISECOND = 21;
125    SECOND = 22;
126    MINUTE = 23;
127    HOUR = 24;
128
129    VERTEX = 25;
130    PIXEL = 26;
131    TRIANGLE = 27;
132    PRIMITIVE = 38;
133    FRAGMENT = 39;
134
135    MILLIWATT = 28;
136    WATT = 29;
137    KILOWATT = 30;
138
139    JOULE = 31;
140    VOLT = 32;
141    AMPERE = 33;
142
143    CELSIUS = 34;
144    FAHRENHEIT = 35;
145    KELVIN = 36;
146
147    // Values should be out of 100.
148    PERCENT = 37;
149
150    INSTRUCTION = 40;
151  }
152}
153
154// End of protos/perfetto/common/gpu_counter_descriptor.proto
155
156// Begin of protos/perfetto/common/track_event_descriptor.proto
157
158message TrackEventCategory {
159  optional string name = 1;
160  optional string description = 2;
161  repeated string tags = 3;
162}
163
164message TrackEventDescriptor {
165  repeated TrackEventCategory available_categories = 1;
166}
167
168// End of protos/perfetto/common/track_event_descriptor.proto
169
170// Begin of protos/perfetto/common/data_source_descriptor.proto
171
172// This message is sent from Producer(s) to the tracing Service when registering
173// to advertise their capabilities. It describes the structure of tracing
174// protos that will be produced by the data source and the supported filters.
175message DataSourceDescriptor {
176  // e.g., "linux.ftrace", "chromium.tracing"
177  optional string name = 1;
178
179  // When non-zero, this is a unique ID within the scope of the Producer for
180  // this data source (it is NOT globally unique). This is useful to
181  // differentiate between data sources with matching names when calling
182  // UpdateDataSource(). This field has been introduced in November 2021
183  // (v22, Android T) and is not supported on older versions.
184  optional uint64 id = 7;
185
186  // When true the data source is expected to ack the stop request through the
187  // NotifyDataSourceStopped() IPC. This field has been introduced after
188  // Android P in Jul 2018 and is not supported on older versions.
189  optional bool will_notify_on_stop = 2;
190
191  // When true the data source is expected to ack the start request through the
192  // NotifyDataSourceStarted() IPC. This field has been introduced after
193  // Android P in March 2019 and is not supported on older versions.
194  optional bool will_notify_on_start = 3;
195
196  // If true, opt into receiving the ClearIncrementalState() IPC. This should be
197  // set if the data source writes packets that refer to previous trace
198  // contents, and knows how to stop referring to the already-emitted data.
199  optional bool handles_incremental_state_clear = 4;
200
201  // If true, indicates that the data source does nothing upon Flush. This
202  // allows the service to reduce the flush-related IPC traffic and better deal
203  // with frozen producers (see go/perfetto-frozen). This is usually the case
204  // for data sources like 'track_event' that don't have access to the various
205  // thread task runners to post a flush task and rely purely on server-side
206  // scraping.
207  // Introduced in v39 / Android V.
208  optional bool no_flush = 9;
209
210  // Optional specification about available GPU counters.
211  optional GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true];
212
213  optional TrackEventDescriptor track_event_descriptor = 6 [lazy = true];
214
215  optional FtraceDescriptor ftrace_descriptor = 8 [lazy = true];
216}
217
218// End of protos/perfetto/common/data_source_descriptor.proto
219
220// Begin of protos/perfetto/common/tracing_service_state.proto
221
222// Reports the state of the tracing service. Used to gather details about the
223// data sources connected.
224// See ConsumerPort::QueryServiceState().
225message TracingServiceState {
226  // Describes a producer process.
227  message Producer {
228    // Unique ID of the producer (monotonic counter).
229    optional int32 id = 1;
230
231    // Typically matches the process name.
232    optional string name = 2;
233
234    // Unix pid of the remote process. Supported only on Linux-based systems.
235    // Introduced in v24 / Android T.
236    optional int32 pid = 5;
237
238    // Unix uid of the remote process.
239    optional int32 uid = 3;
240
241    // The version of the client library used by the producer.
242    // This is a human readable string with and its format varies depending on
243    // the build system and the repo (standalone vs AOSP).
244    // This is intended for human debugging only.
245    optional string sdk_version = 4;
246  }
247
248  // Describes a data source registered by a producer. Data sources are listed
249  // regardless of the fact that they are being used or not.
250  message DataSource {
251    // Descriptor passed by the data source when calling RegisterDataSource().
252    optional DataSourceDescriptor ds_descriptor = 1;
253
254    // ID of the producer, as per Producer.id.
255    optional int32 producer_id = 2;
256  }
257
258  message TracingSession {
259    // The TracingSessionID.
260    optional uint64 id = 1;
261
262    // The Unix uid of the consumer that started the session.
263    // This is meaningful only if the caller is root. In all other cases only
264    // tracing sessions that match the caller UID will be displayed.
265    optional int32 consumer_uid = 2;
266
267    // Internal state of the tracing session.
268    // These strings are FYI only and subjected to change.
269    optional string state = 3;
270
271    // The unique_session_name as set in the trace config (might be empty).
272    optional string unique_session_name = 4;
273
274    // The number and size of each buffer.
275    repeated uint32 buffer_size_kb = 5;
276
277    // Duration, as specified in the TraceConfig.duration_ms.
278    optional uint32 duration_ms = 6;
279
280    // Number of data sources involved in the session.
281    optional uint32 num_data_sources = 7;
282
283    // Time when the session was started, in the CLOCK_REALTIME domain.
284    // Available only on Linux-based systems.
285    optional int64 start_realtime_ns = 8;
286
287    // The fields below have been introduced in v42.
288
289    // The bugreport_score, as set in TraceConfig.bugreport_score.
290    optional int32 bugreport_score = 9;
291
292    // As per TraceConfig.bugreport_filename.
293    optional string bugreport_filename = 10;
294
295    // If true, the session is in the STARTED state. If false the session is in
296    // any other state (see `state` field).
297    optional bool is_started = 11;
298  }
299
300  // Lists all the producers connected.
301  repeated Producer producers = 1;
302
303  // Lists the data sources available.
304  repeated DataSource data_sources = 2;
305
306  // Lists the tracing sessions active AND owned by a consumer that has the same
307  // UID of the caller (or all of them if the caller is root).
308  // Introduced in v24 / Android T.
309  repeated TracingSession tracing_sessions = 6;
310
311  // This is always set to true from v24 and beyond. This flag is only used to
312  // tell the difference between: (1) talking to a recent service which happens
313  // to have no tracing session active; (2) talking to an older version of the
314  // service which will never report any tracing session.
315  optional bool supports_tracing_sessions = 7;
316
317  // Total number of tracing sessions.
318  optional int32 num_sessions = 3;
319
320  // Number of tracing sessions in the started state. Always <= num_sessions.
321  optional int32 num_sessions_started = 4;
322
323  // The version of traced (the same returned by `traced --version`).
324  // This is a human readable string with and its format varies depending on
325  // the build system and the repo (standalone vs AOSP).
326  // This is intended for human debugging only.
327  optional string tracing_service_version = 5;
328}
329
330// End of protos/perfetto/common/tracing_service_state.proto
331
332// Begin of protos/perfetto/common/builtin_clock.proto
333
334enum BuiltinClock {
335  BUILTIN_CLOCK_UNKNOWN = 0;
336  BUILTIN_CLOCK_REALTIME = 1;
337  BUILTIN_CLOCK_REALTIME_COARSE = 2;
338  BUILTIN_CLOCK_MONOTONIC = 3;
339  BUILTIN_CLOCK_MONOTONIC_COARSE = 4;
340  BUILTIN_CLOCK_MONOTONIC_RAW = 5;
341  BUILTIN_CLOCK_BOOTTIME = 6;
342  BUILTIN_CLOCK_TSC = 9;
343  BUILTIN_CLOCK_MAX_ID = 63;
344
345  reserved 7, 8;
346}
347
348// End of protos/perfetto/common/builtin_clock.proto
349
350// Begin of protos/perfetto/config/android/android_game_intervention_list_config.proto
351
352// Data source that lists game modes and game interventions of games
353// on an Android device.
354message AndroidGameInterventionListConfig {
355  // If not empty, emit info about only the following list of package names
356  // (exact match, no regex). Otherwise, emit info about all packages.
357  repeated string package_name_filter = 1;
358}
359
360// End of protos/perfetto/config/android/android_game_intervention_list_config.proto
361
362// Begin of protos/perfetto/config/android/android_input_event_config.proto
363
364// Custom configuration for the "android.input.inputevent" data source.
365//
366// NOTE: Input traces can only be taken on debuggable (userdebug/eng) builds!
367//
368// Next ID: 5
369message AndroidInputEventConfig {
370
371    // Trace modes are tracing presets that are included in the system.
372    enum TraceMode {
373        // Preset mode for maximal tracing.
374        // WARNING: This will bypass all privacy measures on debuggable builds, and will record all
375        //          input events processed by the system, regardless of the context in which they
376        //          were processed. It should only be used for tracing on a local device or for
377        //          tests. It should NEVER be used for field tracing.
378        TRACE_MODE_TRACE_ALL = 0;
379        // Use the tracing rules defined in this config to specify what events to trace.
380        TRACE_MODE_USE_RULES = 1;
381    }
382
383    // The tracing mode to use. If unspecified, it will default to TRACE_MODE_USE_RULES.
384    optional TraceMode mode = 1;
385
386    // The level of tracing that should be applied to an event.
387    enum TraceLevel {
388        // Do not trace the input event.
389        TRACE_LEVEL_NONE = 0;
390        // Trace the event as a redacted event, where certain sensitive fields are omitted from
391        // the trace, including the coordinates of pointer events and the key/scan codes of key
392        // events.
393        TRACE_LEVEL_REDACTED = 1;
394        // Trace the complete event.
395        TRACE_LEVEL_COMPLETE = 2;
396    }
397
398    // A rule that specifies the TraceLevel for an event based on matching conditions.
399    // All matchers in the rule are optional. To trigger this rule, an event must match all
400    // of its specified matchers (i.e. the matchers function like a series of conditions connected
401    // by a logical 'AND' operator). A rule with no specified matchers will match all events.
402    // Next ID: 6
403    message TraceRule {
404        // The trace level to be used for events that trigger this rule.
405        // If unspecified, TRACE_LEVEL_NONE will be used by default.
406        optional TraceLevel trace_level = 1;
407
408        // --- Optional Matchers ---
409
410        // Package matchers
411        //
412        // Respectively matches if all or any of the target apps for this event are contained in
413        // the specified list of package names.
414        //
415        // Intended usage:
416        //   - Use match_all_packages to selectively allow tracing for the listed packages.
417        //   - Use match_any_packages to selectively deny tracing for certain packages.
418        //
419        // WARNING: Great care must be taken when designing rules for field tracing!
420        //          This is because each event is almost always sent to more than one app.
421        //              For example, when allowing tracing for a package that has a spy window
422        //          over the display (e.g. SystemUI) using match_any_packages, essentially all
423        //          input will be recorded on that display. This is because the events will be sent
424        //          to the spy as well as the foreground app, and regardless of what the foreground
425        //          app is, the event will end up being traced.
426        //              Alternatively, when attempting to block tracing for specific packages using
427        //          match_all_packages, no events will likely be blocked. This is because the event
428        //          will also be sent to other apps (such as, but not limited to, ones with spy
429        //          windows), so the matcher will not match unless all other targets are also
430        //          listed under the match_all_packages list.
431        repeated string match_all_packages = 2;
432        repeated string match_any_packages = 3;
433
434        // Matches if the event is secure, which means that at least one of the targets of
435        // this event is using the window flag FLAG_SECURE.
436        optional bool match_secure = 4;
437
438        // Matches if there was an active IME connection while this event was being processed.
439        optional bool match_ime_connection_active = 5;
440    }
441
442    // The list of rules to use to determine the trace level of events.
443    // Each event will be traced using the TraceLevel of the first rule that it triggers
444    // from this list. The rules are evaluated in the order in which they are specified.
445    // If an event does not match any of the rules, TRACE_LEVEL_NONE will be used by default.
446    repeated TraceRule rules = 2;
447
448    // --- Control flags ---
449
450    // Trace input events processed by the system as they are being dispatched
451    // to application windows. All trace rules will apply.
452    //   - If this flag is used without enabling trace_dispatcher_window_dispatch, it will
453    //     trace InputDispatcher's inbound events (which does not include events synthesized
454    //     within InputDispatcher) that match the rules.
455    //   - If used with trace_dispatcher_window_dispatch, all inbound and outbound events
456    //     matching the rules, including all events synthesized within InputDispatcher,
457    //     will be traced.
458    optional bool trace_dispatcher_input_events = 3;
459
460    // Trace details about which windows the system is sending each input event to.
461    // All trace rules will apply.
462    optional bool trace_dispatcher_window_dispatch = 4;
463}
464
465// End of protos/perfetto/config/android/android_input_event_config.proto
466
467// Begin of protos/perfetto/common/android_log_constants.proto
468
469// Values from NDK's android/log.h.
470enum AndroidLogId {
471  // MAIN.
472  LID_DEFAULT = 0;
473
474  LID_RADIO = 1;
475  LID_EVENTS = 2;
476  LID_SYSTEM = 3;
477  LID_CRASH = 4;
478  LID_STATS = 5;
479  LID_SECURITY = 6;
480  LID_KERNEL = 7;
481}
482
483enum AndroidLogPriority {
484  PRIO_UNSPECIFIED = 0;
485
486  // _DEFAULT, but should never be seen in logs.
487  PRIO_UNUSED = 1;
488
489  PRIO_VERBOSE = 2;
490  PRIO_DEBUG = 3;
491  PRIO_INFO = 4;
492  PRIO_WARN = 5;
493  PRIO_ERROR = 6;
494  PRIO_FATAL = 7;
495}
496
497// End of protos/perfetto/common/android_log_constants.proto
498
499// Begin of protos/perfetto/config/android/android_log_config.proto
500
501message AndroidLogConfig {
502  repeated AndroidLogId log_ids = 1;
503
504  // Was |poll_ms|, deprecated.
505  reserved 2;
506
507  // If set ignores all log messages whose prio is < the given value.
508  optional AndroidLogPriority min_prio = 3;
509
510  // If non-empty ignores all log messages whose tag doesn't match one of the
511  // specified values.
512  repeated string filter_tags = 4;
513}
514
515// End of protos/perfetto/config/android/android_log_config.proto
516
517// Begin of protos/perfetto/config/android/android_polled_state_config.proto
518
519// Data source that polls for display state. This should only be used for
520// backward-compatibility; AndroidSystemPropertyConfig should be preferred.
521message AndroidPolledStateConfig {
522  // Frequency of polling. If absent the state will be recorded once, at the
523  // start of the trace.
524  // This is required to be > 100ms to avoid excessive CPU usage.
525  optional uint32 poll_ms = 1;
526}
527
528// End of protos/perfetto/config/android/android_polled_state_config.proto
529
530// Begin of protos/perfetto/config/android/android_sdk_sysprop_guard_config.proto
531
532// Data source that controls the system properties used to guard initialization
533// of track_event producers (i.e. Skia) in apps using HWUI, and certain
534// processes like SurfaceFlinger.
535//
536// This data source only tells Skia to initialized the Perfetto SDK and start
537// routing data to the Track Event system instead of ATrace. For those events
538// to actually show up in a trace, the track_event data source must be used as
539// well. The Perfetto SDK cannot be de-initialized, so some long-lived apps and
540// processes may need to be restarted for Skia to revert to using ATrace if
541// Track Events are no longer desired.
542//
543// In addition to switching Skia to use Perfetto's track_event data source,
544// this "guard" also controls Skia's "broad tracing", which removes Skia's
545// internal tracing constraints and allows the track_event config to specify
546// which categories should be traced. Filtering to the "skia.always" category
547// *tag* in a track_event config can be used to re-enable the standard
548// constraints typically used with ATrace.
549//
550// Data source name: android.sdk_sysprop_guard
551// Introduced in Android 14 (U) QPR1.
552// Next id: 4
553message AndroidSdkSyspropGuardConfig {
554  // If true, configures SurfaceFlinger to initialize Skia's Perfetto
555  // integration with the track_event data source in RenderEngine.
556  // If false or omitted, the simpler ATrace fallback is used.
557  //
558  // NOTE: once enabled, Skia will only revert to ATrace if SurfaceFlinger is
559  // restarted.
560  //
561  // Specifically this sets the following system properties:
562  //   - debug.tracing.ctl.renderengine.skia_tracing_enabled
563  //   - debug.tracing.ctl.renderengine.skia_use_perfetto_track_events
564  //
565  // Does not affect actual track_event data *collection*, which must be
566  // configured seperately.
567  optional bool surfaceflinger_skia_track_events = 1;
568
569  // If true, configures HWUI apps to initialize Skia's Perfetto integration
570  // with the track_event data source. hwui_package_name_filter
571  // can be used to control which apps are affected.
572  // If false or omitted, the simpler ATrace fallback is used.
573  //
574  // NOTE: once enabled, Skia will only revert to ATrace if the app is
575  // restarted.
576  //
577  // ATTENTION: affects ALL HWUI APPS if hwui_package_name_filter is not set!
578  // If filtering is NOT set, this controls these GLOBAL system properties:
579  //   - debug.tracing.ctl.hwui.skia_tracing_enabled
580  //   - debug.tracing.ctl.hwui.skia_use_perfetto_track_events
581  // If filtering IS set, this controls these APP-SPECIFIC system properties,
582  // for each package listed in the filter:
583  //   - debug.tracing.ctl.hwui.skia_tracing_enabled.<package.name>
584  //   - debug.tracing.ctl.hwui.skia_use_perfetto_track_events.<package.name>
585  //
586  // Does not affect actual track_event data *collection*, which must be
587  // configured seperately.
588  optional bool hwui_skia_track_events = 2;
589
590  // If non-empty, hwui_skia_track_events applies to only the packages listed.
591  // Otherwise, hwui_skia_track_events applies globally to all HWUI apps.
592  repeated string hwui_package_name_filter = 3;
593}
594
595// End of protos/perfetto/config/android/android_sdk_sysprop_guard_config.proto
596
597// Begin of protos/perfetto/config/android/android_system_property_config.proto
598
599// Data source that polls for system properties.
600message AndroidSystemPropertyConfig {
601  // Frequency of polling. If absent the state will be recorded once, at the
602  // start of the trace.
603  // This is required to be > 100ms to avoid excessive CPU usage.
604  optional uint32 poll_ms = 1;
605
606  // Properties to poll. All property names must start with "debug.tracing.".
607  repeated string property_name = 2;
608}
609
610// End of protos/perfetto/config/android/android_system_property_config.proto
611
612// Begin of protos/perfetto/config/android/network_trace_config.proto
613
614// Network tracing data source that records details on all packets sent or
615// received by the network.
616message NetworkPacketTraceConfig {
617  // Polling frequency in milliseconds. Network tracing writes to a fixed size
618  // ring buffer. The polling interval should be such that the ring buffer is
619  // unlikely to fill in that interval (or that filling is an acceptable risk).
620  // The minimum polling rate is 100ms (values below this are ignored).
621  // Introduced in Android 14 (U).
622  optional uint32 poll_ms = 1;
623
624  // The aggregation_threshold is the number of packets at which an event will
625  // switch from per-packet details to aggregate details. For example, a value
626  // of 50 means that if a particular event (grouped by the unique combinations
627  // of metadata fields: {interface, direction, uid, etc}) has fewer than 50
628  // packets, the exact timestamp and length are recorded for each packet. If
629  // there were 50 or more packets in an event, it would only record the total
630  // duration, packets, and length. A value of zero or unspecified will always
631  /// record per-packet details. A value of 1 always records aggregate details.
632  optional uint32 aggregation_threshold = 2;
633
634  // Specifies the maximum number of packet contexts to intern at a time. This
635  // prevents the interning table from growing too large and controls whether
636  // interning is enabled or disabled (a value of zero disables interning and
637  // is the default). When a data sources interning table reaches this amount,
638  // packet contexts will be inlined into NetworkPacketEvents.
639  optional uint32 intern_limit = 3;
640
641  // The following fields specify whether certain fields should be dropped from
642  // the output. Dropping fields improves normalization results, reduces the
643  // size of the interning table, and slightly reduces event size.
644  optional bool drop_local_port = 4;
645  optional bool drop_remote_port = 5;
646  optional bool drop_tcp_flags = 6;
647}
648
649// End of protos/perfetto/config/android/network_trace_config.proto
650
651// Begin of protos/perfetto/config/android/packages_list_config.proto
652
653// Data source that lists details (such as version code) about packages on an
654// Android device.
655message PackagesListConfig {
656  // If not empty, emit info about only the following list of package names
657  // (exact match, no regex). Otherwise, emit info about all packages.
658  repeated string package_name_filter = 1;
659}
660
661// End of protos/perfetto/config/android/packages_list_config.proto
662
663// Begin of protos/perfetto/config/android/pixel_modem_config.proto
664
665// Data source that records events from the modem.
666message PixelModemConfig {
667  // Event group to record, as defined by the modem.
668  enum EventGroup {
669    EVENT_GROUP_UNKNOWN = 0;
670
671    // Events suitable for low bandwidth tracing only.
672    EVENT_GROUP_LOW_BANDWIDTH = 1;
673
674    // Events suitable for high and low bandwidth tracing.
675    EVENT_GROUP_HIGH_AND_LOW_BANDWIDTH = 2;
676  }
677
678  optional EventGroup event_group = 1;
679
680  // If set, record only events with these hashes.
681  repeated int64 pigweed_hash_allow_list = 2;
682
683  // If set and allow_list is not set, deny events with these hashes.
684  repeated int64 pigweed_hash_deny_list = 3;
685}
686
687// End of protos/perfetto/config/android/pixel_modem_config.proto
688
689// Begin of protos/perfetto/common/protolog_common.proto
690
691enum ProtoLogLevel {
692  PROTOLOG_LEVEL_UNDEFINED = 0;
693  PROTOLOG_LEVEL_DEBUG = 1;
694  PROTOLOG_LEVEL_VERBOSE = 2;
695  PROTOLOG_LEVEL_INFO = 3;
696  PROTOLOG_LEVEL_WARN = 4;
697  PROTOLOG_LEVEL_ERROR = 5;
698  PROTOLOG_LEVEL_WTF = 6;
699}
700// End of protos/perfetto/common/protolog_common.proto
701
702// Begin of protos/perfetto/config/android/protolog_config.proto
703
704// Custom configuration for the "android.protolog" data source.
705// ProtoLog is a logging mechanism that is intented to be more efficient than
706// logcat. This configures what logs to capture in the tracing instance.
707message ProtoLogConfig {
708  enum TracingMode {
709    // When using the DEFAULT tracing mode, only log groups and levels specified
710    // in the group_overrides are traced.
711    DEFAULT = 0;
712    // When using the ENABLE_ALL tracing mode, all log groups and levels are
713    // traced, unless specified in the group_overrides.
714    ENABLE_ALL = 1;
715  }
716
717  // Specified the configurations for each of the logging groups. If none is
718  // specified for a group the defaults will be used.
719  repeated ProtoLogGroup group_overrides = 1;
720  // Specified what tracing mode to use for the tracing instance.
721  optional TracingMode tracing_mode = 2;
722}
723
724message ProtoLogGroup {
725  // The ProtoLog group name this configuration entry applies to.
726  optional string group_name = 1;
727  // Specify the level from which to start capturing protologs.
728  // e.g. if ProtoLogLevel.WARN is specified only warning, errors and fatal log
729  // message will be traced.
730  optional ProtoLogLevel log_from = 2;
731  // When set to true we will collect the stacktrace for each protolog message
732  // in this group that we are tracing.
733  optional bool collect_stacktrace = 3;
734}
735
736// End of protos/perfetto/config/android/protolog_config.proto
737
738// Begin of protos/perfetto/config/android/surfaceflinger_layers_config.proto
739
740// Custom configuration for the "android.surfaceflinger.layers" data source.
741message SurfaceFlingerLayersConfig {
742  enum Mode {
743    MODE_UNSPECIFIED = 0;
744
745    // Trace layers snapshots. A snapshot is taken every time a layers change
746    // occurs.
747    MODE_ACTIVE = 1;
748
749    // Generate layers snapshots from the transactions kept in the
750    // SurfaceFlinger's internal ring buffer.
751    // The layers snapshots generation occurs when this data source is flushed.
752    MODE_GENERATED = 2;
753
754    // Trace a single layers snapshot.
755    MODE_DUMP = 3;
756
757    // Default mode (applied by SurfaceFlinger if no mode is specified).
758    // Same as MODE_GENERATED, but triggers the layers snapshots generation only when a bugreport
759    // is taken.
760    MODE_GENERATED_BUGREPORT_ONLY = 4;
761  }
762  optional Mode mode = 1;
763
764  enum TraceFlag {
765    TRACE_FLAG_UNSPECIFIED = 0;
766    TRACE_FLAG_INPUT = 0x02;
767    TRACE_FLAG_COMPOSITION = 0x04;
768    TRACE_FLAG_EXTRA = 0x08;
769    TRACE_FLAG_HWC = 0x10;
770    TRACE_FLAG_BUFFERS = 0x20;
771    TRACE_FLAG_VIRTUAL_DISPLAYS = 0x40;
772
773    // INPUT | COMPOSITION | EXTRA
774    TRACE_FLAG_ALL = 0x0e;
775  }
776  repeated TraceFlag trace_flags = 2;
777}
778
779// End of protos/perfetto/config/android/surfaceflinger_layers_config.proto
780
781// Begin of protos/perfetto/config/android/surfaceflinger_transactions_config.proto
782
783// Custom configuration for the "android.surfaceflinger.transactions" data
784// source.
785message SurfaceFlingerTransactionsConfig {
786  enum Mode {
787    MODE_UNSPECIFIED = 0;
788
789    // Default mode (applied by SurfaceFlinger if no mode is specified).
790    // SurfaceFlinger writes its internal ring buffer of transactions every time
791    // the data source is flushed. The ring buffer contains the SurfaceFlinger's
792    // initial state and the latest transactions.
793    MODE_CONTINUOUS = 1;
794
795    // SurfaceFlinger writes the initial state and then each incoming
796    // transaction until the data source is stopped.
797    MODE_ACTIVE = 2;
798  }
799  optional Mode mode = 1;
800}
801
802// End of protos/perfetto/config/android/surfaceflinger_transactions_config.proto
803
804// Begin of protos/perfetto/config/chrome/chrome_config.proto
805
806message ChromeConfig {
807  optional string trace_config = 1;
808
809  // When enabled, the data source should only fill in fields in the output that
810  // are not potentially privacy sensitive.
811  optional bool privacy_filtering_enabled = 2;
812
813  // Instead of emitting binary protobuf, convert the trace data to the legacy
814  // JSON format. Note that the trace data will still be returned as a series of
815  // TracePackets, but the embedded data will be JSON instead of serialized
816  // protobuf.
817  optional bool convert_to_legacy_json = 3;
818
819  // Priority of the tracing session client. A higher priority session may
820  // preempt a lower priority one in configurations where concurrent sessions
821  // aren't supported.
822  enum ClientPriority {
823    UNKNOWN = 0;
824    BACKGROUND = 1;
825    USER_INITIATED = 2;
826  }
827  optional ClientPriority client_priority = 4;
828
829  // Applicable only when using legacy JSON format.
830  // If |json_agent_label_filter| is not empty, only data pertaining to
831  // the specified tracing agent label (e.g. "traceEvents") will be returned.
832  optional string json_agent_label_filter = 5;
833}
834
835// End of protos/perfetto/config/chrome/chrome_config.proto
836
837// Begin of protos/perfetto/config/chrome/v8_config.proto
838
839message V8Config {
840  // Whether to log the actual content of scripts (e.g. content of the JS file
841  // that was compiled to generate code).
842  // ATTENTION: This could considerably increase the size of the resuling trace
843  //            file.
844  optional bool log_script_sources = 1;
845  // Whether to log the generated code for jitted functions (machine code or
846  // bytecode).
847  // ATTENTION: This could considerably increase the size of the resuling trace
848  //            file.
849  optional bool log_instructions = 2;
850}
851
852// End of protos/perfetto/config/chrome/v8_config.proto
853
854// Begin of protos/perfetto/config/etw/etw_config.proto
855
856// Proto definition based on the struct _EVENT_TRACE_PROPERTIES definition
857// See: https://learn.microsoft.com/en-us/windows/win32/api/evntrace/
858// ns-evntrace-event_trace_properties
859message EtwConfig {
860  // The KernelFlag represent list of kernel flags that we are intrested in.
861  // To get a more extensive list run 'xperf -providers k'.
862  enum KernelFlag {
863    CSWITCH = 0;
864    DISPATCHER = 1;
865  }
866
867  // The kernel_flags determines the flags that will be used by the etw tracing
868  // session. These kernel flags have been built to expose the useful events
869  // captured from the kernel mode only.
870  repeated KernelFlag kernel_flags = 1;
871}
872// End of protos/perfetto/config/etw/etw_config.proto
873
874// Begin of protos/perfetto/config/ftrace/ftrace_config.proto
875
876// Next id: 28
877message FtraceConfig {
878  // Ftrace events to record, example: "sched/sched_switch".
879  repeated string ftrace_events = 1;
880  // Android-specific event categories:
881  repeated string atrace_categories = 2;
882  repeated string atrace_apps = 3;
883
884  // Size of each per-cpu kernel ftrace ring buffer.
885  // Not guaranteed if there are multiple concurrent tracing sessions, as the
886  // buffers cannot be resized without pausing recording in the kernel.
887  optional uint32 buffer_size_kb = 10;
888
889  // If set, specifies how often the tracing daemon reads from the kernel ring
890  // buffer. Not guaranteed if there are multiple concurrent tracing sessions.
891  // Leave unset unless you're fine-tuning a local config.
892  optional uint32 drain_period_ms = 11;
893
894  // If set, the tracing daemon will read kernel ring buffers as soon as
895  // they're filled past this percentage of occupancy. In other words, a value
896  // of 50 means that a read pass is triggered as soon as any per-cpu buffer is
897  // half-full. Not guaranteed if there are multiple concurrent tracing
898  // sessions.
899  // Currently does nothing on Linux kernels below v6.1.
900  // Introduced in: perfetto v43.
901  optional uint32 drain_buffer_percent = 26;
902
903  // Configuration for compact encoding of scheduler events. When enabled (and
904  // recording the relevant ftrace events), specific high-volume events are
905  // encoded in a denser format than normal.
906  message CompactSchedConfig {
907    // If true, and sched_switch or sched_waking ftrace events are enabled,
908    // record those events in the compact format.
909    //
910    // If the field is unset, the default is:
911    // * perfetto v42.0+: enabled
912    // * before: disabled
913    optional bool enabled = 1;
914  }
915  optional CompactSchedConfig compact_sched = 12;
916
917  // Optional filter for "ftrace/print" events.
918  //
919  // The filter consists of multiple rules. As soon as a rule matches (the rules
920  // are processed in order), its `allow` field will be used as the outcome: if
921  // `allow` is true, the event will be included in the trace, otherwise it will
922  // be discarded. If an event does not match any rule, it will be allowed by
923  // default (a rule with an empty prefix and allow=false, disallows everything
924  // by default).
925  message PrintFilter {
926    message Rule {
927      // Matches an atrace message of the form:
928      // <type>|pid|<prefix>...
929      message AtraceMessage {
930        optional string type = 1;
931        optional string prefix = 2;
932      }
933      oneof match {
934        // This rule matches if `prefix` matches exactly with the beginning of
935        // the "ftrace/print" "buf" field.
936        string prefix = 1;
937        // This rule matches if the "buf" field contains an atrace-style print
938        // message as specified in `atrace_msg`.
939        AtraceMessage atrace_msg = 3;
940      }
941      optional bool allow = 2;
942    }
943    repeated Rule rules = 1;
944  }
945  optional PrintFilter print_filter = 22;
946
947  // Enables symbol name resolution against /proc/kallsyms.
948  // It requires that either traced_probes is running as root or that
949  // kptr_restrict has been manually lowered.
950  // It does not disclose KASLR, symbol addresses are mangled.
951  optional bool symbolize_ksyms = 13;
952
953  // When symbolize_ksyms=true, determines whether the traced_probes daemon
954  // should keep the symbol map in memory (and reuse it for future tracing
955  // sessions) or clear it (saving memory) and re-create it on each tracing
956  // session (wasting cpu and wall time).
957  // The tradeoff is roughly:
958  //  KSYMS_RETAIN: pay a fixed ~1.2 MB cost after the first trace.
959  //  KSYMS_CLEANUP_ON_STOP: pay a ~300-500ms cost when starting each trace.
960  // Default behavior: KSYMS_CLEANUP_ON_STOP.
961  enum KsymsMemPolicy {
962    KSYMS_UNSPECIFIED = 0;
963    KSYMS_CLEANUP_ON_STOP = 1;
964    KSYMS_RETAIN = 2;
965  }
966  optional KsymsMemPolicy ksyms_mem_policy = 17;
967
968  // By default the kernel symbolizer is lazily initialized on a deferred task
969  // to reduce ftrace's time-to-start-recording. Unfortunately that makes
970  // ksyms integration tests hard. This flag forces the kernel symbolizer to be
971  // initialized synchronously on the data source start and hence avoiding
972  // timing races in tests.
973  // DEPRECATED in v28 / Android U. This is now the default behavior, setting it
974  // to true is a no-op.
975  optional bool initialize_ksyms_synchronously_for_testing = 14
976      [deprecated = true];
977
978  // When this boolean is true AND the ftrace_events contains "kmem/rss_stat",
979  // this option causes traced_probes to enable the "kmem/rss_stat_throttled"
980  // event instead if present, and fall back to "kmem/rss_stat" if not present.
981  // The historical context for this is the following:
982  // - Up to Android S (12), the rss_stat was internally throttled in its
983  //   kernel implementation.
984  // - A change introduced in the kernels after S has introduced a new
985  //   "rss_stat_throttled" making the original "rss_stat" event unthrottled
986  //   (hence very spammy).
987  // - Not all Android T/13 devices will receive a new kernel though, hence we
988  //   need to deal with both cases.
989  // For more context: go/rss-stat-throttled.
990  optional bool throttle_rss_stat = 15;
991
992  // If true, avoid enabling events that aren't statically known by
993  // traced_probes. Otherwise, the default is to emit such events as
994  // GenericFtraceEvent protos.
995  // Prefer to keep this flag at its default. This was added for Android
996  // tracing, where atrace categories and/or atrace HAL requested events can
997  // expand to events that aren't of interest to the tracing user.
998  // Introduced in: Android T.
999  optional bool disable_generic_events = 16;
1000
1001  // The subset of syscalls to record. To record all syscalls, leave this unset
1002  // and add "ftrace_events: raw_syscalls/sys_{enter,exit}" to the config.
1003  // * before perfetto v43, requires the config to also enable
1004  //   raw_syscalls/sys_{enter,exit}.
1005  // * perfetto v43+ does the right thing if you set only this field.
1006  // Example: ["sys_read", "sys_open"].
1007  // Introduced in: Android U.
1008  repeated string syscall_events = 18;
1009
1010  // If true, enable the "function_graph" kernel tracer that emits events
1011  // whenever a kernel function is entered and exited
1012  // (funcgraph_entry/funcgraph_exit).
1013  // Notes on use:
1014  // * Requires |symbolize_ksyms| for function name resolution.
1015  // * Use |function_filters| or |function_graph_roots| to constrain the traced
1016  //   set of functions, otherwise the event bandwidth will be too high for
1017  //   practical use.
1018  // * The data source might be rejected if there is already a concurrent
1019  //   ftrace data source that does not use function graph itself, as we do not
1020  //   support switching kernel tracers mid-trace.
1021  // * Requires a kernel compiled with CONFIG_FUNCTION_GRAPH_TRACER. This is
1022  //   enabled if "cat /sys/kernel/tracing/available_tracers" includes
1023  //   "function_graph".
1024  // Android:
1025  // * Available only on debuggable builds.
1026  // * Introduced in: Android U.
1027  optional bool enable_function_graph = 19;
1028
1029  // Constrains the set of functions traced when |enable_function_graph| is
1030  // true. Supports globs, e.g. "sched*". You can specify multiple filters,
1031  // in which case all matching functions will be traced. See kernel
1032  // documentation on ftrace "set_ftrace_filter" file for more details.
1033  // Android:
1034  // * Available only on debuggable builds.
1035  // * Introduced in: Android U.
1036  repeated string function_filters = 20;
1037
1038  // If |enable_function_graph| is true, trace this set of functions *and* all
1039  // of its callees. Supports globs. Can be set together with
1040  // |function_filters|, in which case only callees matching the filter will be
1041  // traced. If setting both, you most likely want all roots to also be
1042  // included in |function_filters|.
1043  // Android:
1044  // * Available only on debuggable builds.
1045  // * Introduced in: Android U.
1046  repeated string function_graph_roots = 21;
1047
1048  // If true, does not clear ftrace buffers before the start of the program.
1049  // This makes sense only if this is the first ftrace data source instance
1050  // created after the daemon has been started. Can be useful for gathering boot
1051  // traces, if ftrace has been separately configured (e.g. via kernel
1052  // commandline).
1053  optional bool preserve_ftrace_buffer = 23;
1054
1055  // If true, overrides the default timestamp clock and uses a raw hardware
1056  // based monotonic clock for getting timestamps.
1057  // * Introduced in: Android U.
1058  optional bool use_monotonic_raw_clock = 24;
1059
1060  // If |instance_name| is not empty, then attempt to use that tracefs instance
1061  // for event recording. Normally, this means
1062  // `/sys/kernel/tracing/instances/$instance_name`.
1063  //
1064  // The name "hyp" is reserved.
1065  //
1066  // The instance must already exist, the tracing daemon *will not* create it
1067  // for you as it typically doesn't have such permissions.
1068  // Only a subset of features is guaranteed to work with non-default instances,
1069  // at the time of writing:
1070  //  * ftrace_events
1071  //  * buffer_size_kb
1072  optional string instance_name = 25;
1073
1074  // If true, |buffer_size_kb| is interpreted as a lower bound, allowing the
1075  // implementation to choose a bigger buffer size.
1076  //
1077  // Most configs for perfetto v43+ should simply leave both fields unset.
1078  //
1079  // If you need a config compatible with a range of perfetto builds and you
1080  // used to set a non-default buffer_size_kb, consider setting both fields.
1081  // Example:
1082  //   buffer_size_kb: 4096
1083  //   buffer_size_lower_bound: true
1084  // On older builds, the per-cpu buffers will be exactly 4 MB.
1085  // On v43+, buffers will be at least 4 MB.
1086  // In both cases, neither is guaranteed if there are other concurrent
1087  // perfetto ftrace sessions, as the buffers cannot be resized without pausing
1088  // the recording in the kernel.
1089  // Introduced in: perfetto v43.
1090  optional bool buffer_size_lower_bound = 27;
1091}
1092
1093// End of protos/perfetto/config/ftrace/ftrace_config.proto
1094
1095// Begin of protos/perfetto/config/gpu/gpu_counter_config.proto
1096
1097message GpuCounterConfig {
1098  // Desired sampling interval for counters.
1099  optional uint64 counter_period_ns = 1;
1100
1101  // List of counters to be sampled. Counter IDs correspond to the ones
1102  // described in GpuCounterSpec in the data source descriptor.
1103  repeated uint32 counter_ids = 2;
1104
1105  // Sample counters by instrumenting command buffers.
1106  optional bool instrumented_sampling = 3;
1107
1108  // Fix gpu clock rate during trace session.
1109  optional bool fix_gpu_clock = 4;
1110}
1111
1112// End of protos/perfetto/config/gpu/gpu_counter_config.proto
1113
1114// Begin of protos/perfetto/config/gpu/vulkan_memory_config.proto
1115
1116message VulkanMemoryConfig {
1117  // Tracking driver memory usage events
1118  optional bool track_driver_memory_usage = 1;
1119
1120  // Tracking device memory usage events
1121  optional bool track_device_memory_usage = 2;
1122}
1123
1124// End of protos/perfetto/config/gpu/vulkan_memory_config.proto
1125
1126// Begin of protos/perfetto/config/inode_file/inode_file_config.proto
1127
1128message InodeFileConfig {
1129  message MountPointMappingEntry {
1130    optional string mountpoint = 1;
1131    repeated string scan_roots = 2;
1132  }
1133
1134  // How long to pause between batches.
1135  optional uint32 scan_interval_ms = 1;
1136
1137  // How long to wait before the first scan in order to accumulate inodes.
1138  optional uint32 scan_delay_ms = 2;
1139
1140  // How many inodes to scan in one batch.
1141  optional uint32 scan_batch_size = 3;
1142
1143  // Do not scan for inodes not found in the static map.
1144  optional bool do_not_scan = 4;
1145
1146  // If non-empty, only scan inodes corresponding to block devices named in
1147  // this list.
1148  repeated string scan_mount_points = 5;
1149
1150  // When encountering an inode belonging to a block device corresponding
1151  // to one of the mount points in this map, scan its scan_roots instead.
1152  repeated MountPointMappingEntry mount_point_mapping = 6;
1153}
1154
1155// End of protos/perfetto/config/inode_file/inode_file_config.proto
1156
1157// Begin of protos/perfetto/config/interceptors/console_config.proto
1158
1159message ConsoleConfig {
1160  enum Output {
1161    OUTPUT_UNSPECIFIED = 0;
1162    OUTPUT_STDOUT = 1;
1163    OUTPUT_STDERR = 2;
1164  }
1165  optional Output output = 1;
1166  optional bool enable_colors = 2;
1167}
1168
1169// End of protos/perfetto/config/interceptors/console_config.proto
1170
1171// Begin of protos/perfetto/config/interceptor_config.proto
1172
1173// Configuration for trace packet interception. Used for diverting trace data to
1174// non-Perfetto sources (e.g., logging to the console, ETW) when using the
1175// Perfetto SDK.
1176message InterceptorConfig {
1177  // Matches the name given to RegisterInterceptor().
1178  optional string name = 1;
1179
1180  optional ConsoleConfig console_config = 100;
1181}
1182
1183// End of protos/perfetto/config/interceptor_config.proto
1184
1185// Begin of protos/perfetto/config/power/android_power_config.proto
1186
1187message AndroidPowerConfig {
1188  enum BatteryCounters {
1189    BATTERY_COUNTER_UNSPECIFIED = 0;
1190
1191    // Coulomb counter.
1192    BATTERY_COUNTER_CHARGE = 1;
1193
1194    // Charge (%).
1195    BATTERY_COUNTER_CAPACITY_PERCENT = 2;
1196
1197    // Instantaneous current.
1198    BATTERY_COUNTER_CURRENT = 3;
1199
1200    // Avg current.
1201    BATTERY_COUNTER_CURRENT_AVG = 4;
1202
1203    // Instantaneous voltage.
1204    BATTERY_COUNTER_VOLTAGE = 5;
1205  }
1206  optional uint32 battery_poll_ms = 1;
1207  repeated BatteryCounters battery_counters = 2;
1208
1209  // Where available enables per-power-rail measurements.
1210  optional bool collect_power_rails = 3;
1211
1212  // Provides a breakdown of energy estimation for various subsystem (e.g. GPU).
1213  // Available from Android S.
1214  optional bool collect_energy_estimation_breakdown = 4;
1215
1216  // Provides a breakdown of time in state for various subsystems.
1217  // Available from Android U.
1218  optional bool collect_entity_state_residency = 5;
1219}
1220
1221// End of protos/perfetto/config/power/android_power_config.proto
1222
1223// Begin of protos/perfetto/config/process_stats/process_stats_config.proto
1224
1225message ProcessStatsConfig {
1226  enum Quirks {
1227    QUIRKS_UNSPECIFIED = 0;
1228
1229    // This has been deprecated and ignored as per 2018-05-01. Full scan at
1230    // startup is now disabled by default and can be re-enabled using the
1231    // |scan_all_processes_on_start| arg.
1232    DISABLE_INITIAL_DUMP = 1 [deprecated = true];
1233
1234    DISABLE_ON_DEMAND = 2;
1235  }
1236  repeated Quirks quirks = 1;
1237
1238  // If enabled all processes will be scanned and dumped when the trace starts.
1239  optional bool scan_all_processes_on_start = 2;
1240
1241  // If enabled thread names are also recoded (this is redundant if sched_switch
1242  // is enabled).
1243  optional bool record_thread_names = 3;
1244
1245  // If > 0 samples counters (see process_stats.proto) from
1246  // /proc/pid/status and oom_score_adj every X ms.
1247  // It will also sample /proc/pid/smaps_rollup if scan_smaps_rollup = true.
1248  // This is required to be > 100ms to avoid excessive CPU usage.
1249  optional uint32 proc_stats_poll_ms = 4;
1250
1251  // id 5 never used
1252
1253  // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
1254  // (default: |proc_stats_poll_ms|). If = 0, will be set to
1255  // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
1256  // multiple.
1257  optional uint32 proc_stats_cache_ttl_ms = 6;
1258
1259  // Niche feature: If true this will resolve file descriptors for each process
1260  // so these can be mapped to their actual device or file.
1261  // Requires raw_syscalls/sys_{enter,exit} ftrace events to be enabled or
1262  // new fds opened after initially scanning a process will not be
1263  // recognized.
1264  optional bool resolve_process_fds = 9;
1265
1266  // If true, output will include memory stats from /proc/pid/smaps_rollup.
1267  optional bool scan_smaps_rollup = 10;
1268
1269  // If true: process descriptions will include process age (starttime in
1270  // /proc/pid/stat).
1271  // Introduced in: perfetto v44.
1272  optional bool record_process_age = 11;
1273
1274  // If true and |proc_stats_poll_ms| is true, process stats will include time
1275  // spent running in user/kernel mode (utime/stime in /proc/pid/stat).
1276  // Introduced in: perfetto v44.
1277  optional bool record_process_runtime = 12;
1278
1279  // record_thread_time_in_state
1280  reserved 7;
1281  // thread_time_in_state_cache_size
1282  reserved 8;
1283}
1284
1285// End of protos/perfetto/config/process_stats/process_stats_config.proto
1286
1287// Begin of protos/perfetto/config/profiling/heapprofd_config.proto
1288
1289// Configuration for go/heapprofd.
1290// Next id: 28
1291message HeapprofdConfig {
1292  message ContinuousDumpConfig {
1293    // ms to wait before first dump.
1294    optional uint32 dump_phase_ms = 5;
1295    // ms to wait between following dumps.
1296    optional uint32 dump_interval_ms = 6;
1297  }
1298
1299  // Sampling rate for all heaps not specified via heap_sampling_intervals.
1300  //
1301  // These are:
1302  // * All heaps if heap_sampling_intervals is empty.
1303  // * Those profiled due to all_heaps and not named in heaps if
1304  //   heap_sampling_intervals is not empty.
1305  // * The implicit libc.malloc heap if heaps is empty.
1306  //
1307  // Set to 1 for perfect accuracy.
1308  // Otherwise, sample every sample_interval_bytes on average.
1309  //
1310  // See
1311  // https://perfetto.dev/docs/data-sources/native-heap-profiler#sampling-interval
1312  // for more details.
1313  //
1314  // BUGS
1315  // Before Android 12, setting this to 0 would crash the target process.
1316  //
1317  // N.B. This must be explicitly set to a non-zero value for all heaps (with
1318  // this field or with heap_sampling_intervals), otherwise the producer will
1319  // not start.
1320  optional uint64 sampling_interval_bytes = 1;
1321
1322  // If less than the given numbers of bytes are left free in the shared
1323  // memory buffer, increase sampling interval by a factor of two.
1324  // Adaptive sampling is disabled when set to 0.
1325  optional uint64 adaptive_sampling_shmem_threshold = 24;
1326  // Stop doubling the sampling_interval once the sampling interval has reached
1327  // this value.
1328  optional uint64 adaptive_sampling_max_sampling_interval_bytes = 25;
1329
1330  // E.g. surfaceflinger, com.android.phone
1331  // This input is normalized in the following way: if it contains slashes,
1332  // everything up to the last slash is discarded. If it contains "@",
1333  // everything after the first @ is discared.
1334  // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger.
1335  // This transformation is also applied to the processes' command lines when
1336  // matching.
1337  repeated string process_cmdline = 2;
1338
1339  // For watermark based triggering or local debugging.
1340  repeated uint64 pid = 4;
1341
1342  // Only profile target if it was installed by one of the packages given.
1343  // Special values are:
1344  // * @system: installed on the system partition
1345  // * @product: installed on the product partition
1346  // * @null: sideloaded
1347  // Supported on Android 12+.
1348  repeated string target_installed_by = 26;
1349
1350  // Which heaps to sample, e.g. "libc.malloc". If left empty, only samples
1351  // "malloc".
1352  //
1353  // Introduced in Android 12.
1354  repeated string heaps = 20;
1355
1356  // Which heaps not to sample, e.g. "libc.malloc". This is useful when used in
1357  // combination with all_heaps;
1358  //
1359  // Introduced in Android 12.
1360  repeated string exclude_heaps = 27;
1361
1362  optional bool stream_allocations = 23;
1363
1364  // If given, needs to be the same length as heaps and gives the sampling
1365  // interval for the respective entry in heaps.
1366  //
1367  // Otherwise, sampling_interval_bytes is used.
1368  //
1369  // It is recommended to set sampling_interval_bytes to a reasonable default
1370  // value when using this, as a value of 0 for sampling_interval_bytes will
1371  // crash the target process before Android 12.
1372  //
1373  // Introduced in Android 12.
1374  //
1375  // All values must be non-zero or the producer will not start.
1376  repeated uint64 heap_sampling_intervals = 22;
1377
1378  // Sample all heaps registered by target process. Introduced in Android 12.
1379  optional bool all_heaps = 21;
1380
1381  // Profile all processes eligible for profiling on the system.
1382  // See
1383  // https://perfetto.dev/docs/data-sources/native-heap-profiler#heapprofd-targets
1384  // for which processes are eligible.
1385  //
1386  // On unmodified userdebug builds, this will lead to system crashes. Zygote
1387  // will crash when trying to launch a new process as it will have an
1388  // unexpected open socket to heapprofd.
1389  //
1390  // heapprofd will likely be overloaded by the amount of data for low
1391  // sampling intervals.
1392  optional bool all = 5;
1393
1394  // Do not profile processes whose anon RSS + swap < given value.
1395  // Introduced in Android 11.
1396  optional uint32 min_anonymous_memory_kb = 15;
1397
1398  // Stop profile if heapprofd memory usage goes beyond the given value.
1399  // Introduced in Android 11.
1400  optional uint32 max_heapprofd_memory_kb = 16;
1401
1402  // Stop profile if heapprofd CPU time since start of this data-source
1403  // goes beyond given value.
1404  // Introduced in Android 11.
1405  optional uint64 max_heapprofd_cpu_secs = 17;
1406
1407  // Do not emit function names for mappings starting with this prefix.
1408  // E.g. /system to not emit symbols for any system libraries.
1409  repeated string skip_symbol_prefix = 7;
1410
1411  // Dump at a predefined interval.
1412  optional ContinuousDumpConfig continuous_dump_config = 6;
1413
1414  // Size of the shared memory buffer between the profiled processes and
1415  // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500
1416  // MiB.
1417  //
1418  // Needs to be:
1419  // * at least 8192,
1420  // * a power of two,
1421  // * a multiple of 4096.
1422  optional uint64 shmem_size_bytes = 8;
1423
1424  // When the shmem buffer is full, block the client instead of ending the
1425  // trace. Use with caution as this will significantly slow down the target
1426  // process.
1427  optional bool block_client = 9;
1428
1429  // If set, stop the trace session after blocking the client for this
1430  // timeout. Needs to be larger than 100 us, otherwise no retries are done.
1431  // Introduced in Android 11.
1432  optional uint32 block_client_timeout_us = 14;
1433
1434  // Do not profile processes from startup, only match already running
1435  // processes.
1436  //
1437  // Can not be set at the same time as no_running.
1438  // Introduced in Android 11.
1439  optional bool no_startup = 10;
1440
1441  // Do not profile running processes. Only match processes on startup.
1442  //
1443  // Can not be set at the same time as no_startup.
1444  // Introduced in Android 11.
1445  optional bool no_running = 11;
1446
1447  // deprecated idle_allocations.
1448  reserved 12;
1449
1450  // Cause heapprofd to emit a single dump at the end, showing the memory usage
1451  // at the point in time when the sampled heap usage of the process was at its
1452  // maximum. This causes ProfilePacket.HeapSample.self_max to be set, and
1453  // self_allocated and self_freed to not be set.
1454  // Introduced in Android 11.
1455  optional bool dump_at_max = 13;
1456
1457  // FEATURE FLAGS. THERE BE DRAGONS.
1458
1459  // Escape hatch if the session is being torn down because of a forked child
1460  // that shares memory space, but is not correctly identified as a vforked
1461  // child.
1462  // Introduced in Android 11.
1463  optional bool disable_fork_teardown = 18;
1464
1465  // We try to automatically detect when a target applicatation vforks but then
1466  // does a memory allocation (or free). This auto-detection can be disabled
1467  // with this.
1468  // Introduced in Android 11.
1469  optional bool disable_vfork_detection = 19;
1470}
1471
1472// End of protos/perfetto/config/profiling/heapprofd_config.proto
1473
1474// Begin of protos/perfetto/config/profiling/java_hprof_config.proto
1475
1476// Configuration for managed app heap graph snapshots.
1477message JavaHprofConfig {
1478  // If dump_interval_ms != 0, the following configuration is used.
1479  message ContinuousDumpConfig {
1480    // ms to wait before first continuous dump.
1481    // A dump is always created at the beginning of the trace.
1482    optional uint32 dump_phase_ms = 1;
1483    // ms to wait between following dumps.
1484    optional uint32 dump_interval_ms = 2;
1485    // If true, scans all the processes to find `process_cmdline` and filter by
1486    // `min_anonymous_memory_kb` only at data source start. Default on Android
1487    // S-.
1488    //
1489    // If false, rescans all the processes to find on every dump. Default on
1490    // Android T+.
1491    optional bool scan_pids_only_on_start = 3;
1492  }
1493
1494  // Command line allowlist, matched against the /proc/<pid>/cmdline (not the
1495  // comm string). The semantics of this field were changed since its original
1496  // introduction.
1497  //
1498  // On Android T+ (13+), this field can specify a single wildcard (*), and
1499  // the profiler will attempt to match it in two possible ways:
1500  // * if the pattern starts with a '/', then it is matched against the first
1501  //   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
1502  //   "/bin/echo".
1503  // * otherwise the pattern is matched against the part of argv0
1504  //   corresponding to the binary name (this is unrelated to /proc/pid/exe).
1505  //   For example "echo" would match "/bin/echo".
1506  //
1507  // On Android S (12) and below, both this pattern and /proc/pid/cmdline get
1508  // normalized prior to an exact string comparison. Normalization is as
1509  // follows: (1) trim everything beyond the first null or "@" byte; (2) if
1510  // the string contains forward slashes, trim everything up to and including
1511  // the last one.
1512  //
1513  // Implementation note: in either case, at most 511 characters of cmdline
1514  // are considered.
1515  repeated string process_cmdline = 1;
1516
1517  // For watermark based triggering or local debugging.
1518  repeated uint64 pid = 2;
1519
1520  // Only profile target if it was installed by one of the packages given.
1521  // Special values are:
1522  // * @system: installed on the system partition
1523  // * @product: installed on the product partition
1524  // * @null: sideloaded
1525  // Supported on Android 12+.
1526  repeated string target_installed_by = 7;
1527
1528  // Dump at a predefined interval.
1529  optional ContinuousDumpConfig continuous_dump_config = 3;
1530
1531  // Do not profile processes whose anon RSS + swap < given value.
1532  optional uint32 min_anonymous_memory_kb = 4;
1533
1534  // Include the process' /proc/self/smaps.
1535  // This only shows maps that:
1536  // * start with /system
1537  // * start with /vendor
1538  // * start with /data/app
1539  // * contain "extracted in memory from Y", where Y matches any of the above
1540  optional bool dump_smaps = 5;
1541
1542  // Exclude objects of the following types from the profile. This can be
1543  // useful if lots of uninteresting objects, e.g. "sun.misc.Cleaner".
1544  repeated string ignored_types = 6;
1545}
1546
1547// End of protos/perfetto/config/profiling/java_hprof_config.proto
1548
1549// Begin of protos/perfetto/common/perf_events.proto
1550
1551// Next id: 12
1552message PerfEvents {
1553  // What event to sample on, and how often. Commented from the perspective of
1554  // its use in |PerfEventConfig|.
1555  message Timebase {
1556    // How often the per-cpu sampling will occur. Not guaranteed to be honored
1557    // as the kernel can throttle the sampling rate if it's too high.
1558    // If unset, an implementation-defined default is used.
1559    oneof interval {
1560      // Per-cpu sampling frequency in Hz, as requested from the kernel. Not the
1561      // same as 1/period.
1562      // Details: the actual sampling will still be based on a period, but the
1563      // kernel will dynamically adjust it based on the observed event rate, to
1564      // approximate this frequency. Works best with steady-rate events like
1565      // timers.
1566      uint64 frequency = 2;
1567
1568      // Per-cpu sampling will occur every |period| counts of |event|.
1569      // Prefer |frequency| by default, as it's easier to oversample with a
1570      // fixed period.
1571      uint64 period = 1;
1572    }
1573
1574    // Counting event to use as a timebase for the sampling.
1575    // If unset, implies the CPU timer (SW_CPU_CLOCK) as the event,
1576    // which is what you usually want.
1577    // See common/perf_events.proto for the definitions.
1578    oneof event {
1579      Counter counter = 4;
1580      Tracepoint tracepoint = 3;
1581      RawEvent raw_event = 5;
1582    }
1583
1584    // If set, samples will be timestamped with the given clock.
1585    // If unset, the clock is chosen by the implementation.
1586    // For software events, prefer PERF_CLOCK_BOOTTIME. However it cannot be
1587    // used for hardware events (due to interrupt safety), for which the
1588    // recommendation is to use one of the monotonic clocks.
1589    optional PerfClock timestamp_clock = 11;
1590
1591    // Optional arbitrary name for the event, to identify it in the parsed
1592    // trace. Does *not* affect the profiling itself. If unset, the trace
1593    // parser will choose a suitable name.
1594    optional string name = 10;
1595  }
1596
1597  // Builtin counter names from the uapi header. Commented with their perf tool
1598  // aliases.
1599  // TODO(rsavitski): consider generating enums for cache events (should be
1600  // finite), and generally make this list as extensive as possible. Excluding
1601  // things like dynamic PMUs since those don't fit into a static enum.
1602  // Next id: 21
1603  enum Counter {
1604    UNKNOWN_COUNTER = 0;
1605
1606    // cpu-clock
1607    SW_CPU_CLOCK = 1;
1608    // page-faults, faults
1609    SW_PAGE_FAULTS = 2;
1610    // task-clock
1611    SW_TASK_CLOCK = 3;
1612    // context-switches, cs
1613    SW_CONTEXT_SWITCHES = 4;
1614    // cpu-migrations, migrations
1615    SW_CPU_MIGRATIONS = 5;
1616    // minor-faults
1617    SW_PAGE_FAULTS_MIN = 6;
1618    // major-faults
1619    SW_PAGE_FAULTS_MAJ = 7;
1620    // alignment-faults
1621    SW_ALIGNMENT_FAULTS = 8;
1622    // emulation-faults
1623    SW_EMULATION_FAULTS = 9;
1624    // dummy
1625    SW_DUMMY = 20;
1626
1627    // cpu-cycles, cycles
1628    HW_CPU_CYCLES = 10;
1629    // instructions
1630    HW_INSTRUCTIONS = 11;
1631    // cache-references
1632    HW_CACHE_REFERENCES = 12;
1633    // cache-misses
1634    HW_CACHE_MISSES = 13;
1635    // branch-instructions, branches
1636    HW_BRANCH_INSTRUCTIONS = 14;
1637    // branch-misses
1638    HW_BRANCH_MISSES = 15;
1639    // bus-cycles
1640    HW_BUS_CYCLES = 16;
1641    // stalled-cycles-frontend, idle-cycles-frontend
1642    HW_STALLED_CYCLES_FRONTEND = 17;
1643    // stalled-cycles-backend, idle-cycles-backend
1644    HW_STALLED_CYCLES_BACKEND = 18;
1645    // ref-cycles
1646    HW_REF_CPU_CYCLES = 19;
1647  }
1648
1649  message Tracepoint {
1650    // Group and name for the tracepoint, acceptable forms:
1651    // * "sched/sched_switch"
1652    // * "sched:sched_switch"
1653    optional string name = 1;
1654
1655    // Optional field-level filter for the tracepoint. Only events matching this
1656    // filter will be counted (and therefore contribute to the sampling period).
1657    // Example: "prev_pid >= 42 && next_pid == 0".
1658    // For full syntax, see kernel documentation on "Event filtering":
1659    // https://www.kernel.org/doc/Documentation/trace/events.txt
1660    optional string filter = 2;
1661  }
1662
1663  // Syscall-level description of the event, propagated to the perf_event_attr
1664  // struct. Primarily for local use-cases, since the event availability and
1665  // encoding is hardware-specific.
1666  message RawEvent {
1667    optional uint32 type = 1;
1668    optional uint64 config = 2;
1669    optional uint64 config1 = 3;
1670    optional uint64 config2 = 4;
1671  }
1672
1673  // Subset of clocks that is supported by perf timestamping.
1674  // CLOCK_TAI is excluded since it's not expected to be used in practice, but
1675  // would require additions to the trace clock synchronisation logic.
1676  enum PerfClock {
1677    UNKNOWN_PERF_CLOCK = 0;
1678    PERF_CLOCK_REALTIME = 1;
1679    PERF_CLOCK_MONOTONIC = 2;
1680    PERF_CLOCK_MONOTONIC_RAW = 3;
1681    PERF_CLOCK_BOOTTIME = 4;
1682  }
1683}
1684
1685// End of protos/perfetto/common/perf_events.proto
1686
1687// Begin of protos/perfetto/config/profiling/perf_event_config.proto
1688
1689// Configuration for the traced_perf profiler.
1690//
1691// Example config for basic cpu profiling:
1692//   perf_event_config {
1693//     timebase {
1694//       frequency: 80
1695//     }
1696//     callstack_sampling {
1697//       scope {
1698//         target_cmdline: "surfaceflinger"
1699//         target_cmdline: "system_server"
1700//       }
1701//       kernel_frames: true
1702//     }
1703//   }
1704//
1705// Next id: 19
1706message PerfEventConfig {
1707  // What event to sample on, and how often.
1708  // Defined in common/perf_events.proto.
1709  optional PerfEvents.Timebase timebase = 15;
1710
1711  // If set, the profiler will sample userspace processes' callstacks at the
1712  // interval specified by the |timebase|.
1713  // If unset, the profiler will record only the event counts.
1714  optional CallstackSampling callstack_sampling = 16;
1715
1716  //
1717  // Kernel <-> userspace ring buffer options:
1718  //
1719
1720  // How often the per-cpu ring buffers are read by the producer.
1721  // If unset, an implementation-defined default is used.
1722  optional uint32 ring_buffer_read_period_ms = 8;
1723
1724  // Size (in 4k pages) of each per-cpu ring buffer that is filled by the
1725  // kernel. If set, must be a power of two.
1726  // If unset, an implementation-defined default is used.
1727  optional uint32 ring_buffer_pages = 3;
1728
1729  //
1730  // Daemon's resource usage limits:
1731  //
1732
1733  // Drop samples if the heap memory held by the samples in the unwinder queue
1734  // is above the given limit. This counts the memory across all concurrent data
1735  // sources (not just this one's), and there is no fairness guarantee - the
1736  // whole quota might be used up by a concurrent source.
1737  optional uint64 max_enqueued_footprint_kb = 17;
1738
1739  // Stop the data source if traced_perf's combined {RssAnon + Swap} memory
1740  // footprint exceeds this value.
1741  optional uint32 max_daemon_memory_kb = 13;
1742
1743  //
1744  // Uncommon options:
1745  //
1746
1747  // Timeout for the remote /proc/<pid>/{maps,mem} file descriptors for a
1748  // sampled process. This is primarily for Android, where this lookup is
1749  // asynchronous. As long as the producer is waiting, the associated samples
1750  // will be kept enqueued (putting pressure on the capacity of the shared
1751  // unwinding queue). Once a lookup for a process expires, all associated
1752  // samples are discarded. However, if the lookup still succeeds after the
1753  // timeout, future samples will be handled normally.
1754  // If unset, an implementation-defined default is used.
1755  optional uint32 remote_descriptor_timeout_ms = 9;
1756
1757  // Optional period for clearing state cached by the unwinder. This is a heavy
1758  // operation that is only necessary for traces that target a wide set of
1759  // processes, and require the memory footprint to be reset periodically.
1760  // If unset, the cached state will not be cleared.
1761  optional uint32 unwind_state_clear_period_ms = 10;
1762
1763  // If set, only profile target if it was installed by a package with one of
1764  // these names. Special values:
1765  // * "@system": installed on the system partition
1766  // * "@product": installed on the product partition
1767  // * "@null": sideloaded
1768  // Supported on Android 12+.
1769  repeated string target_installed_by = 18;
1770
1771  //
1772  // Deprecated (superseded by options above):
1773  //
1774  // Do not set *any* of these fields in new configs.
1775  //
1776
1777  // Note: legacy configs had to set |all_cpus| to true to pass parsing.
1778  // We rely on this to detect such configs.
1779  optional bool all_cpus = 1;
1780  optional uint32 sampling_frequency = 2;
1781  optional bool kernel_frames = 12;
1782  repeated int32 target_pid = 4;
1783  repeated string target_cmdline = 5;
1784  repeated int32 exclude_pid = 6;
1785  repeated string exclude_cmdline = 7;
1786  optional uint32 additional_cmdline_count = 11;
1787  // previously |tracepoint|
1788  reserved 14;
1789
1790  //
1791  // Sub-messages (nested for generated code namespacing).
1792  //
1793
1794  message CallstackSampling {
1795    // Defines a set of processes for which samples are retained/skipped. If
1796    // unset, all samples are kept, but beware that it will be very heavy on the
1797    // stack unwinder, which might start dropping samples due to overload.
1798    optional Scope scope = 1;
1799
1800    // If true, callstacks will include the kernel-space frames. Such frames can
1801    // be identified by a magical "kernel" string as their mapping name.
1802    // Requires traced_perf to be running as root, or kptr_restrict to have been
1803    // manually unrestricted. On Android, the platform should do the right thing
1804    // on debug builds.
1805    // This does *not* disclose KASLR, as only the function names are emitted.
1806    optional bool kernel_frames = 2;
1807
1808    // Whether to record and unwind userspace callstacks. If unset, defaults to
1809    // including userspace (UNWIND_DWARF) both for backwards compatibility and
1810    // as the most common default (this defaulting is only applicable if the
1811    // outer CallstackSampling message is explicitly set).
1812    optional UnwindMode user_frames = 3;
1813  }
1814
1815  message Scope {
1816    // Process ID (TGID) allowlist. If this list is not empty, only matching
1817    // samples will be retained. If multiple allow/deny-lists are
1818    // specified by the config, then all of them are evaluated for each sampled
1819    // process.
1820    repeated int32 target_pid = 1;
1821
1822    // Command line allowlist, matched against the /proc/<pid>/cmdline (not the
1823    // comm string). The semantics of this field were changed since its original
1824    // introduction.
1825    //
1826    // On Android T+ (13+), this field can specify a single wildcard (*), and
1827    // the profiler will attempt to match it in two possible ways:
1828    // * if the pattern starts with a '/', then it is matched against the first
1829    //   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
1830    //   "/bin/echo".
1831    // * otherwise the pattern is matched against the part of argv0
1832    //   corresponding to the binary name (this is unrelated to /proc/pid/exe).
1833    //   For example "echo" would match "/bin/echo".
1834    //
1835    // On Android S (12) and below, both this pattern and /proc/pid/cmdline get
1836    // normalized prior to an exact string comparison. Normalization is as
1837    // follows: (1) trim everything beyond the first null or "@" byte; (2) if
1838    // the string contains forward slashes, trim everything up to and including
1839    // the last one.
1840    //
1841    // Implementation note: in either case, at most 511 characters of cmdline
1842    // are considered.
1843    repeated string target_cmdline = 2;
1844
1845    // List of excluded pids.
1846    repeated int32 exclude_pid = 3;
1847
1848    // List of excluded cmdlines. See description of |target_cmdline| for how
1849    // this is handled.
1850    repeated string exclude_cmdline = 4;
1851
1852    // Niche features for systemwide callstacks:
1853
1854    // Number of additional command lines to sample. Only those which are
1855    // neither explicitly included nor excluded will be considered. Processes
1856    // are accepted on a first come, first served basis.
1857    optional uint32 additional_cmdline_count = 5;
1858
1859    // If set to N, all encountered processes will be put into one of the N
1860    // possible bins, and only one randomly-chosen bin will be selected for
1861    // unwinding. The binning is simply "pid % N", under the assumption that
1862    // low-order bits of pids are roughly uniformly distributed. Other explicit
1863    // inclusions/exclusions in this |Scope| message are still respected.
1864    //
1865    // The profiler will report the chosen shard in PerfSampleDefaults, and the
1866    // values will be queryable in trace processor under the "stats" table as
1867    // "perf_process_shard_count" and "perf_chosen_process_shard".
1868    //
1869    // NB: all data sources in a config that set |process_shard_count| must set
1870    // it to the same value. The profiler will choose one bin for all those data
1871    // sources.
1872    optional uint32 process_shard_count = 6;
1873  }
1874
1875  // Userspace unwinding mode. A possible future addition is kernel-unwound
1876  // callchains for frame pointer based systems.
1877  enum UnwindMode {
1878    UNWIND_UNKNOWN = 0;
1879    // Do not unwind userspace:
1880    UNWIND_SKIP = 1;
1881    // Use libunwindstack (default):
1882    UNWIND_DWARF = 2;
1883  }
1884}
1885
1886// End of protos/perfetto/config/profiling/perf_event_config.proto
1887
1888// Begin of protos/perfetto/config/statsd/atom_ids.proto
1889
1890// This enum is obtained by post-processing
1891// AOSP/frameworks/proto_logging/stats/atoms.proto through
1892// AOSP/external/perfetto/tools/update-statsd-descriptor, which extracts one
1893// enum value for each proto field defined in the upstream atoms.proto.
1894enum AtomId {
1895  ATOM_UNSPECIFIED = 0;
1896  ATOM_BLE_SCAN_STATE_CHANGED = 2;
1897  ATOM_PROCESS_STATE_CHANGED = 3;
1898  ATOM_BLE_SCAN_RESULT_RECEIVED = 4;
1899  ATOM_SENSOR_STATE_CHANGED = 5;
1900  ATOM_GPS_SCAN_STATE_CHANGED = 6;
1901  ATOM_SYNC_STATE_CHANGED = 7;
1902  ATOM_SCHEDULED_JOB_STATE_CHANGED = 8;
1903  ATOM_SCREEN_BRIGHTNESS_CHANGED = 9;
1904  ATOM_WAKELOCK_STATE_CHANGED = 10;
1905  ATOM_LONG_PARTIAL_WAKELOCK_STATE_CHANGED = 11;
1906  ATOM_MOBILE_RADIO_POWER_STATE_CHANGED = 12;
1907  ATOM_WIFI_RADIO_POWER_STATE_CHANGED = 13;
1908  ATOM_ACTIVITY_MANAGER_SLEEP_STATE_CHANGED = 14;
1909  ATOM_MEMORY_FACTOR_STATE_CHANGED = 15;
1910  ATOM_EXCESSIVE_CPU_USAGE_REPORTED = 16;
1911  ATOM_CACHED_KILL_REPORTED = 17;
1912  ATOM_PROCESS_MEMORY_STAT_REPORTED = 18;
1913  ATOM_LAUNCHER_EVENT = 19;
1914  ATOM_BATTERY_SAVER_MODE_STATE_CHANGED = 20;
1915  ATOM_DEVICE_IDLE_MODE_STATE_CHANGED = 21;
1916  ATOM_DEVICE_IDLING_MODE_STATE_CHANGED = 22;
1917  ATOM_AUDIO_STATE_CHANGED = 23;
1918  ATOM_MEDIA_CODEC_STATE_CHANGED = 24;
1919  ATOM_CAMERA_STATE_CHANGED = 25;
1920  ATOM_FLASHLIGHT_STATE_CHANGED = 26;
1921  ATOM_UID_PROCESS_STATE_CHANGED = 27;
1922  ATOM_PROCESS_LIFE_CYCLE_STATE_CHANGED = 28;
1923  ATOM_SCREEN_STATE_CHANGED = 29;
1924  ATOM_BATTERY_LEVEL_CHANGED = 30;
1925  ATOM_CHARGING_STATE_CHANGED = 31;
1926  ATOM_PLUGGED_STATE_CHANGED = 32;
1927  ATOM_INTERACTIVE_STATE_CHANGED = 33;
1928  ATOM_TOUCH_EVENT_REPORTED = 34;
1929  ATOM_WAKEUP_ALARM_OCCURRED = 35;
1930  ATOM_KERNEL_WAKEUP_REPORTED = 36;
1931  ATOM_WIFI_LOCK_STATE_CHANGED = 37;
1932  ATOM_WIFI_SIGNAL_STRENGTH_CHANGED = 38;
1933  ATOM_WIFI_SCAN_STATE_CHANGED = 39;
1934  ATOM_PHONE_SIGNAL_STRENGTH_CHANGED = 40;
1935  ATOM_SETTING_CHANGED = 41;
1936  ATOM_ACTIVITY_FOREGROUND_STATE_CHANGED = 42;
1937  ATOM_ISOLATED_UID_CHANGED = 43;
1938  ATOM_PACKET_WAKEUP_OCCURRED = 44;
1939  ATOM_WALL_CLOCK_TIME_SHIFTED = 45;
1940  ATOM_ANOMALY_DETECTED = 46;
1941  ATOM_APP_BREADCRUMB_REPORTED = 47;
1942  ATOM_APP_START_OCCURRED = 48;
1943  ATOM_APP_START_CANCELED = 49;
1944  ATOM_APP_START_FULLY_DRAWN = 50;
1945  ATOM_LMK_KILL_OCCURRED = 51;
1946  ATOM_PICTURE_IN_PICTURE_STATE_CHANGED = 52;
1947  ATOM_WIFI_MULTICAST_LOCK_STATE_CHANGED = 53;
1948  ATOM_LMK_STATE_CHANGED = 54;
1949  ATOM_APP_START_MEMORY_STATE_CAPTURED = 55;
1950  ATOM_SHUTDOWN_SEQUENCE_REPORTED = 56;
1951  ATOM_BOOT_SEQUENCE_REPORTED = 57;
1952  ATOM_DAVEY_OCCURRED = 58;
1953  ATOM_OVERLAY_STATE_CHANGED = 59;
1954  ATOM_FOREGROUND_SERVICE_STATE_CHANGED = 60;
1955  ATOM_CALL_STATE_CHANGED = 61;
1956  ATOM_KEYGUARD_STATE_CHANGED = 62;
1957  ATOM_KEYGUARD_BOUNCER_STATE_CHANGED = 63;
1958  ATOM_KEYGUARD_BOUNCER_PASSWORD_ENTERED = 64;
1959  ATOM_APP_DIED = 65;
1960  ATOM_RESOURCE_CONFIGURATION_CHANGED = 66;
1961  ATOM_BLUETOOTH_ENABLED_STATE_CHANGED = 67;
1962  ATOM_BLUETOOTH_CONNECTION_STATE_CHANGED = 68;
1963  ATOM_GPS_SIGNAL_QUALITY_CHANGED = 69;
1964  ATOM_USB_CONNECTOR_STATE_CHANGED = 70;
1965  ATOM_SPEAKER_IMPEDANCE_REPORTED = 71;
1966  ATOM_HARDWARE_FAILED = 72;
1967  ATOM_PHYSICAL_DROP_DETECTED = 73;
1968  ATOM_CHARGE_CYCLES_REPORTED = 74;
1969  ATOM_MOBILE_CONNECTION_STATE_CHANGED = 75;
1970  ATOM_MOBILE_RADIO_TECHNOLOGY_CHANGED = 76;
1971  ATOM_USB_DEVICE_ATTACHED = 77;
1972  ATOM_APP_CRASH_OCCURRED = 78;
1973  ATOM_ANR_OCCURRED = 79;
1974  ATOM_WTF_OCCURRED = 80;
1975  ATOM_LOW_MEM_REPORTED = 81;
1976  ATOM_GENERIC_ATOM = 82;
1977  ATOM_VIBRATOR_STATE_CHANGED = 84;
1978  ATOM_DEFERRED_JOB_STATS_REPORTED = 85;
1979  ATOM_THERMAL_THROTTLING = 86;
1980  ATOM_BIOMETRIC_ACQUIRED = 87;
1981  ATOM_BIOMETRIC_AUTHENTICATED = 88;
1982  ATOM_BIOMETRIC_ERROR_OCCURRED = 89;
1983  ATOM_UI_EVENT_REPORTED = 90;
1984  ATOM_BATTERY_HEALTH_SNAPSHOT = 91;
1985  ATOM_SLOW_IO = 92;
1986  ATOM_BATTERY_CAUSED_SHUTDOWN = 93;
1987  ATOM_PHONE_SERVICE_STATE_CHANGED = 94;
1988  ATOM_PHONE_STATE_CHANGED = 95;
1989  ATOM_USER_RESTRICTION_CHANGED = 96;
1990  ATOM_SETTINGS_UI_CHANGED = 97;
1991  ATOM_CONNECTIVITY_STATE_CHANGED = 98;
1992  ATOM_SERVICE_STATE_CHANGED = 99;
1993  ATOM_SERVICE_LAUNCH_REPORTED = 100;
1994  ATOM_FLAG_FLIP_UPDATE_OCCURRED = 101;
1995  ATOM_BINARY_PUSH_STATE_CHANGED = 102;
1996  ATOM_DEVICE_POLICY_EVENT = 103;
1997  ATOM_DOCS_UI_FILE_OP_CANCELED = 104;
1998  ATOM_DOCS_UI_FILE_OP_COPY_MOVE_MODE_REPORTED = 105;
1999  ATOM_DOCS_UI_FILE_OP_FAILURE = 106;
2000  ATOM_DOCS_UI_PROVIDER_FILE_OP = 107;
2001  ATOM_DOCS_UI_INVALID_SCOPED_ACCESS_REQUEST = 108;
2002  ATOM_DOCS_UI_LAUNCH_REPORTED = 109;
2003  ATOM_DOCS_UI_ROOT_VISITED = 110;
2004  ATOM_DOCS_UI_STARTUP_MS = 111;
2005  ATOM_DOCS_UI_USER_ACTION_REPORTED = 112;
2006  ATOM_WIFI_ENABLED_STATE_CHANGED = 113;
2007  ATOM_WIFI_RUNNING_STATE_CHANGED = 114;
2008  ATOM_APP_COMPACTED = 115;
2009  ATOM_NETWORK_DNS_EVENT_REPORTED = 116;
2010  ATOM_DOCS_UI_PICKER_LAUNCHED_FROM_REPORTED = 117;
2011  ATOM_DOCS_UI_PICK_RESULT_REPORTED = 118;
2012  ATOM_DOCS_UI_SEARCH_MODE_REPORTED = 119;
2013  ATOM_DOCS_UI_SEARCH_TYPE_REPORTED = 120;
2014  ATOM_DATA_STALL_EVENT = 121;
2015  ATOM_RESCUE_PARTY_RESET_REPORTED = 122;
2016  ATOM_SIGNED_CONFIG_REPORTED = 123;
2017  ATOM_GNSS_NI_EVENT_REPORTED = 124;
2018  ATOM_BLUETOOTH_LINK_LAYER_CONNECTION_EVENT = 125;
2019  ATOM_BLUETOOTH_ACL_CONNECTION_STATE_CHANGED = 126;
2020  ATOM_BLUETOOTH_SCO_CONNECTION_STATE_CHANGED = 127;
2021  ATOM_APP_DOWNGRADED = 128;
2022  ATOM_APP_OPTIMIZED_AFTER_DOWNGRADED = 129;
2023  ATOM_LOW_STORAGE_STATE_CHANGED = 130;
2024  ATOM_GNSS_NFW_NOTIFICATION_REPORTED = 131;
2025  ATOM_GNSS_CONFIGURATION_REPORTED = 132;
2026  ATOM_USB_PORT_OVERHEAT_EVENT_REPORTED = 133;
2027  ATOM_NFC_ERROR_OCCURRED = 134;
2028  ATOM_NFC_STATE_CHANGED = 135;
2029  ATOM_NFC_BEAM_OCCURRED = 136;
2030  ATOM_NFC_CARDEMULATION_OCCURRED = 137;
2031  ATOM_NFC_TAG_OCCURRED = 138;
2032  ATOM_NFC_HCE_TRANSACTION_OCCURRED = 139;
2033  ATOM_SE_STATE_CHANGED = 140;
2034  ATOM_SE_OMAPI_REPORTED = 141;
2035  ATOM_BROADCAST_DISPATCH_LATENCY_REPORTED = 142;
2036  ATOM_ATTENTION_MANAGER_SERVICE_RESULT_REPORTED = 143;
2037  ATOM_ADB_CONNECTION_CHANGED = 144;
2038  ATOM_SPEECH_DSP_STAT_REPORTED = 145;
2039  ATOM_USB_CONTAMINANT_REPORTED = 146;
2040  ATOM_WATCHDOG_ROLLBACK_OCCURRED = 147;
2041  ATOM_BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED = 148;
2042  ATOM_BUBBLE_UI_CHANGED = 149;
2043  ATOM_SCHEDULED_JOB_CONSTRAINT_CHANGED = 150;
2044  ATOM_BLUETOOTH_ACTIVE_DEVICE_CHANGED = 151;
2045  ATOM_BLUETOOTH_A2DP_PLAYBACK_STATE_CHANGED = 152;
2046  ATOM_BLUETOOTH_A2DP_CODEC_CONFIG_CHANGED = 153;
2047  ATOM_BLUETOOTH_A2DP_CODEC_CAPABILITY_CHANGED = 154;
2048  ATOM_BLUETOOTH_A2DP_AUDIO_UNDERRUN_REPORTED = 155;
2049  ATOM_BLUETOOTH_A2DP_AUDIO_OVERRUN_REPORTED = 156;
2050  ATOM_BLUETOOTH_DEVICE_RSSI_REPORTED = 157;
2051  ATOM_BLUETOOTH_DEVICE_FAILED_CONTACT_COUNTER_REPORTED = 158;
2052  ATOM_BLUETOOTH_DEVICE_TX_POWER_LEVEL_REPORTED = 159;
2053  ATOM_BLUETOOTH_HCI_TIMEOUT_REPORTED = 160;
2054  ATOM_BLUETOOTH_QUALITY_REPORT_REPORTED = 161;
2055  ATOM_BLUETOOTH_DEVICE_INFO_REPORTED = 162;
2056  ATOM_BLUETOOTH_REMOTE_VERSION_INFO_REPORTED = 163;
2057  ATOM_BLUETOOTH_SDP_ATTRIBUTE_REPORTED = 164;
2058  ATOM_BLUETOOTH_BOND_STATE_CHANGED = 165;
2059  ATOM_BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED = 166;
2060  ATOM_BLUETOOTH_SMP_PAIRING_EVENT_REPORTED = 167;
2061  ATOM_SCREEN_TIMEOUT_EXTENSION_REPORTED = 168;
2062  ATOM_PROCESS_START_TIME = 169;
2063  ATOM_PERMISSION_GRANT_REQUEST_RESULT_REPORTED = 170;
2064  ATOM_BLUETOOTH_SOCKET_CONNECTION_STATE_CHANGED = 171;
2065  ATOM_DEVICE_IDENTIFIER_ACCESS_DENIED = 172;
2066  ATOM_BUBBLE_DEVELOPER_ERROR_REPORTED = 173;
2067  ATOM_ASSIST_GESTURE_STAGE_REPORTED = 174;
2068  ATOM_ASSIST_GESTURE_FEEDBACK_REPORTED = 175;
2069  ATOM_ASSIST_GESTURE_PROGRESS_REPORTED = 176;
2070  ATOM_TOUCH_GESTURE_CLASSIFIED = 177;
2071  ATOM_HIDDEN_API_USED = 178;
2072  ATOM_STYLE_UI_CHANGED = 179;
2073  ATOM_PRIVACY_INDICATORS_INTERACTED = 180;
2074  ATOM_APP_INSTALL_ON_EXTERNAL_STORAGE_REPORTED = 181;
2075  ATOM_NETWORK_STACK_REPORTED = 182;
2076  ATOM_APP_MOVED_STORAGE_REPORTED = 183;
2077  ATOM_BIOMETRIC_ENROLLED = 184;
2078  ATOM_SYSTEM_SERVER_WATCHDOG_OCCURRED = 185;
2079  ATOM_TOMB_STONE_OCCURRED = 186;
2080  ATOM_BLUETOOTH_CLASS_OF_DEVICE_REPORTED = 187;
2081  ATOM_INTELLIGENCE_EVENT_REPORTED = 188;
2082  ATOM_THERMAL_THROTTLING_SEVERITY_STATE_CHANGED = 189;
2083  ATOM_ROLE_REQUEST_RESULT_REPORTED = 190;
2084  ATOM_MEDIAMETRICS_AUDIOPOLICY_REPORTED = 191;
2085  ATOM_MEDIAMETRICS_AUDIORECORD_REPORTED = 192;
2086  ATOM_MEDIAMETRICS_AUDIOTHREAD_REPORTED = 193;
2087  ATOM_MEDIAMETRICS_AUDIOTRACK_REPORTED = 194;
2088  ATOM_MEDIAMETRICS_CODEC_REPORTED = 195;
2089  ATOM_MEDIAMETRICS_DRM_WIDEVINE_REPORTED = 196;
2090  ATOM_MEDIAMETRICS_EXTRACTOR_REPORTED = 197;
2091  ATOM_MEDIAMETRICS_MEDIADRM_REPORTED = 198;
2092  ATOM_MEDIAMETRICS_NUPLAYER_REPORTED = 199;
2093  ATOM_MEDIAMETRICS_RECORDER_REPORTED = 200;
2094  ATOM_MEDIAMETRICS_DRMMANAGER_REPORTED = 201;
2095  ATOM_CAR_POWER_STATE_CHANGED = 203;
2096  ATOM_GARAGE_MODE_INFO = 204;
2097  ATOM_TEST_ATOM_REPORTED = 205;
2098  ATOM_CONTENT_CAPTURE_CALLER_MISMATCH_REPORTED = 206;
2099  ATOM_CONTENT_CAPTURE_SERVICE_EVENTS = 207;
2100  ATOM_CONTENT_CAPTURE_SESSION_EVENTS = 208;
2101  ATOM_CONTENT_CAPTURE_FLUSHED = 209;
2102  ATOM_LOCATION_MANAGER_API_USAGE_REPORTED = 210;
2103  ATOM_REVIEW_PERMISSIONS_FRAGMENT_RESULT_REPORTED = 211;
2104  ATOM_RUNTIME_PERMISSIONS_UPGRADE_RESULT = 212;
2105  ATOM_GRANT_PERMISSIONS_ACTIVITY_BUTTON_ACTIONS = 213;
2106  ATOM_LOCATION_ACCESS_CHECK_NOTIFICATION_ACTION = 214;
2107  ATOM_APP_PERMISSION_FRAGMENT_ACTION_REPORTED = 215;
2108  ATOM_APP_PERMISSION_FRAGMENT_VIEWED = 216;
2109  ATOM_APP_PERMISSIONS_FRAGMENT_VIEWED = 217;
2110  ATOM_PERMISSION_APPS_FRAGMENT_VIEWED = 218;
2111  ATOM_TEXT_SELECTION_EVENT = 219;
2112  ATOM_TEXT_LINKIFY_EVENT = 220;
2113  ATOM_CONVERSATION_ACTIONS_EVENT = 221;
2114  ATOM_LANGUAGE_DETECTION_EVENT = 222;
2115  ATOM_EXCLUSION_RECT_STATE_CHANGED = 223;
2116  ATOM_BACK_GESTURE_REPORTED_REPORTED = 224;
2117  ATOM_UPDATE_ENGINE_UPDATE_ATTEMPT_REPORTED = 225;
2118  ATOM_UPDATE_ENGINE_SUCCESSFUL_UPDATE_REPORTED = 226;
2119  ATOM_CAMERA_ACTION_EVENT = 227;
2120  ATOM_APP_COMPATIBILITY_CHANGE_REPORTED = 228;
2121  ATOM_PERFETTO_UPLOADED = 229;
2122  ATOM_VMS_CLIENT_CONNECTION_STATE_CHANGED = 230;
2123  ATOM_MEDIA_PROVIDER_SCAN_OCCURRED = 233;
2124  ATOM_MEDIA_CONTENT_DELETED = 234;
2125  ATOM_MEDIA_PROVIDER_PERMISSION_REQUESTED = 235;
2126  ATOM_MEDIA_PROVIDER_SCHEMA_CHANGED = 236;
2127  ATOM_MEDIA_PROVIDER_IDLE_MAINTENANCE_FINISHED = 237;
2128  ATOM_REBOOT_ESCROW_RECOVERY_REPORTED = 238;
2129  ATOM_BOOT_TIME_EVENT_DURATION_REPORTED = 239;
2130  ATOM_BOOT_TIME_EVENT_ELAPSED_TIME_REPORTED = 240;
2131  ATOM_BOOT_TIME_EVENT_UTC_TIME_REPORTED = 241;
2132  ATOM_BOOT_TIME_EVENT_ERROR_CODE_REPORTED = 242;
2133  ATOM_USERSPACE_REBOOT_REPORTED = 243;
2134  ATOM_NOTIFICATION_REPORTED = 244;
2135  ATOM_NOTIFICATION_PANEL_REPORTED = 245;
2136  ATOM_NOTIFICATION_CHANNEL_MODIFIED = 246;
2137  ATOM_INTEGRITY_CHECK_RESULT_REPORTED = 247;
2138  ATOM_INTEGRITY_RULES_PUSHED = 248;
2139  ATOM_CB_MESSAGE_REPORTED = 249;
2140  ATOM_CB_MESSAGE_ERROR = 250;
2141  ATOM_WIFI_HEALTH_STAT_REPORTED = 251;
2142  ATOM_WIFI_FAILURE_STAT_REPORTED = 252;
2143  ATOM_WIFI_CONNECTION_RESULT_REPORTED = 253;
2144  ATOM_APP_FREEZE_CHANGED = 254;
2145  ATOM_SNAPSHOT_MERGE_REPORTED = 255;
2146  ATOM_FOREGROUND_SERVICE_APP_OP_SESSION_ENDED = 256;
2147  ATOM_DISPLAY_JANK_REPORTED = 257;
2148  ATOM_APP_STANDBY_BUCKET_CHANGED = 258;
2149  ATOM_SHARESHEET_STARTED = 259;
2150  ATOM_RANKING_SELECTED = 260;
2151  ATOM_TVSETTINGS_UI_INTERACTED = 261;
2152  ATOM_LAUNCHER_SNAPSHOT = 262;
2153  ATOM_PACKAGE_INSTALLER_V2_REPORTED = 263;
2154  ATOM_USER_LIFECYCLE_JOURNEY_REPORTED = 264;
2155  ATOM_USER_LIFECYCLE_EVENT_OCCURRED = 265;
2156  ATOM_ACCESSIBILITY_SHORTCUT_REPORTED = 266;
2157  ATOM_ACCESSIBILITY_SERVICE_REPORTED = 267;
2158  ATOM_DOCS_UI_DRAG_AND_DROP_REPORTED = 268;
2159  ATOM_APP_USAGE_EVENT_OCCURRED = 269;
2160  ATOM_AUTO_REVOKE_NOTIFICATION_CLICKED = 270;
2161  ATOM_AUTO_REVOKE_FRAGMENT_APP_VIEWED = 271;
2162  ATOM_AUTO_REVOKED_APP_INTERACTION = 272;
2163  ATOM_APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION = 273;
2164  ATOM_EVS_USAGE_STATS_REPORTED = 274;
2165  ATOM_AUDIO_POWER_USAGE_DATA_REPORTED = 275;
2166  ATOM_TV_TUNER_STATE_CHANGED = 276;
2167  ATOM_MEDIAOUTPUT_OP_SWITCH_REPORTED = 277;
2168  ATOM_CB_MESSAGE_FILTERED = 278;
2169  ATOM_TV_TUNER_DVR_STATUS = 279;
2170  ATOM_TV_CAS_SESSION_OPEN_STATUS = 280;
2171  ATOM_ASSISTANT_INVOCATION_REPORTED = 281;
2172  ATOM_DISPLAY_WAKE_REPORTED = 282;
2173  ATOM_CAR_USER_HAL_MODIFY_USER_REQUEST_REPORTED = 283;
2174  ATOM_CAR_USER_HAL_MODIFY_USER_RESPONSE_REPORTED = 284;
2175  ATOM_CAR_USER_HAL_POST_SWITCH_RESPONSE_REPORTED = 285;
2176  ATOM_CAR_USER_HAL_INITIAL_USER_INFO_REQUEST_REPORTED = 286;
2177  ATOM_CAR_USER_HAL_INITIAL_USER_INFO_RESPONSE_REPORTED = 287;
2178  ATOM_CAR_USER_HAL_USER_ASSOCIATION_REQUEST_REPORTED = 288;
2179  ATOM_CAR_USER_HAL_SET_USER_ASSOCIATION_RESPONSE_REPORTED = 289;
2180  ATOM_NETWORK_IP_PROVISIONING_REPORTED = 290;
2181  ATOM_NETWORK_DHCP_RENEW_REPORTED = 291;
2182  ATOM_NETWORK_VALIDATION_REPORTED = 292;
2183  ATOM_NETWORK_STACK_QUIRK_REPORTED = 293;
2184  ATOM_MEDIAMETRICS_AUDIORECORDDEVICEUSAGE_REPORTED = 294;
2185  ATOM_MEDIAMETRICS_AUDIOTHREADDEVICEUSAGE_REPORTED = 295;
2186  ATOM_MEDIAMETRICS_AUDIOTRACKDEVICEUSAGE_REPORTED = 296;
2187  ATOM_MEDIAMETRICS_AUDIODEVICECONNECTION_REPORTED = 297;
2188  ATOM_BLOB_COMMITTED = 298;
2189  ATOM_BLOB_LEASED = 299;
2190  ATOM_BLOB_OPENED = 300;
2191  ATOM_CONTACTS_PROVIDER_STATUS_REPORTED = 301;
2192  ATOM_KEYSTORE_KEY_EVENT_REPORTED = 302;
2193  ATOM_NETWORK_TETHERING_REPORTED = 303;
2194  ATOM_IME_TOUCH_REPORTED = 304;
2195  ATOM_UI_INTERACTION_FRAME_INFO_REPORTED = 305;
2196  ATOM_UI_ACTION_LATENCY_REPORTED = 306;
2197  ATOM_WIFI_DISCONNECT_REPORTED = 307;
2198  ATOM_WIFI_CONNECTION_STATE_CHANGED = 308;
2199  ATOM_HDMI_CEC_ACTIVE_SOURCE_CHANGED = 309;
2200  ATOM_HDMI_CEC_MESSAGE_REPORTED = 310;
2201  ATOM_AIRPLANE_MODE = 311;
2202  ATOM_MODEM_RESTART = 312;
2203  ATOM_CARRIER_ID_MISMATCH_REPORTED = 313;
2204  ATOM_CARRIER_ID_TABLE_UPDATED = 314;
2205  ATOM_DATA_STALL_RECOVERY_REPORTED = 315;
2206  ATOM_MEDIAMETRICS_MEDIAPARSER_REPORTED = 316;
2207  ATOM_TLS_HANDSHAKE_REPORTED = 317;
2208  ATOM_TEXT_CLASSIFIER_API_USAGE_REPORTED = 318;
2209  ATOM_CAR_WATCHDOG_KILL_STATS_REPORTED = 319;
2210  ATOM_MEDIAMETRICS_PLAYBACK_REPORTED = 320;
2211  ATOM_MEDIA_NETWORK_INFO_CHANGED = 321;
2212  ATOM_MEDIA_PLAYBACK_STATE_CHANGED = 322;
2213  ATOM_MEDIA_PLAYBACK_ERROR_REPORTED = 323;
2214  ATOM_MEDIA_PLAYBACK_TRACK_CHANGED = 324;
2215  ATOM_WIFI_SCAN_REPORTED = 325;
2216  ATOM_WIFI_PNO_SCAN_REPORTED = 326;
2217  ATOM_TIF_TUNE_CHANGED = 327;
2218  ATOM_AUTO_ROTATE_REPORTED = 328;
2219  ATOM_PERFETTO_TRIGGER = 329;
2220  ATOM_TRANSCODING_DATA = 330;
2221  ATOM_IMS_SERVICE_ENTITLEMENT_UPDATED = 331;
2222  ATOM_DEVICE_ROTATED = 333;
2223  ATOM_SIM_SPECIFIC_SETTINGS_RESTORED = 334;
2224  ATOM_TEXT_CLASSIFIER_DOWNLOAD_REPORTED = 335;
2225  ATOM_PIN_STORAGE_EVENT = 336;
2226  ATOM_FACE_DOWN_REPORTED = 337;
2227  ATOM_BLUETOOTH_HAL_CRASH_REASON_REPORTED = 338;
2228  ATOM_REBOOT_ESCROW_PREPARATION_REPORTED = 339;
2229  ATOM_REBOOT_ESCROW_LSKF_CAPTURE_REPORTED = 340;
2230  ATOM_REBOOT_ESCROW_REBOOT_REPORTED = 341;
2231  ATOM_BINDER_LATENCY_REPORTED = 342;
2232  ATOM_MEDIAMETRICS_AAUDIOSTREAM_REPORTED = 343;
2233  ATOM_MEDIA_TRANSCODING_SESSION_ENDED = 344;
2234  ATOM_MAGNIFICATION_USAGE_REPORTED = 345;
2235  ATOM_MAGNIFICATION_MODE_WITH_IME_ON_REPORTED = 346;
2236  ATOM_APP_SEARCH_CALL_STATS_REPORTED = 347;
2237  ATOM_APP_SEARCH_PUT_DOCUMENT_STATS_REPORTED = 348;
2238  ATOM_DEVICE_CONTROL_CHANGED = 349;
2239  ATOM_DEVICE_STATE_CHANGED = 350;
2240  ATOM_INPUTDEVICE_REGISTERED = 351;
2241  ATOM_SMARTSPACE_CARD_REPORTED = 352;
2242  ATOM_AUTH_PROMPT_AUTHENTICATE_INVOKED = 353;
2243  ATOM_AUTH_MANAGER_CAN_AUTHENTICATE_INVOKED = 354;
2244  ATOM_AUTH_ENROLL_ACTION_INVOKED = 355;
2245  ATOM_AUTH_DEPRECATED_API_USED = 356;
2246  ATOM_UNATTENDED_REBOOT_OCCURRED = 357;
2247  ATOM_LONG_REBOOT_BLOCKING_REPORTED = 358;
2248  ATOM_LOCATION_TIME_ZONE_PROVIDER_STATE_CHANGED = 359;
2249  ATOM_FDTRACK_EVENT_OCCURRED = 364;
2250  ATOM_TIMEOUT_AUTO_EXTENDED_REPORTED = 365;
2251  ATOM_ALARM_BATCH_DELIVERED = 367;
2252  ATOM_ALARM_SCHEDULED = 368;
2253  ATOM_CAR_WATCHDOG_IO_OVERUSE_STATS_REPORTED = 369;
2254  ATOM_USER_LEVEL_HIBERNATION_STATE_CHANGED = 370;
2255  ATOM_APP_SEARCH_INITIALIZE_STATS_REPORTED = 371;
2256  ATOM_APP_SEARCH_QUERY_STATS_REPORTED = 372;
2257  ATOM_APP_PROCESS_DIED = 373;
2258  ATOM_NETWORK_IP_REACHABILITY_MONITOR_REPORTED = 374;
2259  ATOM_SLOW_INPUT_EVENT_REPORTED = 375;
2260  ATOM_ANR_OCCURRED_PROCESSING_STARTED = 376;
2261  ATOM_APP_SEARCH_REMOVE_STATS_REPORTED = 377;
2262  ATOM_MEDIA_CODEC_REPORTED = 378;
2263  ATOM_PERMISSION_USAGE_FRAGMENT_INTERACTION = 379;
2264  ATOM_PERMISSION_DETAILS_INTERACTION = 380;
2265  ATOM_PRIVACY_SENSOR_TOGGLE_INTERACTION = 381;
2266  ATOM_PRIVACY_TOGGLE_DIALOG_INTERACTION = 382;
2267  ATOM_APP_SEARCH_OPTIMIZE_STATS_REPORTED = 383;
2268  ATOM_NON_A11Y_TOOL_SERVICE_WARNING_REPORT = 384;
2269  ATOM_APP_SEARCH_SET_SCHEMA_STATS_REPORTED = 385;
2270  ATOM_APP_COMPAT_STATE_CHANGED = 386;
2271  ATOM_SIZE_COMPAT_RESTART_BUTTON_EVENT_REPORTED = 387;
2272  ATOM_SPLITSCREEN_UI_CHANGED = 388;
2273  ATOM_NETWORK_DNS_HANDSHAKE_REPORTED = 389;
2274  ATOM_BLUETOOTH_CODE_PATH_COUNTER = 390;
2275  ATOM_BLUETOOTH_LE_BATCH_SCAN_REPORT_DELAY = 392;
2276  ATOM_ACCESSIBILITY_FLOATING_MENU_UI_CHANGED = 393;
2277  ATOM_NEURALNETWORKS_COMPILATION_COMPLETED = 394;
2278  ATOM_NEURALNETWORKS_EXECUTION_COMPLETED = 395;
2279  ATOM_NEURALNETWORKS_COMPILATION_FAILED = 396;
2280  ATOM_NEURALNETWORKS_EXECUTION_FAILED = 397;
2281  ATOM_CONTEXT_HUB_BOOTED = 398;
2282  ATOM_CONTEXT_HUB_RESTARTED = 399;
2283  ATOM_CONTEXT_HUB_LOADED_NANOAPP_SNAPSHOT_REPORTED = 400;
2284  ATOM_CHRE_CODE_DOWNLOAD_TRANSACTED = 401;
2285  ATOM_UWB_SESSION_INITED = 402;
2286  ATOM_UWB_SESSION_CLOSED = 403;
2287  ATOM_UWB_FIRST_RANGING_RECEIVED = 404;
2288  ATOM_UWB_RANGING_MEASUREMENT_RECEIVED = 405;
2289  ATOM_TEXT_CLASSIFIER_DOWNLOAD_WORK_SCHEDULED = 406;
2290  ATOM_TEXT_CLASSIFIER_DOWNLOAD_WORK_COMPLETED = 407;
2291  ATOM_CLIPBOARD_CLEARED = 408;
2292  ATOM_VM_CREATION_REQUESTED = 409;
2293  ATOM_NEARBY_DEVICE_SCAN_STATE_CHANGED = 410;
2294  ATOM_CAMERA_COMPAT_CONTROL_EVENT_REPORTED = 411;
2295  ATOM_APPLICATION_LOCALES_CHANGED = 412;
2296  ATOM_MEDIAMETRICS_AUDIOTRACKSTATUS_REPORTED = 413;
2297  ATOM_FOLD_STATE_DURATION_REPORTED = 414;
2298  ATOM_LOCATION_TIME_ZONE_PROVIDER_CONTROLLER_STATE_CHANGED = 415;
2299  ATOM_DISPLAY_HBM_STATE_CHANGED = 416;
2300  ATOM_DISPLAY_HBM_BRIGHTNESS_CHANGED = 417;
2301  ATOM_PERSISTENT_URI_PERMISSIONS_FLUSHED = 418;
2302  ATOM_EARLY_BOOT_COMP_OS_ARTIFACTS_CHECK_REPORTED = 419;
2303  ATOM_VBMETA_DIGEST_REPORTED = 420;
2304  ATOM_APEX_INFO_GATHERED = 421;
2305  ATOM_PVM_INFO_GATHERED = 422;
2306  ATOM_WEAR_SETTINGS_UI_INTERACTED = 423;
2307  ATOM_TRACING_SERVICE_REPORT_EVENT = 424;
2308  ATOM_MEDIAMETRICS_AUDIORECORDSTATUS_REPORTED = 425;
2309  ATOM_LAUNCHER_LATENCY = 426;
2310  ATOM_DROPBOX_ENTRY_DROPPED = 427;
2311  ATOM_WIFI_P2P_CONNECTION_REPORTED = 428;
2312  ATOM_GAME_STATE_CHANGED = 429;
2313  ATOM_HOTWORD_DETECTOR_CREATE_REQUESTED = 430;
2314  ATOM_HOTWORD_DETECTION_SERVICE_INIT_RESULT_REPORTED = 431;
2315  ATOM_HOTWORD_DETECTION_SERVICE_RESTARTED = 432;
2316  ATOM_HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED = 433;
2317  ATOM_HOTWORD_DETECTOR_EVENTS = 434;
2318  ATOM_AD_SERVICES_API_CALLED = 435;
2319  ATOM_AD_SERVICES_MESUREMENT_REPORTS_UPLOADED = 436;
2320  ATOM_BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED = 437;
2321  ATOM_CONTACTS_INDEXER_UPDATE_STATS_REPORTED = 440;
2322  ATOM_APP_BACKGROUND_RESTRICTIONS_INFO = 441;
2323  ATOM_MMS_SMS_PROVIDER_GET_THREAD_ID_FAILED = 442;
2324  ATOM_MMS_SMS_DATABASE_HELPER_ON_UPGRADE_FAILED = 443;
2325  ATOM_PERMISSION_REMINDER_NOTIFICATION_INTERACTED = 444;
2326  ATOM_RECENT_PERMISSION_DECISIONS_INTERACTED = 445;
2327  ATOM_GNSS_PSDS_DOWNLOAD_REPORTED = 446;
2328  ATOM_LE_AUDIO_CONNECTION_SESSION_REPORTED = 447;
2329  ATOM_LE_AUDIO_BROADCAST_SESSION_REPORTED = 448;
2330  ATOM_DREAM_UI_EVENT_REPORTED = 449;
2331  ATOM_TASK_MANAGER_EVENT_REPORTED = 450;
2332  ATOM_CDM_ASSOCIATION_ACTION = 451;
2333  ATOM_MAGNIFICATION_TRIPLE_TAP_AND_HOLD_ACTIVATED_SESSION_REPORTED = 452;
2334  ATOM_MAGNIFICATION_FOLLOW_TYPING_FOCUS_ACTIVATED_SESSION_REPORTED = 453;
2335  ATOM_ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED = 454;
2336  ATOM_WIFI_SETUP_FAILURE_CRASH_REPORTED = 455;
2337  ATOM_UWB_DEVICE_ERROR_REPORTED = 456;
2338  ATOM_ISOLATED_COMPILATION_SCHEDULED = 457;
2339  ATOM_ISOLATED_COMPILATION_ENDED = 458;
2340  ATOM_ONS_OPPORTUNISTIC_ESIM_PROVISIONING_COMPLETE = 459;
2341  ATOM_SYSTEM_SERVER_PRE_WATCHDOG_OCCURRED = 460;
2342  ATOM_TELEPHONY_ANOMALY_DETECTED = 461;
2343  ATOM_LETTERBOX_POSITION_CHANGED = 462;
2344  ATOM_REMOTE_KEY_PROVISIONING_ATTEMPT = 463;
2345  ATOM_REMOTE_KEY_PROVISIONING_NETWORK_INFO = 464;
2346  ATOM_REMOTE_KEY_PROVISIONING_TIMING = 465;
2347  ATOM_MEDIAOUTPUT_OP_INTERACTION_REPORT = 466;
2348  ATOM_SYNC_EXEMPTION_OCCURRED = 468;
2349  ATOM_AUTOFILL_PRESENTATION_EVENT_REPORTED = 469;
2350  ATOM_DOCK_STATE_CHANGED = 470;
2351  ATOM_SAFETY_SOURCE_STATE_COLLECTED = 471;
2352  ATOM_SAFETY_CENTER_SYSTEM_EVENT_REPORTED = 472;
2353  ATOM_SAFETY_CENTER_INTERACTION_REPORTED = 473;
2354  ATOM_SETTINGS_PROVIDER_SETTING_CHANGED = 474;
2355  ATOM_BROADCAST_DELIVERY_EVENT_REPORTED = 475;
2356  ATOM_SERVICE_REQUEST_EVENT_REPORTED = 476;
2357  ATOM_PROVIDER_ACQUISITION_EVENT_REPORTED = 477;
2358  ATOM_BLUETOOTH_DEVICE_NAME_REPORTED = 478;
2359  ATOM_CB_CONFIG_UPDATED = 479;
2360  ATOM_CB_MODULE_ERROR_REPORTED = 480;
2361  ATOM_CB_SERVICE_FEATURE_CHANGED = 481;
2362  ATOM_CB_RECEIVER_FEATURE_CHANGED = 482;
2363  ATOM_JSSCRIPTENGINE_LATENCY_REPORTED = 483;
2364  ATOM_PRIVACY_SIGNAL_NOTIFICATION_INTERACTION = 484;
2365  ATOM_PRIVACY_SIGNAL_ISSUE_CARD_INTERACTION = 485;
2366  ATOM_PRIVACY_SIGNALS_JOB_FAILURE = 486;
2367  ATOM_VIBRATION_REPORTED = 487;
2368  ATOM_UWB_RANGING_START = 489;
2369  ATOM_MOBILE_DATA_DOWNLOAD_FILE_GROUP_STATUS_REPORTED = 490;
2370  ATOM_APP_COMPACTED_V2 = 491;
2371  ATOM_AD_SERVICES_SETTINGS_USAGE_REPORTED = 493;
2372  ATOM_DISPLAY_BRIGHTNESS_CHANGED = 494;
2373  ATOM_ACTIVITY_ACTION_BLOCKED = 495;
2374  ATOM_BACKGROUND_FETCH_PROCESS_REPORTED = 496;
2375  ATOM_UPDATE_CUSTOM_AUDIENCE_PROCESS_REPORTED = 497;
2376  ATOM_RUN_AD_BIDDING_PROCESS_REPORTED = 498;
2377  ATOM_RUN_AD_SCORING_PROCESS_REPORTED = 499;
2378  ATOM_RUN_AD_SELECTION_PROCESS_REPORTED = 500;
2379  ATOM_RUN_AD_BIDDING_PER_CA_PROCESS_REPORTED = 501;
2380  ATOM_MOBILE_DATA_DOWNLOAD_DOWNLOAD_RESULT_REPORTED = 502;
2381  ATOM_MOBILE_DATA_DOWNLOAD_FILE_GROUP_STORAGE_STATS_REPORTED = 503;
2382  ATOM_NETWORK_DNS_SERVER_SUPPORT_REPORTED = 504;
2383  ATOM_VM_BOOTED = 505;
2384  ATOM_VM_EXITED = 506;
2385  ATOM_AMBIENT_BRIGHTNESS_STATS_REPORTED = 507;
2386  ATOM_MEDIAMETRICS_SPATIALIZERCAPABILITIES_REPORTED = 508;
2387  ATOM_MEDIAMETRICS_SPATIALIZERDEVICEENABLED_REPORTED = 509;
2388  ATOM_MEDIAMETRICS_HEADTRACKERDEVICEENABLED_REPORTED = 510;
2389  ATOM_MEDIAMETRICS_HEADTRACKERDEVICESUPPORTED_REPORTED = 511;
2390  ATOM_AD_SERVICES_MEASUREMENT_REGISTRATIONS = 512;
2391  ATOM_HEARING_AID_INFO_REPORTED = 513;
2392  ATOM_DEVICE_WIDE_JOB_CONSTRAINT_CHANGED = 514;
2393  ATOM_AMBIENT_MODE_CHANGED = 515;
2394  ATOM_ANR_LATENCY_REPORTED = 516;
2395  ATOM_RESOURCE_API_INFO = 517;
2396  ATOM_SYSTEM_DEFAULT_NETWORK_CHANGED = 518;
2397  ATOM_IWLAN_SETUP_DATA_CALL_RESULT_REPORTED = 519;
2398  ATOM_IWLAN_PDN_DISCONNECTED_REASON_REPORTED = 520;
2399  ATOM_AIRPLANE_MODE_SESSION_REPORTED = 521;
2400  ATOM_VM_CPU_STATUS_REPORTED = 522;
2401  ATOM_VM_MEM_STATUS_REPORTED = 523;
2402  ATOM_PACKAGE_INSTALLATION_SESSION_REPORTED = 524;
2403  ATOM_DEFAULT_NETWORK_REMATCH_INFO = 525;
2404  ATOM_NETWORK_SELECTION_PERFORMANCE = 526;
2405  ATOM_NETWORK_NSD_REPORTED = 527;
2406  ATOM_BLUETOOTH_DISCONNECTION_REASON_REPORTED = 529;
2407  ATOM_BLUETOOTH_LOCAL_VERSIONS_REPORTED = 530;
2408  ATOM_BLUETOOTH_REMOTE_SUPPORTED_FEATURES_REPORTED = 531;
2409  ATOM_BLUETOOTH_LOCAL_SUPPORTED_FEATURES_REPORTED = 532;
2410  ATOM_BLUETOOTH_GATT_APP_INFO = 533;
2411  ATOM_BRIGHTNESS_CONFIGURATION_UPDATED = 534;
2412  ATOM_AD_SERVICES_GET_TOPICS_REPORTED = 535;
2413  ATOM_AD_SERVICES_EPOCH_COMPUTATION_GET_TOP_TOPICS_REPORTED = 536;
2414  ATOM_AD_SERVICES_EPOCH_COMPUTATION_CLASSIFIER_REPORTED = 537;
2415  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_LAUNCHED = 538;
2416  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_FINISHED = 539;
2417  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_CONNECTION_REPORTED = 540;
2418  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_DEVICE_SCAN_TRIGGERED = 541;
2419  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_FIRST_DEVICE_SCAN_LATENCY = 542;
2420  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_CONNECT_DEVICE_LATENCY = 543;
2421  ATOM_PACKAGE_MANAGER_SNAPSHOT_REPORTED = 544;
2422  ATOM_PACKAGE_MANAGER_APPS_FILTER_CACHE_BUILD_REPORTED = 545;
2423  ATOM_PACKAGE_MANAGER_APPS_FILTER_CACHE_UPDATE_REPORTED = 546;
2424  ATOM_LAUNCHER_IMPRESSION_EVENT = 547;
2425  ATOM_WEAR_MEDIA_OUTPUT_SWITCHER_ALL_DEVICES_SCAN_LATENCY = 549;
2426  ATOM_WS_WATCH_FACE_EDITED = 551;
2427  ATOM_WS_WATCH_FACE_FAVORITE_ACTION_REPORTED = 552;
2428  ATOM_WS_WATCH_FACE_SET_ACTION_REPORTED = 553;
2429  ATOM_PACKAGE_UNINSTALLATION_REPORTED = 554;
2430  ATOM_GAME_MODE_CHANGED = 555;
2431  ATOM_GAME_MODE_CONFIGURATION_CHANGED = 556;
2432  ATOM_BEDTIME_MODE_STATE_CHANGED = 557;
2433  ATOM_NETWORK_SLICE_SESSION_ENDED = 558;
2434  ATOM_NETWORK_SLICE_DAILY_DATA_USAGE_REPORTED = 559;
2435  ATOM_NFC_TAG_TYPE_OCCURRED = 560;
2436  ATOM_NFC_AID_CONFLICT_OCCURRED = 561;
2437  ATOM_NFC_READER_CONFLICT_OCCURRED = 562;
2438  ATOM_WS_TILE_LIST_CHANGED = 563;
2439  ATOM_GET_TYPE_ACCESSED_WITHOUT_PERMISSION = 564;
2440  ATOM_MOBILE_BUNDLED_APP_INFO_GATHERED = 566;
2441  ATOM_WS_WATCH_FACE_COMPLICATION_SET_CHANGED = 567;
2442  ATOM_MEDIA_DRM_CREATED = 568;
2443  ATOM_MEDIA_DRM_ERRORED = 569;
2444  ATOM_MEDIA_DRM_SESSION_OPENED = 570;
2445  ATOM_MEDIA_DRM_SESSION_CLOSED = 571;
2446  ATOM_USER_SELECTED_RESOLUTION = 572;
2447  ATOM_UNSAFE_INTENT_EVENT_REPORTED = 573;
2448  ATOM_PERFORMANCE_HINT_SESSION_REPORTED = 574;
2449  ATOM_MEDIAMETRICS_MIDI_DEVICE_CLOSE_REPORTED = 576;
2450  ATOM_BIOMETRIC_TOUCH_REPORTED = 577;
2451  ATOM_HOTWORD_AUDIO_EGRESS_EVENT_REPORTED = 578;
2452  ATOM_APP_SEARCH_SCHEMA_MIGRATION_STATS_REPORTED = 579;
2453  ATOM_LOCATION_ENABLED_STATE_CHANGED = 580;
2454  ATOM_IME_REQUEST_FINISHED = 581;
2455  ATOM_USB_COMPLIANCE_WARNINGS_REPORTED = 582;
2456  ATOM_APP_SUPPORTED_LOCALES_CHANGED = 583;
2457  ATOM_GRAMMATICAL_INFLECTION_CHANGED = 584;
2458  ATOM_MEDIA_PROVIDER_VOLUME_RECOVERY_REPORTED = 586;
2459  ATOM_BIOMETRIC_PROPERTIES_COLLECTED = 587;
2460  ATOM_KERNEL_WAKEUP_ATTRIBUTED = 588;
2461  ATOM_SCREEN_STATE_CHANGED_V2 = 589;
2462  ATOM_WS_BACKUP_ACTION_REPORTED = 590;
2463  ATOM_WS_RESTORE_ACTION_REPORTED = 591;
2464  ATOM_DEVICE_LOG_ACCESS_EVENT_REPORTED = 592;
2465  ATOM_MEDIA_SESSION_UPDATED = 594;
2466  ATOM_WEAR_OOBE_STATE_CHANGED = 595;
2467  ATOM_WS_NOTIFICATION_UPDATED = 596;
2468  ATOM_NETWORK_VALIDATION_FAILURE_STATS_DAILY_REPORTED = 601;
2469  ATOM_WS_COMPLICATION_TAPPED = 602;
2470  ATOM_WS_WEAR_TIME_SESSION = 610;
2471  ATOM_WIFI_BYTES_TRANSFER = 10000;
2472  ATOM_WIFI_BYTES_TRANSFER_BY_FG_BG = 10001;
2473  ATOM_MOBILE_BYTES_TRANSFER = 10002;
2474  ATOM_MOBILE_BYTES_TRANSFER_BY_FG_BG = 10003;
2475  ATOM_BLUETOOTH_BYTES_TRANSFER = 10006;
2476  ATOM_KERNEL_WAKELOCK = 10004;
2477  ATOM_SUBSYSTEM_SLEEP_STATE = 10005;
2478  ATOM_CPU_TIME_PER_UID = 10009;
2479  ATOM_CPU_TIME_PER_UID_FREQ = 10010;
2480  ATOM_WIFI_ACTIVITY_INFO = 10011;
2481  ATOM_MODEM_ACTIVITY_INFO = 10012;
2482  ATOM_BLUETOOTH_ACTIVITY_INFO = 10007;
2483  ATOM_PROCESS_MEMORY_STATE = 10013;
2484  ATOM_SYSTEM_ELAPSED_REALTIME = 10014;
2485  ATOM_SYSTEM_UPTIME = 10015;
2486  ATOM_CPU_ACTIVE_TIME = 10016;
2487  ATOM_CPU_CLUSTER_TIME = 10017;
2488  ATOM_DISK_SPACE = 10018;
2489  ATOM_REMAINING_BATTERY_CAPACITY = 10019;
2490  ATOM_FULL_BATTERY_CAPACITY = 10020;
2491  ATOM_TEMPERATURE = 10021;
2492  ATOM_BINDER_CALLS = 10022;
2493  ATOM_BINDER_CALLS_EXCEPTIONS = 10023;
2494  ATOM_LOOPER_STATS = 10024;
2495  ATOM_DISK_STATS = 10025;
2496  ATOM_DIRECTORY_USAGE = 10026;
2497  ATOM_APP_SIZE = 10027;
2498  ATOM_CATEGORY_SIZE = 10028;
2499  ATOM_PROC_STATS = 10029;
2500  ATOM_BATTERY_VOLTAGE = 10030;
2501  ATOM_NUM_FINGERPRINTS_ENROLLED = 10031;
2502  ATOM_DISK_IO = 10032;
2503  ATOM_POWER_PROFILE = 10033;
2504  ATOM_PROC_STATS_PKG_PROC = 10034;
2505  ATOM_PROCESS_CPU_TIME = 10035;
2506  ATOM_CPU_TIME_PER_THREAD_FREQ = 10037;
2507  ATOM_ON_DEVICE_POWER_MEASUREMENT = 10038;
2508  ATOM_DEVICE_CALCULATED_POWER_USE = 10039;
2509  ATOM_PROCESS_MEMORY_HIGH_WATER_MARK = 10042;
2510  ATOM_BATTERY_LEVEL = 10043;
2511  ATOM_BUILD_INFORMATION = 10044;
2512  ATOM_BATTERY_CYCLE_COUNT = 10045;
2513  ATOM_DEBUG_ELAPSED_CLOCK = 10046;
2514  ATOM_DEBUG_FAILING_ELAPSED_CLOCK = 10047;
2515  ATOM_NUM_FACES_ENROLLED = 10048;
2516  ATOM_ROLE_HOLDER = 10049;
2517  ATOM_DANGEROUS_PERMISSION_STATE = 10050;
2518  ATOM_TRAIN_INFO = 10051;
2519  ATOM_TIME_ZONE_DATA_INFO = 10052;
2520  ATOM_EXTERNAL_STORAGE_INFO = 10053;
2521  ATOM_GPU_STATS_GLOBAL_INFO = 10054;
2522  ATOM_GPU_STATS_APP_INFO = 10055;
2523  ATOM_SYSTEM_ION_HEAP_SIZE = 10056;
2524  ATOM_APPS_ON_EXTERNAL_STORAGE_INFO = 10057;
2525  ATOM_FACE_SETTINGS = 10058;
2526  ATOM_COOLING_DEVICE = 10059;
2527  ATOM_APP_OPS = 10060;
2528  ATOM_PROCESS_SYSTEM_ION_HEAP_SIZE = 10061;
2529  ATOM_SURFACEFLINGER_STATS_GLOBAL_INFO = 10062;
2530  ATOM_SURFACEFLINGER_STATS_LAYER_INFO = 10063;
2531  ATOM_PROCESS_MEMORY_SNAPSHOT = 10064;
2532  ATOM_VMS_CLIENT_STATS = 10065;
2533  ATOM_NOTIFICATION_REMOTE_VIEWS = 10066;
2534  ATOM_DANGEROUS_PERMISSION_STATE_SAMPLED = 10067;
2535  ATOM_GRAPHICS_STATS = 10068;
2536  ATOM_RUNTIME_APP_OP_ACCESS = 10069;
2537  ATOM_ION_HEAP_SIZE = 10070;
2538  ATOM_PACKAGE_NOTIFICATION_PREFERENCES = 10071;
2539  ATOM_PACKAGE_NOTIFICATION_CHANNEL_PREFERENCES = 10072;
2540  ATOM_PACKAGE_NOTIFICATION_CHANNEL_GROUP_PREFERENCES = 10073;
2541  ATOM_GNSS_STATS = 10074;
2542  ATOM_ATTRIBUTED_APP_OPS = 10075;
2543  ATOM_VOICE_CALL_SESSION = 10076;
2544  ATOM_VOICE_CALL_RAT_USAGE = 10077;
2545  ATOM_SIM_SLOT_STATE = 10078;
2546  ATOM_SUPPORTED_RADIO_ACCESS_FAMILY = 10079;
2547  ATOM_SETTING_SNAPSHOT = 10080;
2548  ATOM_BLOB_INFO = 10081;
2549  ATOM_DATA_USAGE_BYTES_TRANSFER = 10082;
2550  ATOM_BYTES_TRANSFER_BY_TAG_AND_METERED = 10083;
2551  ATOM_DND_MODE_RULE = 10084;
2552  ATOM_GENERAL_EXTERNAL_STORAGE_ACCESS_STATS = 10085;
2553  ATOM_INCOMING_SMS = 10086;
2554  ATOM_OUTGOING_SMS = 10087;
2555  ATOM_CARRIER_ID_TABLE_VERSION = 10088;
2556  ATOM_DATA_CALL_SESSION = 10089;
2557  ATOM_CELLULAR_SERVICE_STATE = 10090;
2558  ATOM_CELLULAR_DATA_SERVICE_SWITCH = 10091;
2559  ATOM_SYSTEM_MEMORY = 10092;
2560  ATOM_IMS_REGISTRATION_TERMINATION = 10093;
2561  ATOM_IMS_REGISTRATION_STATS = 10094;
2562  ATOM_CPU_TIME_PER_CLUSTER_FREQ = 10095;
2563  ATOM_CPU_CYCLES_PER_UID_CLUSTER = 10096;
2564  ATOM_DEVICE_ROTATED_DATA = 10097;
2565  ATOM_CPU_CYCLES_PER_THREAD_GROUP_CLUSTER = 10098;
2566  ATOM_MEDIA_DRM_ACTIVITY_INFO = 10099;
2567  ATOM_OEM_MANAGED_BYTES_TRANSFER = 10100;
2568  ATOM_GNSS_POWER_STATS = 10101;
2569  ATOM_TIME_ZONE_DETECTOR_STATE = 10102;
2570  ATOM_KEYSTORE2_STORAGE_STATS = 10103;
2571  ATOM_RKP_POOL_STATS = 10104;
2572  ATOM_PROCESS_DMABUF_MEMORY = 10105;
2573  ATOM_PENDING_ALARM_INFO = 10106;
2574  ATOM_USER_LEVEL_HIBERNATED_APPS = 10107;
2575  ATOM_LAUNCHER_LAYOUT_SNAPSHOT = 10108;
2576  ATOM_GLOBAL_HIBERNATED_APPS = 10109;
2577  ATOM_INPUT_EVENT_LATENCY_SKETCH = 10110;
2578  ATOM_BATTERY_USAGE_STATS_BEFORE_RESET = 10111;
2579  ATOM_BATTERY_USAGE_STATS_SINCE_RESET = 10112;
2580  ATOM_BATTERY_USAGE_STATS_SINCE_RESET_USING_POWER_PROFILE_MODEL = 10113;
2581  ATOM_INSTALLED_INCREMENTAL_PACKAGE = 10114;
2582  ATOM_TELEPHONY_NETWORK_REQUESTS = 10115;
2583  ATOM_APP_SEARCH_STORAGE_INFO = 10116;
2584  ATOM_VMSTAT = 10117;
2585  ATOM_KEYSTORE2_KEY_CREATION_WITH_GENERAL_INFO = 10118;
2586  ATOM_KEYSTORE2_KEY_CREATION_WITH_AUTH_INFO = 10119;
2587  ATOM_KEYSTORE2_KEY_CREATION_WITH_PURPOSE_AND_MODES_INFO = 10120;
2588  ATOM_KEYSTORE2_ATOM_WITH_OVERFLOW = 10121;
2589  ATOM_KEYSTORE2_KEY_OPERATION_WITH_PURPOSE_AND_MODES_INFO = 10122;
2590  ATOM_KEYSTORE2_KEY_OPERATION_WITH_GENERAL_INFO = 10123;
2591  ATOM_RKP_ERROR_STATS = 10124;
2592  ATOM_KEYSTORE2_CRASH_STATS = 10125;
2593  ATOM_VENDOR_APEX_INFO = 10126;
2594  ATOM_ACCESSIBILITY_SHORTCUT_STATS = 10127;
2595  ATOM_ACCESSIBILITY_FLOATING_MENU_STATS = 10128;
2596  ATOM_DATA_USAGE_BYTES_TRANSFER_V2 = 10129;
2597  ATOM_MEDIA_CAPABILITIES = 10130;
2598  ATOM_CAR_WATCHDOG_SYSTEM_IO_USAGE_SUMMARY = 10131;
2599  ATOM_CAR_WATCHDOG_UID_IO_USAGE_SUMMARY = 10132;
2600  ATOM_IMS_REGISTRATION_FEATURE_TAG_STATS = 10133;
2601  ATOM_RCS_CLIENT_PROVISIONING_STATS = 10134;
2602  ATOM_RCS_ACS_PROVISIONING_STATS = 10135;
2603  ATOM_SIP_DELEGATE_STATS = 10136;
2604  ATOM_SIP_TRANSPORT_FEATURE_TAG_STATS = 10137;
2605  ATOM_SIP_MESSAGE_RESPONSE = 10138;
2606  ATOM_SIP_TRANSPORT_SESSION = 10139;
2607  ATOM_IMS_DEDICATED_BEARER_LISTENER_EVENT = 10140;
2608  ATOM_IMS_DEDICATED_BEARER_EVENT = 10141;
2609  ATOM_IMS_REGISTRATION_SERVICE_DESC_STATS = 10142;
2610  ATOM_UCE_EVENT_STATS = 10143;
2611  ATOM_PRESENCE_NOTIFY_EVENT = 10144;
2612  ATOM_GBA_EVENT = 10145;
2613  ATOM_PER_SIM_STATUS = 10146;
2614  ATOM_GPU_WORK_PER_UID = 10147;
2615  ATOM_PERSISTENT_URI_PERMISSIONS_AMOUNT_PER_PACKAGE = 10148;
2616  ATOM_SIGNED_PARTITION_INFO = 10149;
2617  ATOM_PINNED_FILE_SIZES_PER_PACKAGE = 10150;
2618  ATOM_PENDING_INTENTS_PER_PACKAGE = 10151;
2619  ATOM_USER_INFO = 10152;
2620  ATOM_TELEPHONY_NETWORK_REQUESTS_V2 = 10153;
2621  ATOM_DEVICE_TELEPHONY_PROPERTIES = 10154;
2622  ATOM_REMOTE_KEY_PROVISIONING_ERROR_COUNTS = 10155;
2623  ATOM_SAFETY_STATE = 10156;
2624  ATOM_INCOMING_MMS = 10157;
2625  ATOM_OUTGOING_MMS = 10158;
2626  ATOM_MULTI_USER_INFO = 10160;
2627  ATOM_NETWORK_BPF_MAP_INFO = 10161;
2628  ATOM_OUTGOING_SHORT_CODE_SMS = 10162;
2629  ATOM_CONNECTIVITY_STATE_SAMPLE = 10163;
2630  ATOM_NETWORK_SELECTION_REMATCH_REASONS_INFO = 10164;
2631  ATOM_GAME_MODE_INFO = 10165;
2632  ATOM_GAME_MODE_CONFIGURATION = 10166;
2633  ATOM_GAME_MODE_LISTENER = 10167;
2634  ATOM_NETWORK_SLICE_REQUEST_COUNT = 10168;
2635  ATOM_WS_TILE_SNAPSHOT = 10169;
2636  ATOM_WS_ACTIVE_WATCH_FACE_COMPLICATION_SET_SNAPSHOT = 10170;
2637  ATOM_PROCESS_STATE = 10171;
2638  ATOM_PROCESS_ASSOCIATION = 10172;
2639  ATOM_ADPF_SYSTEM_COMPONENT_INFO = 10173;
2640  ATOM_NOTIFICATION_MEMORY_USE = 10174;
2641  ATOM_HDR_CAPABILITIES = 10175;
2642  ATOM_WS_FAVOURITE_WATCH_FACE_LIST_SNAPSHOT = 10176;
2643  ATOM_WIFI_AWARE_NDP_REPORTED = 638;
2644  ATOM_WIFI_AWARE_ATTACH_REPORTED = 639;
2645  ATOM_WIFI_SELF_RECOVERY_TRIGGERED = 661;
2646  ATOM_SOFT_AP_STARTED = 680;
2647  ATOM_SOFT_AP_STOPPED = 681;
2648  ATOM_WIFI_LOCK_RELEASED = 687;
2649  ATOM_WIFI_LOCK_DEACTIVATED = 688;
2650  ATOM_WIFI_CONFIG_SAVED = 689;
2651  ATOM_WIFI_AWARE_RESOURCE_USING_CHANGED = 690;
2652  ATOM_WIFI_AWARE_HAL_API_CALLED = 691;
2653  ATOM_WIFI_LOCAL_ONLY_REQUEST_RECEIVED = 692;
2654  ATOM_WIFI_LOCAL_ONLY_REQUEST_SCAN_TRIGGERED = 693;
2655  ATOM_WIFI_THREAD_TASK_EXECUTED = 694;
2656  ATOM_WIFI_STATE_CHANGED = 700;
2657  ATOM_WIFI_AWARE_CAPABILITIES = 10190;
2658  ATOM_WIFI_MODULE_INFO = 10193;
2659  ATOM_SETTINGS_SPA_REPORTED = 622;
2660  ATOM_EXPRESS_EVENT_REPORTED = 528;
2661  ATOM_EXPRESS_HISTOGRAM_SAMPLE_REPORTED = 593;
2662  ATOM_EXPRESS_UID_EVENT_REPORTED = 644;
2663  ATOM_EXPRESS_UID_HISTOGRAM_SAMPLE_REPORTED = 658;
2664  ATOM_PERMISSION_RATIONALE_DIALOG_VIEWED = 645;
2665  ATOM_PERMISSION_RATIONALE_DIALOG_ACTION_REPORTED = 646;
2666  ATOM_APP_DATA_SHARING_UPDATES_NOTIFICATION_INTERACTION = 647;
2667  ATOM_APP_DATA_SHARING_UPDATES_FRAGMENT_VIEWED = 648;
2668  ATOM_APP_DATA_SHARING_UPDATES_FRAGMENT_ACTION_REPORTED = 649;
2669  ATOM_WS_INCOMING_CALL_ACTION_REPORTED = 626;
2670  ATOM_WS_CALL_DISCONNECTION_REPORTED = 627;
2671  ATOM_WS_CALL_DURATION_REPORTED = 628;
2672  ATOM_WS_CALL_USER_EXPERIENCE_LATENCY_REPORTED = 629;
2673  ATOM_WS_CALL_INTERACTION_REPORTED = 630;
2674  ATOM_FULL_SCREEN_INTENT_LAUNCHED = 631;
2675  ATOM_BAL_ALLOWED = 632;
2676  ATOM_IN_TASK_ACTIVITY_STARTED = 685;
2677  ATOM_CACHED_APPS_HIGH_WATERMARK = 10189;
2678  ATOM_ODREFRESH_REPORTED = 366;
2679  ATOM_ODSIGN_REPORTED = 548;
2680  ATOM_ART_DATUM_REPORTED = 332;
2681  ATOM_ART_DEVICE_DATUM_REPORTED = 550;
2682  ATOM_ART_DATUM_DELTA_REPORTED = 565;
2683  ATOM_BACKGROUND_DEXOPT_JOB_ENDED = 467;
2684  ATOM_WEAR_ADAPTIVE_SUSPEND_STATS_REPORTED = 619;
2685  ATOM_WEAR_POWER_ANOMALY_SERVICE_OPERATIONAL_STATS_REPORTED = 620;
2686  ATOM_WEAR_POWER_ANOMALY_SERVICE_EVENT_STATS_REPORTED = 621;
2687  ATOM_EMERGENCY_STATE_CHANGED = 633;
2688  ATOM_DND_STATE_CHANGED = 657;
2689  ATOM_MTE_STATE = 10181;
2690  ATOM_AD_SERVICES_BACK_COMPAT_GET_TOPICS_REPORTED = 598;
2691  ATOM_AD_SERVICES_BACK_COMPAT_EPOCH_COMPUTATION_CLASSIFIER_REPORTED = 599;
2692  ATOM_AD_SERVICES_MEASUREMENT_DEBUG_KEYS = 640;
2693  ATOM_AD_SERVICES_ERROR_REPORTED = 662;
2694  ATOM_AD_SERVICES_BACKGROUND_JOBS_EXECUTION_REPORTED = 663;
2695  ATOM_AD_SERVICES_MEASUREMENT_DELAYED_SOURCE_REGISTRATION = 673;
2696  ATOM_AD_SERVICES_MEASUREMENT_ATTRIBUTION = 674;
2697  ATOM_AD_SERVICES_MEASUREMENT_JOBS = 675;
2698  ATOM_AD_SERVICES_MEASUREMENT_WIPEOUT = 676;
2699  ATOM_AD_SERVICES_CONSENT_MIGRATED = 702;
2700  ATOM_RKPD_POOL_STATS = 664;
2701  ATOM_RKPD_CLIENT_OPERATION = 665;
2702  ATOM_AUTOFILL_UI_EVENT_REPORTED = 603;
2703  ATOM_AUTOFILL_FILL_REQUEST_REPORTED = 604;
2704  ATOM_AUTOFILL_FILL_RESPONSE_REPORTED = 605;
2705  ATOM_AUTOFILL_SAVE_EVENT_REPORTED = 606;
2706  ATOM_AUTOFILL_SESSION_COMMITTED = 607;
2707  ATOM_AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED = 659;
2708  ATOM_TEST_EXTENSION_ATOM_REPORTED = 660;
2709  ATOM_TEST_RESTRICTED_ATOM_REPORTED = 672;
2710  ATOM_STATS_SOCKET_LOSS_REPORTED = 752;
2711  ATOM_PLUGIN_INITIALIZED = 655;
2712  ATOM_TV_LOW_POWER_STANDBY_POLICY = 679;
2713  ATOM_LOCKSCREEN_SHORTCUT_SELECTED = 611;
2714  ATOM_LOCKSCREEN_SHORTCUT_TRIGGERED = 612;
2715  ATOM_EMERGENCY_NUMBERS_INFO = 10180;
2716  ATOM_QUALIFIED_RAT_LIST_CHANGED = 634;
2717  ATOM_QNS_IMS_CALL_DROP_STATS = 635;
2718  ATOM_QNS_FALLBACK_RESTRICTION_CHANGED = 636;
2719  ATOM_QNS_RAT_PREFERENCE_MISMATCH_INFO = 10177;
2720  ATOM_QNS_HANDOVER_TIME_MILLIS = 10178;
2721  ATOM_QNS_HANDOVER_PINGPONG = 10179;
2722  ATOM_SATELLITE_CONTROLLER = 10182;
2723  ATOM_SATELLITE_SESSION = 10183;
2724  ATOM_SATELLITE_INCOMING_DATAGRAM = 10184;
2725  ATOM_SATELLITE_OUTGOING_DATAGRAM = 10185;
2726  ATOM_SATELLITE_PROVISION = 10186;
2727  ATOM_SATELLITE_SOS_MESSAGE_RECOMMENDER = 10187;
2728  ATOM_IKE_SESSION_TERMINATED = 678;
2729  ATOM_IKE_LIVENESS_CHECK_SESSION_VALIDATED = 760;
2730  ATOM_BLUETOOTH_HASHED_DEVICE_NAME_REPORTED = 613;
2731  ATOM_BLUETOOTH_L2CAP_COC_CLIENT_CONNECTION = 614;
2732  ATOM_BLUETOOTH_L2CAP_COC_SERVER_CONNECTION = 615;
2733  ATOM_BLUETOOTH_LE_SESSION_CONNECTED = 656;
2734  ATOM_RESTRICTED_BLUETOOTH_DEVICE_NAME_REPORTED = 666;
2735  ATOM_BLUETOOTH_PROFILE_CONNECTION_ATTEMPTED = 696;
2736  ATOM_HEALTH_CONNECT_UI_IMPRESSION = 623;
2737  ATOM_HEALTH_CONNECT_UI_INTERACTION = 624;
2738  ATOM_HEALTH_CONNECT_APP_OPENED_REPORTED = 625;
2739  ATOM_HEALTH_CONNECT_API_CALLED = 616;
2740  ATOM_HEALTH_CONNECT_USAGE_STATS = 617;
2741  ATOM_HEALTH_CONNECT_STORAGE_STATS = 618;
2742  ATOM_HEALTH_CONNECT_API_INVOKED = 643;
2743  ATOM_EXERCISE_ROUTE_API_CALLED = 654;
2744  ATOM_ATOM_9999 = 9999;
2745  ATOM_ATOM_99999 = 99999;
2746  ATOM_THREADNETWORK_TELEMETRY_DATA_REPORTED = 738;
2747  ATOM_THREADNETWORK_TOPO_ENTRY_REPEATED = 739;
2748  ATOM_THREADNETWORK_DEVICE_INFO_REPORTED = 740;
2749  ATOM_EMERGENCY_NUMBER_DIALED = 637;
2750  ATOM_SANDBOX_API_CALLED = 488;
2751  ATOM_SANDBOX_ACTIVITY_EVENT_OCCURRED = 735;
2752  ATOM_SANDBOX_SDK_STORAGE = 10159;
2753  ATOM_CRONET_ENGINE_CREATED = 703;
2754  ATOM_CRONET_TRAFFIC_REPORTED = 704;
2755  ATOM_CRONET_ENGINE_BUILDER_INITIALIZED = 762;
2756  ATOM_CRONET_HTTP_FLAGS_INITIALIZED = 763;
2757  ATOM_CRONET_INITIALIZED = 764;
2758  ATOM_DAILY_KEEPALIVE_INFO_REPORTED = 650;
2759  ATOM_IP_CLIENT_RA_INFO_REPORTED = 778;
2760  ATOM_APF_SESSION_INFO_REPORTED = 777;
2761  ATOM_CREDENTIAL_MANAGER_API_CALLED = 585;
2762  ATOM_CREDENTIAL_MANAGER_INIT_PHASE_REPORTED = 651;
2763  ATOM_CREDENTIAL_MANAGER_CANDIDATE_PHASE_REPORTED = 652;
2764  ATOM_CREDENTIAL_MANAGER_FINAL_PHASE_REPORTED = 653;
2765  ATOM_CREDENTIAL_MANAGER_TOTAL_REPORTED = 667;
2766  ATOM_CREDENTIAL_MANAGER_FINALNOUID_REPORTED = 668;
2767  ATOM_CREDENTIAL_MANAGER_GET_REPORTED = 669;
2768  ATOM_CREDENTIAL_MANAGER_AUTH_CLICK_REPORTED = 670;
2769  ATOM_CREDENTIAL_MANAGER_APIV2_CALLED = 671;
2770  ATOM_UWB_ACTIVITY_INFO = 10188;
2771  ATOM_MEDIA_ACTION_REPORTED = 608;
2772  ATOM_MEDIA_CONTROLS_LAUNCHED = 609;
2773  ATOM_MEDIA_CODEC_RECLAIM_REQUEST_COMPLETED = 600;
2774  ATOM_MEDIA_CODEC_STARTED = 641;
2775  ATOM_MEDIA_CODEC_STOPPED = 642;
2776  ATOM_MEDIA_CODEC_RENDERED = 684;
2777}
2778// End of protos/perfetto/config/statsd/atom_ids.proto
2779
2780// Begin of protos/perfetto/config/statsd/statsd_tracing_config.proto
2781
2782// This file is named 'statsd_tracing_config.proto' rather than
2783// 'statsd_config.proto' (which would be more consistent with the other
2784// config protos) so it doesn't show up and confuse folks looking for
2785// the existing statsd_config.proto for configuring statsd itself.
2786// Same for the config proto itself.
2787message StatsdTracingConfig {
2788  // This is for the common case of the atom id being known in the enum AtomId.
2789  repeated AtomId push_atom_id = 1;
2790
2791  // Escape hatch for Atom IDs that are not yet in the AtomId enum
2792  // (e.g. non-upstream atoms that don't exist in AOSP).
2793  repeated int32 raw_push_atom_id = 2;
2794  repeated StatsdPullAtomConfig pull_config = 3;
2795}
2796
2797message StatsdPullAtomConfig {
2798  repeated AtomId pull_atom_id = 1;
2799  repeated int32 raw_pull_atom_id = 2;
2800
2801  optional int32 pull_frequency_ms = 3;
2802  repeated string packages = 4;
2803}
2804
2805// End of protos/perfetto/config/statsd/statsd_tracing_config.proto
2806
2807// Begin of protos/perfetto/common/sys_stats_counters.proto
2808
2809// When editing entries here remember also to update "sys_stats_counters.h" with
2810// the corresponding string definitions for the actual /proc files parser.
2811
2812// Counter definitions for Linux's /proc/meminfo.
2813enum MeminfoCounters {
2814  MEMINFO_UNSPECIFIED = 0;
2815  MEMINFO_MEM_TOTAL = 1;
2816  MEMINFO_MEM_FREE = 2;
2817  MEMINFO_MEM_AVAILABLE = 3;
2818  MEMINFO_BUFFERS = 4;
2819  MEMINFO_CACHED = 5;
2820  MEMINFO_SWAP_CACHED = 6;
2821  MEMINFO_ACTIVE = 7;
2822  MEMINFO_INACTIVE = 8;
2823  MEMINFO_ACTIVE_ANON = 9;
2824  MEMINFO_INACTIVE_ANON = 10;
2825  MEMINFO_ACTIVE_FILE = 11;
2826  MEMINFO_INACTIVE_FILE = 12;
2827  MEMINFO_UNEVICTABLE = 13;
2828  MEMINFO_MLOCKED = 14;
2829  MEMINFO_SWAP_TOTAL = 15;
2830  MEMINFO_SWAP_FREE = 16;
2831  MEMINFO_DIRTY = 17;
2832  MEMINFO_WRITEBACK = 18;
2833  MEMINFO_ANON_PAGES = 19;
2834  MEMINFO_MAPPED = 20;
2835  MEMINFO_SHMEM = 21;
2836  MEMINFO_SLAB = 22;
2837  MEMINFO_SLAB_RECLAIMABLE = 23;
2838  MEMINFO_SLAB_UNRECLAIMABLE = 24;
2839  MEMINFO_KERNEL_STACK = 25;
2840  MEMINFO_PAGE_TABLES = 26;
2841  MEMINFO_COMMIT_LIMIT = 27;
2842  MEMINFO_COMMITED_AS = 28;
2843  MEMINFO_VMALLOC_TOTAL = 29;
2844  MEMINFO_VMALLOC_USED = 30;
2845  MEMINFO_VMALLOC_CHUNK = 31;
2846  MEMINFO_CMA_TOTAL = 32;
2847  MEMINFO_CMA_FREE = 33;
2848}
2849
2850// Counter definitions for Linux's /proc/vmstat.
2851enum VmstatCounters {
2852  VMSTAT_UNSPECIFIED = 0;
2853  VMSTAT_NR_FREE_PAGES = 1;
2854  VMSTAT_NR_ALLOC_BATCH = 2;
2855  VMSTAT_NR_INACTIVE_ANON = 3;
2856  VMSTAT_NR_ACTIVE_ANON = 4;
2857  VMSTAT_NR_INACTIVE_FILE = 5;
2858  VMSTAT_NR_ACTIVE_FILE = 6;
2859  VMSTAT_NR_UNEVICTABLE = 7;
2860  VMSTAT_NR_MLOCK = 8;
2861  VMSTAT_NR_ANON_PAGES = 9;
2862  VMSTAT_NR_MAPPED = 10;
2863  VMSTAT_NR_FILE_PAGES = 11;
2864  VMSTAT_NR_DIRTY = 12;
2865  VMSTAT_NR_WRITEBACK = 13;
2866  VMSTAT_NR_SLAB_RECLAIMABLE = 14;
2867  VMSTAT_NR_SLAB_UNRECLAIMABLE = 15;
2868  VMSTAT_NR_PAGE_TABLE_PAGES = 16;
2869  VMSTAT_NR_KERNEL_STACK = 17;
2870  VMSTAT_NR_OVERHEAD = 18;
2871  VMSTAT_NR_UNSTABLE = 19;
2872  VMSTAT_NR_BOUNCE = 20;
2873  VMSTAT_NR_VMSCAN_WRITE = 21;
2874  VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22;
2875  VMSTAT_NR_WRITEBACK_TEMP = 23;
2876  VMSTAT_NR_ISOLATED_ANON = 24;
2877  VMSTAT_NR_ISOLATED_FILE = 25;
2878  VMSTAT_NR_SHMEM = 26;
2879  VMSTAT_NR_DIRTIED = 27;
2880  VMSTAT_NR_WRITTEN = 28;
2881  VMSTAT_NR_PAGES_SCANNED = 29;
2882  VMSTAT_WORKINGSET_REFAULT = 30;
2883  VMSTAT_WORKINGSET_ACTIVATE = 31;
2884  VMSTAT_WORKINGSET_NODERECLAIM = 32;
2885  VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33;
2886  VMSTAT_NR_FREE_CMA = 34;
2887  VMSTAT_NR_SWAPCACHE = 35;
2888  VMSTAT_NR_DIRTY_THRESHOLD = 36;
2889  VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37;
2890  VMSTAT_PGPGIN = 38;
2891  VMSTAT_PGPGOUT = 39;
2892  VMSTAT_PGPGOUTCLEAN = 40;
2893  VMSTAT_PSWPIN = 41;
2894  VMSTAT_PSWPOUT = 42;
2895  VMSTAT_PGALLOC_DMA = 43;
2896  VMSTAT_PGALLOC_NORMAL = 44;
2897  VMSTAT_PGALLOC_MOVABLE = 45;
2898  VMSTAT_PGFREE = 46;
2899  VMSTAT_PGACTIVATE = 47;
2900  VMSTAT_PGDEACTIVATE = 48;
2901  VMSTAT_PGFAULT = 49;
2902  VMSTAT_PGMAJFAULT = 50;
2903  VMSTAT_PGREFILL_DMA = 51;
2904  VMSTAT_PGREFILL_NORMAL = 52;
2905  VMSTAT_PGREFILL_MOVABLE = 53;
2906  VMSTAT_PGSTEAL_KSWAPD_DMA = 54;
2907  VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55;
2908  VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56;
2909  VMSTAT_PGSTEAL_DIRECT_DMA = 57;
2910  VMSTAT_PGSTEAL_DIRECT_NORMAL = 58;
2911  VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59;
2912  VMSTAT_PGSCAN_KSWAPD_DMA = 60;
2913  VMSTAT_PGSCAN_KSWAPD_NORMAL = 61;
2914  VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62;
2915  VMSTAT_PGSCAN_DIRECT_DMA = 63;
2916  VMSTAT_PGSCAN_DIRECT_NORMAL = 64;
2917  VMSTAT_PGSCAN_DIRECT_MOVABLE = 65;
2918  VMSTAT_PGSCAN_DIRECT_THROTTLE = 66;
2919  VMSTAT_PGINODESTEAL = 67;
2920  VMSTAT_SLABS_SCANNED = 68;
2921  VMSTAT_KSWAPD_INODESTEAL = 69;
2922  VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70;
2923  VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71;
2924  VMSTAT_PAGEOUTRUN = 72;
2925  VMSTAT_ALLOCSTALL = 73;
2926  VMSTAT_PGROTATED = 74;
2927  VMSTAT_DROP_PAGECACHE = 75;
2928  VMSTAT_DROP_SLAB = 76;
2929  VMSTAT_PGMIGRATE_SUCCESS = 77;
2930  VMSTAT_PGMIGRATE_FAIL = 78;
2931  VMSTAT_COMPACT_MIGRATE_SCANNED = 79;
2932  VMSTAT_COMPACT_FREE_SCANNED = 80;
2933  VMSTAT_COMPACT_ISOLATED = 81;
2934  VMSTAT_COMPACT_STALL = 82;
2935  VMSTAT_COMPACT_FAIL = 83;
2936  VMSTAT_COMPACT_SUCCESS = 84;
2937  VMSTAT_COMPACT_DAEMON_WAKE = 85;
2938  VMSTAT_UNEVICTABLE_PGS_CULLED = 86;
2939  VMSTAT_UNEVICTABLE_PGS_SCANNED = 87;
2940  VMSTAT_UNEVICTABLE_PGS_RESCUED = 88;
2941  VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89;
2942  VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90;
2943  VMSTAT_UNEVICTABLE_PGS_CLEARED = 91;
2944  VMSTAT_UNEVICTABLE_PGS_STRANDED = 92;
2945  VMSTAT_NR_ZSPAGES = 93;
2946  VMSTAT_NR_ION_HEAP = 94;
2947  VMSTAT_NR_GPU_HEAP = 95;
2948  VMSTAT_ALLOCSTALL_DMA = 96;
2949  VMSTAT_ALLOCSTALL_MOVABLE = 97;
2950  VMSTAT_ALLOCSTALL_NORMAL = 98;
2951  VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99;
2952  VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100;
2953  VMSTAT_NR_FASTRPC = 101;
2954  VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102;
2955  VMSTAT_NR_ION_HEAP_POOL = 103;
2956  VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104;
2957  VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105;
2958  VMSTAT_NR_SHMEM_HUGEPAGES = 106;
2959  VMSTAT_NR_SHMEM_PMDMAPPED = 107;
2960  VMSTAT_NR_UNRECLAIMABLE_PAGES = 108;
2961  VMSTAT_NR_ZONE_ACTIVE_ANON = 109;
2962  VMSTAT_NR_ZONE_ACTIVE_FILE = 110;
2963  VMSTAT_NR_ZONE_INACTIVE_ANON = 111;
2964  VMSTAT_NR_ZONE_INACTIVE_FILE = 112;
2965  VMSTAT_NR_ZONE_UNEVICTABLE = 113;
2966  VMSTAT_NR_ZONE_WRITE_PENDING = 114;
2967  VMSTAT_OOM_KILL = 115;
2968  VMSTAT_PGLAZYFREE = 116;
2969  VMSTAT_PGLAZYFREED = 117;
2970  VMSTAT_PGREFILL = 118;
2971  VMSTAT_PGSCAN_DIRECT = 119;
2972  VMSTAT_PGSCAN_KSWAPD = 120;
2973  VMSTAT_PGSKIP_DMA = 121;
2974  VMSTAT_PGSKIP_MOVABLE = 122;
2975  VMSTAT_PGSKIP_NORMAL = 123;
2976  VMSTAT_PGSTEAL_DIRECT = 124;
2977  VMSTAT_PGSTEAL_KSWAPD = 125;
2978  VMSTAT_SWAP_RA = 126;
2979  VMSTAT_SWAP_RA_HIT = 127;
2980  VMSTAT_WORKINGSET_RESTORE = 128;
2981  VMSTAT_ALLOCSTALL_DEVICE = 129;
2982  VMSTAT_ALLOCSTALL_DMA32 = 130;
2983  VMSTAT_BALLOON_DEFLATE = 131;
2984  VMSTAT_BALLOON_INFLATE = 132;
2985  VMSTAT_BALLOON_MIGRATE = 133;
2986  VMSTAT_CMA_ALLOC_FAIL = 134;
2987  VMSTAT_CMA_ALLOC_SUCCESS = 135;
2988  VMSTAT_NR_FILE_HUGEPAGES = 136;
2989  VMSTAT_NR_FILE_PMDMAPPED = 137;
2990  VMSTAT_NR_FOLL_PIN_ACQUIRED = 138;
2991  VMSTAT_NR_FOLL_PIN_RELEASED = 139;
2992  VMSTAT_NR_SEC_PAGE_TABLE_PAGES = 140;
2993  VMSTAT_NR_SHADOW_CALL_STACK = 141;
2994  VMSTAT_NR_SWAPCACHED = 142;
2995  VMSTAT_NR_THROTTLED_WRITTEN = 143;
2996  VMSTAT_PGALLOC_DEVICE = 144;
2997  VMSTAT_PGALLOC_DMA32 = 145;
2998  VMSTAT_PGDEMOTE_DIRECT = 146;
2999  VMSTAT_PGDEMOTE_KSWAPD = 147;
3000  VMSTAT_PGREUSE = 148;
3001  VMSTAT_PGSCAN_ANON = 149;
3002  VMSTAT_PGSCAN_FILE = 150;
3003  VMSTAT_PGSKIP_DEVICE = 151;
3004  VMSTAT_PGSKIP_DMA32 = 152;
3005  VMSTAT_PGSTEAL_ANON = 153;
3006  VMSTAT_PGSTEAL_FILE = 154;
3007  VMSTAT_THP_COLLAPSE_ALLOC = 155;
3008  VMSTAT_THP_COLLAPSE_ALLOC_FAILED = 156;
3009  VMSTAT_THP_DEFERRED_SPLIT_PAGE = 157;
3010  VMSTAT_THP_FAULT_ALLOC = 158;
3011  VMSTAT_THP_FAULT_FALLBACK = 159;
3012  VMSTAT_THP_FAULT_FALLBACK_CHARGE = 160;
3013  VMSTAT_THP_FILE_ALLOC = 161;
3014  VMSTAT_THP_FILE_FALLBACK = 162;
3015  VMSTAT_THP_FILE_FALLBACK_CHARGE = 163;
3016  VMSTAT_THP_FILE_MAPPED = 164;
3017  VMSTAT_THP_MIGRATION_FAIL = 165;
3018  VMSTAT_THP_MIGRATION_SPLIT = 166;
3019  VMSTAT_THP_MIGRATION_SUCCESS = 167;
3020  VMSTAT_THP_SCAN_EXCEED_NONE_PTE = 168;
3021  VMSTAT_THP_SCAN_EXCEED_SHARE_PTE = 169;
3022  VMSTAT_THP_SCAN_EXCEED_SWAP_PTE = 170;
3023  VMSTAT_THP_SPLIT_PAGE = 171;
3024  VMSTAT_THP_SPLIT_PAGE_FAILED = 172;
3025  VMSTAT_THP_SPLIT_PMD = 173;
3026  VMSTAT_THP_SWPOUT = 174;
3027  VMSTAT_THP_SWPOUT_FALLBACK = 175;
3028  VMSTAT_THP_ZERO_PAGE_ALLOC = 176;
3029  VMSTAT_THP_ZERO_PAGE_ALLOC_FAILED = 177;
3030  VMSTAT_VMA_LOCK_ABORT = 178;
3031  VMSTAT_VMA_LOCK_MISS = 179;
3032  VMSTAT_VMA_LOCK_RETRY = 180;
3033  VMSTAT_VMA_LOCK_SUCCESS = 181;
3034  VMSTAT_WORKINGSET_ACTIVATE_ANON = 182;
3035  VMSTAT_WORKINGSET_ACTIVATE_FILE = 183;
3036  VMSTAT_WORKINGSET_NODES = 184;
3037  VMSTAT_WORKINGSET_REFAULT_ANON = 185;
3038  VMSTAT_WORKINGSET_REFAULT_FILE = 186;
3039  VMSTAT_WORKINGSET_RESTORE_ANON = 187;
3040  VMSTAT_WORKINGSET_RESTORE_FILE = 188;
3041}
3042
3043// End of protos/perfetto/common/sys_stats_counters.proto
3044
3045// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto
3046
3047// This file defines the configuration for the Linux /proc poller data source,
3048// which injects counters in the trace.
3049// Counters that are needed in the trace must be explicitly listed in the
3050// *_counters fields. This is to avoid spamming the trace with all counters
3051// at all times.
3052// The sampling rate is configurable. All polling rates (*_period_ms) need
3053// to be integer multiples of each other.
3054// OK:     [10ms, 10ms, 10ms],  [10ms, 20ms, 10ms],  [10ms, 20ms, 60ms]
3055// Not OK: [10ms, 10ms, 11ms],  [10ms, 15ms, 20ms]
3056message SysStatsConfig {
3057  // Polls /proc/meminfo every X ms, if non-zero.
3058  // This is required to be > 10ms to avoid excessive CPU usage.
3059  // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
3060  optional uint32 meminfo_period_ms = 1;
3061
3062  // If empty all known counters are reported. Otherwise, only the counters
3063  // specified below are reported.
3064  repeated MeminfoCounters meminfo_counters = 2;
3065
3066  // Polls /proc/vmstat every X ms, if non-zero.
3067  // This is required to be > 10ms to avoid excessive CPU usage.
3068  // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
3069  optional uint32 vmstat_period_ms = 3;
3070  repeated VmstatCounters vmstat_counters = 4;
3071
3072  // Pols /proc/stat every X ms, if non-zero.
3073  // This is required to be > 10ms to avoid excessive CPU usage.
3074  // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
3075  optional uint32 stat_period_ms = 5;
3076  enum StatCounters {
3077    STAT_UNSPECIFIED = 0;
3078    STAT_CPU_TIMES = 1;
3079    STAT_IRQ_COUNTS = 2;
3080    STAT_SOFTIRQ_COUNTS = 3;
3081    STAT_FORK_COUNT = 4;
3082  }
3083  repeated StatCounters stat_counters = 6;
3084
3085  // Polls /sys/devfreq/*/curfreq every X ms, if non-zero.
3086  // This is required to be > 10ms to avoid excessive CPU usage.
3087  // This option can be used to record unchanging values.
3088  // Updates from frequency changes can come from ftrace/set_clock_rate.
3089  optional uint32 devfreq_period_ms = 7;
3090
3091  // Polls /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq every X ms.
3092  // This is required to be > 10ms to avoid excessive CPU usage.
3093  optional uint32 cpufreq_period_ms = 8;
3094
3095  // Polls /proc/buddyinfo every X ms, if non-zero.
3096  // This is required to be > 10ms to avoid excessive CPU usage.
3097  optional uint32 buddyinfo_period_ms = 9;
3098
3099  // Polls /proc/diskstats every X ms, if non-zero.
3100  // This is required to be > 10ms to avoid excessive CPU usage.
3101  optional uint32 diskstat_period_ms = 10;
3102
3103  // Polls /proc/pressure/* every X ms, if non-zero.
3104  // This is required to be > 10ms to avoid excessive CPU usage.
3105  optional uint32 psi_period_ms = 11;
3106}
3107
3108// End of protos/perfetto/config/sys_stats/sys_stats_config.proto
3109
3110// Begin of protos/perfetto/config/system_info/system_info.proto
3111
3112// This data-source does a one-off recording of system information when
3113// the trace starts.
3114// Currently this includes:
3115// - Values of
3116// /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies This
3117// datasource has no configuration options at present.
3118message SystemInfoConfig {}
3119
3120// End of protos/perfetto/config/system_info/system_info.proto
3121
3122// Begin of protos/perfetto/config/test_config.proto
3123
3124// The configuration for a fake producer used in tests.
3125message TestConfig {
3126  message DummyFields {
3127    optional uint32 field_uint32 = 1;
3128    optional int32 field_int32 = 2;
3129    optional uint64 field_uint64 = 3;
3130    optional int64 field_int64 = 4;
3131    optional fixed64 field_fixed64 = 5;
3132    optional sfixed64 field_sfixed64 = 6;
3133    optional fixed32 field_fixed32 = 7;
3134    optional sfixed32 field_sfixed32 = 8;
3135    optional double field_double = 9;
3136    optional float field_float = 10;
3137    optional sint64 field_sint64 = 11;
3138    optional sint32 field_sint32 = 12;
3139    optional string field_string = 13;
3140    optional bytes field_bytes = 14;
3141  }
3142
3143  // The number of messages the fake producer should send.
3144  optional uint32 message_count = 1;
3145
3146  // The maximum number of messages which should be sent each second.
3147  // The actual obserced speed may be lower if the producer is unable to
3148  // work fast enough.
3149  // If this is zero or unset, the producer will send as fast as possible.
3150  optional uint32 max_messages_per_second = 2;
3151
3152  // The seed value for a simple multiplicative congruential pseudo-random
3153  // number sequence.
3154  optional uint32 seed = 3;
3155
3156  // The size of each message in bytes. Should be greater than or equal 5 to
3157  // account for the number of bytes needed to encode the random number and a
3158  // null byte for the string.
3159  optional uint32 message_size = 4;
3160
3161  // Whether the producer should send a event batch when the data source is
3162  // is initially registered.
3163  optional bool send_batch_on_register = 5;
3164
3165  optional DummyFields dummy_fields = 6;
3166}
3167
3168// End of protos/perfetto/config/test_config.proto
3169
3170// Begin of protos/perfetto/config/track_event/track_event_config.proto
3171
3172message TrackEventConfig {
3173  // The following fields define the set of enabled trace categories. Each list
3174  // item is a glob.
3175  //
3176  // To determine if category is enabled, it is checked against the filters in
3177  // the following order:
3178  //
3179  //   1. Exact matches in enabled categories.
3180  //   2. Exact matches in enabled tags.
3181  //   3. Exact matches in disabled categories.
3182  //   4. Exact matches in disabled tags.
3183  //   5. Pattern matches in enabled categories.
3184  //   6. Pattern matches in enabled tags.
3185  //   7. Pattern matches in disabled categories.
3186  //   8. Pattern matches in disabled tags.
3187  //
3188  // If none of the steps produced a match:
3189  //  - In the C++ SDK (`perfetto::Category`), categories are enabled by
3190  //  default.
3191  //  - In the C SDK (`PerfettoTeCategory`), categories are disabled by default.
3192  //
3193  // Examples:
3194  //
3195  //  - To enable all non-slow/debug categories:
3196  //
3197  //       enabled_categories: "*"
3198  //
3199  //  - To enable specific categories:
3200  //
3201  //       disabled_categories: "*"
3202  //       enabled_categories: "my_category"
3203  //       enabled_categories: "my_category2"
3204  //
3205  //  - To enable only categories with a specific tag:
3206  //
3207  //       disabled_tags: "*"
3208  //       enabled_tags: "my_tag"
3209  //
3210
3211  // Default: []
3212  repeated string disabled_categories = 1;
3213
3214  // Default: []
3215  repeated string enabled_categories = 2;
3216
3217  // Default: ["slow", "debug"]
3218  repeated string disabled_tags = 3;
3219
3220  // Default: []
3221  repeated string enabled_tags = 4;
3222
3223  // Default: false (i.e. enabled by default)
3224  optional bool disable_incremental_timestamps = 5;
3225
3226  // Allows to specify a custom unit different than the default (ns).
3227  // Also affects thread timestamps if enable_thread_time_sampling = true.
3228  // A multiplier of 1000 means that a timestamp = 3 should be interpreted as
3229  // 3000 ns = 3 us.
3230  // Default: 1 (if unset, it should be read as 1).
3231  optional uint64 timestamp_unit_multiplier = 6;
3232
3233  // Default: false (i.e. debug_annotations is NOT filtered out by default)
3234  // When true, any debug annotations provided as arguments to the
3235  // TRACE_EVENT macros are not written into the trace. Typed arguments will
3236  // still be emitted even if set to true.
3237  optional bool filter_debug_annotations = 7;
3238
3239  // Default : false (i.e. disabled)
3240  // When true, the SDK samples and emits the current thread time counter value
3241  // for each event on the current thread's track. This value represents the
3242  // total CPU time consumed by that thread since its creation. Note that if a
3243  // thread is not scheduled by OS for some duration, that time won't be
3244  // included in thread_time.
3245  // Learn more : "CLOCK_THREAD_CPUTIME_ID" flag at
3246  // https://linux.die.net/man/3/clock_gettime
3247  optional bool enable_thread_time_sampling = 8;
3248
3249  // Default: false (i.e. dynamic event names are NOT filtered out by default)
3250  // When true, event_names wrapped in perfetto::DynamicString will be filtered
3251  // out.
3252  optional bool filter_dynamic_event_names = 9;
3253}
3254
3255// End of protos/perfetto/config/track_event/track_event_config.proto
3256
3257// Begin of protos/perfetto/config/data_source_config.proto
3258
3259// The configuration that is passed to each data source when starting tracing.
3260// Next id: 130
3261message DataSourceConfig {
3262  enum SessionInitiator {
3263    SESSION_INITIATOR_UNSPECIFIED = 0;
3264    // This trace was initiated from a trusted system app has DUMP and
3265    // USAGE_STATS permission. This system app is expected to not expose the
3266    // trace to the user of the device.
3267    // This is determined by checking the UID initiating the trace.
3268    SESSION_INITIATOR_TRUSTED_SYSTEM = 1;
3269  };
3270  // Data source unique name, e.g., "linux.ftrace". This must match
3271  // the name passed by the data source when it registers (see
3272  // RegisterDataSource()).
3273  optional string name = 1;
3274
3275  // The index of the logging buffer where TracePacket(s) will be stored.
3276  // This field doesn't make a major difference for the Producer(s). The final
3277  // logging buffers, in fact, are completely owned by the Service. We just ask
3278  // the Producer to copy this number into the chunk headers it emits, so that
3279  // the Service can quickly identify the buffer where to move the chunks into
3280  // without expensive lookups on its fastpath.
3281  optional uint32 target_buffer = 2;
3282
3283  // Set by the service to indicate the duration of the trace.
3284  // DO NOT SET in consumer as this will be overridden by the service.
3285  optional uint32 trace_duration_ms = 3;
3286
3287  // If true, |trace_duration_ms| should count also time in suspend. This
3288  // is propagated from TraceConfig.prefer_suspend_clock_for_duration.
3289  optional bool prefer_suspend_clock_for_duration = 122;
3290
3291  // Set by the service to indicate how long it waits after StopDataSource.
3292  // DO NOT SET in consumer as this will be overridden by the service.
3293  optional uint32 stop_timeout_ms = 7;
3294
3295  // Set by the service to indicate whether this tracing session has extra
3296  // guardrails.
3297  // DO NOT SET in consumer as this will be overridden by the service.
3298  optional bool enable_extra_guardrails = 6;
3299
3300  // Set by the service to indicate which user initiated this trace.
3301  // DO NOT SET in consumer as this will be overridden by the service.
3302  optional SessionInitiator session_initiator = 8;
3303
3304  // Set by the service to indicate which tracing session the data source
3305  // belongs to. The intended use case for this is checking if two data sources,
3306  // one of which produces metadata for the other one, belong to the same trace
3307  // session and hence should be linked together.
3308  // This field was introduced in Aug 2018 after Android P.
3309  // DO NOT SET in consumer as this will be overridden by the service.
3310  optional uint64 tracing_session_id = 4;
3311
3312  // Keeep the lower IDs (up to 99) for fields that are *not* specific to
3313  // data-sources and needs to be processed by the traced daemon.
3314
3315  // All data source config fields must be marked as [lazy=true]. This prevents
3316  // the proto-to-cpp generator from recursing into those when generating the
3317  // cpp classes and polluting tracing/core with data-source-specific classes.
3318  // Instead they are treated as opaque strings containing raw proto bytes.
3319
3320  // Data source name: linux.ftrace
3321  optional FtraceConfig ftrace_config = 100 [lazy = true];
3322  // Data source name: linux.inode_file_map
3323  optional InodeFileConfig inode_file_config = 102 [lazy = true];
3324  // Data source name: linux.process_stats
3325  optional ProcessStatsConfig process_stats_config = 103 [lazy = true];
3326  // Data source name: linux.sys_stats
3327  optional SysStatsConfig sys_stats_config = 104 [lazy = true];
3328  // Data source name: android.heapprofd
3329  // Introduced in Android 10.
3330  optional HeapprofdConfig heapprofd_config = 105 [lazy = true];
3331  // Data source name: android.java_hprof
3332  // Introduced in Android 11.
3333  optional JavaHprofConfig java_hprof_config = 110 [lazy = true];
3334  // Data source name: android.power
3335  optional AndroidPowerConfig android_power_config = 106 [lazy = true];
3336  // Data source name: android.log
3337  optional AndroidLogConfig android_log_config = 107 [lazy = true];
3338  // TODO(fmayer): Add data source name for this.
3339  optional GpuCounterConfig gpu_counter_config = 108 [lazy = true];
3340  // Data source name: android.game_interventions
3341  optional AndroidGameInterventionListConfig
3342      android_game_intervention_list_config = 116 [lazy = true];
3343  // Data source name: android.packages_list
3344  optional PackagesListConfig packages_list_config = 109 [lazy = true];
3345  // Data source name: linux.perf
3346  optional PerfEventConfig perf_event_config = 111 [lazy = true];
3347  // Data source name: vulkan.memory_tracker
3348  optional VulkanMemoryConfig vulkan_memory_config = 112 [lazy = true];
3349  // Data source name: track_event
3350  optional TrackEventConfig track_event_config = 113 [lazy = true];
3351  // Data source name: android.polled_state
3352  optional AndroidPolledStateConfig android_polled_state_config = 114
3353      [lazy = true];
3354  // Data source name: android.system_property
3355  optional AndroidSystemPropertyConfig android_system_property_config = 118
3356      [lazy = true];
3357  // Data source name: android.statsd
3358  optional StatsdTracingConfig statsd_tracing_config = 117 [lazy = true];
3359  // Data source name: linux.system_info
3360  optional SystemInfoConfig system_info_config = 119;
3361
3362  // Chrome is special as it doesn't use the perfetto IPC layer. We want to
3363  // avoid proto serialization and de-serialization there because that would
3364  // just add extra hops on top of the Mojo ser/des. Instead we auto-generate a
3365  // C++ class for it so it can pass around plain C++ objets.
3366  optional ChromeConfig chrome_config = 101;
3367
3368  // Data source name: code.v8.dev
3369  optional V8Config v8_config = 127 [lazy = true];
3370
3371  // If an interceptor is specified here, packets for this data source will be
3372  // rerouted to the interceptor instead of the main trace buffer. This can be
3373  // used, for example, to write trace data into ETW or for logging trace points
3374  // to the console.
3375  //
3376  // Note that interceptors are only supported by data sources registered
3377  // through the Perfetto SDK API. Data sources that don't use that API (e.g.,
3378  // traced_probes) may not support interception.
3379  optional InterceptorConfig interceptor_config = 115;
3380
3381  // Data source name: android.network_packets.
3382  // Introduced in Android 14 (U).
3383  optional NetworkPacketTraceConfig network_packet_trace_config = 120
3384      [lazy = true];
3385
3386  // Data source name: android.surfaceflinger.layers
3387  optional SurfaceFlingerLayersConfig surfaceflinger_layers_config = 121
3388      [lazy = true];
3389
3390  // Data source name: android.surfaceflinger.transactions
3391  optional SurfaceFlingerTransactionsConfig surfaceflinger_transactions_config =
3392      123 [lazy = true];
3393
3394  // Data source name: android.sdk_sysprop_guard
3395  // Introduced in Android 14 (U) QPR1.
3396  optional AndroidSdkSyspropGuardConfig android_sdk_sysprop_guard_config = 124
3397      [lazy = true];
3398
3399  // Data source name: windows.etw
3400  optional EtwConfig etw_config = 125 [lazy = true];
3401
3402  // Data source name: android.protolog
3403  optional ProtoLogConfig protolog_config = 126 [lazy = true];
3404
3405  // Data source name: android.input.inputevent
3406  optional AndroidInputEventConfig android_input_event_config = 128 [lazy = true];
3407
3408  // Data source name: android.pixel.modem
3409  optional PixelModemConfig pixel_modem_config = 129 [lazy = true];
3410
3411  // This is a fallback mechanism to send a free-form text config to the
3412  // producer. In theory this should never be needed. All the code that
3413  // is part of the platform (i.e. traced service) is supposed to *not* truncate
3414  // the trace config proto and propagate unknown fields. However, if anything
3415  // in the pipeline (client or backend) ends up breaking this forward compat
3416  // plan, this field will become the escape hatch to allow future data sources
3417  // to get some meaningful configuration.
3418  optional string legacy_config = 1000;
3419
3420  // This field is only used for testing.
3421  optional TestConfig for_testing = 1001;
3422
3423  // Was |for_testing|. Caused more problems then found.
3424  reserved 268435455;
3425}
3426
3427// End of protos/perfetto/config/data_source_config.proto
3428
3429// Begin of protos/perfetto/config/trace_config.proto
3430
3431// The overall config that is used when starting a new tracing session through
3432// ProducerPort::StartTracing().
3433// It contains the general config for the logging buffer(s) and the configs for
3434// all the data source being enabled.
3435//
3436// Next id: 39.
3437message TraceConfig {
3438  message BufferConfig {
3439    optional uint32 size_kb = 1;
3440
3441    // |page_size|, now deprecated.
3442    reserved 2;
3443
3444    // |optimize_for|, now deprecated.
3445    reserved 3;
3446
3447    enum FillPolicy {
3448      UNSPECIFIED = 0;
3449
3450      // Default behavior. The buffer operates as a conventional ring buffer.
3451      // If the writer is faster than the reader (or if the reader reads only
3452      // after tracing is stopped) newly written packets will overwrite old
3453      // packets.
3454      RING_BUFFER = 1;
3455
3456      // Behaves like RING_BUFFER as long as there is space in the buffer or
3457      // the reader catches up with the writer. As soon as the writer hits
3458      // an unread chunk, it stops accepting new data in the buffer.
3459      DISCARD = 2;
3460    }
3461    optional FillPolicy fill_policy = 4;
3462
3463    // When true the buffer is moved (rather than copied) onto the cloned
3464    // session, and an empty buffer of the same size is allocated in the source
3465    // tracing session. This feature will likely get deprecated in the future.
3466    // It been introduced mainly to support the surfaceflinger snapshot dump
3467    // for bugreports, where SF can dumps O(400MB) into the bugreport trace. In
3468    // that case we don't want to retain another in-memory copy of the buffer.
3469    optional bool transfer_on_clone = 5;
3470
3471    // Used in conjuction with transfer_on_clone. When true the buffer is
3472    // cleared before issuing the Flush(reason=kTraceClone). This is to ensure
3473    // that if the data source took too long to write the data in a previous
3474    // clone-related flush, we don't end up with a mixture of leftovers from
3475    // the previous write and new data.
3476    optional bool clear_before_clone = 6;
3477  }
3478  repeated BufferConfig buffers = 1;
3479
3480  message DataSource {
3481    // Filters and data-source specific config. It contains also the unique name
3482    // of the data source, the one passed in the  DataSourceDescriptor when they
3483    // register on the service.
3484    optional protos.DataSourceConfig config = 1;
3485
3486    // Optional. If multiple producers (~processes) expose the same data source
3487    // and either |producer_name_filter| or |producer_name_regex_filter| is set,
3488    // the data source is enabled only for producers whose names match any of
3489    // the filters.
3490    // |producer_name_filter| has to be an exact match, while
3491    // |producer_name_regex_filter| is a regular expression.
3492    // This allows to enable a data source only for specific processes.
3493    // The "repeated" fields have OR semantics: specifying a filter ["foo",
3494    // "bar"] will enable data sources on both "foo" and "bar" (if they exist).
3495    repeated string producer_name_filter = 2;
3496    repeated string producer_name_regex_filter = 3;
3497  }
3498  repeated DataSource data_sources = 2;
3499
3500  // Config for disabling builtin data sources in the tracing service.
3501  message BuiltinDataSource {
3502    // Disable emitting clock timestamps into the trace.
3503    optional bool disable_clock_snapshotting = 1;
3504
3505    // Disable echoing the original trace config in the trace.
3506    optional bool disable_trace_config = 2;
3507
3508    // Disable emitting system info (build fingerprint, cpuinfo, etc).
3509    optional bool disable_system_info = 3;
3510
3511    // Disable emitting events for data-source state changes (e.g. the marker
3512    // for all data sources having ACKed the start of the trace).
3513    optional bool disable_service_events = 4;
3514
3515    // The authoritative clock domain for the trace. Defaults to BOOTTIME. See
3516    // also ClockSnapshot's primary_trace_clock. The configured value is written
3517    // into the trace as part of the ClockSnapshots emitted by the service.
3518    // Trace processor will attempt to translate packet/event timestamps from
3519    // various data sources (and their chosen clock domains) to this domain
3520    // during import. Added in Android R.
3521    optional BuiltinClock primary_trace_clock = 5;
3522
3523    // Time interval in between snapshotting of sync markers, clock snapshots,
3524    // stats, and other periodic service-emitted events. Note that the service
3525    // only keeps track of the first and the most recent snapshot until
3526    // ReadBuffers() is called.
3527    optional uint32 snapshot_interval_ms = 6;
3528
3529    // Hints to the service that a suspend-aware (i.e. counting time in suspend)
3530    // clock should be used for periodic snapshots of service-emitted events.
3531    // This means, if a snapshot *should* have happened during suspend, it will
3532    // happen immediately after the device resumes.
3533    //
3534    // Choosing a clock like this is done on best-effort basis; not all
3535    // platforms (e.g. Windows) expose a clock which can be used for periodic
3536    // tasks counting suspend. If such a clock is not available, the service
3537    // falls back to the best-available alternative.
3538    //
3539    // Introduced in Android S.
3540    // TODO(lalitm): deprecate this in T and make this the default if nothing
3541    // crashes in S.
3542    optional bool prefer_suspend_clock_for_snapshot = 7;
3543
3544    // Disables the reporting of per-trace-writer histograms in TraceStats.
3545    optional bool disable_chunk_usage_histograms = 8;
3546  }
3547  optional BuiltinDataSource builtin_data_sources = 20;
3548
3549  // If specified, the trace will be stopped |duration_ms| after starting.
3550  // This does *not* count the time the system is suspended, so we will run
3551  // for duration_ms of system activity, not wall time.
3552  //
3553  // However in case of traces with triggers, see
3554  // TriggerConfig.trigger_timeout_ms instead.
3555  optional uint32 duration_ms = 3;
3556
3557  // If true, tries to use CLOCK_BOOTTIME for duration_ms rather than
3558  // CLOCK_MONOTONIC (which doesn't count time in suspend). Supported only on
3559  // Linux/Android, no-op on other platforms. This is used when dealing with
3560  // long (e.g. 24h) traces, where suspend can inflate them to weeks of
3561  // wall-time, making them more likely to hit device reboots (and hence loss).
3562  // This option also changes consistently the semantic of
3563  // TriggerConfig.stop_delay_ms.
3564  optional bool prefer_suspend_clock_for_duration = 36;
3565
3566  // This is set when --dropbox is passed to the Perfetto command line client
3567  // and enables guardrails that limit resource usage for traces requested
3568  // by statsd.
3569  optional bool enable_extra_guardrails = 4;
3570
3571  enum LockdownModeOperation {
3572    LOCKDOWN_UNCHANGED = 0;
3573    LOCKDOWN_CLEAR = 1;
3574    LOCKDOWN_SET = 2;
3575  }
3576  // Reject producers that are not running under the same UID as the tracing
3577  // service.
3578  optional LockdownModeOperation lockdown_mode = 5;
3579
3580  message ProducerConfig {
3581    // Identifies the producer for which this config is for.
3582    optional string producer_name = 1;
3583
3584    // Specifies the preferred size of the shared memory buffer. If the size is
3585    // larger than the max size, the max will be used. If it is smaller than
3586    // the page size or doesn't fit pages evenly into it, it will fall back to
3587    // the size specified by the producer or finally the default shared memory
3588    // size.
3589    optional uint32 shm_size_kb = 2;
3590
3591    // Specifies the preferred size of each page in the shared memory buffer.
3592    // Must be an integer multiple of 4K.
3593    optional uint32 page_size_kb = 3;
3594  }
3595
3596  repeated ProducerConfig producers = 6;
3597
3598  // Contains statsd-specific metadata about an alert associated with the trace.
3599  message StatsdMetadata {
3600    // The identifier of the alert which triggered this trace.
3601    optional int64 triggering_alert_id = 1;
3602    // The uid which registered the triggering configuration with statsd.
3603    optional int32 triggering_config_uid = 2;
3604    // The identifier of the config which triggered the alert.
3605    optional int64 triggering_config_id = 3;
3606    // The identifier of the subscription which triggered this trace.
3607    optional int64 triggering_subscription_id = 4;
3608  }
3609
3610  // Statsd-specific metadata.
3611  optional StatsdMetadata statsd_metadata = 7;
3612
3613  // When true && |output_path| is empty, the EnableTracing() request must
3614  // provide a file descriptor. The service will then periodically read packets
3615  // out of the trace buffer and store it into the passed file.
3616  // If |output_path| is not empty no fd should be passed, the service
3617  // will create a new file and write into that (see comment below).
3618  optional bool write_into_file = 8;
3619
3620  // This must point to a non-existing file. If the file exists the service
3621  // will NOT overwrite and will fail instead as a security precaution.
3622  // On Android, when this is used with the system traced, the path must be
3623  // within /data/misc/perfetto-traces/ or the trace will fail.
3624  // This option has been introduced in Android R. Before R write_into_file
3625  // can be used only with the "pass a file descriptor over IPC" mode.
3626  optional string output_path = 29;
3627
3628  // Optional. If non-zero tunes the write period. A min value of 100ms is
3629  // enforced (i.e. smaller values are ignored).
3630  optional uint32 file_write_period_ms = 9;
3631
3632  // Optional. When non zero the periodic write stops once at most X bytes
3633  // have been written into the file. Tracing is disabled when this limit is
3634  // reached, even if |duration_ms| has not been reached yet.
3635  optional uint64 max_file_size_bytes = 10;
3636
3637  // Contains flags which override the default values of the guardrails inside
3638  // Perfetto.
3639  message GuardrailOverrides {
3640    // Override the default limit (in bytes) for uploading data to server within
3641    // a 24 hour period.
3642    // On R-, this override only affected userdebug builds. Since S, it also
3643    // affects user builds.
3644    // In 24Q3+ (V+), this override is a noop because upload guardrail logic
3645    // was removed from Perfetto.
3646    optional uint64 max_upload_per_day_bytes = 1 [deprecated = true];
3647
3648    // Overrides the guardrail for maximum trace buffer size.
3649    // Available on U+
3650    optional uint32 max_tracing_buffer_size_kb = 2;
3651  }
3652  optional GuardrailOverrides guardrail_overrides = 11;
3653
3654  // When true, data sources are not started until an explicit call to
3655  // StartTracing() on the consumer port. This is to support early
3656  // initialization and fast trace triggering. This can be used only when the
3657  // Consumer explicitly triggers the StartTracing() method.
3658  // This should not be used in a remote trace config via statsd, doing so will
3659  // result in a hung trace session.
3660  optional bool deferred_start = 12;
3661
3662  // When set, it periodically issues a Flush() to all data source, forcing them
3663  // to commit their data into the tracing service. This can be used for
3664  // quasi-real-time streaming mode and to guarantee some partial ordering of
3665  // events in the trace in windows of X ms.
3666  optional uint32 flush_period_ms = 13;
3667
3668  // Wait for this long for producers to acknowledge flush requests.
3669  // Default 5s.
3670  optional uint32 flush_timeout_ms = 14;
3671
3672  // Wait for this long for producers to acknowledge stop requests.
3673  // Default 5s.
3674  optional uint32 data_source_stop_timeout_ms = 23;
3675
3676  // |disable_clock_snapshotting| moved.
3677  reserved 15;
3678
3679  // Android-only. If set, sends an intent to the Traceur system app when the
3680  // trace ends to notify it about the trace readiness.
3681  optional bool notify_traceur = 16;
3682
3683  // This field was introduced in Android S.
3684  // Android-only. If set to a value > 0, marks the trace session as a candidate
3685  // for being attached to a bugreport. This field effectively acts as a z-index
3686  // for bugreports. When Android's dumpstate runs perfetto
3687  // --save-for-bugreport, traced will pick the tracing session with the highest
3688  // score (score <= 0 is ignored) and:
3689  // On Android S, T:  will steal its contents, save the trace into
3690  //     a known path and stop prematurely.
3691  // On Android U+: will create a read-only snapshot and save that into a known
3692  //     path, without stoppin the original tracing session.
3693  // When this field is set the tracing session becomes eligible to be cloned
3694  // by other UIDs.
3695  optional int32 bugreport_score = 30;
3696
3697  // When set, defines name of the file that will be saved under
3698  // /data/misc/perfetto-traces/bugreport/ when using --save-all-for-bugreport.
3699  // If omitted, traces will be named systrace.pftrace, systrace_1.pftrace, etc,
3700  // starting from the highest `bugreport_score`.
3701  // Introduced in v42 / Android V.
3702  optional string bugreport_filename = 38;
3703
3704  // Triggers allow producers to start or stop the tracing session when an event
3705  // occurs.
3706  //
3707  // For example if we are tracing probabilistically, most traces will be
3708  // uninteresting. Triggers allow us to keep only the interesting ones such as
3709  // those traces during which the device temperature reached a certain
3710  // threshold. In this case the producer can activate a trigger to keep
3711  // (STOP_TRACING) the trace, otherwise it can also begin a trace
3712  // (START_TRACING) because it knows something is about to happen.
3713  message TriggerConfig {
3714    enum TriggerMode {
3715      UNSPECIFIED = 0;
3716
3717      // When this mode is chosen, data sources are not started until one of the
3718      // |triggers| are received. This supports early initialization and fast
3719      // starting of the tracing system. On triggering, the session will then
3720      // record for |stop_delay_ms|. However if no trigger is seen
3721      // after |trigger_timeout_ms| the session will be stopped and no data will
3722      // be returned.
3723      START_TRACING = 1;
3724
3725      // When this mode is chosen, the session will be started via the normal
3726      // EnableTracing() & StartTracing(). If no trigger is ever seen
3727      // the session will be stopped after |trigger_timeout_ms| and no data will
3728      // be returned. However if triggered the trace will stop after
3729      // |stop_delay_ms| and any data in the buffer will be returned to the
3730      // consumer.
3731      STOP_TRACING = 2;
3732
3733      // 3 was taken by CLONE_SNAPSHOT but that has been moved to 4.
3734      // The early implementation of CLONE_SNAPSHOT had various bugs
3735      // (b/290798988, b/290799105) and made it into Android U. The number
3736      // change is to make sure nobody rolls out a config that hits the broken
3737      // behaviour.
3738      reserved 3;
3739
3740      // When this mode is chosen, this causes a snapshot of the current tracing
3741      // session to be created after |stop_delay_ms| while the current tracing
3742      // session continues undisturbed (% an extra flush). This mode can be
3743      // used only when the tracing session is handled by the "perfetto" cmdline
3744      // client (which is true in 90% of cases). Part of the business logic
3745      // necessary for this behavior, and ensuing file handling, lives in
3746      // perfetto_cmd.cc . On other consumers, this causes only a notification
3747      // of the trigger through a CloneTriggerHit ObservableEvent. The custom
3748      // consumer is supposed to call CloneSession() itself after the event.
3749      // Use use_clone_snapshot_if_available=true when targeting older versions
3750      // of perfetto.
3751      CLONE_SNAPSHOT = 4;
3752
3753      // NOTE: CLONE_SNAPSHOT should be used only when we targeting Android V+
3754      // (15+) / Perfetto v38+. A bug in older versions of the tracing service
3755      // might cause indefinitely long tracing sessions (see b/274931668).
3756    }
3757    optional TriggerMode trigger_mode = 1;
3758
3759    // This flag is really a workaround for b/274931668. This is needed only
3760    // when deploying configs to different versions of the tracing service.
3761    // When this is set to true this has the same effect of setting trigger_mode
3762    // to CLONE_SNAPSHOT on newer versions of the service. This boolean has been
3763    // introduced to allow to have configs that use CLONE_SNAPSHOT on newer
3764    // versions of Android and fall back to STOP_TRACING on older versions where
3765    // CLONE_SNAPSHOT did not exist.
3766    // When using this flag, trigger_mode must be set to STOP_TRACING.
3767    optional bool use_clone_snapshot_if_available = 5;
3768
3769    // DEPRECATED, was use_clone_snapshot_if_available in U. See the comment
3770    // around CLONE_SNAPSHOT.
3771    reserved 4;
3772
3773    message Trigger {
3774      // The producer must specify this name to activate the trigger.
3775      optional string name = 1;
3776
3777      // An std::regex that will match the producer that can activate this
3778      // trigger. This is optional. If unset any producers can activate this
3779      // trigger.
3780      optional string producer_name_regex = 2;
3781
3782      // After a trigger is received either in START_TRACING or STOP_TRACING
3783      // mode then the trace will end |stop_delay_ms| after triggering.
3784      // In CLONE_SNAPSHOT mode, this is the delay between the trigger and the
3785      // snapshot.
3786      // If |prefer_suspend_clock_for_duration| is set, the duration will be
3787      // based on wall-clock, counting also time in suspend.
3788      optional uint32 stop_delay_ms = 3;
3789
3790      // Limits the number of traces this trigger can start/stop in a rolling
3791      // 24 hour window. If this field is unset or zero, no limit is applied and
3792      // activiation of this trigger *always* starts/stops the trace.
3793      optional uint32 max_per_24_h = 4;
3794
3795      // A value between 0 and 1 which encodes the probability of skipping a
3796      // trigger with this name. This is useful for reducing the probability
3797      // of high-frequency triggers from dominating trace finaization. If this
3798      // field is unset or zero, the trigger will *never* be skipped. If this
3799      // field is greater than or equal to 1, this trigger will *always* be
3800      // skipped i.e. it will be as if this trigger was never included in the
3801      // first place.
3802      // This probability check is applied *before* any other limits. For
3803      // example, if |max_per_24_h| is also set, first we will check if the
3804      // probability bar is met and only then will we check the |max_per_24_h|
3805      // limit.
3806      optional double skip_probability = 5;
3807    }
3808    // A list of triggers which are related to this configuration. If ANY
3809    // trigger is seen then an action will be performed based on |trigger_mode|.
3810    repeated Trigger triggers = 2;
3811
3812    // Required and must be positive if a TriggerConfig is specified. This is
3813    // how long this TraceConfig should wait for a trigger to arrive. After this
3814    // period of time if no trigger is seen the TracingSession will be cleaned
3815    // up.
3816    optional uint32 trigger_timeout_ms = 3;
3817  }
3818  optional TriggerConfig trigger_config = 17;
3819
3820  // When this is non-empty the perfetto command line tool will ignore the rest
3821  // of this TraceConfig and instead connect to the perfetto service as a
3822  // producer and send these triggers, potentially stopping or starting traces
3823  // that were previous configured to use a TriggerConfig.
3824  repeated string activate_triggers = 18;
3825
3826  // Configuration for trace contents that reference earlier trace data. For
3827  // example, a data source might intern strings, and emit packets containing
3828  // {interned id : string} pairs. Future packets from that data source can then
3829  // use the interned ids instead of duplicating the raw string contents. The
3830  // trace parser will then need to use that interning table to fully interpret
3831  // the rest of the trace.
3832  message IncrementalStateConfig {
3833    // If nonzero, notify eligible data sources to clear their incremental state
3834    // periodically, with the given period. The notification is sent only to
3835    // data sources that have |handles_incremental_state_clear| set in their
3836    // DataSourceDescriptor. The notification requests that the data source
3837    // stops referring to past trace contents. This is particularly useful when
3838    // tracing in ring buffer mode, where it is not exceptional to overwrite old
3839    // trace data.
3840    //
3841    // Warning: this time-based global clearing is likely to be removed in the
3842    // future, to be replaced with a smarter way of sending the notifications
3843    // only when necessary.
3844    optional uint32 clear_period_ms = 1;
3845  }
3846  optional IncrementalStateConfig incremental_state_config = 21;
3847
3848  // Additional guardrail used by the Perfetto command line client.
3849  // On user builds when --dropbox is set perfetto will refuse to trace unless
3850  // this is also set.
3851  // Added in Q.
3852  optional bool allow_user_build_tracing = 19;
3853
3854  // If set the tracing service will ensure there is at most one tracing session
3855  // with this key.
3856  optional string unique_session_name = 22;
3857
3858  // Compress trace with the given method. Best effort.
3859  enum CompressionType {
3860    COMPRESSION_TYPE_UNSPECIFIED = 0;
3861    COMPRESSION_TYPE_DEFLATE = 1;
3862  }
3863  optional CompressionType compression_type = 24;
3864
3865  // DEPRECATED, was compress_from_cli.
3866  reserved 37;
3867
3868  // Android-only. Not for general use. If set, saves the trace into an
3869  // incident. This field is read by perfetto_cmd, rather than the tracing
3870  // service. This field must be set when passing the --upload flag to
3871  // perfetto_cmd.
3872  message IncidentReportConfig {
3873    // In this message, either:
3874    //  * all of |destination_package|, |destination_class| and |privacy_level|
3875    //    must be set.
3876    //  * |skip_incidentd| must be explicitly set to true.
3877
3878    optional string destination_package = 1;
3879    optional string destination_class = 2;
3880    // Level of filtering in the requested incident. See |Destination| in
3881    // frameworks/base/core/proto/android/privacy.proto.
3882    optional int32 privacy_level = 3;
3883
3884    // If true, then skips saving the trace to incidentd.
3885    //
3886    // This flag is useful in testing (e.g. Perfetto-statsd integration tests)
3887    // or when we explicitly don't want traces to go to incidentd even when they
3888    // usually would (e.g. configs deployed using statsd but only used for
3889    // inclusion in bugreports using |bugreport_score|).
3890    //
3891    // The motivation for having this flag, instead of just not setting
3892    // |incident_report_config|, is prevent accidents where
3893    // |incident_report_config| is omitted by mistake.
3894    optional bool skip_incidentd = 5;
3895
3896    // If true, do not write the trace into dropbox (i.e. incident only).
3897    // Otherwise, write to both dropbox and incident.
3898    // TODO(lalitm): remove this field as we no longer use Dropbox.
3899    optional bool skip_dropbox = 4 [deprecated = true];
3900  }
3901  optional IncidentReportConfig incident_report_config = 25;
3902
3903  enum StatsdLogging {
3904    STATSD_LOGGING_UNSPECIFIED = 0;
3905    STATSD_LOGGING_ENABLED = 1;
3906    STATSD_LOGGING_DISABLED = 2;
3907  }
3908
3909  // Android-only. Not for general use. If specified, sets the logging to statsd
3910  // of guardrails and checkpoints in the tracing service. perfetto_cmd sets
3911  // this to enabled (if not explicitly set in the config) when specifying
3912  // --upload.
3913  optional StatsdLogging statsd_logging = 31;
3914
3915  // DEPRECATED. Was trace_uuid, use trace_uuid_msb and trace_uuid_lsb instead.
3916  reserved 26;
3917
3918  // An identifier clients can use to tie this trace to other logging.
3919  // DEPRECATED as per v32. See TracePacket.trace_uuid for the authoritative
3920  // Trace UUID. If this field is set, the tracing service will respect the
3921  // requested UUID (i.e. TracePacket.trace_uuid == this field) but only if
3922  // gap-less snapshotting is not used.
3923  optional int64 trace_uuid_msb = 27 [deprecated = true];
3924  optional int64 trace_uuid_lsb = 28 [deprecated = true];
3925
3926  // When set applies a post-filter to the trace contents using the filter
3927  // provided. The filter is applied at ReadBuffers() time and works both in the
3928  // case of IPC readback and write_into_file. This filter can be generated
3929  // using `tools/proto_filter -s schema.proto -F filter_out.bytes` or
3930  // `-T filter_out.escaped_string` (for .pbtx). See go/trace-filtering for
3931  // design.
3932  //
3933  // Introduced in Android S, but it was broken (b/195065199). Reintroduced in
3934  // Android T with a different field number. Updated in Android U with a new
3935  // bytecode version which supports string filtering.
3936  message TraceFilter {
3937    // =========================
3938    // Filter bytecode.
3939    // =========================
3940
3941    // The bytecode as implemented in Android T.
3942    optional bytes bytecode = 1;
3943
3944    // The bytecode as implemented in Android U. Adds support for string
3945    // filtering.
3946    optional bytes bytecode_v2 = 2;
3947
3948    // =========================
3949    // String filtering
3950    // =========================
3951
3952    // The principles and terminology of string filtering is heavily inspired by
3953    // iptables. A "rule" decide how strings should be filtered. Each rule
3954    // contains a "policy" which indicates the algorithm to use for filtering.
3955    // A "chain" is a list of rules which will be sequentially checked against
3956    // each string.
3957    //
3958    // The first rule which applies to the string terminates filtering for that
3959    // string. If no rules apply, the string is left unchanged.
3960
3961    // A policy specifies which algorithm should be used for filtering the
3962    // string.
3963    enum StringFilterPolicy {
3964      SFP_UNSPECIFIED = 0;
3965
3966      // Tries to match the string field against |regex_pattern|. If it
3967      // matches, all matching groups are "redacted" (i.e. replaced with a
3968      // constant string) and filtering is terminated (i.e. no further rules are
3969      // checked). If it doesn't match, the string is left unchanged and the
3970      // next rule in chain is considered.
3971      SFP_MATCH_REDACT_GROUPS = 1;
3972
3973      // Like |SFP_MATCH_REDACT_GROUPS| but tries to do some pre-work before
3974      // checking the regex. Specifically, it tries to parse the string field as
3975      // an atrace tracepoint and checks if the post-tgid field starts with
3976      // |atrace_post_tgid_starts_with|. The regex matching is only performed if
3977      // this check succeeds.
3978      SFP_ATRACE_MATCH_REDACT_GROUPS = 2;
3979
3980      // Tries to match the string field against |regex_pattern|. If it
3981      // matches, filtering is terminated (i.e. no further rules are checked).
3982      // If it doesn't match, the string is left unchanged and the next rule in
3983      // chain is considered.
3984      SFP_MATCH_BREAK = 3;
3985
3986      // Like |SFP_MATCH_BREAK| but tries to do some pre-work before checking
3987      // the regex. Specifically, it tries to parse the string field as an
3988      // atrace tracepoint and checks if the post-tgid field starts with
3989      // |atrace_post_tgid_starts_with|. The regex matching is only performed if
3990      // this check succeeds.
3991      SFP_ATRACE_MATCH_BREAK = 4;
3992
3993      // Tries to repeatedly search (i.e. find substrings of) the string field
3994      // with |regex_pattern|. For each match, redacts any matching groups (i.e.
3995      // replaced with a constant string). Once there are no further matches,
3996      // filtering is terminated (i.e. no further rules are checked).
3997      //
3998      // Note that this is policy is a "search" policy not a "match" policy
3999      // unlike the above policies:
4000      //  * Match policies require matching the full string i.e. there is an
4001      //    implicit leading `^` and trailing `$`.
4002      //  * Search policies perform repeated partial matching of the string
4003      //    e.g.
4004      //      - String: `foo=aaa,bar=123,foo=bbb,baz=456`
4005      //      - Pattern: `foo=(\d+)`
4006      //      - Output: `foo=P6O,bar=123,foo=P6O,baz=456`
4007      //    where P6O is the redaction string
4008      //
4009      // All of this is only performed after some pre-work where we try to parse
4010      // the string field as an atrace tracepoint and check if the post-tgid
4011      // field starts with |atrace_post_tgid_starts_with|.
4012      //
4013      // If there are no partial matches, the string is left unchanged and the
4014      // next rule in chain is considered.
4015      SFP_ATRACE_REPEATED_SEARCH_REDACT_GROUPS = 5;
4016    }
4017
4018    // A rule specifies how strings should be filtered.
4019    message StringFilterRule {
4020      // The policy (i.e. algorithm) dictating how strings matching this rule
4021      // should be handled.
4022      optional StringFilterPolicy policy = 1;
4023
4024      // The regex pattern used to match against each string.
4025      optional string regex_pattern = 2;
4026
4027      // The string which should appear after the tgid in atrace tracepoint
4028      // strings.
4029      optional string atrace_payload_starts_with = 3;
4030    }
4031
4032    // A chain is a list of rules which string will be sequentially checked
4033    // against.
4034    message StringFilterChain {
4035      repeated StringFilterRule rules = 1;
4036    }
4037    optional StringFilterChain string_filter_chain = 3;
4038  }
4039  // old field number for trace_filter
4040  reserved 32;
4041  optional TraceFilter trace_filter = 33;
4042
4043  // Android-only. Not for general use. If set, reports the trace to the
4044  // Android framework. This field is read by perfetto_cmd, rather than the
4045  // tracing service. This field must be set when passing the --upload flag to
4046  // perfetto_cmd.
4047  message AndroidReportConfig {
4048    // In this message, either:
4049    //  * |reporter_service_package| and |reporter_service_class| must be set.
4050    //  * |skip_reporting| must be explicitly set to true.
4051
4052    optional string reporter_service_package = 1;
4053    optional string reporter_service_class = 2;
4054
4055    // If true, then skips reporting the trace to Android framework.
4056    //
4057    // This flag is useful in testing (e.g. Perfetto-statsd integration tests)
4058    // or when we explicitly don't want to report traces to the framework even
4059    // when they usually would (e.g. configs deployed using statsd but only
4060    // used for inclusion in bugreports using |bugreport_score|).
4061    //
4062    // The motivation for having this flag, instead of just not setting
4063    // |framework_report_config|, is prevent accidents where
4064    // |framework_report_config| is omitted by mistake.
4065    optional bool skip_report = 3;
4066
4067    // If true, will direct the Android framework to read the data in trace
4068    // file and pass it to the reporter class over a pipe instead of passing
4069    // the file descriptor directly.
4070    //
4071    // This flag is needed because the Android test framework does not
4072    // currently support priv-app helper apps (in terms of SELinux) and we
4073    // really don't want to add an allow rule for untrusted_app to receive
4074    // trace fds.
4075    //
4076    // Because of this, we instead will direct the framework to create a new
4077    // pipe and pass this to the reporter process instead. As the pipe is
4078    // created by the framework, we won't have any problems with SELinux
4079    // (system_server is already allowed to pass pipe fds, even
4080    // to untrusted apps).
4081    //
4082    // As the name suggests this option *MUST* only be used for testing.
4083    // Note that the framework will reject (and drop) files which are too
4084    // large both for simplicity and to be minimize the amount of data we
4085    // pass to a non-priv app (note that the framework will still check
4086    // manifest permissions even though SELinux permissions are worked around).
4087    optional bool use_pipe_in_framework_for_testing = 4;
4088  }
4089  optional AndroidReportConfig android_report_config = 34;
4090
4091  // If set, delays the start of tracing by a random duration. The duration is
4092  // chosen from a uniform distribution between the specified minimum and
4093  // maximum.
4094  // Note: this delay is implemented by perfetto_cmd *not* by traced so will
4095  // not work if you communicate with traced directly over the consumer API.
4096  // Introduced in Android T.
4097  message CmdTraceStartDelay {
4098    optional uint32 min_delay_ms = 1;
4099    optional uint32 max_delay_ms = 2;
4100  }
4101  optional CmdTraceStartDelay cmd_trace_start_delay = 35;
4102}
4103
4104// End of protos/perfetto/config/trace_config.proto
4105
4106// Begin of protos/perfetto/common/trace_stats.proto
4107
4108// Statistics for the internals of the tracing service.
4109//
4110// Next id: 19.
4111message TraceStats {
4112  // From TraceBuffer::Stats.
4113  //
4114  // Next id: 21.
4115  message BufferStats {
4116    // Size of the circular buffer in bytes.
4117    optional uint64 buffer_size = 12;
4118
4119    // Num. bytes written into the circular buffer, including chunk headers.
4120    optional uint64 bytes_written = 1;
4121
4122    // Num. bytes overwritten before they have been read (i.e. loss of data).
4123    optional uint64 bytes_overwritten = 13;
4124
4125    // Total size of chunks that were fully read from the circular buffer by the
4126    // consumer. This may not be equal to |bytes_written| either in the middle
4127    // of tracing, or if |chunks_overwritten| is non-zero. Note that this is the
4128    // size of the chunks read from the buffer, including chunk headers, which
4129    // will be different from the total size of packets returned to the
4130    // consumer.
4131    //
4132    // The current utilization of the trace buffer (mid-tracing) can be obtained
4133    // by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|,
4134    // adding the difference of |padding_bytes_written| and
4135    // |padding_bytes_cleared|, and comparing this sum to the |buffer_size|.
4136    // Note that this represents the total size of buffered data in the buffer,
4137    // yet this data may be spread non-contiguously through the buffer and may
4138    // be overridden before the utilization reaches 100%.
4139    optional uint64 bytes_read = 14;
4140
4141    // Num. bytes that were allocated as padding between chunks in the circular
4142    // buffer.
4143    optional uint64 padding_bytes_written = 15;
4144
4145    // Num. of padding bytes that were removed from the circular buffer when
4146    // they were overwritten.
4147    //
4148    // The difference between |padding_bytes_written| and
4149    // |padding_bytes_cleared| denotes the total size of padding currently
4150    // present in the buffer.
4151    optional uint64 padding_bytes_cleared = 16;
4152
4153    // Num. chunks (!= packets) written into the buffer.
4154    optional uint64 chunks_written = 2;
4155
4156    // Num. chunks (!= packets) rewritten into the buffer. This means we rewrote
4157    // the same chunk with additional packets appended to the end.
4158    optional uint64 chunks_rewritten = 10;
4159
4160    // Num. chunks overwritten before they have been read (i.e. loss of data).
4161    optional uint64 chunks_overwritten = 3;
4162
4163    // Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer
4164    // is configured with FillPolicy == DISCARD.
4165    optional uint64 chunks_discarded = 18;
4166
4167    // Num. chunks (!= packets) that were fully read from the circular buffer by
4168    // the consumer. This may not be equal to |chunks_written| either in the
4169    // middle of tracing, or if |chunks_overwritten| is non-zero.
4170    optional uint64 chunks_read = 17;
4171
4172    // Num. chunks that were committed out of order.
4173    optional uint64 chunks_committed_out_of_order = 11;
4174
4175    // Num. times the ring buffer wrapped around.
4176    optional uint64 write_wrap_count = 4;
4177
4178    // Num. out-of-band (OOB) patches that succeeded.
4179    optional uint64 patches_succeeded = 5;
4180
4181    // Num. OOB patches that failed (e.g., the chunk to patch was gone).
4182    optional uint64 patches_failed = 6;
4183
4184    // Num. readaheads (for large multi-chunk packet reads) that ended up in a
4185    // successful packet read.
4186    optional uint64 readaheads_succeeded = 7;
4187
4188    // Num. readaheads aborted because of missing chunks in the sequence stream.
4189    // Note that a small number > 0 is totally expected: occasionally, when
4190    // issuing a read, the very last packet in a sequence might be incomplete
4191    // (because the producer is still writing it while we read). The read will
4192    // stop at that point, for that sequence, increasing this counter.
4193    optional uint64 readaheads_failed = 8;
4194
4195    // Num. of violations of the SharedMemoryABI found while writing or reading
4196    // the buffer. This is an indication of either a bug in the producer(s) or
4197    // malicious producer(s).
4198    optional uint64 abi_violations = 9;
4199
4200    // The fields below have been introduced in Android R.
4201
4202    // Num. of times the service detected packet loss on a trace writer
4203    // sequence. This is usually caused by exhaustion of available chunks in the
4204    // writer process's SMB. Note that this relies on the client's TraceWriter
4205    // indicating this loss to the service -- packets lost for other reasons are
4206    // not reflected in this stat.
4207    optional uint64 trace_writer_packet_loss = 19;
4208  }
4209
4210  // Stats for the TraceBuffer(s) of the current trace session.
4211  repeated BufferStats buffer_stats = 1;
4212
4213  // Per TraceWriter stat. Each {producer, trace writer} tuple is publicly
4214  // visible as a unique sequence ID in the trace.
4215  message WriterStats {
4216    // This matches the TracePacket.trusted_packet_sequence_id and is used to
4217    // correlate the stats with the actual packet types.
4218    optional uint64 sequence_id = 1;
4219
4220    // The buffer index (0..N, as defined in the TraceConfig).
4221    optional uint32 buffer = 4;
4222
4223    // These two arrays have the same cardinality and match the cardinality of
4224    // chunk_payload_histogram_def + 1 (for the overflow bucket, see below).
4225    // `sum` contains the SUM(entries) and `counts` contains the COUNT(entries)
4226    // for each bucket.
4227    repeated uint64 chunk_payload_histogram_counts = 2 [packed = true];
4228    repeated int64 chunk_payload_histogram_sum = 3 [packed = true];
4229  }
4230
4231  // The thresholds of each the `writer_stats` histogram buckets. This is
4232  // emitted only once as all WriterStats share the same bucket layout.
4233  // This field has the same cardinality of the
4234  // `writer_stats.chunk_payload_histogram_{counts,sum}` - 1.
4235  // (The -1 is because the last overflow bucket is not reported in the _def).
4236  // An array of values [10, 100, 1000] in the _def array means that there are
4237  // four buckets (3 + the implicit overflow bucket):
4238  // [0]: x <= 10; [1]: 100 < x <= 1000; [2]: 1000 < x <= 1000; [3]: x > 1000.
4239  repeated int64 chunk_payload_histogram_def = 17;
4240  repeated WriterStats writer_stats = 18;
4241
4242  // Num. producers connected (whether they are involved in the current tracing
4243  // session or not).
4244  optional uint32 producers_connected = 2;
4245
4246  // Num. producers ever seen for all trace sessions since startup (it's a good
4247  // proxy for inferring num. producers crashed / killed).
4248  optional uint64 producers_seen = 3;
4249
4250  // Num. data sources registered for all trace sessions.
4251  optional uint32 data_sources_registered = 4;
4252
4253  // Num. data sources ever seen for all trace sessions since startup.
4254  optional uint64 data_sources_seen = 5;
4255
4256  // Num. concurrently active tracing sessions.
4257  optional uint32 tracing_sessions = 6;
4258
4259  // Num. buffers for all tracing session (not just the current one). This will
4260  // be >= buffer_stats.size(), because the latter is only about the current
4261  // session.
4262  optional uint32 total_buffers = 7;
4263
4264  // The fields below have been introduced in Android Q.
4265
4266  // Num. chunks that were discarded by the service before attempting to commit
4267  // them to a buffer, e.g. because the producer specified an invalid buffer ID.
4268  optional uint64 chunks_discarded = 8;
4269
4270  // Num. patches that were discarded by the service before attempting to apply
4271  // them to a buffer, e.g. because the producer specified an invalid buffer ID.
4272  optional uint64 patches_discarded = 9;
4273
4274  // Packets that failed validation of the TrustedPacket. If this is > 0, there
4275  // is a bug in the producer.
4276  optional uint64 invalid_packets = 10;
4277
4278  // This is set only when the TraceConfig specifies a TraceFilter.
4279  message FilterStats {
4280    optional uint64 input_packets = 1;
4281    optional uint64 input_bytes = 2;
4282    optional uint64 output_bytes = 3;
4283    optional uint64 errors = 4;
4284    optional uint64 time_taken_ns = 5;
4285
4286    // The number of bytes discarded by the filter (i.e. output - input).
4287    // The array has one entry for each buffer defined in the config (unless no
4288    // packets for that buffer were seen and hence filtered).
4289    // Note: the SUM(bytes_discarded_per_buffer) will be <= but not == the total
4290    // (output_bytes - input_bytes) because the filter might also discard
4291    // server-generated synthetic packets, that have no buffer index.
4292    repeated uint64 bytes_discarded_per_buffer = 20;
4293  }
4294  optional FilterStats filter_stats = 11;
4295
4296  // Count of Flush() requests (either from the Consumer, or self-induced
4297  // periodic flushes). The final Flush() is also included in the count.
4298  optional uint64 flushes_requested = 12;
4299
4300  // The count of the Flush() requests that were completed successfully.
4301  // In a well behaving trace this should always be == `flush_requests`.
4302  optional uint64 flushes_succeeded = 13;
4303
4304  // The count of the Flush() requests that failed (in most timed out).
4305  // In a well behaving trace this should always be == 0.
4306  optional uint64 flushes_failed = 14;
4307
4308  enum FinalFlushOutcome {
4309    FINAL_FLUSH_UNSPECIFIED = 0;
4310    FINAL_FLUSH_SUCCEEDED = 1;
4311    FINAL_FLUSH_FAILED = 2;
4312  }
4313  optional FinalFlushOutcome final_flush_outcome = 15;
4314}
4315
4316// End of protos/perfetto/common/trace_stats.proto
4317
4318// Begin of protos/perfetto/trace/android/android_game_intervention_list.proto
4319
4320message AndroidGameInterventionList {
4321  message GameModeInfo {
4322    optional uint32 mode = 1;
4323    optional bool use_angle = 2;
4324    optional float resolution_downscale = 3;
4325    optional float fps = 4;
4326  }
4327  message GamePackageInfo {
4328    optional string name = 1;
4329    optional uint64 uid = 2;
4330    optional uint32 current_mode = 3;
4331    repeated GameModeInfo game_mode_info = 4;
4332  }
4333
4334  repeated GamePackageInfo game_packages = 1;
4335
4336  // True when at least one error occurred when parsing
4337  // game_mode_intervention.list
4338  optional bool parse_error = 2;
4339
4340  // Failed to open / read game_mode_intervention.list
4341  optional bool read_error = 3;
4342}
4343
4344// End of protos/perfetto/trace/android/android_game_intervention_list.proto
4345
4346// Begin of protos/perfetto/trace/android/android_input_event.proto
4347
4348// A representation of an Android MotionEvent.
4349// See: https://developer.android.com/reference/android/view/MotionEvent
4350message AndroidMotionEvent {
4351  // A representation of one pointer inside a MotionEvent.
4352  // Each Pointer contains the values present in its corresponding
4353  // MotionEvent.PointerCoords and MotionEvent.PointerProperties.
4354  message Pointer {
4355     message AxisValue {
4356      optional int32 axis = 1;
4357      optional float value = 2;
4358    }
4359    repeated AxisValue axis_value = 1;
4360    optional int32 pointer_id = 2;
4361    optional int32 tool_type = 3;
4362  }
4363
4364  // The randomly-generated ID used to track the event through the pipeline.
4365  optional fixed32 event_id = 1;
4366  // The event's timestamp - generated by the kernel.
4367  optional int64 event_time_nanos = 2;
4368  optional uint32 source = 3;
4369  optional int32 action = 4;
4370  optional int32 device_id = 5;
4371  // Use a signed int for display_id, because -1 (DISPLAY_IS_NONE) is a common value.
4372  optional sint32 display_id = 6;
4373  optional int32 classification = 7;
4374  optional uint32 flags = 8;
4375  repeated Pointer pointer = 9;
4376
4377  // Field numbers 10-15 are reserved for commonly used fields.
4378
4379  // If this event was synthesized as a result of one or more different
4380  // event, original_event_ids are the event_ids associated with the original events.
4381  // For example, if this is an ACTION_HOVER_ENTER event that is synthesized
4382  // due to an ACTION_HOVER_MOVE event entering the bounds of a window, the
4383  // id of the original hover move event will be listed here.
4384  repeated fixed32 original_event_id = 16 [packed = true];
4385  // The timestamp of the ACTION_DOWN event associated with this gesture.
4386  optional int64 down_time_nanos = 17;
4387  optional float cursor_position_x = 18;
4388  optional float cursor_position_y = 19;
4389  optional int32 action_button = 20;
4390  optional uint32 button_state = 21;
4391  optional uint32 meta_state = 22;
4392  optional uint32 policy_flags = 23;
4393  optional float precision_x = 24;
4394  optional float precision_y = 25;
4395}
4396
4397// A representation of an Android KeyEvent.
4398// See: https://developer.android.com/reference/android/view/KeyEvent
4399message AndroidKeyEvent {
4400  // The randomly-generated ID used to track the event through the pipeline.
4401  optional fixed32 event_id = 1;
4402  // The event's timestamp - generated by the kernel.
4403  optional int64 event_time_nanos = 2;
4404  // The timestamp of the ACTION_DOWN event associated with this gesture.
4405  optional int64 down_time_nanos = 3;
4406  optional uint32 source = 4;
4407  optional int32 action = 5;
4408  optional int32 device_id = 6;
4409  // Use a signed int for display_id, because -1 (DISPLAY_IS_NONE) is a common value.
4410  optional sint32 display_id = 7;
4411  optional int32 key_code = 8;
4412  optional uint32 scan_code = 9;
4413  optional uint32 meta_state = 10;
4414  optional int32 repeat_count = 11;
4415  optional uint32 flags = 12;
4416  optional uint32 policy_flags = 13;
4417}
4418
4419// An event that traces an input event being dispatched by the system to one window.
4420message AndroidWindowInputDispatchEvent {
4421  // Stores x/y values for each pointer sent to the window for events
4422  // that are dispatched to a certain location on the screen. This is not relevant
4423  // for KeyEvents and MotionEvents that are dispatched to focused windows.
4424  message DispatchedPointer {
4425    optional int32 pointer_id = 1;
4426    // The coordinates of the pointer in the logical display space, AKA "raw coordinates".
4427    optional float x_in_display = 2;
4428    optional float y_in_display = 3;
4429    // The axis values for this pointer that were modified by the window transform.
4430    repeated AndroidMotionEvent.Pointer.AxisValue axis_value_in_window = 4;
4431  }
4432
4433  // The event_id of the event that was dispatched to the window.
4434  optional fixed32 event_id = 1;
4435  // The vsync_id of the frame in which the decision was made to dispatch the event to
4436  // the window.
4437  optional int64 vsync_id = 2;
4438  // The id of the window to which the event was dispatched.
4439  optional int32 window_id = 3;
4440  // Only relevant for MotionEvents that are dispatched to a screen location.
4441  // Each DispatchedPointer has a 1:1 correspondence with the Pointers in the AndroidMotionEvent.
4442  repeated DispatchedPointer dispatched_pointer = 4;
4443  // The event flags that were used when dispatching the event to this window.
4444  // If the same event is dispatched to more than one window, it is possible that they
4445  // were dispatched using different flag values for each window.
4446  optional uint32 resolved_flags = 5;
4447}
4448
4449message AndroidInputEvent {
4450  oneof event {
4451    // Traces input events received by or generated by InputDispatcher
4452    AndroidMotionEvent dispatcher_motion_event = 1;
4453    AndroidMotionEvent dispatcher_motion_event_redacted = 2;
4454    AndroidKeyEvent dispatcher_key_event = 3;
4455    AndroidKeyEvent dispatcher_key_event_redacted = 4;
4456
4457    // Traces an event being dispatched to a window.
4458    AndroidWindowInputDispatchEvent dispatcher_window_dispatch_event = 5;
4459    AndroidWindowInputDispatchEvent dispatcher_window_dispatch_event_redacted = 6;
4460  }
4461}
4462
4463// End of protos/perfetto/trace/android/android_input_event.proto
4464
4465// Begin of protos/perfetto/trace/android/android_log.proto
4466
4467message AndroidLogPacket {
4468  message LogEvent {
4469    // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
4470    optional AndroidLogId log_id = 1;
4471
4472    // PID (TGID), TID and UID of the task that emitted the event.
4473    optional int32 pid = 2;
4474    optional int32 tid = 3;
4475    optional int32 uid = 4;
4476
4477    // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
4478    // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
4479    // processor will take care of realigning clocks using the ClockSnapshot(s).
4480    optional uint64 timestamp = 5;
4481
4482    // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
4483    // the second column of /system/etc/event-log-tags. For all other events,
4484    // |tag| is the app-specified argument passed to __android_log_write().
4485    optional string tag = 6;
4486
4487    // Empty when log_id == LID_EVENTS.
4488    optional AndroidLogPriority prio = 7;
4489
4490    // Empty when log_id == LID_EVENTS.
4491    optional string message = 8;
4492
4493    message Arg {
4494      optional string name = 1;
4495      oneof value {
4496        int64 int_value = 2;
4497        float float_value = 3;
4498        string string_value = 4;
4499      }
4500    }
4501    // Only populated when log_id == LID_EVENTS.
4502    repeated Arg args = 9;
4503  }
4504
4505  repeated LogEvent events = 1;
4506
4507  // Stats are emitted only upon Flush() and are monotonic (i.e. they are
4508  // absolute counters since the beginning of the lifetime of the tracing
4509  // session and NOT relative to the previous Stats snapshot).
4510  message Stats {
4511    // Total number of log events seen, including errors and skipped entries
4512    // (num of events stored in the trace = total - failed - skipped).
4513    optional uint64 num_total = 1;
4514
4515    // Parser failures.
4516    optional uint64 num_failed = 2;
4517
4518    // Messages skipped due to filters.
4519    optional uint64 num_skipped = 3;
4520  }
4521  optional Stats stats = 2;
4522}
4523
4524// End of protos/perfetto/trace/android/android_log.proto
4525
4526// Begin of protos/perfetto/trace/android/android_system_property.proto
4527
4528message AndroidSystemProperty {
4529  message PropertyValue {
4530    optional string name = 1;
4531    optional string value = 2;
4532  }
4533
4534  repeated PropertyValue values = 1;
4535}
4536
4537// End of protos/perfetto/trace/android/android_system_property.proto
4538
4539// Begin of protos/perfetto/trace/android/camera_event.proto
4540
4541// A profiling event corresponding to a single camera frame. This message
4542// collects important details and timestamps involved in producing a single
4543// camera frame.
4544// Next ID: 17
4545message AndroidCameraFrameEvent {
4546  // Identifier for the CameraCaptureSession this frame originates from. See:
4547  // https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession
4548  optional uint64 session_id = 1;
4549  // Identifier for the camera sensor that is the source of this frame. This may
4550  // be either a physical or logical camera (up to vendor interpretation).
4551  optional uint32 camera_id = 2;
4552  // The frame number identifying this frame on this camera.
4553  optional int64 frame_number = 3;
4554  // Identifier for the CaptureRequest. See:
4555  // https://developer.android.com/reference/android/hardware/camera2/CaptureRequest
4556  //
4557  // If multiple cameras are streaming simultaneously, the request_id may be
4558  // used to identify which frames were captured in service of the same request.
4559  optional int64 request_id = 4;
4560
4561  // The CLOCK_BOOTTIME timestamp at which the camera framework request is
4562  // received by the camera HAL pipeline. Note that this request may wait for
4563  // some time before processing actually begins. See also
4564  // request_processing_started_ns.
4565  optional int64 request_received_ns = 5;
4566  // The CLOCK_BOOTTIME timestamp at which the framework request is accepted for
4567  // processing by the camera HAL pipeline. This is the time at which the
4568  // pipeline actually begins to work on the request.
4569  optional int64 request_processing_started_ns = 6;
4570
4571  // The CLOCK_BOOTTIME timestamp at which the sensor begins its exposure.
4572  optional int64 start_of_exposure_ns = 7;
4573  // The CLOCK_BOOTTIME timestamp corresponding to the sensor start of frame
4574  // event.
4575  optional int64 start_of_frame_ns = 8;
4576  // The CLOCK_BOOTTIME timestamp at which the camera HAL has sent all responses
4577  // for the frame.
4578  optional int64 responses_all_sent_ns = 9;
4579
4580  // The error status, if any, reported to the camera framework. Any status
4581  // other than STATUS_OK indicates a dropped frame.
4582  // Next Enum: 6
4583  enum CaptureResultStatus {
4584    STATUS_UNSPECIFIED = 0;
4585    STATUS_OK = 1;
4586    // Early metadata was returned to the camera framework with an error.
4587    STATUS_EARLY_METADATA_ERROR = 2;
4588    // Final metadata was returned to the camera framework with an error.
4589    STATUS_FINAL_METADATA_ERROR = 3;
4590    // One or more buffers were returned to the camera framework with an error.
4591    STATUS_BUFFER_ERROR = 4;
4592    // The frame was dropped as a result of a flush operation.
4593    STATUS_FLUSH_ERROR = 5;
4594  }
4595  optional CaptureResultStatus capture_result_status = 10;
4596
4597  // The number of sensor frames that were skipped between this frame and the
4598  // previous frame. Under normal operation, this should be zero. Any number
4599  // greater than zero indicates dropped sensor frames.
4600  optional int32 skipped_sensor_frames = 11;
4601
4602  // The value of CONTROL_CAPTURE_INTENT. See:
4603  // https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_CAPTURE_INTENT
4604  optional int32 capture_intent = 12;
4605  // The number of streams in the capture request.
4606  optional int32 num_streams = 13;
4607
4608  // A profiling event corresponding to a single node processing within the camera
4609  // pipeline. Intuitively this corresponds to a single stage of processing to
4610  // produce a camera frame.
4611  // Next ID: 6
4612  message CameraNodeProcessingDetails {
4613    optional int64 node_id = 1;
4614    // The timestamp at which node processing begins to run.
4615    optional int64 start_processing_ns = 2;
4616    // The timestamp at which node processing finishes running.
4617    optional int64 end_processing_ns = 3;
4618    // The delay between inputs becoming ready and the node actually beginning to
4619    // run.
4620    optional int64 scheduling_latency_ns = 4;
4621  }
4622  repeated CameraNodeProcessingDetails node_processing_details = 14;
4623
4624  // These fields capture vendor-specific additions to this proto message. In
4625  // practice `vendor_data` typically contains a serialized message of the
4626  // vendor's design, and `vendor_data_version` is incremented each time there
4627  // is a backwards incompatible change made to the message.
4628  optional int32 vendor_data_version = 15;
4629  optional bytes vendor_data = 16;
4630}
4631
4632// A profiling event that may be emitted periodically (i.e., at a slower rate
4633// than `AndroidCameraFrameEvent`s) to record fixed and aggregated camera
4634// session-specific values.
4635message AndroidCameraSessionStats {
4636  // Identifier for the CameraCaptureSession this frame originates from. See:
4637  // https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession
4638  optional uint64 session_id = 1;
4639
4640  // Although vendor implementations may vary, camera pipeline processing is
4641  // typically arranged into a directed graph-like structure. This message is
4642  // used to record that graph.
4643  message CameraGraph {
4644    message CameraNode {
4645      optional int64 node_id = 1;
4646      // A list of inputs consumed by this node.
4647      repeated int64 input_ids = 2;
4648      // A list of outputs produced by this node.
4649      repeated int64 output_ids = 3;
4650
4651      // These fields capture vendor-specific additions to this proto message. In
4652      // practice `vendor_data` typically contains a serialized message of the
4653      // vendor's design, and `vendor_data_version` is incremented each time there
4654      // is a backwards incompatible change made to the message.
4655      optional int32 vendor_data_version = 4;
4656      optional bytes vendor_data = 5;
4657    }
4658    repeated CameraNode nodes = 1;
4659
4660    // An adjacency list describing connections between CameraNodes, mapping
4661    // nodes and their outputs to other nodes that consume them as inputs.
4662    message CameraEdge {
4663      // The pair of IDs identifying the node and output connected by this edge.
4664      optional int64 output_node_id = 1;
4665      optional int64 output_id = 2;
4666
4667      // The pair of IDs identifying the node and input connected by this edge.
4668      optional int64 input_node_id = 3;
4669      optional int64 input_id = 4;
4670
4671      // These fields capture vendor-specific additions to this proto message. In
4672      // practice `vendor_data` typically contains a serialized message of the
4673      // vendor's design, and `vendor_data_version` is incremented each time there
4674      // is a backwards incompatible change made to the message.
4675      optional int32 vendor_data_version = 5;
4676      optional bytes vendor_data = 6;
4677    }
4678    repeated CameraEdge edges = 2;
4679  }
4680  optional CameraGraph graph = 2;
4681}
4682
4683// End of protos/perfetto/trace/android/camera_event.proto
4684
4685// Begin of protos/perfetto/trace/android/frame_timeline_event.proto
4686
4687// Generated by SurfaceFlinger's FrameTimeline (go/adaptive-scheduling-fr).
4688// Used in comparing the expected timeline of a frame to the actual timeline.
4689// Key terms:
4690//    1) DisplayFrame - represents SurfaceFlinger's work on a frame(composited)
4691//    2) SurfaceFrame - represents App's work on its frame
4692//    3) Timeline = start to end of a component's(app/SF) work on a frame.
4693// SurfaceFlinger composites frames from many apps together, so
4694//    One DisplayFrame can map to N SurfaceFrame(s)
4695// This relationship can be reconstructed by using
4696//    DisplayFrame.token = SurfaceFrame.display_frame_token
4697message FrameTimelineEvent {
4698  // Specifies the reason(s) most likely to have caused the jank.
4699  // Used as a bitmask.
4700  enum JankType {
4701    JANK_UNSPECIFIED = 0;
4702    JANK_NONE = 1;
4703    JANK_SF_SCHEDULING = 2;
4704    JANK_PREDICTION_ERROR = 4;
4705    JANK_DISPLAY_HAL = 8;
4706    JANK_SF_CPU_DEADLINE_MISSED = 16;
4707    JANK_SF_GPU_DEADLINE_MISSED = 32;
4708    JANK_APP_DEADLINE_MISSED = 64;
4709    JANK_BUFFER_STUFFING = 128;
4710    JANK_UNKNOWN = 256;
4711    JANK_SF_STUFFING = 512;
4712    JANK_DROPPED = 1024;
4713  };
4714
4715  // Specifies the severity of a jank.
4716  enum JankSeverityType {
4717    SEVERITY_UNKNOWN = 0;
4718    SEVERITY_NONE = 1;
4719    SEVERITY_PARTIAL = 2;
4720    SEVERITY_FULL = 3;
4721  }
4722
4723  // Specifies how a frame was presented on screen w.r.t. timing.
4724  // Can be different for SurfaceFrame and DisplayFrame.
4725  enum PresentType {
4726    PRESENT_UNSPECIFIED = 0;
4727    PRESENT_ON_TIME = 1;
4728    PRESENT_LATE = 2;
4729    PRESENT_EARLY = 3;
4730    PRESENT_DROPPED = 4;
4731    PRESENT_UNKNOWN = 5;
4732  };
4733
4734  // Specifies if the predictions for the frame are still valid, expired or
4735  // unknown.
4736  enum PredictionType {
4737    PREDICTION_UNSPECIFIED = 0;
4738    PREDICTION_VALID = 1;
4739    PREDICTION_EXPIRED = 2;
4740    PREDICTION_UNKNOWN = 3;
4741  };
4742
4743  // Indicates the start of expected timeline slice for SurfaceFrames.
4744  message ExpectedSurfaceFrameStart {
4745    // Cookie used to correlate between the start and end messages of the same
4746    // frame. Since all values except the ts are same for start and end, cookie
4747    // helps in preventing redundant data transmission.
4748    // The same cookie is used only by start and end messages of a single frame
4749    // and is otherwise unique.
4750    optional int64 cookie = 1;
4751
4752    // Token received by the app for its work. Can be shared between multiple
4753    // layers of the same app (example: pip mode).
4754    optional int64 token = 2;
4755    // The corresponding DisplayFrame token is required to link the App's work
4756    // with SurfaceFlinger's work. Many SurfaceFrames can be mapped to a single
4757    // DisplayFrame.
4758    // this.display_frame_token = DisplayFrame.token
4759    optional int64 display_frame_token = 3;
4760
4761    // Pid of the app. Used in creating the timeline tracks (and slices) inside
4762    // the respective process track group.
4763    optional int32 pid = 4;
4764    optional string layer_name = 5;
4765  };
4766
4767  // Indicates the start of actual timeline slice for SurfaceFrames. Also
4768  // includes the jank information.
4769  message ActualSurfaceFrameStart {
4770    // Cookie used to correlate between the start and end messages of the same
4771    // frame. Since all values except the ts are same for start and end, cookie
4772    // helps in preventing redundant data transmission.
4773    // The same cookie is used only by start and end messages of a single frame
4774    // and is otherwise unique.
4775    optional int64 cookie = 1;
4776
4777    // Token received by the app for its work. Can be shared between multiple
4778    // layers of the same app (example: pip mode).
4779    optional int64 token = 2;
4780    // The corresponding DisplayFrame token is required to link the App's work
4781    // with SurfaceFlinger's work. Many SurfaceFrames can be mapped to a single
4782    // DisplayFrame.
4783    // this.display_frame_token = DisplayFrame.token
4784    optional int64 display_frame_token = 3;
4785
4786    // Pid of the app. Used in creating the timeline tracks (and slices) inside
4787    // the respective process track group.
4788    optional int32 pid = 4;
4789    optional string layer_name = 5;
4790
4791    optional PresentType present_type = 6;
4792    optional bool on_time_finish = 7;
4793    optional bool gpu_composition = 8;
4794    // A bitmask of JankType. More than one reason can be attributed to a janky
4795    // frame.
4796    optional int32 jank_type = 9;
4797    optional PredictionType prediction_type = 10;
4798    optional bool is_buffer = 11;
4799    optional JankSeverityType jank_severity_type = 12;
4800  };
4801
4802  // Indicates the start of expected timeline slice for DisplayFrames.
4803  message ExpectedDisplayFrameStart {
4804    // Cookie used to correlate between the start and end messages of the same
4805    // frame. Since all values except the ts are same for start and end, cookie
4806    // helps in preventing redundant data transmission.
4807    // The same cookie is used only by start and end messages of a single frame
4808    // and is otherwise unique.
4809    optional int64 cookie = 1;
4810
4811    // Token received by SurfaceFlinger for its work
4812    // this.token = SurfaceFrame.display_frame_token
4813    optional int64 token = 2;
4814
4815    // Pid of SurfaceFlinger. Used in creating the timeline tracks (and slices)
4816    // inside the SurfaceFlinger process group.
4817    optional int32 pid = 3;
4818  };
4819
4820  // Indicates the start of actual timeline slice for DisplayFrames. Also
4821  // includes the jank information.
4822  message ActualDisplayFrameStart {
4823    // Cookie used to correlate between the start and end messages of the same
4824    // frame. Since all values except the ts are same for start and end, cookie
4825    // helps in preventing redundant data transmission.
4826    // The same cookie is used only by start and end messages of a single frame
4827    // and is otherwise unique.
4828    optional int64 cookie = 1;
4829
4830    // Token received by SurfaceFlinger for its work
4831    // this.token = SurfaceFrame.display_frame_token
4832    optional int64 token = 2;
4833
4834    // Pid of SurfaceFlinger. Used in creating the timeline tracks (and slices)
4835    // inside the SurfaceFlinger process group.
4836    optional int32 pid = 3;
4837
4838    optional PresentType present_type = 4;
4839    optional bool on_time_finish = 5;
4840    optional bool gpu_composition = 6;
4841    // A bitmask of JankType. More than one reason can be attributed to a janky
4842    // frame.
4843    optional int32 jank_type = 7;
4844    optional PredictionType prediction_type = 8;
4845    optional JankSeverityType jank_severity_type = 9;
4846  };
4847
4848  // FrameEnd just sends the cookie to indicate that the corresponding
4849  // <display/surface>frame slice's end.
4850  message FrameEnd { optional int64 cookie = 1; };
4851
4852  oneof event {
4853    ExpectedDisplayFrameStart expected_display_frame_start = 1;
4854    ActualDisplayFrameStart actual_display_frame_start = 2;
4855
4856    ExpectedSurfaceFrameStart expected_surface_frame_start = 3;
4857    ActualSurfaceFrameStart actual_surface_frame_start = 4;
4858
4859    FrameEnd frame_end = 5;
4860  }
4861}
4862
4863// End of protos/perfetto/trace/android/frame_timeline_event.proto
4864
4865// Begin of protos/perfetto/trace/android/gpu_mem_event.proto
4866
4867// Generated by Android's GpuService.
4868message GpuMemTotalEvent {
4869  optional uint32 gpu_id = 1;
4870  optional uint32 pid = 2;
4871  optional uint64 size = 3;
4872}
4873
4874// End of protos/perfetto/trace/android/gpu_mem_event.proto
4875
4876// Begin of protos/perfetto/trace/android/graphics_frame_event.proto
4877
4878// Generated by Android's SurfaceFlinger.
4879message GraphicsFrameEvent {
4880  enum BufferEventType {
4881    UNSPECIFIED = 0;
4882    DEQUEUE = 1;
4883    QUEUE = 2;
4884    POST = 3;
4885    ACQUIRE_FENCE = 4;
4886    LATCH = 5;
4887    // HWC will compose this buffer
4888    HWC_COMPOSITION_QUEUED = 6;
4889    // renderEngine composition
4890    FALLBACK_COMPOSITION = 7;
4891    PRESENT_FENCE = 8;
4892    RELEASE_FENCE = 9;
4893    MODIFY = 10;
4894    DETACH = 11;
4895    ATTACH = 12;
4896    CANCEL = 13;
4897  }
4898
4899  message BufferEvent {
4900    optional uint32 frame_number = 1;
4901    optional BufferEventType type = 2;
4902    optional string layer_name = 3;
4903    // If no duration is set, the event is an instant event.
4904    optional uint64 duration_ns = 4;
4905    // Unique buffer identifier.
4906    optional uint32 buffer_id = 5;
4907  }
4908
4909  optional BufferEvent buffer_event = 1;
4910}
4911
4912// End of protos/perfetto/trace/android/graphics_frame_event.proto
4913
4914// Begin of protos/perfetto/trace/android/initial_display_state.proto
4915
4916message InitialDisplayState {
4917  // Same values as android.view.Display.STATE_*
4918  optional int32 display_state = 1;
4919  optional double brightness = 2;
4920}
4921
4922// End of protos/perfetto/trace/android/initial_display_state.proto
4923
4924// Begin of protos/perfetto/trace/android/network_trace.proto
4925
4926enum TrafficDirection {
4927  DIR_UNSPECIFIED = 0;
4928  DIR_INGRESS = 1;
4929  DIR_EGRESS = 2;
4930}
4931
4932// NetworkPacketEvent records the details of a single packet sent or received
4933// on the network (in Linux kernel terminology, one sk_buff struct).
4934message NetworkPacketEvent {
4935  // The direction traffic is flowing for this event.
4936  optional TrafficDirection direction = 1;
4937
4938  // The name of the interface if available (e.g. 'rmnet0').
4939  optional string interface = 2;
4940
4941  // The length of the packet in bytes (wire_size - L2_header_size). Ignored
4942  // when using NetworkPacketEvent as the ctx in either NetworkPacketBundle or
4943  // NetworkPacketContext.
4944  optional uint32 length = 3;
4945
4946  // The Linux user id associated with the packet's socket.
4947  optional uint32 uid = 4;
4948
4949  // The Android network tag associated with the packet's socket.
4950  optional uint32 tag = 5;
4951
4952  // The packet's IP protocol (TCP=6, UDP=17, etc).
4953  optional uint32 ip_proto = 6;
4954
4955  // The packet's TCP flags as a bitmask (FIN=0x1, SYN=0x2, RST=0x4, etc).
4956  optional uint32 tcp_flags = 7;
4957
4958  // The local udp/tcp port of the packet.
4959  optional uint32 local_port = 8;
4960
4961  // The remote udp/tcp port of the packet.
4962  optional uint32 remote_port = 9;
4963
4964  // The 1-byte ICMP type identifier.
4965  optional uint32 icmp_type = 10;
4966
4967  // The 1-byte ICMP code identifier.
4968  optional uint32 icmp_code = 11;
4969}
4970
4971// NetworkPacketBundle bundles one or more packets sharing the same attributes.
4972message NetworkPacketBundle {
4973  oneof packet_context {
4974    // The intern id for looking up the associated packet context.
4975    uint64 iid = 1;
4976
4977    // The inlined context for events in this bundle.
4978    NetworkPacketEvent ctx = 2;
4979  }
4980
4981  // The timestamp of the i-th packet encoded as the nanoseconds since the
4982  // enclosing TracePacket's timestamp.
4983  repeated uint64 packet_timestamps = 3 [packed = true];
4984
4985  // The length of the i-th packet in bytes (wire_size - L2_header_size).
4986  repeated uint32 packet_lengths = 4 [packed = true];
4987
4988  // Total number of packets in the bundle (when above aggregation_threshold).
4989  optional uint32 total_packets = 5;
4990
4991  // Duration between first and last packet (when above aggregation_threshold).
4992  optional uint64 total_duration = 6;
4993
4994  // Total packet length in bytes (when above aggregation_threshold).
4995  optional uint64 total_length = 7;
4996}
4997
4998// An internable packet context.
4999message NetworkPacketContext {
5000  optional uint64 iid = 1;
5001  optional NetworkPacketEvent ctx = 2;
5002}
5003
5004// End of protos/perfetto/trace/android/network_trace.proto
5005
5006// Begin of protos/perfetto/trace/android/packages_list.proto
5007
5008message PackagesList {
5009  message PackageInfo {
5010    optional string name = 1;
5011    optional uint64 uid = 2;
5012    optional bool debuggable = 3;
5013    optional bool profileable_from_shell = 4;
5014    optional int64 version_code = 5;
5015  }
5016
5017  repeated PackageInfo packages = 1;
5018
5019  // At least one error occurred parsing the packages.list.
5020  optional bool parse_error = 2;
5021
5022  // Failed to open / read packages.list.
5023  optional bool read_error = 3;
5024}
5025
5026// End of protos/perfetto/trace/android/packages_list.proto
5027
5028// Begin of protos/perfetto/trace/android/pixel_modem_events.proto
5029
5030message PixelModemEvents {
5031  // Pigweed-format dehydrated events.
5032  repeated bytes events = 1;
5033
5034  // Timestamps of the events, converted to CLOCK_BOOTTIME. The first
5035  // timestamp is the absolute timestamp of the first event. Subsequent
5036  // timestamps are deltas from the previous timestamp.
5037  // The nth entry from `events` gets the nth entry here.
5038  repeated uint64 event_time_nanos = 2;
5039}
5040
5041// NB: this is not emitted in the trace but can be prepended later.
5042message PixelModemTokenDatabase {
5043  // Pigweed-format database to allow event rehydration.
5044  optional bytes database = 1;
5045}
5046
5047// End of protos/perfetto/trace/android/pixel_modem_events.proto
5048
5049// Begin of protos/perfetto/trace/android/protolog.proto
5050
5051/* represents a single log entry */
5052message ProtoLogMessage {
5053  /* log statement identifier, created from message string and log level. */
5054  optional fixed64 message_id = 1;
5055  /* string parameters passed to the log call that have been interned. */
5056  repeated uint32 str_param_iids = 2;
5057  /* integer parameters passed to the log call. */
5058  repeated sint64 sint64_params = 3;
5059  /* floating point parameters passed to the log call. */
5060  repeated double double_params = 4;
5061  /* boolean parameters passed to the log call. */
5062  repeated int32 boolean_params = 5;
5063  // id of the interned stacktrace string
5064  // (only dumped if explicitly confuigured to do so)
5065  optional uint32 stacktrace_iid = 6;
5066}
5067
5068/* contains all the data required to fully decode the protolog messages */
5069message ProtoLogViewerConfig {
5070  message MessageData {
5071    // the id of the message that is logged in a ProtoLogMessage
5072    optional fixed64 message_id = 1;
5073    // the string representation of the message
5074    optional string message = 2;
5075    // the level of the message
5076    optional ProtoLogLevel level = 3;
5077    // the id of the log group this message belongs to
5078    optional uint32 group_id = 4;
5079  }
5080
5081  /* information about a ProtoLog log group */
5082  message Group {
5083    optional uint32 id = 1;
5084    optional string name = 2;
5085    optional string tag = 3;
5086  }
5087
5088  repeated MessageData messages = 1;
5089  repeated Group groups = 2;
5090}
5091
5092// End of protos/perfetto/trace/android/protolog.proto
5093
5094// Begin of protos/perfetto/trace/android/shell_transition.proto
5095
5096// ShellTransition messages record information about the shell transitions in
5097// the system. This is used to track the animations that are created and execute
5098// through the shell transition system.
5099message ShellTransition {
5100  // The unique identifier of the transition.
5101  optional int32 id = 1;
5102
5103  // The time the transition was created on the WM side
5104  // (using SystemClock.elapsedRealtimeNanos())
5105  optional int64 create_time_ns = 2;
5106  // The time the transition was sent from the WM side to shell
5107  // (using SystemClock.elapsedRealtimeNanos())
5108  optional int64 send_time_ns = 3;
5109  // The time the transition was dispatched by shell to execute
5110  // (using SystemClock.elapsedRealtimeNanos())
5111  optional int64 dispatch_time_ns = 4;
5112  // If the transition merge was accepted by the transition handler, this
5113  // contains the time the transition was merged into transition with id
5114  // `merge_target`.
5115  // (using SystemClock.elapsedRealtimeNanos())
5116  optional int64 merge_time_ns = 5;
5117  // The time shell proposed the transition should be merged to the transition
5118  // handler into transition with id `merge_target`.
5119  // (using SystemClock.elapsedRealtimeNanos()).
5120  optional int64 merge_request_time_ns = 6;
5121  // If the transition was aborted on the shell side, this is the time that
5122  // occurred.
5123  // (using SystemClock.elapsedRealtimeNanos())
5124  optional int64 shell_abort_time_ns = 7;
5125  // If the transition was aborted on the wm side, this is the time that
5126  // occurred.
5127  // (using SystemClock.elapsedRealtimeNanos())
5128  optional int64 wm_abort_time_ns = 8;
5129  // The time WM considers the transition to be complete.
5130  // (using SystemClock.elapsedRealtimeNanos())
5131  optional int64 finish_time_ns = 9;
5132
5133  // The id of the transaction that WM proposed to use as the starting
5134  // transaction. It contains all the layer changes required to setup the
5135  // transition and should be executed right at the start of the transition
5136  // by the transition handler.
5137  optional uint64 start_transaction_id = 10;
5138  // The if of the transaction that WM proposed to use as the finish
5139  // transaction. It contains all the layer changes required to set the final
5140  // state of the transition.
5141  optional uint64 finish_transaction_id = 11;
5142
5143  // The id of the handler that executed the transition. A HandlerMappings
5144  // message in the trace will contain the mapping of id to a string
5145  // representation of the handler.
5146  optional int32 handler = 12;
5147  // The transition type of this transition (e.g. TO_FRONT, OPEN, CLOSE).
5148  optional int32 type = 13;
5149
5150  // The list of targets that are part of this transition.
5151  repeated Target targets = 14;
5152  // The id of the transition we have requested to merge or have merged this
5153  // transition into.
5154  optional int32 merge_target = 15;
5155
5156  // The flags set on this transition.
5157  optional int32 flags = 16;
5158  // The time the starting window was removed. Tracked because this can
5159  // happen after the transition finishes, but the app may not yet be visible
5160  // until the starting window is removed. So in a sense the transition is not
5161  // finished until the starting window is removed. (b/284302118)
5162  // (using SystemClock.elapsedRealtimeNanos())
5163  optional int64 starting_window_remove_time_ns = 17;
5164
5165  // Contains the information about the windows targeted in a transition.
5166  message Target {
5167    // The transition mode of this target (e.g. TO_FRONT, CLOSE...)
5168    optional int32 mode = 1;
5169    // The layer id of this target.
5170    optional int32 layer_id = 2;
5171    // The window id of this target.
5172    optional int32 window_id = 3;
5173    // The flags set on this target.
5174    optional int32 flags = 4;
5175  }
5176}
5177
5178// Contains mappings from handler ids to string representation of the handlers.
5179message ShellHandlerMappings {
5180  repeated ShellHandlerMapping mapping = 1;
5181}
5182
5183message ShellHandlerMapping {
5184  // The id of the handler used in the ShellTransition message.
5185  optional int32 id = 1;
5186  // A human readable and meaningful string representation of the handler.
5187  optional string name = 2;
5188}
5189
5190// End of protos/perfetto/trace/android/shell_transition.proto
5191
5192// Begin of protos/perfetto/trace/android/surfaceflinger_common.proto
5193
5194message RegionProto {
5195  // Previously: uint64 id
5196  reserved 1;
5197  repeated RectProto rect = 2;
5198}
5199
5200message RectProto {
5201  optional int32 left = 1;
5202  optional int32 top = 2;
5203  optional int32 right = 3;
5204  optional int32 bottom = 4;
5205}
5206
5207message SizeProto {
5208  optional int32 w = 1;
5209  optional int32 h = 2;
5210}
5211
5212message TransformProto {
5213  optional float dsdx = 1;
5214  optional float dtdx = 2;
5215  optional float dsdy = 3;
5216  optional float dtdy = 4;
5217  optional int32 type = 5;
5218}
5219
5220message ColorProto {
5221  optional float r = 1;
5222  optional float g = 2;
5223  optional float b = 3;
5224  optional float a = 4;
5225}
5226
5227message InputWindowInfoProto {
5228  optional uint32 layout_params_flags = 1;
5229  optional int32 layout_params_type = 2;
5230  optional RectProto frame = 3;
5231  optional RegionProto touchable_region = 4;
5232
5233  optional int32 surface_inset = 5;
5234  optional bool visible = 6;
5235  optional bool can_receive_keys = 7 [deprecated = true];
5236  optional bool focusable = 8;
5237  optional bool has_wallpaper = 9;
5238
5239  optional float global_scale_factor = 10;
5240  optional float window_x_scale = 11 [deprecated = true];
5241  optional float window_y_scale = 12 [deprecated = true];
5242
5243  optional int32 crop_layer_id = 13;
5244  optional bool replace_touchable_region_with_crop = 14;
5245  optional RectProto touchable_region_crop = 15;
5246  optional TransformProto transform = 16;
5247  optional uint32 input_config = 17;
5248}
5249
5250message BlurRegion {
5251  optional uint32 blur_radius = 1;
5252  optional uint32 corner_radius_tl = 2;
5253  optional uint32 corner_radius_tr = 3;
5254  optional uint32 corner_radius_bl = 4;
5255  optional float corner_radius_br = 5;
5256  optional float alpha = 6;
5257  optional int32 left = 7;
5258  optional int32 top = 8;
5259  optional int32 right = 9;
5260  optional int32 bottom = 10;
5261}
5262
5263message ColorTransformProto {
5264  // This will be a 4x4 matrix of float values
5265  repeated float val = 1 [packed = true];
5266}
5267
5268// End of protos/perfetto/trace/android/surfaceflinger_common.proto
5269
5270// Begin of protos/perfetto/trace/android/surfaceflinger_layers.proto
5271
5272// Message used by Winscope to process legacy trace files.
5273// Represents a file full of surface flinger trace entries.
5274// Encoded, it should start with 0x4c 0x59 0x52 0x54 0x52 0x41 0x43 0x45
5275// (.LYRTRACE), such that they can be easily identified.
5276message LayersTraceFileProto {
5277  // constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 |
5278  // MagicNumber.MAGIC_NUMBER_L (this is needed because enums have to be 32 bits
5279  // and there's no nice way to put 64bit constants into .proto files.
5280  enum MagicNumber {
5281    INVALID = 0;
5282    // LYRT (little-endian ASCII)
5283    MAGIC_NUMBER_L = 0x5452594c;
5284    // RACE (little-endian ASCII)
5285    MAGIC_NUMBER_H = 0x45434152;
5286  }
5287
5288  // Must be the first field, set to value in MagicNumber
5289  optional fixed64 magic_number = 1;
5290
5291  repeated LayersSnapshotProto entry = 2;
5292
5293  // Offset between real-time clock and elapsed time clock in nanoseconds.
5294  // Calculated as: systemTime(SYSTEM_TIME_REALTIME) -
5295  // systemTime(SYSTEM_TIME_MONOTONIC)
5296  optional fixed64 real_to_elapsed_time_offset_nanos = 3;
5297}
5298
5299message LayersSnapshotProto {
5300  // elapsed realtime in nanos since boot of when this entry was logged
5301  optional sfixed64 elapsed_realtime_nanos = 1;
5302
5303  // SurfaceFlinger's stage where the snapshot was triggered.
5304  // Currently either "visibleRegionsDirty" or "bufferLatched".
5305  optional string where = 2;
5306
5307  optional LayersProto layers = 3;
5308
5309  // Blob for the current HWC information for all layers, reported by dumpsys.
5310  // Example:
5311  //   "maxDownScale: 4, maxFullWidth: 8192, HWState: 1, AssignedState: 3, ..."
5312  optional string hwc_blob = 4;
5313
5314  // Excludes state sent during composition like visible region and composition
5315  // type.
5316  optional bool excludes_composition_state = 5;
5317
5318  // Number of missed entries since the last entry was recorded.
5319  optional uint32 missed_entries = 6;
5320
5321  repeated DisplayProto displays = 7;
5322
5323  optional int64 vsync_id = 8;
5324}
5325
5326// Contains a list of all layers.
5327message LayersProto {
5328  repeated LayerProto layers = 1;
5329}
5330
5331message DisplayProto {
5332  optional uint64 id = 1;
5333  // Display descriptor, e.g. "Built-In Screen"
5334  optional string name = 2;
5335  optional uint32 layer_stack = 3;
5336  optional SizeProto size = 4;
5337  optional RectProto layer_stack_space_rect = 5;
5338  optional TransformProto transform = 6;
5339  optional bool is_virtual = 7;
5340  optional double dpi_x = 8;
5341  optional double dpi_y = 9;
5342}
5343
5344// Must match definition in the IComposerClient HAL
5345enum HwcCompositionType {
5346  // Invalid composition type
5347  HWC_TYPE_UNSPECIFIED = 0;
5348  // Layer was composited by the client into the client target buffer
5349  HWC_TYPE_CLIENT = 1;
5350  // Layer was composited by the device through hardware overlays
5351  HWC_TYPE_DEVICE = 2;
5352  // Layer was composited by the device using a color
5353  HWC_TYPE_SOLID_COLOR = 3;
5354  // Similar to DEVICE, but the layer position may have been asynchronously set
5355  // through setCursorPosition
5356  HWC_TYPE_CURSOR = 4;
5357  // Layer was composited by the device via a sideband stream
5358  HWC_TYPE_SIDEBAND = 5;
5359   // Layer was composited by hardware optimized for display decoration
5360  HWC_TYPE_DISPLAY_DECORATION = 6;
5361}
5362
5363// Information about each layer.
5364message LayerProto {
5365  // unique id per layer.
5366  optional int32 id = 1;
5367  // unique name per layer.
5368  // Example: "Wallpaper".
5369  optional string name = 2;
5370  // list of children this layer may have. May be empty.
5371  repeated int32 children = 3 [packed = true];
5372  // list of layers that are z order relative to this layer.
5373  repeated int32 relatives = 4 [packed = true];
5374  // The type of layer.
5375  // Examples: "ContainerLayer", "BufferStateLayer".
5376  optional string type = 5;
5377  optional RegionProto transparent_region = 6;
5378  optional RegionProto visible_region = 7;
5379  optional RegionProto damage_region = 8;
5380  optional uint32 layer_stack = 9;
5381  // The layer's z order. Can be z order in layer stack, relative to parent,
5382  // or relative to another layer specified in zOrderRelative.
5383  optional int32 z = 10;
5384  // The layer's position on the display.
5385  optional PositionProto position = 11;
5386  // The layer's requested position.
5387  optional PositionProto requested_position = 12;
5388  // The layer's size.
5389  optional SizeProto size = 13;
5390  // The layer's crop in its own bounds.
5391  optional RectProto crop = 14;
5392  // The layer's crop in its parent's bounds.
5393  optional RectProto final_crop = 15 [deprecated = true];
5394  optional bool is_opaque = 16;
5395  optional bool invalidate = 17;
5396  // Composition states's dataspace.
5397  // Examples: "STANDARD_BT709", "STANDARD_BT601_625".
5398  // See full enum in
5399  // frameworks/native/libs/nativewindow/include/android/data_space.h
5400  optional string dataspace = 18;
5401  // Buffer's pixel format
5402  // Examples: "PIXEL_FORMAT_TRANSLUCENT", "PIXEL_FORMAT_RGBA_8888".
5403  // See full enum in frameworks/native/libs/ui/include/ui/PixelFormat.h
5404  optional string pixel_format = 19;
5405  // The layer's actual color.
5406  optional ColorProto color = 20;
5407  // The layer's requested color.
5408  optional ColorProto requested_color = 21;
5409  // Can be any combination of
5410  //    hidden = 0x01
5411  //    opaque = 0x02,
5412  //    secure = 0x80,
5413  optional uint32 flags = 22;
5414  // The layer's actual transform
5415  optional TransformProto transform = 23;
5416  // The layer's requested transform.
5417  optional TransformProto requested_transform = 24;
5418  // The parent layer. This value can be null if there is no parent.
5419  optional int32 parent = 25;
5420  // The layer that this layer has a z order relative to. This value can be
5421  // null.
5422  optional int32 z_order_relative_of = 26;
5423  // This value can be null if there's nothing to draw.
5424  optional ActiveBufferProto active_buffer = 27;
5425  // The number of frames available.
5426  optional int32 queued_frames = 28;
5427  optional bool refresh_pending = 29;
5428  // The layer's composer backend destination frame
5429  optional RectProto hwc_frame = 30;
5430  // The layer's composer backend source crop
5431  optional FloatRectProto hwc_crop = 31;
5432  // The layer's composer backend transform
5433  optional int32 hwc_transform = 32;
5434  optional int32 window_type = 33 [deprecated = true];
5435  optional int32 app_id = 34 [deprecated = true];
5436  // The layer's composition type
5437  optional HwcCompositionType hwc_composition_type = 35;
5438  // If it's a buffer layer, indicate if the content is protected
5439  optional bool is_protected = 36;
5440  // Current frame number being rendered.
5441  optional uint64 curr_frame = 37;
5442  // A list of barriers that the layer is waiting to update state.
5443  repeated BarrierLayerProto barrier_layer = 38;
5444  // If active_buffer is not null, record its transform.
5445  optional TransformProto buffer_transform = 39;
5446  optional int32 effective_scaling_mode = 40;
5447  // Layer's corner radius.
5448  optional float corner_radius = 41;
5449  // Metadata map. May be empty.
5450  map<int32, string> metadata = 42;
5451
5452  optional TransformProto effective_transform = 43;
5453  optional FloatRectProto source_bounds = 44;
5454  optional FloatRectProto bounds = 45;
5455  optional FloatRectProto screen_bounds = 46;
5456
5457  optional InputWindowInfoProto input_window_info = 47;
5458
5459  // Crop used to draw the rounded corner.
5460  optional FloatRectProto corner_radius_crop = 48;
5461
5462  // length of the shadow to draw around the layer, it may be set on the
5463  // layer or set by a parent layer.
5464  optional float shadow_radius = 49;
5465  optional ColorTransformProto color_transform = 50;
5466
5467  optional bool is_relative_of = 51;
5468  // Layer's background blur radius in pixels.
5469  optional int32 background_blur_radius = 52;
5470
5471  optional uint32 owner_uid = 53;
5472
5473  // Regions of a layer, where blur should be applied.
5474  repeated BlurRegion blur_regions = 54;
5475
5476  optional bool is_trusted_overlay = 55;
5477
5478  // Corner radius explicitly set on layer rather than inherited
5479  optional float requested_corner_radius = 56;
5480
5481  optional RectProto destination_frame = 57;
5482
5483  optional uint32 original_id = 58;
5484}
5485
5486message PositionProto {
5487  optional float x = 1;
5488  optional float y = 2;
5489}
5490
5491message FloatRectProto {
5492  optional float left = 1;
5493  optional float top = 2;
5494  optional float right = 3;
5495  optional float bottom = 4;
5496}
5497
5498message ActiveBufferProto {
5499  optional uint32 width = 1;
5500  optional uint32 height = 2;
5501  optional uint32 stride = 3;
5502  optional int32 format = 4;
5503  optional uint64 usage = 5;
5504}
5505
5506message BarrierLayerProto {
5507  // layer id the barrier is waiting on.
5508  optional int32 id = 1;
5509  // frame number the barrier is waiting on.
5510  optional uint64 frame_number = 2;
5511}
5512
5513// End of protos/perfetto/trace/android/surfaceflinger_layers.proto
5514
5515// Begin of protos/perfetto/trace/android/surfaceflinger_transactions.proto
5516
5517// Message used by Winscope to process legacy trace files.
5518// Represents a file full of surface flinger transactions.
5519// Encoded, it should start with 0x54 0x4E 0x58 0x54 0x52 0x41 0x43 0x45
5520// (.TNXTRACE), such that they can be easily identified.
5521message TransactionTraceFile {
5522  // constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 |
5523  // MagicNumber.MAGIC_NUMBER_L (this is needed because enums have to be 32 bits
5524  // and there's no nice way to put 64bit constants into .proto files.
5525  enum MagicNumber {
5526    INVALID = 0;
5527    // TNXT (little-endian ASCII)
5528    MAGIC_NUMBER_L = 0x54584E54;
5529    // RACE (little-endian ASCII)
5530    MAGIC_NUMBER_H = 0x45434152;
5531  }
5532
5533  // Must be the first field, set to value in MagicNumber
5534  optional fixed64 magic_number = 1;
5535  repeated TransactionTraceEntry entry = 2;
5536
5537  // offset between real-time clock and elapsed time clock in nanoseconds.
5538  // Calculated as: systemTime(SYSTEM_TIME_REALTIME) -
5539  // systemTime(SYSTEM_TIME_MONOTONIC)
5540  optional fixed64 real_to_elapsed_time_offset_nanos = 3;
5541  optional uint32 version = 4;
5542}
5543
5544message TransactionTraceEntry {
5545  optional int64 elapsed_realtime_nanos = 1;
5546  optional int64 vsync_id = 2;
5547  repeated TransactionState transactions = 3;
5548  repeated LayerCreationArgs added_layers = 4;
5549  repeated uint32 destroyed_layers = 5;
5550  repeated DisplayState added_displays = 6;
5551  repeated int32 removed_displays = 7;
5552  repeated uint32 destroyed_layer_handles = 8;
5553  optional bool displays_changed = 9;
5554  repeated DisplayInfo displays = 10;
5555}
5556
5557message DisplayInfo {
5558  optional uint32 layer_stack = 1;
5559  optional int32 display_id = 2;
5560  optional int32 logical_width = 3;
5561  optional int32 logical_height = 4;
5562  optional Transform transform_inverse = 5;
5563  optional Transform transform = 6;
5564  optional bool receives_input = 7;
5565  optional bool is_secure = 8;
5566  optional bool is_primary = 9;
5567  optional bool is_virtual = 10;
5568  optional int32 rotation_flags = 11;
5569  optional int32 transform_hint = 12;
5570}
5571
5572message LayerCreationArgs {
5573  optional uint32 layer_id = 1;
5574  optional string name = 2;
5575  optional uint32 flags = 3;
5576  optional uint32 parent_id = 4;
5577  optional uint32 mirror_from_id = 5;
5578  optional bool add_to_root = 6;
5579  optional uint32 layer_stack_to_mirror = 7;
5580}
5581
5582message Transform {
5583  optional float dsdx = 1;
5584  optional float dtdx = 2;
5585  optional float dtdy = 3;
5586  optional float dsdy = 4;
5587  optional float tx = 5;
5588  optional float ty = 6;
5589}
5590
5591message TransactionState {
5592  optional int32 pid = 1;
5593  optional int32 uid = 2;
5594  optional int64 vsync_id = 3;
5595  optional int32 input_event_id = 4;
5596  optional int64 post_time = 5;
5597  optional uint64 transaction_id = 6;
5598  repeated LayerState layer_changes = 7;
5599  repeated DisplayState display_changes = 8;
5600  repeated uint64 merged_transaction_ids = 9;
5601}
5602
5603// Keep insync with layer_state_t
5604message LayerState {
5605  optional uint32 layer_id = 1;
5606  // Changes are split into ChangesLsb and ChangesMsb. First 32 bits are in
5607  // ChangesLsb and the next 32 bits are in ChangesMsb. This is needed because
5608  // enums have to be 32 bits and there's no nice way to put 64bit constants
5609  // into .proto files.
5610  enum ChangesLsb {
5611    eChangesLsbNone = 0;
5612    ePositionChanged = 0x00000001;
5613    eLayerChanged = 0x00000002;
5614    // unused = 0x00000004;
5615    eAlphaChanged = 0x00000008;
5616
5617    eMatrixChanged = 0x00000010;
5618    eTransparentRegionChanged = 0x00000020;
5619    eFlagsChanged = 0x00000040;
5620    eLayerStackChanged = 0x00000080;
5621
5622    eReleaseBufferListenerChanged = 0x00000400;
5623    eShadowRadiusChanged = 0x00000800;
5624
5625    eBufferCropChanged = 0x00002000;
5626    eRelativeLayerChanged = 0x00004000;
5627    eReparent = 0x00008000;
5628
5629    eColorChanged = 0x00010000;
5630    eBufferTransformChanged = 0x00040000;
5631    eTransformToDisplayInverseChanged = 0x00080000;
5632
5633    eCropChanged = 0x00100000;
5634    eBufferChanged = 0x00200000;
5635    eAcquireFenceChanged = 0x00400000;
5636    eDataspaceChanged = 0x00800000;
5637
5638    eHdrMetadataChanged = 0x01000000;
5639    eSurfaceDamageRegionChanged = 0x02000000;
5640    eApiChanged = 0x04000000;
5641    eSidebandStreamChanged = 0x08000000;
5642
5643    eColorTransformChanged = 0x10000000;
5644    eHasListenerCallbacksChanged = 0x20000000;
5645    eInputInfoChanged = 0x40000000;
5646    // 0x80000000; (proto stores enums as signed int)
5647    eCornerRadiusChanged = -2147483648;
5648  };
5649  enum ChangesMsb {
5650    eChangesMsbNone = 0;
5651    eDestinationFrameChanged = 0x1;
5652    eCachedBufferChanged = 0x2;
5653    eBackgroundColorChanged = 0x4;
5654    eMetadataChanged = 0x8;
5655    eColorSpaceAgnosticChanged = 0x10;
5656    eFrameRateSelectionPriority = 0x20;
5657    eFrameRateChanged = 0x40;
5658    eBackgroundBlurRadiusChanged = 0x80;
5659    eProducerDisconnect = 0x100;
5660    eFixedTransformHintChanged = 0x200;
5661    eFrameNumberChanged = 0x400;
5662    eBlurRegionsChanged = 0x800;
5663    eAutoRefreshChanged = 0x1000;
5664    eStretchChanged = 0x2000;
5665    eTrustedOverlayChanged = 0x4000;
5666    eDropInputModeChanged = 0x8000;
5667  };
5668  optional uint64 what = 2;
5669  optional float x = 3;
5670  optional float y = 4;
5671  optional int32 z = 5;
5672  optional uint32 w = 6;
5673  optional uint32 h = 7;
5674  optional uint32 layer_stack = 8;
5675
5676  enum Flags {
5677    eFlagsNone = 0;
5678    eLayerHidden = 0x01;
5679    eLayerOpaque = 0x02;
5680    eLayerSkipScreenshot = 0x40;
5681    eLayerSecure = 0x80;
5682    eEnableBackpressure = 0x100;
5683    eLayerIsDisplayDecoration = 0x200;
5684  };
5685  optional uint32 flags = 9;
5686  optional uint32 mask = 10;
5687
5688  message Matrix22 {
5689    optional float dsdx = 1;
5690    optional float dtdx = 2;
5691    optional float dtdy = 3;
5692    optional float dsdy = 4;
5693  };
5694  optional Matrix22 matrix = 11;
5695  optional float corner_radius = 12;
5696  optional uint32 background_blur_radius = 13;
5697  optional uint32 parent_id = 14;
5698  optional uint32 relative_parent_id = 15;
5699
5700  optional float alpha = 16;
5701  message Color3 {
5702    optional float r = 1;
5703    optional float g = 2;
5704    optional float b = 3;
5705  }
5706  optional Color3 color = 17;
5707  optional RegionProto transparent_region = 18;
5708  optional uint32 transform = 19;
5709  optional bool transform_to_display_inverse = 20;
5710  optional RectProto crop = 21;
5711
5712  message BufferData {
5713    optional uint64 buffer_id = 1;
5714    optional uint32 width = 2;
5715    optional uint32 height = 3;
5716    optional uint64 frame_number = 4;
5717
5718    enum BufferDataChange {
5719      BufferDataChangeNone = 0;
5720      fenceChanged = 0x01;
5721      frameNumberChanged = 0x02;
5722      cachedBufferChanged = 0x04;
5723    }
5724    optional uint32 flags = 5;
5725    optional uint64 cached_buffer_id = 6;
5726
5727    enum PixelFormat {
5728      PIXEL_FORMAT_UNKNOWN = 0;
5729      PIXEL_FORMAT_CUSTOM = -4;
5730      PIXEL_FORMAT_TRANSLUCENT = -3;
5731      PIXEL_FORMAT_TRANSPARENT = -2;
5732      PIXEL_FORMAT_OPAQUE = -1;
5733      PIXEL_FORMAT_RGBA_8888 = 1;
5734      PIXEL_FORMAT_RGBX_8888 = 2;
5735      PIXEL_FORMAT_RGB_888 = 3;
5736      PIXEL_FORMAT_RGB_565 = 4;
5737      PIXEL_FORMAT_BGRA_8888 = 5;
5738      PIXEL_FORMAT_RGBA_5551 = 6;
5739      PIXEL_FORMAT_RGBA_4444 = 7;
5740      PIXEL_FORMAT_RGBA_FP16 = 22;
5741      PIXEL_FORMAT_RGBA_1010102 = 43;
5742      PIXEL_FORMAT_R_8 = 0x38;
5743    }
5744    optional PixelFormat pixel_format = 7;
5745    optional uint64 usage = 8;
5746  }
5747  optional BufferData buffer_data = 22;
5748  optional int32 api = 23;
5749  optional bool has_sideband_stream = 24;
5750  optional ColorTransformProto color_transform = 25;
5751  repeated BlurRegion blur_regions = 26;
5752
5753  message WindowInfo {
5754    optional uint32 layout_params_flags = 1;
5755    optional int32 layout_params_type = 2;
5756    optional RegionProto touchable_region = 3;
5757    optional int32 surface_inset = 4;
5758    // unused
5759    optional bool focusable = 5;
5760    // unused
5761    optional bool has_wallpaper = 6;
5762    optional float global_scale_factor = 7;
5763    optional uint32 crop_layer_id = 8;
5764    optional bool replace_touchable_region_with_crop = 9;
5765    optional RectProto touchable_region_crop = 10;
5766    optional Transform transform = 11;
5767    optional uint32 input_config = 12;
5768  }
5769  optional WindowInfo window_info_handle = 27;
5770  optional float bg_color_alpha = 28;
5771  optional int32 bg_color_dataspace = 29;
5772  optional bool color_space_agnostic = 30;
5773  optional float shadow_radius = 31;
5774  optional int32 frame_rate_selection_priority = 32;
5775  optional float frame_rate = 33;
5776  optional int32 frame_rate_compatibility = 34;
5777  optional int32 change_frame_rate_strategy = 35;
5778  optional uint32 fixed_transform_hint = 36;
5779  optional uint64 frame_number = 37;
5780  optional bool auto_refresh = 38;
5781  optional bool is_trusted_overlay = 39;
5782  optional RectProto buffer_crop = 40;
5783  optional RectProto destination_frame = 41;
5784
5785  enum DropInputMode {
5786    NONE = 0;
5787    ALL = 1;
5788    OBSCURED = 2;
5789  };
5790  optional DropInputMode drop_input_mode = 42;
5791}
5792
5793message DisplayState {
5794  enum Changes {
5795    eChangesNone = 0;
5796    eSurfaceChanged = 0x01;
5797    eLayerStackChanged = 0x02;
5798    eDisplayProjectionChanged = 0x04;
5799    eDisplaySizeChanged = 0x08;
5800    eFlagsChanged = 0x10;
5801  };
5802  optional int32 id = 1;
5803  optional uint32 what = 2;
5804  optional uint32 flags = 3;
5805  optional uint32 layer_stack = 4;
5806  optional uint32 orientation = 5;
5807  optional RectProto layer_stack_space_rect = 6;
5808  optional RectProto oriented_display_space_rect = 7;
5809  optional uint32 width = 8;
5810  optional uint32 height = 9;
5811}
5812
5813// End of protos/perfetto/trace/android/surfaceflinger_transactions.proto
5814
5815// Begin of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
5816
5817// This message is not intended to be written by the chrome on the device.
5818// It's emitted on the host by the telemetry benchmark infrastructure (it's a
5819// part of the trace that's written by the telemetry tracing agent).
5820message ChromeBenchmarkMetadata {
5821  // Time when the benchmark execution started (host unixtime in microseconds).
5822  optional int64 benchmark_start_time_us = 1;
5823
5824  // Time when this particular story was run (host unixtime in microseconds).
5825  optional int64 story_run_time_us = 2;
5826
5827  // Name of benchmark.
5828  optional string benchmark_name = 3;
5829
5830  // Description of benchmark.
5831  optional string benchmark_description = 4;
5832
5833  // Optional label.
5834  optional string label = 5;
5835
5836  // Name of story.
5837  optional string story_name = 6;
5838
5839  // List of story tags.
5840  repeated string story_tags = 7;
5841
5842  // Index of the story run (>0 if the same story was run several times).
5843  optional int32 story_run_index = 8;
5844
5845  // Whether this run failed.
5846  optional bool had_failures = 9;
5847}
5848
5849// End of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
5850
5851// Begin of protos/perfetto/trace/chrome/chrome_metadata.proto
5852
5853// Metadata for chrome traces.
5854message ChromeMetadataPacket {
5855  optional BackgroundTracingMetadata background_tracing_metadata = 1;
5856
5857  // Version code of Chrome used by Android's Play Store. This field is only set
5858  // on Android.
5859  optional int32 chrome_version_code = 2;
5860
5861  // Comma separated list of enabled categories for tracing. The list of
5862  // possible category strings are listed in code
5863  // base/trace_event/builtin_categories.h.
5864  optional string enabled_categories = 3;
5865
5866  // Finch name and group based on the ActiveGroupId.
5867  message FinchHash {
5868    optional uint32 name = 1;
5869    optional uint32 group = 2;
5870  }
5871
5872  // List of Finch study/groups that apply to this trace.
5873  repeated FinchHash field_trial_hashes = 4;
5874}
5875
5876// Metadata related to background tracing scenarios, states and triggers.
5877message BackgroundTracingMetadata {
5878  // Information about a trigger rule defined in the experiment config.
5879  message TriggerRule {
5880    enum TriggerType {
5881      TRIGGER_UNSPECIFIED = 0;
5882
5883      // Traces are triggered by specific range of values of an UMA histogram.
5884      MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1;
5885
5886      // Traces are triggered by specific named events in chromium codebase,
5887      // like "second-update-failure".
5888      MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2;
5889    }
5890    optional TriggerType trigger_type = 1;
5891
5892    // Configuration of histogram trigger.
5893    message HistogramRule {
5894      // UMA histogram name hash, same as HistogramEventProto.name_hash.
5895      optional fixed64 histogram_name_hash = 1;
5896
5897      // Range of values of the histogram that activates trigger.
5898      optional int64 histogram_min_trigger = 2;
5899      optional int64 histogram_max_trigger = 3;
5900    }
5901    optional HistogramRule histogram_rule = 2;
5902
5903    // Configuration of named trigger.
5904    message NamedRule {
5905      enum EventType {
5906        UNSPECIFIED = 0;
5907        SESSION_RESTORE = 1;
5908        NAVIGATION = 2;
5909        STARTUP = 3;
5910        REACHED_CODE = 4;
5911        CONTENT_TRIGGER = 5;
5912
5913        TEST_RULE = 1000;
5914      }
5915      optional EventType event_type = 1;
5916
5917      // If |event_type| is CONTENT_TRIGGER, then this stores the hash of the
5918      // content-trigger that actually fired.
5919      optional fixed64 content_trigger_name_hash = 2;
5920    }
5921    optional NamedRule named_rule = 3;
5922
5923    // Hash of the rule name.
5924    optional fixed32 name_hash = 4;
5925  }
5926
5927  // Specifies the rule that caused the trace to be uploaded.
5928  optional TriggerRule triggered_rule = 1;
5929
5930  // List of all active triggers in current session, when trace was triggered.
5931  repeated TriggerRule active_rules = 2;
5932
5933  // Hash of the scenario name.
5934  optional fixed32 scenario_name_hash = 3;
5935}
5936
5937// End of protos/perfetto/trace/chrome/chrome_metadata.proto
5938
5939// Begin of protos/perfetto/trace/chrome/chrome_trace_event.proto
5940
5941message ChromeTracedValue {
5942  enum NestedType {
5943    DICT = 0;
5944    ARRAY = 1;
5945  }
5946  optional NestedType nested_type = 1;
5947
5948  repeated string dict_keys = 2;
5949  repeated ChromeTracedValue dict_values = 3;
5950  repeated ChromeTracedValue array_values = 4;
5951  optional int32 int_value = 5;
5952  optional double double_value = 6;
5953  optional bool bool_value = 7;
5954  optional string string_value = 8;
5955}
5956
5957message ChromeStringTableEntry {
5958  optional string value = 1;
5959  optional int32 index = 2;
5960}
5961
5962// Deprecated, use TrackEvent protos instead.
5963message ChromeTraceEvent {
5964  message Arg {
5965    optional string name = 1;
5966
5967    oneof value {
5968      bool bool_value = 2;
5969      uint64 uint_value = 3;
5970      int64 int_value = 4;
5971      double double_value = 5;
5972      string string_value = 6;
5973      // Pointers are stored in a separate type as the JSON output treats them
5974      // differently from other uint64 values.
5975      uint64 pointer_value = 7;
5976      string json_value = 8;
5977      ChromeTracedValue traced_value = 10;
5978    }
5979
5980    // Takes precedence over |name| if set,
5981    // and is an index into |string_table|.
5982    optional uint32 name_index = 9;
5983  }
5984
5985  optional string name = 1;
5986  optional int64 timestamp = 2;
5987  optional int32 phase = 3;
5988  optional int32 thread_id = 4;
5989  optional int64 duration = 5;
5990  optional int64 thread_duration = 6;
5991  optional string scope = 7;
5992  optional uint64 id = 8;
5993  optional uint32 flags = 9;
5994  optional string category_group_name = 10;
5995  optional int32 process_id = 11;
5996  optional int64 thread_timestamp = 12;
5997  optional uint64 bind_id = 13;
5998
5999  repeated Arg args = 14;
6000
6001  // Takes precedence over respectively |name| and
6002  // |category_group_name_index| if set,
6003  // and are indices into |string_table|.
6004  optional uint32 name_index = 15;
6005  optional uint32 category_group_name_index = 16;
6006}
6007
6008message ChromeMetadata {
6009  optional string name = 1;
6010
6011  oneof value {
6012    string string_value = 2;
6013    bool bool_value = 3;
6014    int64 int_value = 4;
6015    string json_value = 5;
6016  }
6017}
6018
6019// Subtraces produced in legacy json format by Chrome tracing agents not yet
6020// updated to support the new binary format, e.g. ETW and CrOS ARC.
6021// TODO(eseckler): Update these agents to become perfetto producers.
6022message ChromeLegacyJsonTrace {
6023  enum TraceType {
6024    USER_TRACE = 0;
6025
6026    // Deprecated.
6027    SYSTEM_TRACE = 1;
6028  }
6029  optional TraceType type = 1;
6030  optional string data = 2;
6031}
6032
6033message ChromeEventBundle {
6034  // Deprecated, use TrackEvent protos instead.
6035  repeated ChromeTraceEvent trace_events = 1 [deprecated = true];
6036  // TODO(ssid): This should be deprecated in favor of ChromeMetadataPacket
6037  // which contains typed fields.
6038  repeated ChromeMetadata metadata = 2;
6039  // ftrace output from CrOS and Cast system tracing agents.
6040  // TODO(eseckler): Replace system traces with native perfetto service.
6041  repeated string legacy_ftrace_output = 4;
6042  repeated ChromeLegacyJsonTrace legacy_json_trace = 5;
6043
6044  // Contents of a string table that's valid for
6045  // the whole ChromeEventBundle entry.
6046  repeated ChromeStringTableEntry string_table = 3 [deprecated = true];
6047}
6048
6049// End of protos/perfetto/trace/chrome/chrome_trace_event.proto
6050
6051// Begin of protos/perfetto/trace/chrome/chrome_trigger.proto
6052
6053// Information about a specific trigger during a background tracing scenario
6054// Associated packet timestamps are useful to delimitate a scenario range in a
6055// trace. Triggers are also useful for filtering traces.
6056message ChromeTrigger {
6057  // Name of the trigger which was received.
6058  optional string trigger_name = 1;
6059  // SHA1 hash of the trigger name.
6060  optional fixed32 trigger_name_hash = 2;
6061}
6062
6063// End of protos/perfetto/trace/chrome/chrome_trigger.proto
6064
6065// Begin of protos/perfetto/trace/chrome/v8.proto
6066
6067// These are the protos for the V8 data source.
6068//
6069// All events are associated to a V8 isolate instance. There can be multiple
6070// instances associated to a given thread, although this is rare.
6071//
6072// Generated code in V8 is allocated in the V8 heap (in a special executeable
6073// section), this means that code can be garbage collected (when no longer used)
6074// or can be moved around (e.g. during heap compactation). This means that a
6075// given callsite might correspond to function `A` at one point in time and to
6076// function `B` later on.
6077// In addition V8 code has various levels of optimization, so a function might
6078// have multiple associated code snippets.
6079//
6080// V8 does not track code deletion, so we have to indirectly infer it by
6081// detecting code overlaps, if a newer code creation event overlaps with older
6082// code we need to asume that the old code was deleted. Code moves are logged,
6083// and there is an event to track those.
6084
6085// Strings used by V8 can have different encodings, instead of coverting to a
6086// common encoding (e.g. UTF-8) on device is expensive. Instead we send the
6087// "raw" string and do the convestion at trace ingestion time.
6088//
6089// ATTENTION: There is some overhead in using a message (as opossed to having
6090// the `oneof encoded_string`` direcly embedded in the message), so use this
6091// message in places were these extra bytes don't matter that much.
6092// Next id: 5
6093message V8String {
6094  oneof encoded_string {
6095    // ISO/IEC 8859-1:1998 encoding aka latin1
6096    // https://en.wikipedia.org/wiki/ISO/IEC_8859-1
6097    bytes latin1 = 1;
6098    // UTF-16 Little Endian Encoding
6099    bytes utf16_le = 2;
6100    // UTF-16 Big Endian Encoding
6101    bytes utf16_be = 3;
6102  }
6103}
6104
6105// Interned version of V8String
6106message InternedV8String {
6107  optional uint64 iid = 1;
6108  // We inline the fields in V8String here to save some bytes in the serialized
6109  // proto format. Interning is about saving bytes so this makes sense here.
6110  oneof encoded_string {
6111    // ISO/IEC 8859-1:1998 encoding aka latin1
6112    // https://en.wikipedia.org/wiki/ISO/IEC_8859-1
6113    bytes latin1 = 2;
6114    // UTF-16 Little Endian Encoding
6115    bytes utf16_le = 3;
6116    // UTF-16 Big Endian Encoding
6117    bytes utf16_be = 4;
6118  }
6119}
6120
6121// Represents a script that was compiled to generate code. Some V8 code is
6122// generated out of scripts and will reference a V8Script other types of code
6123// will not (e.g. builtins).
6124message InternedV8JsScript {
6125  optional uint64 iid = 1;
6126  // Unique in a given isolate
6127  optional int32 script_id = 2;
6128
6129  enum Type {
6130    TYPE_UNKNOWN = 0;
6131    TYPE_NORMAL = 1;
6132    TYPE_EVAL = 2;
6133    TYPE_MODULE = 3;
6134    TYPE_NATIVE = 4;
6135    TYPE_EXTENSION = 5;
6136    TYPE_INSPECTOR = 6;
6137  }
6138
6139  optional Type type = 3;
6140  optional V8String name = 4;
6141  // Actual source of the script
6142  optional V8String source = 5;
6143}
6144
6145message InternedV8WasmScript {
6146  optional uint64 iid = 1;
6147  // Unique in a given isolate
6148  optional int32 script_id = 2;
6149
6150  optional string url = 3;
6151}
6152
6153message InternedV8JsFunction {
6154  enum Kind {
6155    KIND_UNKNOWN = 0;
6156    KIND_NORMAL_FUNCTION = 1;
6157    KIND_MODULE = 2;
6158    KIND_ASYNC_MODULE = 3;
6159    KIND_BASE_CONSTRUCTOR = 4;
6160    KIND_DEFAULT_BASE_CONSTRUCTOR = 5;
6161    KIND_DEFAULT_DERIVED_CONSTRUCTOR = 6;
6162    KIND_DERIVED_CONSTRUCTOR = 7;
6163    KIND_GETTER_FUNCTION = 8;
6164    KIND_STATIC_GETTER_FUNCTION = 9;
6165    KIND_SETTER_FUNCTION = 10;
6166    KIND_STATIC_SETTER_FUNCTION = 11;
6167    KIND_ARROW_FUNCTION = 12;
6168    KIND_ASYNC_ARROW_FUNCTION = 13;
6169    KIND_ASYNC_FUNCTION = 14;
6170    KIND_ASYNC_CONCISE_METHOD = 15;
6171    KIND_STATIC_ASYNC_CONCISE_METHOD = 16;
6172    KIND_ASYNC_CONCISE_GENERATOR_METHOD = 17;
6173    KIND_STATIC_ASYNC_CONCISE_GENERATOR_METHOD = 18;
6174    KIND_ASYNC_GENERATOR_FUNCTION = 19;
6175    KIND_GENERATOR_FUNCTION = 20;
6176    KIND_CONCISE_GENERATOR_METHOD = 21;
6177    KIND_STATIC_CONCISE_GENERATOR_METHOD = 22;
6178    KIND_CONCISE_METHOD = 23;
6179    KIND_STATIC_CONCISE_METHOD = 24;
6180    KIND_CLASS_MEMBERS_INITIALIZER_FUNCTION = 25;
6181    KIND_CLASS_STATIC_INITIALIZER_FUNCTION = 26;
6182    KIND_INVALID = 27;
6183  }
6184  optional uint64 iid = 1;
6185  optional uint64 v8_js_function_name_iid = 2;
6186  optional uint64 v8_js_script_iid = 3;
6187
6188  optional bool is_toplevel = 4;
6189  optional Kind kind = 5;
6190
6191  // Where in the script source this function is defined. This is counted in
6192  // bytes not characters.
6193  optional uint32 byte_offset = 6;
6194}
6195
6196// A V8 Isolate instance. A V8 Isolate represents an isolated instance of the V8
6197// engine.
6198message InternedV8Isolate {
6199  optional uint64 iid = 1;
6200
6201  optional uint32 pid = 2;
6202
6203  // Process unique isolate id.
6204  optional int32 isolate_id = 3;
6205
6206  // A code range is a virtual memory cage that may contain executable code.
6207  // Depending on the Isolate settings the Isolate might have one or not.
6208  // See:
6209  // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/code-range.h
6210  // If the isolate defines code range this will be tracked here.
6211  message CodeRange {
6212    optional uint64 base_address = 1;
6213    optional uint64 size = 2;
6214    // Used when short builtin calls are enabled, where embedded builtins are
6215    // copied into the CodeRange so calls can be nearer.
6216    optional uint64 embedded_blob_code_copy_start_address = 3;
6217    // Whether this code range is shared with other Isolates in the same process
6218    optional bool is_process_wide = 4;
6219  }
6220  optional CodeRange code_range = 4;
6221  // The embedded blob holds code for built in functions that are precompiled in
6222  // the V8 library.
6223  optional uint64 embedded_blob_code_start_address = 5;
6224  optional uint64 embedded_blob_code_size = 6;
6225}
6226
6227message V8JsCode {
6228  enum Tier {
6229    TIER_UNKNOWN = 0;
6230    TIER_IGNITION = 1;
6231    TIER_SPARKPLUG = 2;
6232    TIER_MAGLEV = 3;
6233    TIER_TURBOSHAFT = 4;
6234    TIER_TURBOFAN = 5;
6235  }
6236  optional uint64 v8_isolate_iid = 1;
6237  optional uint32 tid = 2;
6238  optional uint64 v8_js_function_iid = 3;
6239  optional Tier tier = 4;
6240
6241  optional uint64 instruction_start = 5;
6242  optional uint64 instruction_size_bytes = 6;
6243  oneof instructions {
6244    bytes machine_code = 7;
6245    bytes bytecode = 8;
6246  }
6247}
6248
6249message V8InternalCode {
6250  enum Type {
6251    TYPE_UNKNOWN = 0;
6252    TYPE_BYTECODE_HANDLER = 1;
6253    TYPE_FOR_TESTING = 2;
6254    TYPE_BUILTIN = 3;
6255    TYPE_WASM_FUNCTION = 4;
6256    TYPE_WASM_TO_CAPI_FUNCTION = 5;
6257    TYPE_WASM_TO_JS_FUNCTION = 6;
6258    TYPE_JS_TO_WASM_FUNCTION = 7;
6259    TYPE_JS_TO_JS_FUNCTION = 8;
6260    TYPE_C_WASM_ENTRY = 9;
6261  }
6262  optional uint64 v8_isolate_iid = 1;
6263  optional uint32 tid = 2;
6264  optional string name = 3;
6265  optional Type type = 4;
6266  optional int32 builtin_id = 5;
6267
6268  optional uint64 instruction_start = 6;
6269  optional uint64 instruction_size_bytes = 7;
6270  optional bytes machine_code = 8;
6271}
6272
6273message V8WasmCode {
6274  enum Tier {
6275    TIER_UNKNOWN = 0;
6276    TIER_LIFTOFF = 1;
6277    TIER_TURBOFAN = 2;
6278  }
6279  optional uint64 v8_isolate_iid = 1;
6280  optional uint32 tid = 2;
6281  optional uint64 v8_wasm_script_iid = 3;
6282  optional string function_name = 4;
6283
6284  optional Tier tier = 5;
6285  optional int32 code_offset_in_module = 6;
6286
6287  optional uint64 instruction_start = 7;
6288  optional uint64 instruction_size_bytes = 8;
6289  optional bytes machine_code = 9;
6290}
6291
6292message V8RegExpCode {
6293  optional uint64 v8_isolate_iid = 1;
6294  optional uint32 tid = 2;
6295  optional V8String pattern = 3;
6296
6297  optional uint64 instruction_start = 4;
6298  optional uint64 instruction_size_bytes = 5;
6299  optional bytes machine_code = 6;
6300}
6301
6302// Move event for V8 code (JS / Wasm / Internal / Regexp) that was relocated in
6303// memory by V8's GC.
6304message V8CodeMove {
6305  optional uint64 isolate_iid = 1;
6306  optional uint32 tid = 2;
6307  optional uint64 from_instruction_start_address = 3;
6308  optional uint64 to_instruction_start_address = 4;
6309  optional uint64 instruction_size_bytes = 5;
6310  oneof to_instructions {
6311    bytes to_machine_code = 6;
6312    bytes to_bytecode = 7;
6313  }
6314}
6315
6316message V8CodeDefaults {
6317  optional uint32 tid = 1;
6318}
6319// End of protos/perfetto/trace/chrome/v8.proto
6320
6321// Begin of protos/perfetto/trace/clock_snapshot.proto
6322
6323// A snapshot of clock readings to allow for trace alignment.
6324message ClockSnapshot {
6325  message Clock {
6326    // DEPRECATED. This enum has moved to ../common/builtin_clock.proto.
6327    enum BuiltinClocks {
6328      UNKNOWN = 0;
6329      REALTIME = 1;
6330      REALTIME_COARSE = 2;
6331      MONOTONIC = 3;
6332      MONOTONIC_COARSE = 4;
6333      MONOTONIC_RAW = 5;
6334      BOOTTIME = 6;
6335      BUILTIN_CLOCK_MAX_ID = 63;
6336
6337      reserved 7, 8;
6338    }
6339
6340    // Clock IDs have the following semantic:
6341    // [1, 63]:    Builtin types, see BuiltinClock from
6342    //             ../common/builtin_clock.proto.
6343    // [64, 127]:  User-defined clocks. These clocks are sequence-scoped. They
6344    //             are only valid within the same |trusted_packet_sequence_id|
6345    //             (i.e. only for TracePacket(s) emitted by the same TraceWriter
6346    //             that emitted the clock snapshot).
6347    // [128, MAX]: Reserved for future use. The idea is to allow global clock
6348    //             IDs and setting this ID to hash(full_clock_name) & ~127.
6349    optional uint32 clock_id = 1;
6350
6351    // Absolute timestamp. Unit is ns unless specified otherwise by the
6352    // unit_multiplier_ns field below.
6353    optional uint64 timestamp = 2;
6354
6355    // When true each TracePacket's timestamp should be interpreted as a delta
6356    // from the last TracePacket's timestamp (referencing this clock) emitted by
6357    // the same packet_sequence_id. Should only be used for user-defined
6358    // sequence-local clocks. The first packet timestamp after each
6359    // ClockSnapshot that contains this clock is relative to the |timestamp| in
6360    // the ClockSnapshot.
6361    optional bool is_incremental = 3;
6362
6363    // Allows to specify a custom unit different than the default (ns) for this
6364    // clock domain. A multiplier of 1000 means that a timestamp = 3 should be
6365    // interpreted as 3000 ns = 3 us. All snapshots for the same clock within a
6366    // trace need to use the same unit.
6367    optional uint64 unit_multiplier_ns = 4;
6368  }
6369  repeated Clock clocks = 1;
6370
6371  // The authoritative clock domain for the trace. Defaults to BOOTTIME, but can
6372  // be overridden in TraceConfig's builtin_data_sources. Trace processor will
6373  // attempt to translate packet/event timestamps from various data sources (and
6374  // their chosen clock domains) to this domain during import.
6375  optional BuiltinClock primary_trace_clock = 2;
6376}
6377
6378// End of protos/perfetto/trace/clock_snapshot.proto
6379
6380// Begin of protos/perfetto/trace/etw/etw.proto
6381
6382// Proto definition based on the Thread_v2 CSwitch class definition
6383// See: https://learn.microsoft.com/en-us/windows/win32/etw/cswitch
6384message CSwitchEtwEvent {
6385  // New thread ID after the switch.
6386  optional uint32 new_thread_id = 1;
6387
6388  // Previous thread ID.
6389  optional uint32 old_thread_id = 2;
6390
6391  // Thread priority of the new thread.
6392  optional sint32 new_thread_priority = 3;
6393
6394  // Thread priority of the previous thread.
6395  optional sint32 old_thread_priority = 4;
6396
6397  // The index of the C-state that was last used by the processor. A value of 0
6398  // represents the lightest idle state with higher values representing deeper
6399  // C-states.
6400  optional uint32 previous_c_state = 5;
6401
6402  // Wait reason for the previous thread. The ordering is important as based on
6403  // the OldThreadWaitReason definition from the link above. The following are
6404  // the possible values:
6405  enum OldThreadWaitReason {
6406    EXECUTIVE = 0;
6407    FREE_PAGE = 1;
6408    PAGE_IN = 2;
6409    POOL_ALLOCATION = 3;
6410    DELAY_EXECUTION = 4;
6411    SUSPEND = 5;
6412    USER_REQUEST = 6;
6413    WR_EXECUTIVE = 7;
6414    WR_FREE_PAGE = 8;
6415    WR_PAGE_IN = 9;
6416    WR_POOL_ALLOCATION = 10;
6417    WR_DELAY_EXECUTION = 11;
6418    WR_SUSPENDED = 12;
6419    WR_USER_REQUEST = 13;
6420    WR_EVENT_PAIR = 14;
6421    WR_QUEUE = 15;
6422    WR_LPC_RECEIVER = 16;
6423    WR_LPC_REPLY = 17;
6424    WR_VIRTUAL_MEMORY = 18;
6425    WR_PAGE_OUT = 19;
6426    WR_RENDEZ_VOUS = 20;
6427    WR_KEYED_EVENT = 21;
6428    WR_TERMINATED = 22;
6429    WR_PROCESS_IN_SWAP = 23;
6430    WR_CPU_RATE_CONTROL = 24;
6431    WR_CALLOUT_STACK = 25;
6432    WR_KERNEL = 26;
6433    WR_RESOURCE = 27;
6434    WR_PUSH_LOCK = 28;
6435    WR_MUTEX = 29;
6436    WR_QUANTUM_END = 30;
6437    WR_DISPATCH_INT = 31;
6438    WR_PREEMPTED = 32;
6439    WR_YIELD_EXECUTION = 33;
6440    WR_FAST_MUTEX = 34;
6441    WR_GUARD_MUTEX = 35;
6442    WR_RUNDOWN = 36;
6443    MAXIMUM_WAIT_REASON = 37;
6444  }
6445
6446  optional OldThreadWaitReason old_thread_wait_reason = 6;
6447
6448  // Wait mode for the previous thread. The ordering is important as based on
6449  // the OldThreadWaitMode definition from the link above. The following are the
6450  // possible values:
6451  enum OldThreadWaitMode {
6452    KERNEL_MODE = 0;
6453    USER_MODE = 1;
6454  }
6455
6456  optional OldThreadWaitMode old_thread_wait_mode = 7;
6457
6458  // State of the previous thread. The ordering is important as based on the
6459  // OldThreadState definition from the link above. The following are the
6460  // possible state values:
6461  enum OldThreadState {
6462    INITIALIZED = 0;
6463    READY = 1;
6464    RUNNING = 2;
6465    STANDBY = 3;
6466    TERMINATED = 4;
6467    WAITING = 5;
6468    TRANSITION = 6;
6469    DEFERRED_READY = 7;
6470  }
6471
6472  optional OldThreadState old_thread_state = 8;
6473
6474  // Ideal wait time of the previous thread.
6475  optional sint32 old_thread_wait_ideal_processor = 9;
6476
6477  // Wait time for the new thread.
6478  optional uint32 new_thread_wait_time = 10;
6479}
6480
6481// Proto definition based on the Thread_v2 CSwitch class definition
6482// See: https://learn.microsoft.com/en-us/windows/win32/etw/readythread
6483message ReadyThreadEtwEvent {
6484  // The thread identifier of the thread being readied for execution.
6485  optional uint32 t_thread_id = 1;
6486
6487  // The reason for the priority boost. The ordering is important as based on
6488  // the AdjustReason definition from the link above.
6489  enum AdjustReason {
6490    IGNORE_THE_INCREMENT = 0;
6491    // Apply the increment, which will decay incrementally at the end of each
6492    // quantum.
6493    APPLY_INCREMENT = 1;
6494    // Apply the increment as a boost that will decay in its entirety at quantum
6495    // (typically for priority donation).
6496    APPLY_INCREMENT_BOOST = 2;
6497  }
6498
6499  optional AdjustReason adjust_reason = 2;
6500
6501  //  The value by which the priority is being adjusted.
6502  optional sint32 adjust_increment = 3;
6503
6504  enum TraceFlag {
6505    TRACE_FLAG_UNSPECIFIED = 0;
6506    // The thread has been readied from DPC (deferred procedure call).
6507    THREAD_READIED = 0x1;
6508    // The kernel stack is currently swapped out.
6509    KERNEL_STACK_SWAPPED_OUT = 0x2;
6510    // The process address space is swapped out.
6511    PROCESS_ADDRESS_SWAPPED_OUT = 0x4;
6512  }
6513
6514  optional TraceFlag flag = 4;
6515}
6516// End of protos/perfetto/trace/etw/etw.proto
6517
6518// Begin of protos/perfetto/trace/etw/etw_event.proto
6519
6520message EtwTraceEvent {
6521  optional uint64 timestamp = 1;
6522  optional uint32 cpu = 4;
6523
6524  oneof event {
6525    CSwitchEtwEvent c_switch = 2;
6526    ReadyThreadEtwEvent ready_thread = 3;
6527  }
6528}
6529// End of protos/perfetto/trace/etw/etw_event.proto
6530
6531// Begin of protos/perfetto/trace/etw/etw_event_bundle.proto
6532
6533// The result of tracing one or more etw event uses per-processor buffers where
6534// an in-use buffer is assigned to each processor at all times. Therefore,
6535// collecting multiple events they should already be synchronized.
6536message EtwTraceEventBundle {
6537  optional uint32 cpu = 1;
6538  repeated EtwTraceEvent event = 2;
6539}
6540// End of protos/perfetto/trace/etw/etw_event_bundle.proto
6541
6542// Begin of protos/perfetto/common/descriptor.proto
6543
6544// The protocol compiler can output a FileDescriptorSet containing the .proto
6545// files it parses.
6546message FileDescriptorSet {
6547  repeated FileDescriptorProto file = 1;
6548}
6549
6550// Describes a complete .proto file.
6551message FileDescriptorProto {
6552  // file name, relative to root of source tree
6553  optional string name = 1;
6554  // e.g. "foo", "foo.bar", etc.
6555  optional string package = 2;
6556
6557  // Names of files imported by this file.
6558  repeated string dependency = 3;
6559  // Indexes of the public imported files in the dependency list above.
6560  repeated int32 public_dependency = 10;
6561  // Indexes of the weak imported files in the dependency list.
6562  // For Google-internal migration only. Do not use.
6563  repeated int32 weak_dependency = 11;
6564
6565  // All top-level definitions in this file.
6566  repeated DescriptorProto message_type = 4;
6567  repeated EnumDescriptorProto enum_type = 5;
6568  repeated FieldDescriptorProto extension = 7;
6569
6570  reserved 6;
6571  reserved 8;
6572  reserved 9;
6573  reserved 12;
6574}
6575
6576// Describes a message type.
6577message DescriptorProto {
6578  optional string name = 1;
6579
6580  repeated FieldDescriptorProto field = 2;
6581  repeated FieldDescriptorProto extension = 6;
6582
6583  repeated DescriptorProto nested_type = 3;
6584  repeated EnumDescriptorProto enum_type = 4;
6585
6586  reserved 5;
6587
6588  repeated OneofDescriptorProto oneof_decl = 8;
6589
6590  reserved 7;
6591
6592  // Range of reserved tag numbers. Reserved tag numbers may not be used by
6593  // fields or extension ranges in the same message. Reserved ranges may
6594  // not overlap.
6595  message ReservedRange {
6596    // Inclusive.
6597    optional int32 start = 1;
6598    // Exclusive.
6599    optional int32 end = 2;
6600  }
6601  repeated ReservedRange reserved_range = 9;
6602  // Reserved field names, which may not be used by fields in the same message.
6603  // A given name may only be reserved once.
6604  repeated string reserved_name = 10;
6605}
6606
6607// A message representing a option the parser does not recognize. This only
6608// appears in options protos created by the compiler::Parser class.
6609// DescriptorPool resolves these when building Descriptor objects. Therefore,
6610// options protos in descriptor objects (e.g. returned by Descriptor::options(),
6611// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
6612// in them.
6613message UninterpretedOption {
6614  // The name of the uninterpreted option.  Each string represents a segment in
6615  // a dot-separated name.  is_extension is true iff a segment represents an
6616  // extension (denoted with parentheses in options specs in .proto files).
6617  // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
6618  // "foo.(bar.baz).moo".
6619  message NamePart {
6620    optional string name_part = 1;
6621    optional bool is_extension = 2;
6622  }
6623  repeated NamePart name = 2;
6624
6625  // The value of the uninterpreted option, in whatever type the tokenizer
6626  // identified it as during parsing. Exactly one of these should be set.
6627  optional string identifier_value = 3;
6628  optional uint64 positive_int_value = 4;
6629  optional int64 negative_int_value = 5;
6630  optional double double_value = 6;
6631  optional bytes string_value = 7;
6632  optional string aggregate_value = 8;
6633}
6634
6635message FieldOptions {
6636  // The packed option can be enabled for repeated primitive fields to enable
6637  // a more efficient representation on the wire. Rather than repeatedly
6638  // writing the tag and type for each element, the entire array is encoded as
6639  // a single length-delimited blob. In proto3, only explicit setting it to
6640  // false will avoid using packed encoding.
6641  optional bool packed = 2;
6642
6643  // The parser stores options it doesn't recognize here. See above.
6644  repeated UninterpretedOption uninterpreted_option = 999;
6645}
6646
6647// Describes a field within a message.
6648message FieldDescriptorProto {
6649  enum Type {
6650    // 0 is reserved for errors.
6651    // Order is weird for historical reasons.
6652    TYPE_DOUBLE = 1;
6653    TYPE_FLOAT = 2;
6654    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
6655    // negative values are likely.
6656    TYPE_INT64 = 3;
6657    TYPE_UINT64 = 4;
6658    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
6659    // negative values are likely.
6660    TYPE_INT32 = 5;
6661    TYPE_FIXED64 = 6;
6662    TYPE_FIXED32 = 7;
6663    TYPE_BOOL = 8;
6664    TYPE_STRING = 9;
6665    // Tag-delimited aggregate.
6666    // Group type is deprecated and not supported in proto3. However, Proto3
6667    // implementations should still be able to parse the group wire format and
6668    // treat group fields as unknown fields.
6669    TYPE_GROUP = 10;
6670    // Length-delimited aggregate.
6671    TYPE_MESSAGE = 11;
6672
6673    // New in version 2.
6674    TYPE_BYTES = 12;
6675    TYPE_UINT32 = 13;
6676    TYPE_ENUM = 14;
6677    TYPE_SFIXED32 = 15;
6678    TYPE_SFIXED64 = 16;
6679    // Uses ZigZag encoding.
6680    TYPE_SINT32 = 17;
6681    // Uses ZigZag encoding.
6682    TYPE_SINT64 = 18;
6683  };
6684
6685  enum Label {
6686    // 0 is reserved for errors
6687    LABEL_OPTIONAL = 1;
6688    LABEL_REQUIRED = 2;
6689    LABEL_REPEATED = 3;
6690  };
6691
6692  optional string name = 1;
6693  optional int32 number = 3;
6694  optional Label label = 4;
6695
6696  // If type_name is set, this need not be set.  If both this and type_name
6697  // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
6698  optional Type type = 5;
6699
6700  // For message and enum types, this is the name of the type.  If the name
6701  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
6702  // rules are used to find the type (i.e. first the nested types within this
6703  // message are searched, then within the parent, on up to the root
6704  // namespace).
6705  optional string type_name = 6;
6706
6707  // For extensions, this is the name of the type being extended.  It is
6708  // resolved in the same manner as type_name.
6709  optional string extendee = 2;
6710
6711  // For numeric types, contains the original text representation of the value.
6712  // For booleans, "true" or "false".
6713  // For strings, contains the default text contents (not escaped in any way).
6714  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
6715  // TODO(kenton):  Base-64 encode?
6716  optional string default_value = 7;
6717
6718  optional FieldOptions options = 8;
6719
6720  // If set, gives the index of a oneof in the containing type's oneof_decl
6721  // list.  This field is a member of that oneof.
6722  optional int32 oneof_index = 9;
6723
6724  reserved 10;
6725}
6726
6727// Describes a oneof.
6728message OneofDescriptorProto {
6729  optional string name = 1;
6730  optional OneofOptions options = 2;
6731}
6732
6733// Describes an enum type.
6734message EnumDescriptorProto {
6735  optional string name = 1;
6736
6737  repeated EnumValueDescriptorProto value = 2;
6738
6739  reserved 3;
6740  reserved 4;
6741
6742  // Reserved enum value names, which may not be reused. A given name may only
6743  // be reserved once.
6744  repeated string reserved_name = 5;
6745}
6746
6747// Describes a value within an enum.
6748message EnumValueDescriptorProto {
6749  optional string name = 1;
6750  optional int32 number = 2;
6751
6752  reserved 3;
6753}
6754
6755message OneofOptions {
6756  reserved 999;
6757
6758  // Clients can define custom options in extensions of this message. See above.
6759  extensions 1000 to max;
6760}
6761
6762// End of protos/perfetto/common/descriptor.proto
6763
6764// Begin of protos/perfetto/trace/extension_descriptor.proto
6765
6766// This message contains descriptors used to parse extension fields of
6767// TrackEvent.
6768//
6769// See docs/design-docs/extensions.md for more details.
6770message ExtensionDescriptor {
6771  optional FileDescriptorSet extension_set = 1;
6772}
6773
6774// End of protos/perfetto/trace/extension_descriptor.proto
6775
6776// Begin of protos/perfetto/trace/filesystem/inode_file_map.proto
6777
6778// Represents the mapping between inode numbers in a block device and their path
6779// on the filesystem
6780message InodeFileMap {
6781  // Representation of Entry
6782  message Entry {
6783    optional uint64 inode_number = 1;
6784
6785    // The path to the file, e.g. "etc/file.xml"
6786    // List of strings for multiple hardlinks
6787    repeated string paths = 2;
6788
6789    // The file type
6790    enum Type {
6791      UNKNOWN = 0;
6792      FILE = 1;
6793      DIRECTORY = 2;
6794    }
6795    optional Type type = 3;
6796  }
6797
6798  optional uint64 block_device_id = 1;
6799
6800  // The mount points of the block device, e.g. ["system"].
6801  repeated string mount_points = 2;
6802
6803  // The list of all the entries from the block device
6804  repeated Entry entries = 3;
6805}
6806
6807// End of protos/perfetto/trace/filesystem/inode_file_map.proto
6808
6809// Begin of protos/perfetto/trace/ftrace/android_fs.proto
6810
6811message AndroidFsDatareadEndFtraceEvent {
6812  optional int32 bytes = 1;
6813  optional uint64 ino = 2;
6814  optional int64 offset = 3;
6815}
6816message AndroidFsDatareadStartFtraceEvent {
6817  optional int32 bytes = 1;
6818  optional string cmdline = 2;
6819  optional int64 i_size = 3;
6820  optional uint64 ino = 4;
6821  optional int64 offset = 5;
6822  optional string pathbuf = 6;
6823  optional int32 pid = 7;
6824}
6825message AndroidFsDatawriteEndFtraceEvent {
6826  optional int32 bytes = 1;
6827  optional uint64 ino = 2;
6828  optional int64 offset = 3;
6829}
6830message AndroidFsDatawriteStartFtraceEvent {
6831  optional int32 bytes = 1;
6832  optional string cmdline = 2;
6833  optional int64 i_size = 3;
6834  optional uint64 ino = 4;
6835  optional int64 offset = 5;
6836  optional string pathbuf = 6;
6837  optional int32 pid = 7;
6838}
6839message AndroidFsFsyncEndFtraceEvent {
6840  optional int32 bytes = 1;
6841  optional uint64 ino = 2;
6842  optional int64 offset = 3;
6843}
6844message AndroidFsFsyncStartFtraceEvent {
6845  optional string cmdline = 1;
6846  optional int64 i_size = 2;
6847  optional uint64 ino = 3;
6848  optional string pathbuf = 4;
6849  optional int32 pid = 5;
6850}
6851
6852// End of protos/perfetto/trace/ftrace/android_fs.proto
6853
6854// Begin of protos/perfetto/trace/ftrace/binder.proto
6855
6856message BinderTransactionFtraceEvent {
6857  optional int32 debug_id = 1;
6858  optional int32 target_node = 2;
6859  optional int32 to_proc = 3;
6860  optional int32 to_thread = 4;
6861  optional int32 reply = 5;
6862  optional uint32 code = 6;
6863  optional uint32 flags = 7;
6864}
6865message BinderTransactionReceivedFtraceEvent {
6866  optional int32 debug_id = 1;
6867}
6868message BinderSetPriorityFtraceEvent {
6869  optional int32 proc = 1;
6870  optional int32 thread = 2;
6871  optional uint32 old_prio = 3;
6872  optional uint32 new_prio = 4;
6873  optional uint32 desired_prio = 5;
6874}
6875message BinderLockFtraceEvent {
6876  optional string tag = 1;
6877}
6878message BinderLockedFtraceEvent {
6879  optional string tag = 1;
6880}
6881message BinderUnlockFtraceEvent {
6882  optional string tag = 1;
6883}
6884message BinderTransactionAllocBufFtraceEvent {
6885  optional uint64 data_size = 1;
6886  optional int32 debug_id = 2;
6887  optional uint64 offsets_size = 3;
6888  optional uint64 extra_buffers_size = 4;
6889}
6890message BinderCommandFtraceEvent {
6891  optional uint32 cmd = 1;
6892}
6893message BinderReturnFtraceEvent {
6894  optional uint32 cmd = 1;
6895}
6896
6897// End of protos/perfetto/trace/ftrace/binder.proto
6898
6899// Begin of protos/perfetto/trace/ftrace/block.proto
6900
6901message BlockRqIssueFtraceEvent {
6902  optional uint64 dev = 1;
6903  optional uint64 sector = 2;
6904  optional uint32 nr_sector = 3;
6905  optional uint32 bytes = 4;
6906  optional string rwbs = 5;
6907  optional string comm = 6;
6908  optional string cmd = 7;
6909}
6910message BlockBioBackmergeFtraceEvent {
6911  optional uint64 dev = 1;
6912  optional uint64 sector = 2;
6913  optional uint32 nr_sector = 3;
6914  optional string rwbs = 4;
6915  optional string comm = 5;
6916}
6917message BlockBioBounceFtraceEvent {
6918  optional uint64 dev = 1;
6919  optional uint64 sector = 2;
6920  optional uint32 nr_sector = 3;
6921  optional string rwbs = 4;
6922  optional string comm = 5;
6923}
6924message BlockBioCompleteFtraceEvent {
6925  optional uint64 dev = 1;
6926  optional uint64 sector = 2;
6927  optional uint32 nr_sector = 3;
6928  optional int32 error = 4;
6929  optional string rwbs = 5;
6930}
6931message BlockBioFrontmergeFtraceEvent {
6932  optional uint64 dev = 1;
6933  optional uint64 sector = 2;
6934  optional uint32 nr_sector = 3;
6935  optional string rwbs = 4;
6936  optional string comm = 5;
6937}
6938message BlockBioQueueFtraceEvent {
6939  optional uint64 dev = 1;
6940  optional uint64 sector = 2;
6941  optional uint32 nr_sector = 3;
6942  optional string rwbs = 4;
6943  optional string comm = 5;
6944}
6945message BlockBioRemapFtraceEvent {
6946  optional uint64 dev = 1;
6947  optional uint64 sector = 2;
6948  optional uint32 nr_sector = 3;
6949  optional uint64 old_dev = 4;
6950  optional uint64 old_sector = 5;
6951  optional string rwbs = 6;
6952}
6953message BlockDirtyBufferFtraceEvent {
6954  optional uint64 dev = 1;
6955  optional uint64 sector = 2;
6956  optional uint64 size = 3;
6957}
6958message BlockGetrqFtraceEvent {
6959  optional uint64 dev = 1;
6960  optional uint64 sector = 2;
6961  optional uint32 nr_sector = 3;
6962  optional string rwbs = 4;
6963  optional string comm = 5;
6964}
6965message BlockPlugFtraceEvent {
6966  optional string comm = 1;
6967}
6968message BlockRqAbortFtraceEvent {
6969  optional uint64 dev = 1;
6970  optional uint64 sector = 2;
6971  optional uint32 nr_sector = 3;
6972  optional int32 errors = 4;
6973  optional string rwbs = 5;
6974  optional string cmd = 6;
6975}
6976message BlockRqCompleteFtraceEvent {
6977  optional uint64 dev = 1;
6978  optional uint64 sector = 2;
6979  optional uint32 nr_sector = 3;
6980  optional int32 errors = 4;
6981  optional string rwbs = 5;
6982  optional string cmd = 6;
6983  optional int32 error = 7;
6984}
6985message BlockRqInsertFtraceEvent {
6986  optional uint64 dev = 1;
6987  optional uint64 sector = 2;
6988  optional uint32 nr_sector = 3;
6989  optional uint32 bytes = 4;
6990  optional string rwbs = 5;
6991  optional string comm = 6;
6992  optional string cmd = 7;
6993}
6994message BlockRqRemapFtraceEvent {
6995  optional uint64 dev = 1;
6996  optional uint64 sector = 2;
6997  optional uint32 nr_sector = 3;
6998  optional uint64 old_dev = 4;
6999  optional uint64 old_sector = 5;
7000  optional uint32 nr_bios = 6;
7001  optional string rwbs = 7;
7002}
7003message BlockRqRequeueFtraceEvent {
7004  optional uint64 dev = 1;
7005  optional uint64 sector = 2;
7006  optional uint32 nr_sector = 3;
7007  optional int32 errors = 4;
7008  optional string rwbs = 5;
7009  optional string cmd = 6;
7010}
7011message BlockSleeprqFtraceEvent {
7012  optional uint64 dev = 1;
7013  optional uint64 sector = 2;
7014  optional uint32 nr_sector = 3;
7015  optional string rwbs = 4;
7016  optional string comm = 5;
7017}
7018message BlockSplitFtraceEvent {
7019  optional uint64 dev = 1;
7020  optional uint64 sector = 2;
7021  optional uint64 new_sector = 3;
7022  optional string rwbs = 4;
7023  optional string comm = 5;
7024}
7025message BlockTouchBufferFtraceEvent {
7026  optional uint64 dev = 1;
7027  optional uint64 sector = 2;
7028  optional uint64 size = 3;
7029}
7030message BlockUnplugFtraceEvent {
7031  optional int32 nr_rq = 1;
7032  optional string comm = 2;
7033}
7034
7035// End of protos/perfetto/trace/ftrace/block.proto
7036
7037// Begin of protos/perfetto/trace/ftrace/cgroup.proto
7038
7039message CgroupAttachTaskFtraceEvent {
7040  optional int32 dst_root = 1;
7041  optional int32 dst_id = 2;
7042  optional int32 pid = 3;
7043  optional string comm = 4;
7044  optional string cname = 5;
7045  optional int32 dst_level = 6;
7046  optional string dst_path = 7;
7047}
7048message CgroupMkdirFtraceEvent {
7049  optional int32 root = 1;
7050  optional int32 id = 2;
7051  optional string cname = 3;
7052  optional int32 level = 4;
7053  optional string path = 5;
7054}
7055message CgroupRemountFtraceEvent {
7056  optional int32 root = 1;
7057  optional uint32 ss_mask = 2;
7058  optional string name = 3;
7059}
7060message CgroupRmdirFtraceEvent {
7061  optional int32 root = 1;
7062  optional int32 id = 2;
7063  optional string cname = 3;
7064  optional int32 level = 4;
7065  optional string path = 5;
7066}
7067message CgroupTransferTasksFtraceEvent {
7068  optional int32 dst_root = 1;
7069  optional int32 dst_id = 2;
7070  optional int32 pid = 3;
7071  optional string comm = 4;
7072  optional string cname = 5;
7073  optional int32 dst_level = 6;
7074  optional string dst_path = 7;
7075}
7076message CgroupDestroyRootFtraceEvent {
7077  optional int32 root = 1;
7078  optional uint32 ss_mask = 2;
7079  optional string name = 3;
7080}
7081message CgroupReleaseFtraceEvent {
7082  optional int32 root = 1;
7083  optional int32 id = 2;
7084  optional string cname = 3;
7085  optional int32 level = 4;
7086  optional string path = 5;
7087}
7088message CgroupRenameFtraceEvent {
7089  optional int32 root = 1;
7090  optional int32 id = 2;
7091  optional string cname = 3;
7092  optional int32 level = 4;
7093  optional string path = 5;
7094}
7095message CgroupSetupRootFtraceEvent {
7096  optional int32 root = 1;
7097  optional uint32 ss_mask = 2;
7098  optional string name = 3;
7099}
7100
7101// End of protos/perfetto/trace/ftrace/cgroup.proto
7102
7103// Begin of protos/perfetto/trace/ftrace/clk.proto
7104
7105message ClkEnableFtraceEvent {
7106  optional string name = 1;
7107}
7108message ClkDisableFtraceEvent {
7109  optional string name = 1;
7110}
7111message ClkSetRateFtraceEvent {
7112  optional string name = 1;
7113  optional uint64 rate = 2;
7114}
7115
7116// End of protos/perfetto/trace/ftrace/clk.proto
7117
7118// Begin of protos/perfetto/trace/ftrace/cma.proto
7119
7120message CmaAllocStartFtraceEvent {
7121  optional uint32 align = 1;
7122  optional uint32 count = 2;
7123  optional string name = 3;
7124}
7125message CmaAllocInfoFtraceEvent {
7126  optional uint32 align = 1;
7127  optional uint32 count = 2;
7128  optional uint32 err_iso = 3;
7129  optional uint32 err_mig = 4;
7130  optional uint32 err_test = 5;
7131  optional string name = 6;
7132  optional uint64 nr_mapped = 7;
7133  optional uint64 nr_migrated = 8;
7134  optional uint64 nr_reclaimed = 9;
7135  optional uint64 pfn = 10;
7136}
7137
7138// End of protos/perfetto/trace/ftrace/cma.proto
7139
7140// Begin of protos/perfetto/trace/ftrace/compaction.proto
7141
7142message MmCompactionBeginFtraceEvent {
7143  optional uint64 zone_start = 1;
7144  optional uint64 migrate_pfn = 2;
7145  optional uint64 free_pfn = 3;
7146  optional uint64 zone_end = 4;
7147  optional uint32 sync = 5;
7148}
7149message MmCompactionDeferCompactionFtraceEvent {
7150  optional int32 nid = 1;
7151  optional uint32 idx = 2;
7152  optional int32 order = 3;
7153  optional uint32 considered = 4;
7154  optional uint32 defer_shift = 5;
7155  optional int32 order_failed = 6;
7156}
7157message MmCompactionDeferredFtraceEvent {
7158  optional int32 nid = 1;
7159  optional uint32 idx = 2;
7160  optional int32 order = 3;
7161  optional uint32 considered = 4;
7162  optional uint32 defer_shift = 5;
7163  optional int32 order_failed = 6;
7164}
7165message MmCompactionDeferResetFtraceEvent {
7166  optional int32 nid = 1;
7167  optional uint32 idx = 2;
7168  optional int32 order = 3;
7169  optional uint32 considered = 4;
7170  optional uint32 defer_shift = 5;
7171  optional int32 order_failed = 6;
7172}
7173message MmCompactionEndFtraceEvent {
7174  optional uint64 zone_start = 1;
7175  optional uint64 migrate_pfn = 2;
7176  optional uint64 free_pfn = 3;
7177  optional uint64 zone_end = 4;
7178  optional uint32 sync = 5;
7179  optional int32 status = 6;
7180}
7181message MmCompactionFinishedFtraceEvent {
7182  optional int32 nid = 1;
7183  optional uint32 idx = 2;
7184  optional int32 order = 3;
7185  optional int32 ret = 4;
7186}
7187message MmCompactionIsolateFreepagesFtraceEvent {
7188  optional uint64 start_pfn = 1;
7189  optional uint64 end_pfn = 2;
7190  optional uint64 nr_scanned = 3;
7191  optional uint64 nr_taken = 4;
7192}
7193message MmCompactionIsolateMigratepagesFtraceEvent {
7194  optional uint64 start_pfn = 1;
7195  optional uint64 end_pfn = 2;
7196  optional uint64 nr_scanned = 3;
7197  optional uint64 nr_taken = 4;
7198}
7199message MmCompactionKcompactdSleepFtraceEvent {
7200  optional int32 nid = 1;
7201}
7202message MmCompactionKcompactdWakeFtraceEvent {
7203  optional int32 nid = 1;
7204  optional int32 order = 2;
7205  optional uint32 classzone_idx = 3;
7206  optional uint32 highest_zoneidx = 4;
7207}
7208message MmCompactionMigratepagesFtraceEvent {
7209  optional uint64 nr_migrated = 1;
7210  optional uint64 nr_failed = 2;
7211}
7212message MmCompactionSuitableFtraceEvent {
7213  optional int32 nid = 1;
7214  optional uint32 idx = 2;
7215  optional int32 order = 3;
7216  optional int32 ret = 4;
7217}
7218message MmCompactionTryToCompactPagesFtraceEvent {
7219  optional int32 order = 1;
7220  optional uint32 gfp_mask = 2;
7221  optional uint32 mode = 3;
7222  optional int32 prio = 4;
7223}
7224message MmCompactionWakeupKcompactdFtraceEvent {
7225  optional int32 nid = 1;
7226  optional int32 order = 2;
7227  optional uint32 classzone_idx = 3;
7228  optional uint32 highest_zoneidx = 4;
7229}
7230
7231// End of protos/perfetto/trace/ftrace/compaction.proto
7232
7233// Begin of protos/perfetto/trace/ftrace/cpuhp.proto
7234
7235message CpuhpExitFtraceEvent {
7236  optional uint32 cpu = 1;
7237  optional int32 idx = 2;
7238  optional int32 ret = 3;
7239  optional int32 state = 4;
7240}
7241message CpuhpMultiEnterFtraceEvent {
7242  optional uint32 cpu = 1;
7243  optional uint64 fun = 2;
7244  optional int32 idx = 3;
7245  optional int32 target = 4;
7246}
7247message CpuhpEnterFtraceEvent {
7248  optional uint32 cpu = 1;
7249  optional uint64 fun = 2;
7250  optional int32 idx = 3;
7251  optional int32 target = 4;
7252}
7253message CpuhpLatencyFtraceEvent {
7254  optional uint32 cpu = 1;
7255  optional int32 ret = 2;
7256  optional uint32 state = 3;
7257  optional uint64 time = 4;
7258}
7259message CpuhpPauseFtraceEvent {
7260  optional uint32 active_cpus = 1;
7261  optional uint32 cpus = 2;
7262  optional uint32 pause = 3;
7263  optional uint32 time = 4;
7264}
7265
7266// End of protos/perfetto/trace/ftrace/cpuhp.proto
7267
7268// Begin of protos/perfetto/trace/ftrace/cros_ec.proto
7269
7270message CrosEcSensorhubDataFtraceEvent {
7271  optional int64 current_time = 1;
7272  optional int64 current_timestamp = 2;
7273  optional int64 delta = 3;
7274  optional uint32 ec_fifo_timestamp = 4;
7275  optional uint32 ec_sensor_num = 5;
7276  optional int64 fifo_timestamp = 6;
7277}
7278
7279// End of protos/perfetto/trace/ftrace/cros_ec.proto
7280
7281// Begin of protos/perfetto/trace/ftrace/dma_fence.proto
7282
7283message DmaFenceInitFtraceEvent {
7284  optional uint32 context = 1;
7285  optional string driver = 2;
7286  optional uint32 seqno = 3;
7287  optional string timeline = 4;
7288}
7289message DmaFenceEmitFtraceEvent {
7290  optional uint32 context = 1;
7291  optional string driver = 2;
7292  optional uint32 seqno = 3;
7293  optional string timeline = 4;
7294}
7295message DmaFenceSignaledFtraceEvent {
7296  optional uint32 context = 1;
7297  optional string driver = 2;
7298  optional uint32 seqno = 3;
7299  optional string timeline = 4;
7300}
7301message DmaFenceWaitStartFtraceEvent {
7302  optional uint32 context = 1;
7303  optional string driver = 2;
7304  optional uint32 seqno = 3;
7305  optional string timeline = 4;
7306}
7307message DmaFenceWaitEndFtraceEvent {
7308  optional uint32 context = 1;
7309  optional string driver = 2;
7310  optional uint32 seqno = 3;
7311  optional string timeline = 4;
7312}
7313
7314// End of protos/perfetto/trace/ftrace/dma_fence.proto
7315
7316// Begin of protos/perfetto/trace/ftrace/dmabuf_heap.proto
7317
7318message DmaHeapStatFtraceEvent {
7319  optional uint64 inode = 1;
7320  optional int64 len = 2;
7321  optional uint64 total_allocated = 3;
7322}
7323
7324// End of protos/perfetto/trace/ftrace/dmabuf_heap.proto
7325
7326// Begin of protos/perfetto/trace/ftrace/dpu.proto
7327
7328message DpuTracingMarkWriteFtraceEvent {
7329  optional int32 pid = 1;
7330  optional string trace_name = 2;
7331  optional uint32 trace_begin = 3;
7332  optional string name = 4;
7333  optional uint32 type = 5;
7334  optional int32 value = 6;
7335}
7336message DpuDsiCmdFifoStatusFtraceEvent {
7337  optional uint32 header = 1;
7338  optional uint32 payload = 2;
7339}
7340message DpuDsiRxFtraceEvent {
7341  optional uint32 cmd = 1;
7342  optional uint32 rx_buf = 2;
7343}
7344message DpuDsiTxFtraceEvent {
7345  optional uint32 type = 1;
7346  optional uint32 tx_buf = 2;
7347  optional uint32 last = 3;
7348  optional uint32 delay_ms = 4;
7349}
7350
7351// End of protos/perfetto/trace/ftrace/dpu.proto
7352
7353// Begin of protos/perfetto/trace/ftrace/drm.proto
7354
7355message DrmVblankEventFtraceEvent {
7356  optional int32 crtc = 1;
7357  optional uint32 high_prec = 2;
7358  optional uint32 seq = 3;
7359  optional int64 time = 4;
7360}
7361message DrmVblankEventDeliveredFtraceEvent {
7362  optional int32 crtc = 1;
7363  optional uint64 file = 2;
7364  optional uint32 seq = 3;
7365}
7366
7367// End of protos/perfetto/trace/ftrace/drm.proto
7368
7369// Begin of protos/perfetto/trace/ftrace/ext4.proto
7370
7371message Ext4DaWriteBeginFtraceEvent {
7372  optional uint64 dev = 1;
7373  optional uint64 ino = 2;
7374  optional int64 pos = 3;
7375  optional uint32 len = 4;
7376  optional uint32 flags = 5;
7377}
7378message Ext4DaWriteEndFtraceEvent {
7379  optional uint64 dev = 1;
7380  optional uint64 ino = 2;
7381  optional int64 pos = 3;
7382  optional uint32 len = 4;
7383  optional uint32 copied = 5;
7384}
7385message Ext4SyncFileEnterFtraceEvent {
7386  optional uint64 dev = 1;
7387  optional uint64 ino = 2;
7388  optional uint64 parent = 3;
7389  optional int32 datasync = 4;
7390}
7391message Ext4SyncFileExitFtraceEvent {
7392  optional uint64 dev = 1;
7393  optional uint64 ino = 2;
7394  optional int32 ret = 3;
7395}
7396message Ext4AllocDaBlocksFtraceEvent {
7397  optional uint64 dev = 1;
7398  optional uint64 ino = 2;
7399  optional uint32 data_blocks = 3;
7400  optional uint32 meta_blocks = 4;
7401}
7402message Ext4AllocateBlocksFtraceEvent {
7403  optional uint64 dev = 1;
7404  optional uint64 ino = 2;
7405  optional uint64 block = 3;
7406  optional uint32 len = 4;
7407  optional uint32 logical = 5;
7408  optional uint32 lleft = 6;
7409  optional uint32 lright = 7;
7410  optional uint64 goal = 8;
7411  optional uint64 pleft = 9;
7412  optional uint64 pright = 10;
7413  optional uint32 flags = 11;
7414}
7415message Ext4AllocateInodeFtraceEvent {
7416  optional uint64 dev = 1;
7417  optional uint64 ino = 2;
7418  optional uint64 dir = 3;
7419  optional uint32 mode = 4;
7420}
7421message Ext4BeginOrderedTruncateFtraceEvent {
7422  optional uint64 dev = 1;
7423  optional uint64 ino = 2;
7424  optional int64 new_size = 3;
7425}
7426message Ext4CollapseRangeFtraceEvent {
7427  optional uint64 dev = 1;
7428  optional uint64 ino = 2;
7429  optional int64 offset = 3;
7430  optional int64 len = 4;
7431}
7432message Ext4DaReleaseSpaceFtraceEvent {
7433  optional uint64 dev = 1;
7434  optional uint64 ino = 2;
7435  optional uint64 i_blocks = 3;
7436  optional int32 freed_blocks = 4;
7437  optional int32 reserved_data_blocks = 5;
7438  optional int32 reserved_meta_blocks = 6;
7439  optional int32 allocated_meta_blocks = 7;
7440  optional uint32 mode = 8;
7441}
7442message Ext4DaReserveSpaceFtraceEvent {
7443  optional uint64 dev = 1;
7444  optional uint64 ino = 2;
7445  optional uint64 i_blocks = 3;
7446  optional int32 reserved_data_blocks = 4;
7447  optional int32 reserved_meta_blocks = 5;
7448  optional uint32 mode = 6;
7449  optional int32 md_needed = 7;
7450}
7451message Ext4DaUpdateReserveSpaceFtraceEvent {
7452  optional uint64 dev = 1;
7453  optional uint64 ino = 2;
7454  optional uint64 i_blocks = 3;
7455  optional int32 used_blocks = 4;
7456  optional int32 reserved_data_blocks = 5;
7457  optional int32 reserved_meta_blocks = 6;
7458  optional int32 allocated_meta_blocks = 7;
7459  optional int32 quota_claim = 8;
7460  optional uint32 mode = 9;
7461}
7462message Ext4DaWritePagesFtraceEvent {
7463  optional uint64 dev = 1;
7464  optional uint64 ino = 2;
7465  optional uint64 first_page = 3;
7466  optional int64 nr_to_write = 4;
7467  optional int32 sync_mode = 5;
7468  optional uint64 b_blocknr = 6;
7469  optional uint32 b_size = 7;
7470  optional uint32 b_state = 8;
7471  optional int32 io_done = 9;
7472  optional int32 pages_written = 10;
7473}
7474message Ext4DaWritePagesExtentFtraceEvent {
7475  optional uint64 dev = 1;
7476  optional uint64 ino = 2;
7477  optional uint64 lblk = 3;
7478  optional uint32 len = 4;
7479  optional uint32 flags = 5;
7480}
7481message Ext4DirectIOEnterFtraceEvent {
7482  optional uint64 dev = 1;
7483  optional uint64 ino = 2;
7484  optional int64 pos = 3;
7485  optional uint64 len = 4;
7486  optional int32 rw = 5;
7487}
7488message Ext4DirectIOExitFtraceEvent {
7489  optional uint64 dev = 1;
7490  optional uint64 ino = 2;
7491  optional int64 pos = 3;
7492  optional uint64 len = 4;
7493  optional int32 rw = 5;
7494  optional int32 ret = 6;
7495}
7496message Ext4DiscardBlocksFtraceEvent {
7497  optional uint64 dev = 1;
7498  optional uint64 blk = 2;
7499  optional uint64 count = 3;
7500}
7501message Ext4DiscardPreallocationsFtraceEvent {
7502  optional uint64 dev = 1;
7503  optional uint64 ino = 2;
7504  optional uint32 len = 3;
7505  optional uint32 needed = 4;
7506}
7507message Ext4DropInodeFtraceEvent {
7508  optional uint64 dev = 1;
7509  optional uint64 ino = 2;
7510  optional int32 drop = 3;
7511}
7512message Ext4EsCacheExtentFtraceEvent {
7513  optional uint64 dev = 1;
7514  optional uint64 ino = 2;
7515  optional uint32 lblk = 3;
7516  optional uint32 len = 4;
7517  optional uint64 pblk = 5;
7518  optional uint32 status = 6;
7519}
7520message Ext4EsFindDelayedExtentRangeEnterFtraceEvent {
7521  optional uint64 dev = 1;
7522  optional uint64 ino = 2;
7523  optional uint32 lblk = 3;
7524}
7525message Ext4EsFindDelayedExtentRangeExitFtraceEvent {
7526  optional uint64 dev = 1;
7527  optional uint64 ino = 2;
7528  optional uint32 lblk = 3;
7529  optional uint32 len = 4;
7530  optional uint64 pblk = 5;
7531  optional uint64 status = 6;
7532}
7533message Ext4EsInsertExtentFtraceEvent {
7534  optional uint64 dev = 1;
7535  optional uint64 ino = 2;
7536  optional uint32 lblk = 3;
7537  optional uint32 len = 4;
7538  optional uint64 pblk = 5;
7539  optional uint64 status = 6;
7540}
7541message Ext4EsLookupExtentEnterFtraceEvent {
7542  optional uint64 dev = 1;
7543  optional uint64 ino = 2;
7544  optional uint32 lblk = 3;
7545}
7546message Ext4EsLookupExtentExitFtraceEvent {
7547  optional uint64 dev = 1;
7548  optional uint64 ino = 2;
7549  optional uint32 lblk = 3;
7550  optional uint32 len = 4;
7551  optional uint64 pblk = 5;
7552  optional uint64 status = 6;
7553  optional int32 found = 7;
7554}
7555message Ext4EsRemoveExtentFtraceEvent {
7556  optional uint64 dev = 1;
7557  optional uint64 ino = 2;
7558  optional int64 lblk = 3;
7559  optional int64 len = 4;
7560}
7561message Ext4EsShrinkFtraceEvent {
7562  optional uint64 dev = 1;
7563  optional int32 nr_shrunk = 2;
7564  optional uint64 scan_time = 3;
7565  optional int32 nr_skipped = 4;
7566  optional int32 retried = 5;
7567}
7568message Ext4EsShrinkCountFtraceEvent {
7569  optional uint64 dev = 1;
7570  optional int32 nr_to_scan = 2;
7571  optional int32 cache_cnt = 3;
7572}
7573message Ext4EsShrinkScanEnterFtraceEvent {
7574  optional uint64 dev = 1;
7575  optional int32 nr_to_scan = 2;
7576  optional int32 cache_cnt = 3;
7577}
7578message Ext4EsShrinkScanExitFtraceEvent {
7579  optional uint64 dev = 1;
7580  optional int32 nr_shrunk = 2;
7581  optional int32 cache_cnt = 3;
7582}
7583message Ext4EvictInodeFtraceEvent {
7584  optional uint64 dev = 1;
7585  optional uint64 ino = 2;
7586  optional int32 nlink = 3;
7587}
7588message Ext4ExtConvertToInitializedEnterFtraceEvent {
7589  optional uint64 dev = 1;
7590  optional uint64 ino = 2;
7591  optional uint32 m_lblk = 3;
7592  optional uint32 m_len = 4;
7593  optional uint32 u_lblk = 5;
7594  optional uint32 u_len = 6;
7595  optional uint64 u_pblk = 7;
7596}
7597message Ext4ExtConvertToInitializedFastpathFtraceEvent {
7598  optional uint64 dev = 1;
7599  optional uint64 ino = 2;
7600  optional uint32 m_lblk = 3;
7601  optional uint32 m_len = 4;
7602  optional uint32 u_lblk = 5;
7603  optional uint32 u_len = 6;
7604  optional uint64 u_pblk = 7;
7605  optional uint32 i_lblk = 8;
7606  optional uint32 i_len = 9;
7607  optional uint64 i_pblk = 10;
7608}
7609message Ext4ExtHandleUnwrittenExtentsFtraceEvent {
7610  optional uint64 dev = 1;
7611  optional uint64 ino = 2;
7612  optional int32 flags = 3;
7613  optional uint32 lblk = 4;
7614  optional uint64 pblk = 5;
7615  optional uint32 len = 6;
7616  optional uint32 allocated = 7;
7617  optional uint64 newblk = 8;
7618}
7619message Ext4ExtInCacheFtraceEvent {
7620  optional uint64 dev = 1;
7621  optional uint64 ino = 2;
7622  optional uint32 lblk = 3;
7623  optional int32 ret = 4;
7624}
7625message Ext4ExtLoadExtentFtraceEvent {
7626  optional uint64 dev = 1;
7627  optional uint64 ino = 2;
7628  optional uint64 pblk = 3;
7629  optional uint32 lblk = 4;
7630}
7631message Ext4ExtMapBlocksEnterFtraceEvent {
7632  optional uint64 dev = 1;
7633  optional uint64 ino = 2;
7634  optional uint32 lblk = 3;
7635  optional uint32 len = 4;
7636  optional uint32 flags = 5;
7637}
7638message Ext4ExtMapBlocksExitFtraceEvent {
7639  optional uint64 dev = 1;
7640  optional uint64 ino = 2;
7641  optional uint32 flags = 3;
7642  optional uint64 pblk = 4;
7643  optional uint32 lblk = 5;
7644  optional uint32 len = 6;
7645  optional uint32 mflags = 7;
7646  optional int32 ret = 8;
7647}
7648message Ext4ExtPutInCacheFtraceEvent {
7649  optional uint64 dev = 1;
7650  optional uint64 ino = 2;
7651  optional uint32 lblk = 3;
7652  optional uint32 len = 4;
7653  optional uint64 start = 5;
7654}
7655message Ext4ExtRemoveSpaceFtraceEvent {
7656  optional uint64 dev = 1;
7657  optional uint64 ino = 2;
7658  optional uint32 start = 3;
7659  optional uint32 end = 4;
7660  optional int32 depth = 5;
7661}
7662message Ext4ExtRemoveSpaceDoneFtraceEvent {
7663  optional uint64 dev = 1;
7664  optional uint64 ino = 2;
7665  optional uint32 start = 3;
7666  optional uint32 end = 4;
7667  optional int32 depth = 5;
7668  optional int64 partial = 6;
7669  optional uint32 eh_entries = 7;
7670  optional uint32 pc_lblk = 8;
7671  optional uint64 pc_pclu = 9;
7672  optional int32 pc_state = 10;
7673}
7674message Ext4ExtRmIdxFtraceEvent {
7675  optional uint64 dev = 1;
7676  optional uint64 ino = 2;
7677  optional uint64 pblk = 3;
7678}
7679message Ext4ExtRmLeafFtraceEvent {
7680  optional uint64 dev = 1;
7681  optional uint64 ino = 2;
7682  optional int64 partial = 3;
7683  optional uint32 start = 4;
7684  optional uint32 ee_lblk = 5;
7685  optional uint64 ee_pblk = 6;
7686  optional int32 ee_len = 7;
7687  optional uint32 pc_lblk = 8;
7688  optional uint64 pc_pclu = 9;
7689  optional int32 pc_state = 10;
7690}
7691message Ext4ExtShowExtentFtraceEvent {
7692  optional uint64 dev = 1;
7693  optional uint64 ino = 2;
7694  optional uint64 pblk = 3;
7695  optional uint32 lblk = 4;
7696  optional uint32 len = 5;
7697}
7698message Ext4FallocateEnterFtraceEvent {
7699  optional uint64 dev = 1;
7700  optional uint64 ino = 2;
7701  optional int64 offset = 3;
7702  optional int64 len = 4;
7703  optional int32 mode = 5;
7704  optional int64 pos = 6;
7705}
7706message Ext4FallocateExitFtraceEvent {
7707  optional uint64 dev = 1;
7708  optional uint64 ino = 2;
7709  optional int64 pos = 3;
7710  optional uint32 blocks = 4;
7711  optional int32 ret = 5;
7712}
7713message Ext4FindDelallocRangeFtraceEvent {
7714  optional uint64 dev = 1;
7715  optional uint64 ino = 2;
7716  optional uint32 from = 3;
7717  optional uint32 to = 4;
7718  optional int32 reverse = 5;
7719  optional int32 found = 6;
7720  optional uint32 found_blk = 7;
7721}
7722message Ext4ForgetFtraceEvent {
7723  optional uint64 dev = 1;
7724  optional uint64 ino = 2;
7725  optional uint64 block = 3;
7726  optional int32 is_metadata = 4;
7727  optional uint32 mode = 5;
7728}
7729message Ext4FreeBlocksFtraceEvent {
7730  optional uint64 dev = 1;
7731  optional uint64 ino = 2;
7732  optional uint64 block = 3;
7733  optional uint64 count = 4;
7734  optional int32 flags = 5;
7735  optional uint32 mode = 6;
7736}
7737message Ext4FreeInodeFtraceEvent {
7738  optional uint64 dev = 1;
7739  optional uint64 ino = 2;
7740  optional uint32 uid = 3;
7741  optional uint32 gid = 4;
7742  optional uint64 blocks = 5;
7743  optional uint32 mode = 6;
7744}
7745message Ext4GetImpliedClusterAllocExitFtraceEvent {
7746  optional uint64 dev = 1;
7747  optional uint32 flags = 2;
7748  optional uint32 lblk = 3;
7749  optional uint64 pblk = 4;
7750  optional uint32 len = 5;
7751  optional int32 ret = 6;
7752}
7753message Ext4GetReservedClusterAllocFtraceEvent {
7754  optional uint64 dev = 1;
7755  optional uint64 ino = 2;
7756  optional uint32 lblk = 3;
7757  optional uint32 len = 4;
7758}
7759message Ext4IndMapBlocksEnterFtraceEvent {
7760  optional uint64 dev = 1;
7761  optional uint64 ino = 2;
7762  optional uint32 lblk = 3;
7763  optional uint32 len = 4;
7764  optional uint32 flags = 5;
7765}
7766message Ext4IndMapBlocksExitFtraceEvent {
7767  optional uint64 dev = 1;
7768  optional uint64 ino = 2;
7769  optional uint32 flags = 3;
7770  optional uint64 pblk = 4;
7771  optional uint32 lblk = 5;
7772  optional uint32 len = 6;
7773  optional uint32 mflags = 7;
7774  optional int32 ret = 8;
7775}
7776message Ext4InsertRangeFtraceEvent {
7777  optional uint64 dev = 1;
7778  optional uint64 ino = 2;
7779  optional int64 offset = 3;
7780  optional int64 len = 4;
7781}
7782message Ext4InvalidatepageFtraceEvent {
7783  optional uint64 dev = 1;
7784  optional uint64 ino = 2;
7785  optional uint64 index = 3;
7786  optional uint64 offset = 4;
7787  optional uint32 length = 5;
7788}
7789message Ext4JournalStartFtraceEvent {
7790  optional uint64 dev = 1;
7791  optional uint64 ip = 2;
7792  optional int32 blocks = 3;
7793  optional int32 rsv_blocks = 4;
7794  optional int32 nblocks = 5;
7795  optional int32 revoke_creds = 6;
7796}
7797message Ext4JournalStartReservedFtraceEvent {
7798  optional uint64 dev = 1;
7799  optional uint64 ip = 2;
7800  optional int32 blocks = 3;
7801}
7802message Ext4JournalledInvalidatepageFtraceEvent {
7803  optional uint64 dev = 1;
7804  optional uint64 ino = 2;
7805  optional uint64 index = 3;
7806  optional uint64 offset = 4;
7807  optional uint32 length = 5;
7808}
7809message Ext4JournalledWriteEndFtraceEvent {
7810  optional uint64 dev = 1;
7811  optional uint64 ino = 2;
7812  optional int64 pos = 3;
7813  optional uint32 len = 4;
7814  optional uint32 copied = 5;
7815}
7816message Ext4LoadInodeFtraceEvent {
7817  optional uint64 dev = 1;
7818  optional uint64 ino = 2;
7819}
7820message Ext4LoadInodeBitmapFtraceEvent {
7821  optional uint64 dev = 1;
7822  optional uint32 group = 2;
7823}
7824message Ext4MarkInodeDirtyFtraceEvent {
7825  optional uint64 dev = 1;
7826  optional uint64 ino = 2;
7827  optional uint64 ip = 3;
7828}
7829message Ext4MbBitmapLoadFtraceEvent {
7830  optional uint64 dev = 1;
7831  optional uint32 group = 2;
7832}
7833message Ext4MbBuddyBitmapLoadFtraceEvent {
7834  optional uint64 dev = 1;
7835  optional uint32 group = 2;
7836}
7837message Ext4MbDiscardPreallocationsFtraceEvent {
7838  optional uint64 dev = 1;
7839  optional int32 needed = 2;
7840}
7841message Ext4MbNewGroupPaFtraceEvent {
7842  optional uint64 dev = 1;
7843  optional uint64 ino = 2;
7844  optional uint64 pa_pstart = 3;
7845  optional uint64 pa_lstart = 4;
7846  optional uint32 pa_len = 5;
7847}
7848message Ext4MbNewInodePaFtraceEvent {
7849  optional uint64 dev = 1;
7850  optional uint64 ino = 2;
7851  optional uint64 pa_pstart = 3;
7852  optional uint64 pa_lstart = 4;
7853  optional uint32 pa_len = 5;
7854}
7855message Ext4MbReleaseGroupPaFtraceEvent {
7856  optional uint64 dev = 1;
7857  optional uint64 pa_pstart = 2;
7858  optional uint32 pa_len = 3;
7859}
7860message Ext4MbReleaseInodePaFtraceEvent {
7861  optional uint64 dev = 1;
7862  optional uint64 ino = 2;
7863  optional uint64 block = 3;
7864  optional uint32 count = 4;
7865}
7866message Ext4MballocAllocFtraceEvent {
7867  optional uint64 dev = 1;
7868  optional uint64 ino = 2;
7869  optional uint32 orig_logical = 3;
7870  optional int32 orig_start = 4;
7871  optional uint32 orig_group = 5;
7872  optional int32 orig_len = 6;
7873  optional uint32 goal_logical = 7;
7874  optional int32 goal_start = 8;
7875  optional uint32 goal_group = 9;
7876  optional int32 goal_len = 10;
7877  optional uint32 result_logical = 11;
7878  optional int32 result_start = 12;
7879  optional uint32 result_group = 13;
7880  optional int32 result_len = 14;
7881  optional uint32 found = 15;
7882  optional uint32 groups = 16;
7883  optional uint32 buddy = 17;
7884  optional uint32 flags = 18;
7885  optional uint32 tail = 19;
7886  optional uint32 cr = 20;
7887}
7888message Ext4MballocDiscardFtraceEvent {
7889  optional uint64 dev = 1;
7890  optional uint64 ino = 2;
7891  optional int32 result_start = 3;
7892  optional uint32 result_group = 4;
7893  optional int32 result_len = 5;
7894}
7895message Ext4MballocFreeFtraceEvent {
7896  optional uint64 dev = 1;
7897  optional uint64 ino = 2;
7898  optional int32 result_start = 3;
7899  optional uint32 result_group = 4;
7900  optional int32 result_len = 5;
7901}
7902message Ext4MballocPreallocFtraceEvent {
7903  optional uint64 dev = 1;
7904  optional uint64 ino = 2;
7905  optional uint32 orig_logical = 3;
7906  optional int32 orig_start = 4;
7907  optional uint32 orig_group = 5;
7908  optional int32 orig_len = 6;
7909  optional uint32 result_logical = 7;
7910  optional int32 result_start = 8;
7911  optional uint32 result_group = 9;
7912  optional int32 result_len = 10;
7913}
7914message Ext4OtherInodeUpdateTimeFtraceEvent {
7915  optional uint64 dev = 1;
7916  optional uint64 ino = 2;
7917  optional uint64 orig_ino = 3;
7918  optional uint32 uid = 4;
7919  optional uint32 gid = 5;
7920  optional uint32 mode = 6;
7921}
7922message Ext4PunchHoleFtraceEvent {
7923  optional uint64 dev = 1;
7924  optional uint64 ino = 2;
7925  optional int64 offset = 3;
7926  optional int64 len = 4;
7927  optional int32 mode = 5;
7928}
7929message Ext4ReadBlockBitmapLoadFtraceEvent {
7930  optional uint64 dev = 1;
7931  optional uint32 group = 2;
7932  optional uint32 prefetch = 3;
7933}
7934message Ext4ReadpageFtraceEvent {
7935  optional uint64 dev = 1;
7936  optional uint64 ino = 2;
7937  optional uint64 index = 3;
7938}
7939message Ext4ReleasepageFtraceEvent {
7940  optional uint64 dev = 1;
7941  optional uint64 ino = 2;
7942  optional uint64 index = 3;
7943}
7944message Ext4RemoveBlocksFtraceEvent {
7945  optional uint64 dev = 1;
7946  optional uint64 ino = 2;
7947  optional uint32 from = 3;
7948  optional uint32 to = 4;
7949  optional int64 partial = 5;
7950  optional uint64 ee_pblk = 6;
7951  optional uint32 ee_lblk = 7;
7952  optional uint32 ee_len = 8;
7953  optional uint32 pc_lblk = 9;
7954  optional uint64 pc_pclu = 10;
7955  optional int32 pc_state = 11;
7956}
7957message Ext4RequestBlocksFtraceEvent {
7958  optional uint64 dev = 1;
7959  optional uint64 ino = 2;
7960  optional uint32 len = 3;
7961  optional uint32 logical = 4;
7962  optional uint32 lleft = 5;
7963  optional uint32 lright = 6;
7964  optional uint64 goal = 7;
7965  optional uint64 pleft = 8;
7966  optional uint64 pright = 9;
7967  optional uint32 flags = 10;
7968}
7969message Ext4RequestInodeFtraceEvent {
7970  optional uint64 dev = 1;
7971  optional uint64 dir = 2;
7972  optional uint32 mode = 3;
7973}
7974message Ext4SyncFsFtraceEvent {
7975  optional uint64 dev = 1;
7976  optional int32 wait = 2;
7977}
7978message Ext4TrimAllFreeFtraceEvent {
7979  optional int32 dev_major = 1;
7980  optional int32 dev_minor = 2;
7981  optional uint32 group = 3;
7982  optional int32 start = 4;
7983  optional int32 len = 5;
7984}
7985message Ext4TrimExtentFtraceEvent {
7986  optional int32 dev_major = 1;
7987  optional int32 dev_minor = 2;
7988  optional uint32 group = 3;
7989  optional int32 start = 4;
7990  optional int32 len = 5;
7991}
7992message Ext4TruncateEnterFtraceEvent {
7993  optional uint64 dev = 1;
7994  optional uint64 ino = 2;
7995  optional uint64 blocks = 3;
7996}
7997message Ext4TruncateExitFtraceEvent {
7998  optional uint64 dev = 1;
7999  optional uint64 ino = 2;
8000  optional uint64 blocks = 3;
8001}
8002message Ext4UnlinkEnterFtraceEvent {
8003  optional uint64 dev = 1;
8004  optional uint64 ino = 2;
8005  optional uint64 parent = 3;
8006  optional int64 size = 4;
8007}
8008message Ext4UnlinkExitFtraceEvent {
8009  optional uint64 dev = 1;
8010  optional uint64 ino = 2;
8011  optional int32 ret = 3;
8012}
8013message Ext4WriteBeginFtraceEvent {
8014  optional uint64 dev = 1;
8015  optional uint64 ino = 2;
8016  optional int64 pos = 3;
8017  optional uint32 len = 4;
8018  optional uint32 flags = 5;
8019}
8020message Ext4WriteEndFtraceEvent {
8021  optional uint64 dev = 1;
8022  optional uint64 ino = 2;
8023  optional int64 pos = 3;
8024  optional uint32 len = 4;
8025  optional uint32 copied = 5;
8026}
8027message Ext4WritepageFtraceEvent {
8028  optional uint64 dev = 1;
8029  optional uint64 ino = 2;
8030  optional uint64 index = 3;
8031}
8032message Ext4WritepagesFtraceEvent {
8033  optional uint64 dev = 1;
8034  optional uint64 ino = 2;
8035  optional int64 nr_to_write = 3;
8036  optional int64 pages_skipped = 4;
8037  optional int64 range_start = 5;
8038  optional int64 range_end = 6;
8039  optional uint64 writeback_index = 7;
8040  optional int32 sync_mode = 8;
8041  optional uint32 for_kupdate = 9;
8042  optional uint32 range_cyclic = 10;
8043}
8044message Ext4WritepagesResultFtraceEvent {
8045  optional uint64 dev = 1;
8046  optional uint64 ino = 2;
8047  optional int32 ret = 3;
8048  optional int32 pages_written = 4;
8049  optional int64 pages_skipped = 5;
8050  optional uint64 writeback_index = 6;
8051  optional int32 sync_mode = 7;
8052}
8053message Ext4ZeroRangeFtraceEvent {
8054  optional uint64 dev = 1;
8055  optional uint64 ino = 2;
8056  optional int64 offset = 3;
8057  optional int64 len = 4;
8058  optional int32 mode = 5;
8059}
8060
8061// End of protos/perfetto/trace/ftrace/ext4.proto
8062
8063// Begin of protos/perfetto/trace/ftrace/f2fs.proto
8064
8065message F2fsDoSubmitBioFtraceEvent {
8066  optional uint64 dev = 1;
8067  optional int32 btype = 2;
8068  optional uint32 sync = 3;
8069  optional uint64 sector = 4;
8070  optional uint32 size = 5;
8071}
8072message F2fsEvictInodeFtraceEvent {
8073  optional uint64 dev = 1;
8074  optional uint64 ino = 2;
8075  optional uint64 pino = 3;
8076  optional uint32 mode = 4;
8077  optional int64 size = 5;
8078  optional uint32 nlink = 6;
8079  optional uint64 blocks = 7;
8080  optional uint32 advise = 8;
8081}
8082message F2fsFallocateFtraceEvent {
8083  optional uint64 dev = 1;
8084  optional uint64 ino = 2;
8085  optional int32 mode = 3;
8086  optional int64 offset = 4;
8087  optional int64 len = 5;
8088  optional int64 size = 6;
8089  optional uint64 blocks = 7;
8090  optional int32 ret = 8;
8091}
8092message F2fsGetDataBlockFtraceEvent {
8093  optional uint64 dev = 1;
8094  optional uint64 ino = 2;
8095  optional uint64 iblock = 3;
8096  optional uint64 bh_start = 4;
8097  optional uint64 bh_size = 5;
8098  optional int32 ret = 6;
8099}
8100message F2fsGetVictimFtraceEvent {
8101  optional uint64 dev = 1;
8102  optional int32 type = 2;
8103  optional int32 gc_type = 3;
8104  optional int32 alloc_mode = 4;
8105  optional int32 gc_mode = 5;
8106  optional uint32 victim = 6;
8107  optional uint32 ofs_unit = 7;
8108  optional uint32 pre_victim = 8;
8109  optional uint32 prefree = 9;
8110  optional uint32 free = 10;
8111  optional uint32 cost = 11;
8112}
8113message F2fsIgetFtraceEvent {
8114  optional uint64 dev = 1;
8115  optional uint64 ino = 2;
8116  optional uint64 pino = 3;
8117  optional uint32 mode = 4;
8118  optional int64 size = 5;
8119  optional uint32 nlink = 6;
8120  optional uint64 blocks = 7;
8121  optional uint32 advise = 8;
8122}
8123message F2fsIgetExitFtraceEvent {
8124  optional uint64 dev = 1;
8125  optional uint64 ino = 2;
8126  optional int32 ret = 3;
8127}
8128message F2fsNewInodeFtraceEvent {
8129  optional uint64 dev = 1;
8130  optional uint64 ino = 2;
8131  optional int32 ret = 3;
8132}
8133message F2fsReadpageFtraceEvent {
8134  optional uint64 dev = 1;
8135  optional uint64 ino = 2;
8136  optional uint64 index = 3;
8137  optional uint64 blkaddr = 4;
8138  optional int32 type = 5;
8139  optional int32 dir = 6;
8140  optional int32 dirty = 7;
8141  optional int32 uptodate = 8;
8142}
8143message F2fsReserveNewBlockFtraceEvent {
8144  optional uint64 dev = 1;
8145  optional uint32 nid = 2;
8146  optional uint32 ofs_in_node = 3;
8147}
8148message F2fsSetPageDirtyFtraceEvent {
8149  optional uint64 dev = 1;
8150  optional uint64 ino = 2;
8151  optional int32 type = 3;
8152  optional int32 dir = 4;
8153  optional uint64 index = 5;
8154  optional int32 dirty = 6;
8155  optional int32 uptodate = 7;
8156}
8157message F2fsSubmitWritePageFtraceEvent {
8158  optional uint64 dev = 1;
8159  optional uint64 ino = 2;
8160  optional int32 type = 3;
8161  optional uint64 index = 4;
8162  optional uint32 block = 5;
8163}
8164message F2fsSyncFileEnterFtraceEvent {
8165  optional uint64 dev = 1;
8166  optional uint64 ino = 2;
8167  optional uint64 pino = 3;
8168  optional uint32 mode = 4;
8169  optional int64 size = 5;
8170  optional uint32 nlink = 6;
8171  optional uint64 blocks = 7;
8172  optional uint32 advise = 8;
8173}
8174message F2fsSyncFileExitFtraceEvent {
8175  optional uint64 dev = 1;
8176  optional uint64 ino = 2;
8177  optional uint32 need_cp = 3;
8178  optional int32 datasync = 4;
8179  optional int32 ret = 5;
8180  optional int32 cp_reason = 6;
8181}
8182message F2fsSyncFsFtraceEvent {
8183  optional uint64 dev = 1;
8184  optional int32 dirty = 2;
8185  optional int32 wait = 3;
8186}
8187message F2fsTruncateFtraceEvent {
8188  optional uint64 dev = 1;
8189  optional uint64 ino = 2;
8190  optional uint64 pino = 3;
8191  optional uint32 mode = 4;
8192  optional int64 size = 5;
8193  optional uint32 nlink = 6;
8194  optional uint64 blocks = 7;
8195  optional uint32 advise = 8;
8196}
8197message F2fsTruncateBlocksEnterFtraceEvent {
8198  optional uint64 dev = 1;
8199  optional uint64 ino = 2;
8200  optional int64 size = 3;
8201  optional uint64 blocks = 4;
8202  optional uint64 from = 5;
8203}
8204message F2fsTruncateBlocksExitFtraceEvent {
8205  optional uint64 dev = 1;
8206  optional uint64 ino = 2;
8207  optional int32 ret = 3;
8208}
8209message F2fsTruncateDataBlocksRangeFtraceEvent {
8210  optional uint64 dev = 1;
8211  optional uint64 ino = 2;
8212  optional uint32 nid = 3;
8213  optional uint32 ofs = 4;
8214  optional int32 free = 5;
8215}
8216message F2fsTruncateInodeBlocksEnterFtraceEvent {
8217  optional uint64 dev = 1;
8218  optional uint64 ino = 2;
8219  optional int64 size = 3;
8220  optional uint64 blocks = 4;
8221  optional uint64 from = 5;
8222}
8223message F2fsTruncateInodeBlocksExitFtraceEvent {
8224  optional uint64 dev = 1;
8225  optional uint64 ino = 2;
8226  optional int32 ret = 3;
8227}
8228message F2fsTruncateNodeFtraceEvent {
8229  optional uint64 dev = 1;
8230  optional uint64 ino = 2;
8231  optional uint32 nid = 3;
8232  optional uint32 blk_addr = 4;
8233}
8234message F2fsTruncateNodesEnterFtraceEvent {
8235  optional uint64 dev = 1;
8236  optional uint64 ino = 2;
8237  optional uint32 nid = 3;
8238  optional uint32 blk_addr = 4;
8239}
8240message F2fsTruncateNodesExitFtraceEvent {
8241  optional uint64 dev = 1;
8242  optional uint64 ino = 2;
8243  optional int32 ret = 3;
8244}
8245message F2fsTruncatePartialNodesFtraceEvent {
8246  optional uint64 dev = 1;
8247  optional uint64 ino = 2;
8248  optional uint32 nid = 3;
8249  optional int32 depth = 4;
8250  optional int32 err = 5;
8251}
8252message F2fsUnlinkEnterFtraceEvent {
8253  optional uint64 dev = 1;
8254  optional uint64 ino = 2;
8255  optional int64 size = 3;
8256  optional uint64 blocks = 4;
8257  optional string name = 5;
8258}
8259message F2fsUnlinkExitFtraceEvent {
8260  optional uint64 dev = 1;
8261  optional uint64 ino = 2;
8262  optional int32 ret = 3;
8263}
8264message F2fsVmPageMkwriteFtraceEvent {
8265  optional uint64 dev = 1;
8266  optional uint64 ino = 2;
8267  optional int32 type = 3;
8268  optional int32 dir = 4;
8269  optional uint64 index = 5;
8270  optional int32 dirty = 6;
8271  optional int32 uptodate = 7;
8272}
8273message F2fsWriteBeginFtraceEvent {
8274  optional uint64 dev = 1;
8275  optional uint64 ino = 2;
8276  optional int64 pos = 3;
8277  optional uint32 len = 4;
8278  optional uint32 flags = 5;
8279}
8280message F2fsWriteCheckpointFtraceEvent {
8281  optional uint64 dev = 1;
8282  optional uint32 is_umount = 2;
8283  optional string msg = 3;
8284  optional int32 reason = 4;
8285}
8286message F2fsWriteEndFtraceEvent {
8287  optional uint64 dev = 1;
8288  optional uint64 ino = 2;
8289  optional int64 pos = 3;
8290  optional uint32 len = 4;
8291  optional uint32 copied = 5;
8292}
8293message F2fsIostatFtraceEvent {
8294  optional uint64 app_bio = 1;
8295  optional uint64 app_brio = 2;
8296  optional uint64 app_dio = 3;
8297  optional uint64 app_drio = 4;
8298  optional uint64 app_mio = 5;
8299  optional uint64 app_mrio = 6;
8300  optional uint64 app_rio = 7;
8301  optional uint64 app_wio = 8;
8302  optional uint64 dev = 9;
8303  optional uint64 fs_cdrio = 10;
8304  optional uint64 fs_cp_dio = 11;
8305  optional uint64 fs_cp_mio = 12;
8306  optional uint64 fs_cp_nio = 13;
8307  optional uint64 fs_dio = 14;
8308  optional uint64 fs_discard = 15;
8309  optional uint64 fs_drio = 16;
8310  optional uint64 fs_gc_dio = 17;
8311  optional uint64 fs_gc_nio = 18;
8312  optional uint64 fs_gdrio = 19;
8313  optional uint64 fs_mio = 20;
8314  optional uint64 fs_mrio = 21;
8315  optional uint64 fs_nio = 22;
8316  optional uint64 fs_nrio = 23;
8317}
8318message F2fsIostatLatencyFtraceEvent {
8319  optional uint32 d_rd_avg = 1;
8320  optional uint32 d_rd_cnt = 2;
8321  optional uint32 d_rd_peak = 3;
8322  optional uint32 d_wr_as_avg = 4;
8323  optional uint32 d_wr_as_cnt = 5;
8324  optional uint32 d_wr_as_peak = 6;
8325  optional uint32 d_wr_s_avg = 7;
8326  optional uint32 d_wr_s_cnt = 8;
8327  optional uint32 d_wr_s_peak = 9;
8328  optional uint64 dev = 10;
8329  optional uint32 m_rd_avg = 11;
8330  optional uint32 m_rd_cnt = 12;
8331  optional uint32 m_rd_peak = 13;
8332  optional uint32 m_wr_as_avg = 14;
8333  optional uint32 m_wr_as_cnt = 15;
8334  optional uint32 m_wr_as_peak = 16;
8335  optional uint32 m_wr_s_avg = 17;
8336  optional uint32 m_wr_s_cnt = 18;
8337  optional uint32 m_wr_s_peak = 19;
8338  optional uint32 n_rd_avg = 20;
8339  optional uint32 n_rd_cnt = 21;
8340  optional uint32 n_rd_peak = 22;
8341  optional uint32 n_wr_as_avg = 23;
8342  optional uint32 n_wr_as_cnt = 24;
8343  optional uint32 n_wr_as_peak = 25;
8344  optional uint32 n_wr_s_avg = 26;
8345  optional uint32 n_wr_s_cnt = 27;
8346  optional uint32 n_wr_s_peak = 28;
8347}
8348message F2fsBackgroundGcFtraceEvent {
8349  optional uint64 dev = 1;
8350  optional uint32 wait_ms = 2;
8351  optional uint32 prefree = 3;
8352  optional uint32 free = 4;
8353}
8354message F2fsGcBeginFtraceEvent {
8355  optional uint64 dev = 1;
8356  optional uint32 sync = 2;
8357  optional uint32 background = 3;
8358  optional int64 dirty_nodes = 4;
8359  optional int64 dirty_dents = 5;
8360  optional int64 dirty_imeta = 6;
8361  optional uint32 free_sec = 7;
8362  optional uint32 free_seg = 8;
8363  optional int32 reserved_seg = 9;
8364  optional uint32 prefree_seg = 10;
8365  optional int32 gc_type = 11;
8366  optional uint32 no_bg_gc = 12;
8367  optional uint32 nr_free_secs = 13;
8368}
8369message F2fsGcEndFtraceEvent {
8370  optional uint64 dev = 1;
8371  optional int32 ret = 2;
8372  optional int32 seg_freed = 3;
8373  optional int32 sec_freed = 4;
8374  optional int64 dirty_nodes = 5;
8375  optional int64 dirty_dents = 6;
8376  optional int64 dirty_imeta = 7;
8377  optional uint32 free_sec = 8;
8378  optional uint32 free_seg = 9;
8379  optional int32 reserved_seg = 10;
8380  optional uint32 prefree_seg = 11;
8381}
8382
8383// End of protos/perfetto/trace/ftrace/f2fs.proto
8384
8385// Begin of protos/perfetto/trace/ftrace/fastrpc.proto
8386
8387message FastrpcDmaStatFtraceEvent {
8388  optional int32 cid = 1;
8389  optional int64 len = 2;
8390  optional uint64 total_allocated = 3;
8391}
8392message FastrpcDmaFreeFtraceEvent {
8393  optional int32 cid = 1;
8394  optional uint64 phys = 2;
8395  optional uint64 size = 3;
8396}
8397message FastrpcDmaAllocFtraceEvent {
8398  optional int32 cid = 1;
8399  optional uint64 phys = 2;
8400  optional uint64 size = 3;
8401  optional uint64 attr = 4;
8402  optional int32 mflags = 5;
8403}
8404message FastrpcDmaUnmapFtraceEvent {
8405  optional int32 cid = 1;
8406  optional uint64 phys = 2;
8407  optional uint64 size = 3;
8408}
8409message FastrpcDmaMapFtraceEvent {
8410  optional int32 cid = 1;
8411  optional int32 fd = 2;
8412  optional uint64 phys = 3;
8413  optional uint64 size = 4;
8414  optional uint64 len = 5;
8415  optional uint32 attr = 6;
8416  optional int32 mflags = 7;
8417}
8418
8419// End of protos/perfetto/trace/ftrace/fastrpc.proto
8420
8421// Begin of protos/perfetto/trace/ftrace/fence.proto
8422
8423message FenceInitFtraceEvent {
8424  optional uint32 context = 1;
8425  optional string driver = 2;
8426  optional uint32 seqno = 3;
8427  optional string timeline = 4;
8428}
8429message FenceDestroyFtraceEvent {
8430  optional uint32 context = 1;
8431  optional string driver = 2;
8432  optional uint32 seqno = 3;
8433  optional string timeline = 4;
8434}
8435message FenceEnableSignalFtraceEvent {
8436  optional uint32 context = 1;
8437  optional string driver = 2;
8438  optional uint32 seqno = 3;
8439  optional string timeline = 4;
8440}
8441message FenceSignaledFtraceEvent {
8442  optional uint32 context = 1;
8443  optional string driver = 2;
8444  optional uint32 seqno = 3;
8445  optional string timeline = 4;
8446}
8447
8448// End of protos/perfetto/trace/ftrace/fence.proto
8449
8450// Begin of protos/perfetto/trace/ftrace/filemap.proto
8451
8452message MmFilemapAddToPageCacheFtraceEvent {
8453  optional uint64 pfn = 1;
8454  optional uint64 i_ino = 2;
8455  optional uint64 index = 3;
8456  optional uint64 s_dev = 4;
8457  optional uint64 page = 5;
8458}
8459message MmFilemapDeleteFromPageCacheFtraceEvent {
8460  optional uint64 pfn = 1;
8461  optional uint64 i_ino = 2;
8462  optional uint64 index = 3;
8463  optional uint64 s_dev = 4;
8464  optional uint64 page = 5;
8465}
8466
8467// End of protos/perfetto/trace/ftrace/filemap.proto
8468
8469// Begin of protos/perfetto/trace/ftrace/ftrace.proto
8470
8471message PrintFtraceEvent {
8472  optional uint64 ip = 1;
8473  optional string buf = 2;
8474}
8475message FuncgraphEntryFtraceEvent {
8476  optional int32 depth = 1;
8477  optional uint64 func = 2;
8478}
8479message FuncgraphExitFtraceEvent {
8480  optional uint64 calltime = 1;
8481  optional int32 depth = 2;
8482  optional uint64 func = 3;
8483  optional uint64 overrun = 4;
8484  optional uint64 rettime = 5;
8485}
8486
8487// End of protos/perfetto/trace/ftrace/ftrace.proto
8488
8489// Begin of protos/perfetto/trace/ftrace/g2d.proto
8490
8491message G2dTracingMarkWriteFtraceEvent {
8492  optional int32 pid = 1;
8493  optional string name = 4;
8494  optional uint32 type = 5;
8495  optional int32 value = 6;
8496}
8497
8498// End of protos/perfetto/trace/ftrace/g2d.proto
8499
8500// Begin of protos/perfetto/trace/ftrace/generic.proto
8501
8502// This generic proto is used to output events in the trace
8503// when a specific proto for that event does not exist.
8504message GenericFtraceEvent {
8505  message Field {
8506    optional string name = 1;
8507    oneof value {
8508      string str_value = 3;
8509      int64 int_value = 4;
8510      uint64 uint_value = 5;
8511    }
8512  }
8513
8514  optional string event_name = 1;
8515  repeated Field field = 2;
8516}
8517
8518// End of protos/perfetto/trace/ftrace/generic.proto
8519
8520// Begin of protos/perfetto/trace/ftrace/gpu_mem.proto
8521
8522message GpuMemTotalFtraceEvent {
8523  optional uint32 gpu_id = 1;
8524  optional uint32 pid = 2;
8525  optional uint64 size = 3;
8526}
8527
8528// End of protos/perfetto/trace/ftrace/gpu_mem.proto
8529
8530// Begin of protos/perfetto/trace/ftrace/gpu_scheduler.proto
8531
8532message DrmSchedJobFtraceEvent {
8533  optional uint64 entity = 1;
8534  optional uint64 fence = 2;
8535  optional int32 hw_job_count = 3;
8536  optional uint64 id = 4;
8537  optional uint32 job_count = 5;
8538  optional string name = 6;
8539}
8540message DrmRunJobFtraceEvent {
8541  optional uint64 entity = 1;
8542  optional uint64 fence = 2;
8543  optional int32 hw_job_count = 3;
8544  optional uint64 id = 4;
8545  optional uint32 job_count = 5;
8546  optional string name = 6;
8547}
8548message DrmSchedProcessJobFtraceEvent {
8549  optional uint64 fence = 1;
8550}
8551
8552// End of protos/perfetto/trace/ftrace/gpu_scheduler.proto
8553
8554// Begin of protos/perfetto/trace/ftrace/hyp.proto
8555
8556message HypEnterFtraceEvent {}
8557message HypExitFtraceEvent {}
8558message HostHcallFtraceEvent {
8559  optional uint32 id = 1;
8560  optional uint32 invalid = 2;
8561}
8562message HostSmcFtraceEvent {
8563  optional uint64 id = 1;
8564  optional uint32 forwarded = 2;
8565}
8566message HostMemAbortFtraceEvent {
8567  optional uint64 esr = 1;
8568  optional uint64 addr = 2;
8569}
8570
8571// End of protos/perfetto/trace/ftrace/hyp.proto
8572
8573// Begin of protos/perfetto/trace/ftrace/i2c.proto
8574
8575message I2cReadFtraceEvent {
8576  optional int32 adapter_nr = 1;
8577  optional uint32 msg_nr = 2;
8578  optional uint32 addr = 3;
8579  optional uint32 flags = 4;
8580  optional uint32 len = 5;
8581}
8582message I2cWriteFtraceEvent {
8583  optional int32 adapter_nr = 1;
8584  optional uint32 msg_nr = 2;
8585  optional uint32 addr = 3;
8586  optional uint32 flags = 4;
8587  optional uint32 len = 5;
8588  optional uint32 buf = 6;
8589}
8590message I2cResultFtraceEvent {
8591  optional int32 adapter_nr = 1;
8592  optional uint32 nr_msgs = 2;
8593  optional int32 ret = 3;
8594}
8595message I2cReplyFtraceEvent {
8596  optional int32 adapter_nr = 1;
8597  optional uint32 msg_nr = 2;
8598  optional uint32 addr = 3;
8599  optional uint32 flags = 4;
8600  optional uint32 len = 5;
8601  optional uint32 buf = 6;
8602}
8603message SmbusReadFtraceEvent {
8604  optional int32 adapter_nr = 1;
8605  optional uint32 flags = 2;
8606  optional uint32 addr = 3;
8607  optional uint32 command = 4;
8608  optional uint32 protocol = 5;
8609}
8610message SmbusWriteFtraceEvent {
8611  optional int32 adapter_nr = 1;
8612  optional uint32 addr = 2;
8613  optional uint32 flags = 3;
8614  optional uint32 command = 4;
8615  optional uint32 len = 5;
8616  optional uint32 protocol = 6;
8617}
8618message SmbusResultFtraceEvent {
8619  optional int32 adapter_nr = 1;
8620  optional uint32 addr = 2;
8621  optional uint32 flags = 3;
8622  optional uint32 read_write = 4;
8623  optional uint32 command = 5;
8624  optional int32 res = 6;
8625  optional uint32 protocol = 7;
8626}
8627message SmbusReplyFtraceEvent {
8628  optional int32 adapter_nr = 1;
8629  optional uint32 addr = 2;
8630  optional uint32 flags = 3;
8631  optional uint32 command = 4;
8632  optional uint32 len = 5;
8633  optional uint32 protocol = 6;
8634}
8635
8636// End of protos/perfetto/trace/ftrace/i2c.proto
8637
8638// Begin of protos/perfetto/trace/ftrace/ion.proto
8639
8640message IonStatFtraceEvent {
8641  optional uint32 buffer_id = 1;
8642  optional int64 len = 2;
8643  optional uint64 total_allocated = 3;
8644}
8645
8646// End of protos/perfetto/trace/ftrace/ion.proto
8647
8648// Begin of protos/perfetto/trace/ftrace/ipi.proto
8649
8650message IpiEntryFtraceEvent {
8651  optional string reason = 1;
8652}
8653message IpiExitFtraceEvent {
8654  optional string reason = 1;
8655}
8656message IpiRaiseFtraceEvent {
8657  optional uint32 target_cpus = 1;
8658  optional string reason = 2;
8659}
8660
8661// End of protos/perfetto/trace/ftrace/ipi.proto
8662
8663// Begin of protos/perfetto/trace/ftrace/irq.proto
8664
8665message SoftirqEntryFtraceEvent {
8666  optional uint32 vec = 1;
8667}
8668message SoftirqExitFtraceEvent {
8669  optional uint32 vec = 1;
8670}
8671message SoftirqRaiseFtraceEvent {
8672  optional uint32 vec = 1;
8673}
8674message IrqHandlerEntryFtraceEvent {
8675  optional int32 irq = 1;
8676  optional string name = 2;
8677  optional uint32 handler = 3;
8678}
8679message IrqHandlerExitFtraceEvent {
8680  optional int32 irq = 1;
8681  optional int32 ret = 2;
8682}
8683
8684// End of protos/perfetto/trace/ftrace/irq.proto
8685
8686// Begin of protos/perfetto/trace/ftrace/kmem.proto
8687
8688message AllocPagesIommuEndFtraceEvent {
8689  optional uint32 gfp_flags = 1;
8690  optional uint32 order = 2;
8691}
8692message AllocPagesIommuFailFtraceEvent {
8693  optional uint32 gfp_flags = 1;
8694  optional uint32 order = 2;
8695}
8696message AllocPagesIommuStartFtraceEvent {
8697  optional uint32 gfp_flags = 1;
8698  optional uint32 order = 2;
8699}
8700message AllocPagesSysEndFtraceEvent {
8701  optional uint32 gfp_flags = 1;
8702  optional uint32 order = 2;
8703}
8704message AllocPagesSysFailFtraceEvent {
8705  optional uint32 gfp_flags = 1;
8706  optional uint32 order = 2;
8707}
8708message AllocPagesSysStartFtraceEvent {
8709  optional uint32 gfp_flags = 1;
8710  optional uint32 order = 2;
8711}
8712message DmaAllocContiguousRetryFtraceEvent {
8713  optional int32 tries = 1;
8714}
8715message IommuMapRangeFtraceEvent {
8716  optional uint64 chunk_size = 1;
8717  optional uint64 len = 2;
8718  optional uint64 pa = 3;
8719  optional uint64 va = 4;
8720}
8721message IommuSecPtblMapRangeEndFtraceEvent {
8722  optional uint64 len = 1;
8723  optional int32 num = 2;
8724  optional uint32 pa = 3;
8725  optional int32 sec_id = 4;
8726  optional uint64 va = 5;
8727}
8728message IommuSecPtblMapRangeStartFtraceEvent {
8729  optional uint64 len = 1;
8730  optional int32 num = 2;
8731  optional uint32 pa = 3;
8732  optional int32 sec_id = 4;
8733  optional uint64 va = 5;
8734}
8735message IonAllocBufferEndFtraceEvent {
8736  optional string client_name = 1;
8737  optional uint32 flags = 2;
8738  optional string heap_name = 3;
8739  optional uint64 len = 4;
8740  optional uint32 mask = 5;
8741}
8742message IonAllocBufferFailFtraceEvent {
8743  optional string client_name = 1;
8744  optional int64 error = 2;
8745  optional uint32 flags = 3;
8746  optional string heap_name = 4;
8747  optional uint64 len = 5;
8748  optional uint32 mask = 6;
8749}
8750message IonAllocBufferFallbackFtraceEvent {
8751  optional string client_name = 1;
8752  optional int64 error = 2;
8753  optional uint32 flags = 3;
8754  optional string heap_name = 4;
8755  optional uint64 len = 5;
8756  optional uint32 mask = 6;
8757}
8758message IonAllocBufferStartFtraceEvent {
8759  optional string client_name = 1;
8760  optional uint32 flags = 2;
8761  optional string heap_name = 3;
8762  optional uint64 len = 4;
8763  optional uint32 mask = 5;
8764}
8765message IonCpAllocRetryFtraceEvent {
8766  optional int32 tries = 1;
8767}
8768message IonCpSecureBufferEndFtraceEvent {
8769  optional uint64 align = 1;
8770  optional uint64 flags = 2;
8771  optional string heap_name = 3;
8772  optional uint64 len = 4;
8773}
8774message IonCpSecureBufferStartFtraceEvent {
8775  optional uint64 align = 1;
8776  optional uint64 flags = 2;
8777  optional string heap_name = 3;
8778  optional uint64 len = 4;
8779}
8780message IonPrefetchingFtraceEvent {
8781  optional uint64 len = 1;
8782}
8783message IonSecureCmaAddToPoolEndFtraceEvent {
8784  optional uint32 is_prefetch = 1;
8785  optional uint64 len = 2;
8786  optional int32 pool_total = 3;
8787}
8788message IonSecureCmaAddToPoolStartFtraceEvent {
8789  optional uint32 is_prefetch = 1;
8790  optional uint64 len = 2;
8791  optional int32 pool_total = 3;
8792}
8793message IonSecureCmaAllocateEndFtraceEvent {
8794  optional uint64 align = 1;
8795  optional uint64 flags = 2;
8796  optional string heap_name = 3;
8797  optional uint64 len = 4;
8798}
8799message IonSecureCmaAllocateStartFtraceEvent {
8800  optional uint64 align = 1;
8801  optional uint64 flags = 2;
8802  optional string heap_name = 3;
8803  optional uint64 len = 4;
8804}
8805message IonSecureCmaShrinkPoolEndFtraceEvent {
8806  optional uint64 drained_size = 1;
8807  optional uint64 skipped_size = 2;
8808}
8809message IonSecureCmaShrinkPoolStartFtraceEvent {
8810  optional uint64 drained_size = 1;
8811  optional uint64 skipped_size = 2;
8812}
8813message KfreeFtraceEvent {
8814  optional uint64 call_site = 1;
8815  optional uint64 ptr = 2;
8816}
8817message KmallocFtraceEvent {
8818  optional uint64 bytes_alloc = 1;
8819  optional uint64 bytes_req = 2;
8820  optional uint64 call_site = 3;
8821  optional uint32 gfp_flags = 4;
8822  optional uint64 ptr = 5;
8823}
8824message KmallocNodeFtraceEvent {
8825  optional uint64 bytes_alloc = 1;
8826  optional uint64 bytes_req = 2;
8827  optional uint64 call_site = 3;
8828  optional uint32 gfp_flags = 4;
8829  optional int32 node = 5;
8830  optional uint64 ptr = 6;
8831}
8832message KmemCacheAllocFtraceEvent {
8833  optional uint64 bytes_alloc = 1;
8834  optional uint64 bytes_req = 2;
8835  optional uint64 call_site = 3;
8836  optional uint32 gfp_flags = 4;
8837  optional uint64 ptr = 5;
8838}
8839message KmemCacheAllocNodeFtraceEvent {
8840  optional uint64 bytes_alloc = 1;
8841  optional uint64 bytes_req = 2;
8842  optional uint64 call_site = 3;
8843  optional uint32 gfp_flags = 4;
8844  optional int32 node = 5;
8845  optional uint64 ptr = 6;
8846}
8847message KmemCacheFreeFtraceEvent {
8848  optional uint64 call_site = 1;
8849  optional uint64 ptr = 2;
8850}
8851message MigratePagesEndFtraceEvent {
8852  optional int32 mode = 1;
8853}
8854message MigratePagesStartFtraceEvent {
8855  optional int32 mode = 1;
8856}
8857message MigrateRetryFtraceEvent {
8858  optional int32 tries = 1;
8859}
8860message MmPageAllocFtraceEvent {
8861  optional uint32 gfp_flags = 1;
8862  optional int32 migratetype = 2;
8863  optional uint32 order = 3;
8864  optional uint64 page = 4;
8865  optional uint64 pfn = 5;
8866}
8867message MmPageAllocExtfragFtraceEvent {
8868  optional int32 alloc_migratetype = 1;
8869  optional int32 alloc_order = 2;
8870  optional int32 fallback_migratetype = 3;
8871  optional int32 fallback_order = 4;
8872  optional uint64 page = 5;
8873  optional int32 change_ownership = 6;
8874  optional uint64 pfn = 7;
8875}
8876message MmPageAllocZoneLockedFtraceEvent {
8877  optional int32 migratetype = 1;
8878  optional uint32 order = 2;
8879  optional uint64 page = 3;
8880  optional uint64 pfn = 4;
8881}
8882message MmPageFreeFtraceEvent {
8883  optional uint32 order = 1;
8884  optional uint64 page = 2;
8885  optional uint64 pfn = 3;
8886}
8887message MmPageFreeBatchedFtraceEvent {
8888  optional int32 cold = 1;
8889  optional uint64 page = 2;
8890  optional uint64 pfn = 3;
8891}
8892message MmPagePcpuDrainFtraceEvent {
8893  optional int32 migratetype = 1;
8894  optional uint32 order = 2;
8895  optional uint64 page = 3;
8896  optional uint64 pfn = 4;
8897}
8898message RssStatFtraceEvent {
8899  optional int32 member = 1;
8900  optional int64 size = 2;
8901  optional uint32 curr = 3;
8902  optional uint32 mm_id = 4;
8903}
8904message IonHeapShrinkFtraceEvent {
8905  optional string heap_name = 1;
8906  optional uint64 len = 2;
8907  optional int64 total_allocated = 3;
8908}
8909message IonHeapGrowFtraceEvent {
8910  optional string heap_name = 1;
8911  optional uint64 len = 2;
8912  optional int64 total_allocated = 3;
8913}
8914message IonBufferCreateFtraceEvent {
8915  optional uint64 addr = 1;
8916  optional uint64 len = 2;
8917}
8918message IonBufferDestroyFtraceEvent {
8919  optional uint64 addr = 1;
8920  optional uint64 len = 2;
8921}
8922
8923// End of protos/perfetto/trace/ftrace/kmem.proto
8924
8925// Begin of protos/perfetto/trace/ftrace/kvm.proto
8926
8927message KvmAccessFaultFtraceEvent {
8928  optional uint64 ipa = 1;
8929}
8930message KvmAckIrqFtraceEvent {
8931  optional uint32 irqchip = 1;
8932  optional uint32 pin = 2;
8933}
8934message KvmAgeHvaFtraceEvent {
8935  optional uint64 end = 1;
8936  optional uint64 start = 2;
8937}
8938message KvmAgePageFtraceEvent {
8939  optional uint64 gfn = 1;
8940  optional uint64 hva = 2;
8941  optional uint32 level = 3;
8942  optional uint32 referenced = 4;
8943}
8944message KvmArmClearDebugFtraceEvent {
8945  optional uint32 guest_debug = 1;
8946}
8947message KvmArmSetDreg32FtraceEvent {
8948  optional string name = 1;
8949  optional uint32 value = 2;
8950}
8951message KvmArmSetRegsetFtraceEvent {
8952  optional int32 len = 1;
8953  optional string name = 2;
8954}
8955message KvmArmSetupDebugFtraceEvent {
8956  optional uint32 guest_debug = 1;
8957  optional uint64 vcpu = 2;
8958}
8959message KvmEntryFtraceEvent {
8960  optional uint64 vcpu_pc = 1;
8961}
8962message KvmExitFtraceEvent {
8963  optional uint32 esr_ec = 1;
8964  optional int32 ret = 2;
8965  optional uint64 vcpu_pc = 3;
8966}
8967message KvmFpuFtraceEvent {
8968  optional uint32 load = 1;
8969}
8970message KvmGetTimerMapFtraceEvent {
8971  optional int32 direct_ptimer = 1;
8972  optional int32 direct_vtimer = 2;
8973  optional int32 emul_ptimer = 3;
8974  optional uint64 vcpu_id = 4;
8975}
8976message KvmGuestFaultFtraceEvent {
8977  optional uint64 hsr = 1;
8978  optional uint64 hxfar = 2;
8979  optional uint64 ipa = 3;
8980  optional uint64 vcpu_pc = 4;
8981}
8982message KvmHandleSysRegFtraceEvent {
8983  optional uint64 hsr = 1;
8984}
8985message KvmHvcArm64FtraceEvent {
8986  optional uint64 imm = 1;
8987  optional uint64 r0 = 2;
8988  optional uint64 vcpu_pc = 3;
8989}
8990message KvmIrqLineFtraceEvent {
8991  optional int32 irq_num = 1;
8992  optional int32 level = 2;
8993  optional uint32 type = 3;
8994  optional int32 vcpu_idx = 4;
8995}
8996message KvmMmioFtraceEvent {
8997  optional uint64 gpa = 1;
8998  optional uint32 len = 2;
8999  optional uint32 type = 3;
9000  optional uint64 val = 4;
9001}
9002message KvmMmioEmulateFtraceEvent {
9003  optional uint64 cpsr = 1;
9004  optional uint64 instr = 2;
9005  optional uint64 vcpu_pc = 3;
9006}
9007message KvmSetGuestDebugFtraceEvent {
9008  optional uint32 guest_debug = 1;
9009  optional uint64 vcpu = 2;
9010}
9011message KvmSetIrqFtraceEvent {
9012  optional uint32 gsi = 1;
9013  optional int32 irq_source_id = 2;
9014  optional int32 level = 3;
9015}
9016message KvmSetSpteHvaFtraceEvent {
9017  optional uint64 hva = 1;
9018}
9019message KvmSetWayFlushFtraceEvent {
9020  optional uint32 cache = 1;
9021  optional uint64 vcpu_pc = 2;
9022}
9023message KvmSysAccessFtraceEvent {
9024  optional uint32 CRm = 1;
9025  optional uint32 CRn = 2;
9026  optional uint32 Op0 = 3;
9027  optional uint32 Op1 = 4;
9028  optional uint32 Op2 = 5;
9029  optional uint32 is_write = 6;
9030  optional string name = 7;
9031  optional uint64 vcpu_pc = 8;
9032}
9033message KvmTestAgeHvaFtraceEvent {
9034  optional uint64 hva = 1;
9035}
9036message KvmTimerEmulateFtraceEvent {
9037  optional uint32 should_fire = 1;
9038  optional int32 timer_idx = 2;
9039}
9040message KvmTimerHrtimerExpireFtraceEvent {
9041  optional int32 timer_idx = 1;
9042}
9043message KvmTimerRestoreStateFtraceEvent {
9044  optional uint64 ctl = 1;
9045  optional uint64 cval = 2;
9046  optional int32 timer_idx = 3;
9047}
9048message KvmTimerSaveStateFtraceEvent {
9049  optional uint64 ctl = 1;
9050  optional uint64 cval = 2;
9051  optional int32 timer_idx = 3;
9052}
9053message KvmTimerUpdateIrqFtraceEvent {
9054  optional uint32 irq = 1;
9055  optional int32 level = 2;
9056  optional uint64 vcpu_id = 3;
9057}
9058message KvmToggleCacheFtraceEvent {
9059  optional uint32 now = 1;
9060  optional uint64 vcpu_pc = 2;
9061  optional uint32 was = 3;
9062}
9063message KvmUnmapHvaRangeFtraceEvent {
9064  optional uint64 end = 1;
9065  optional uint64 start = 2;
9066}
9067message KvmUserspaceExitFtraceEvent {
9068  optional uint32 reason = 1;
9069}
9070message KvmVcpuWakeupFtraceEvent {
9071  optional uint64 ns = 1;
9072  optional uint32 valid = 2;
9073  optional uint32 waited = 3;
9074}
9075message KvmWfxArm64FtraceEvent {
9076  optional uint32 is_wfe = 1;
9077  optional uint64 vcpu_pc = 2;
9078}
9079message TrapRegFtraceEvent {
9080  optional string fn = 1;
9081  optional uint32 is_write = 2;
9082  optional int32 reg = 3;
9083  optional uint64 write_value = 4;
9084}
9085message VgicUpdateIrqPendingFtraceEvent {
9086  optional uint32 irq = 1;
9087  optional uint32 level = 2;
9088  optional uint64 vcpu_id = 3;
9089}
9090
9091// End of protos/perfetto/trace/ftrace/kvm.proto
9092
9093// Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto
9094
9095message LowmemoryKillFtraceEvent {
9096  optional string comm = 1;
9097  optional int32 pid = 2;
9098  optional int64 pagecache_size = 3;
9099  optional int64 pagecache_limit = 4;
9100  optional int64 free = 5;
9101}
9102
9103// End of protos/perfetto/trace/ftrace/lowmemorykiller.proto
9104
9105// Begin of protos/perfetto/trace/ftrace/lwis.proto
9106
9107message LwisTracingMarkWriteFtraceEvent {
9108  optional string lwis_name = 1;
9109  optional uint32 type = 2;
9110  optional int32 pid = 3;
9111  optional string func_name = 4;
9112  optional int64 value = 5;
9113}
9114
9115// End of protos/perfetto/trace/ftrace/lwis.proto
9116
9117// Begin of protos/perfetto/trace/ftrace/mali.proto
9118
9119message MaliTracingMarkWriteFtraceEvent {
9120  optional string name = 1;
9121  optional int32 pid = 2;
9122  optional uint32 type = 3;
9123  optional int32 value = 4;
9124}
9125message MaliMaliKCPUCQSSETFtraceEvent {
9126  optional uint32 id = 1;
9127  optional uint64 info_val1 = 2;
9128  optional uint64 info_val2 = 3;
9129  optional uint32 kctx_id = 4;
9130  optional int32 kctx_tgid = 5;
9131}
9132message MaliMaliKCPUCQSWAITSTARTFtraceEvent {
9133  optional uint32 id = 1;
9134  optional uint64 info_val1 = 2;
9135  optional uint64 info_val2 = 3;
9136  optional uint32 kctx_id = 4;
9137  optional int32 kctx_tgid = 5;
9138}
9139message MaliMaliKCPUCQSWAITENDFtraceEvent {
9140  optional uint32 id = 1;
9141  optional uint64 info_val1 = 2;
9142  optional uint64 info_val2 = 3;
9143  optional uint32 kctx_id = 4;
9144  optional int32 kctx_tgid = 5;
9145}
9146message MaliMaliKCPUFENCESIGNALFtraceEvent {
9147  optional uint64 info_val1 = 1;
9148  optional uint64 info_val2 = 2;
9149  optional int32 kctx_tgid = 3;
9150  optional uint32 kctx_id = 4;
9151  optional uint32 id = 5;
9152}
9153message MaliMaliKCPUFENCEWAITSTARTFtraceEvent {
9154  optional uint64 info_val1 = 1;
9155  optional uint64 info_val2 = 2;
9156  optional int32 kctx_tgid = 3;
9157  optional uint32 kctx_id = 4;
9158  optional uint32 id = 5;
9159}
9160message MaliMaliKCPUFENCEWAITENDFtraceEvent {
9161  optional uint64 info_val1 = 1;
9162  optional uint64 info_val2 = 2;
9163  optional int32 kctx_tgid = 3;
9164  optional uint32 kctx_id = 4;
9165  optional uint32 id = 5;
9166}
9167message MaliMaliCSFINTERRUPTSTARTFtraceEvent {
9168  optional int32 kctx_tgid = 1;
9169  optional uint32 kctx_id = 2;
9170  optional uint64 info_val = 3;
9171}
9172message MaliMaliCSFINTERRUPTENDFtraceEvent {
9173  optional int32 kctx_tgid = 1;
9174  optional uint32 kctx_id = 2;
9175  optional uint64 info_val = 3;
9176}
9177
9178// End of protos/perfetto/trace/ftrace/mali.proto
9179
9180// Begin of protos/perfetto/trace/ftrace/mdss.proto
9181
9182message MdpCmdKickoffFtraceEvent {
9183  optional uint32 ctl_num = 1;
9184  optional int32 kickoff_cnt = 2;
9185}
9186message MdpCommitFtraceEvent {
9187  optional uint32 num = 1;
9188  optional uint32 play_cnt = 2;
9189  optional uint32 clk_rate = 3;
9190  optional uint64 bandwidth = 4;
9191}
9192message MdpPerfSetOtFtraceEvent {
9193  optional uint32 pnum = 1;
9194  optional uint32 xin_id = 2;
9195  optional uint32 rd_lim = 3;
9196  optional uint32 is_vbif_rt = 4;
9197}
9198message MdpSsppChangeFtraceEvent {
9199  optional uint32 num = 1;
9200  optional uint32 play_cnt = 2;
9201  optional uint32 mixer = 3;
9202  optional uint32 stage = 4;
9203  optional uint32 flags = 5;
9204  optional uint32 format = 6;
9205  optional uint32 img_w = 7;
9206  optional uint32 img_h = 8;
9207  optional uint32 src_x = 9;
9208  optional uint32 src_y = 10;
9209  optional uint32 src_w = 11;
9210  optional uint32 src_h = 12;
9211  optional uint32 dst_x = 13;
9212  optional uint32 dst_y = 14;
9213  optional uint32 dst_w = 15;
9214  optional uint32 dst_h = 16;
9215}
9216message TracingMarkWriteFtraceEvent {
9217  optional int32 pid = 1;
9218  optional string trace_name = 2;
9219  optional uint32 trace_begin = 3;
9220}
9221message MdpCmdPingpongDoneFtraceEvent {
9222  optional uint32 ctl_num = 1;
9223  optional uint32 intf_num = 2;
9224  optional uint32 pp_num = 3;
9225  optional int32 koff_cnt = 4;
9226}
9227message MdpCompareBwFtraceEvent {
9228  optional uint64 new_ab = 1;
9229  optional uint64 new_ib = 2;
9230  optional uint64 new_wb = 3;
9231  optional uint64 old_ab = 4;
9232  optional uint64 old_ib = 5;
9233  optional uint64 old_wb = 6;
9234  optional uint32 params_changed = 7;
9235  optional uint32 update_bw = 8;
9236}
9237message MdpPerfSetPanicLutsFtraceEvent {
9238  optional uint32 pnum = 1;
9239  optional uint32 fmt = 2;
9240  optional uint32 mode = 3;
9241  optional uint32 panic_lut = 4;
9242  optional uint32 robust_lut = 5;
9243}
9244message MdpSsppSetFtraceEvent {
9245  optional uint32 num = 1;
9246  optional uint32 play_cnt = 2;
9247  optional uint32 mixer = 3;
9248  optional uint32 stage = 4;
9249  optional uint32 flags = 5;
9250  optional uint32 format = 6;
9251  optional uint32 img_w = 7;
9252  optional uint32 img_h = 8;
9253  optional uint32 src_x = 9;
9254  optional uint32 src_y = 10;
9255  optional uint32 src_w = 11;
9256  optional uint32 src_h = 12;
9257  optional uint32 dst_x = 13;
9258  optional uint32 dst_y = 14;
9259  optional uint32 dst_w = 15;
9260  optional uint32 dst_h = 16;
9261}
9262message MdpCmdReadptrDoneFtraceEvent {
9263  optional uint32 ctl_num = 1;
9264  optional int32 koff_cnt = 2;
9265}
9266message MdpMisrCrcFtraceEvent {
9267  optional uint32 block_id = 1;
9268  optional uint32 vsync_cnt = 2;
9269  optional uint32 crc = 3;
9270}
9271message MdpPerfSetQosLutsFtraceEvent {
9272  optional uint32 pnum = 1;
9273  optional uint32 fmt = 2;
9274  optional uint32 intf = 3;
9275  optional uint32 rot = 4;
9276  optional uint32 fl = 5;
9277  optional uint32 lut = 6;
9278  optional uint32 linear = 7;
9279}
9280message MdpTraceCounterFtraceEvent {
9281  optional int32 pid = 1;
9282  optional string counter_name = 2;
9283  optional int32 value = 3;
9284}
9285message MdpCmdReleaseBwFtraceEvent {
9286  optional uint32 ctl_num = 1;
9287}
9288message MdpMixerUpdateFtraceEvent {
9289  optional uint32 mixer_num = 1;
9290}
9291message MdpPerfSetWmLevelsFtraceEvent {
9292  optional uint32 pnum = 1;
9293  optional uint32 use_space = 2;
9294  optional uint32 priority_bytes = 3;
9295  optional uint32 wm0 = 4;
9296  optional uint32 wm1 = 5;
9297  optional uint32 wm2 = 6;
9298  optional uint32 mb_cnt = 7;
9299  optional uint32 mb_size = 8;
9300}
9301message MdpVideoUnderrunDoneFtraceEvent {
9302  optional uint32 ctl_num = 1;
9303  optional uint32 underrun_cnt = 2;
9304}
9305message MdpCmdWaitPingpongFtraceEvent {
9306  optional uint32 ctl_num = 1;
9307  optional int32 kickoff_cnt = 2;
9308}
9309message MdpPerfPrefillCalcFtraceEvent {
9310  optional uint32 pnum = 1;
9311  optional uint32 latency_buf = 2;
9312  optional uint32 ot = 3;
9313  optional uint32 y_buf = 4;
9314  optional uint32 y_scaler = 5;
9315  optional uint32 pp_lines = 6;
9316  optional uint32 pp_bytes = 7;
9317  optional uint32 post_sc = 8;
9318  optional uint32 fbc_bytes = 9;
9319  optional uint32 prefill_bytes = 10;
9320}
9321message MdpPerfUpdateBusFtraceEvent {
9322  optional int32 client = 1;
9323  optional uint64 ab_quota = 2;
9324  optional uint64 ib_quota = 3;
9325}
9326message RotatorBwAoAsContextFtraceEvent {
9327  optional uint32 state = 1;
9328}
9329
9330// End of protos/perfetto/trace/ftrace/mdss.proto
9331
9332// Begin of protos/perfetto/trace/ftrace/mm_event.proto
9333
9334message MmEventRecordFtraceEvent {
9335  optional uint32 avg_lat = 1;
9336  optional uint32 count = 2;
9337  optional uint32 max_lat = 3;
9338  optional uint32 type = 4;
9339}
9340
9341// End of protos/perfetto/trace/ftrace/mm_event.proto
9342
9343// Begin of protos/perfetto/trace/ftrace/net.proto
9344
9345message NetifReceiveSkbFtraceEvent {
9346  optional uint32 len = 1;
9347  optional string name = 2;
9348  optional uint64 skbaddr = 3;
9349}
9350message NetDevXmitFtraceEvent {
9351  optional uint32 len = 1;
9352  optional string name = 2;
9353  optional int32 rc = 3;
9354  optional uint64 skbaddr = 4;
9355}
9356message NapiGroReceiveEntryFtraceEvent {
9357  optional uint32 data_len = 1;
9358  optional uint32 gso_size = 2;
9359  optional uint32 gso_type = 3;
9360  optional uint32 hash = 4;
9361  optional uint32 ip_summed = 5;
9362  optional uint32 l4_hash = 6;
9363  optional uint32 len = 7;
9364  optional int32 mac_header = 8;
9365  optional uint32 mac_header_valid = 9;
9366  optional string name = 10;
9367  optional uint32 napi_id = 11;
9368  optional uint32 nr_frags = 12;
9369  optional uint32 protocol = 13;
9370  optional uint32 queue_mapping = 14;
9371  optional uint64 skbaddr = 15;
9372  optional uint32 truesize = 16;
9373  optional uint32 vlan_proto = 17;
9374  optional uint32 vlan_tagged = 18;
9375  optional uint32 vlan_tci = 19;
9376}
9377message NapiGroReceiveExitFtraceEvent {
9378  optional int32 ret = 1;
9379}
9380
9381// End of protos/perfetto/trace/ftrace/net.proto
9382
9383// Begin of protos/perfetto/trace/ftrace/oom.proto
9384
9385message OomScoreAdjUpdateFtraceEvent {
9386  optional string comm = 1;
9387  optional int32 oom_score_adj = 2;
9388  optional int32 pid = 3;
9389}
9390message MarkVictimFtraceEvent {
9391  optional int32 pid = 1;
9392}
9393
9394// End of protos/perfetto/trace/ftrace/oom.proto
9395
9396// Begin of protos/perfetto/trace/ftrace/panel.proto
9397
9398message DsiCmdFifoStatusFtraceEvent {
9399  optional uint32 header = 1;
9400  optional uint32 payload = 2;
9401}
9402message DsiRxFtraceEvent {
9403  optional uint32 cmd = 1;
9404  optional uint32 rx_buf = 2;
9405}
9406message DsiTxFtraceEvent {
9407  optional uint32 last = 1;
9408  optional uint32 tx_buf = 2;
9409  optional uint32 type = 3;
9410}
9411message PanelWriteGenericFtraceEvent {
9412  optional int32 pid = 1;
9413  optional string trace_name = 2;
9414  optional uint32 trace_begin = 3;
9415  optional string name = 4;
9416  optional uint32 type = 5;
9417  optional int32 value = 6;
9418}
9419
9420// End of protos/perfetto/trace/ftrace/panel.proto
9421
9422// Begin of protos/perfetto/trace/ftrace/perf_trace_counters.proto
9423
9424message SchedSwitchWithCtrsFtraceEvent {
9425  optional int32 old_pid = 1;
9426  optional int32 new_pid = 2;
9427  optional uint32 cctr = 3;
9428  optional uint32 ctr0 = 4;
9429  optional uint32 ctr1 = 5;
9430  optional uint32 ctr2 = 6;
9431  optional uint32 ctr3 = 7;
9432  optional uint32 lctr0 = 8;
9433  optional uint32 lctr1 = 9;
9434  optional uint32 ctr4 = 10;
9435  optional uint32 ctr5 = 11;
9436  optional string prev_comm = 12;
9437  optional int32 prev_pid = 13;
9438  optional uint32 cyc = 14;
9439  optional uint32 inst = 15;
9440  optional uint32 stallbm = 16;
9441  optional uint32 l3dm = 17;
9442}
9443
9444// End of protos/perfetto/trace/ftrace/perf_trace_counters.proto
9445
9446// Begin of protos/perfetto/trace/ftrace/power.proto
9447
9448message CpuFrequencyFtraceEvent {
9449  optional uint32 state = 1;
9450  optional uint32 cpu_id = 2;
9451}
9452message CpuFrequencyLimitsFtraceEvent {
9453  optional uint32 min_freq = 1;
9454  optional uint32 max_freq = 2;
9455  optional uint32 cpu_id = 3;
9456}
9457message CpuIdleFtraceEvent {
9458  optional uint32 state = 1;
9459  optional uint32 cpu_id = 2;
9460}
9461message ClockEnableFtraceEvent {
9462  optional string name = 1;
9463  optional uint64 state = 2;
9464  optional uint64 cpu_id = 3;
9465}
9466message ClockDisableFtraceEvent {
9467  optional string name = 1;
9468  optional uint64 state = 2;
9469  optional uint64 cpu_id = 3;
9470}
9471message ClockSetRateFtraceEvent {
9472  optional string name = 1;
9473  optional uint64 state = 2;
9474  optional uint64 cpu_id = 3;
9475}
9476message SuspendResumeFtraceEvent {
9477  optional string action = 1;
9478  optional int32 val = 2;
9479  optional uint32 start = 3;
9480}
9481message GpuFrequencyFtraceEvent {
9482  optional uint32 gpu_id = 1;
9483  optional uint32 state = 2;
9484}
9485message WakeupSourceActivateFtraceEvent {
9486  optional string name = 1;
9487  optional uint64 state = 2;
9488}
9489message WakeupSourceDeactivateFtraceEvent {
9490  optional string name = 1;
9491  optional uint64 state = 2;
9492}
9493message GpuWorkPeriodFtraceEvent {
9494  optional uint32 gpu_id = 1;
9495  optional uint32 uid = 2;
9496  optional uint64 start_time_ns = 3;
9497  optional uint64 end_time_ns = 4;
9498  optional uint64 total_active_duration_ns = 5;
9499}
9500
9501// End of protos/perfetto/trace/ftrace/power.proto
9502
9503// Begin of protos/perfetto/trace/ftrace/printk.proto
9504
9505message ConsoleFtraceEvent {
9506  optional string msg = 1;
9507}
9508
9509// End of protos/perfetto/trace/ftrace/printk.proto
9510
9511// Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto
9512
9513message SysEnterFtraceEvent {
9514  optional int64 id = 1;
9515  repeated uint64 args = 2;
9516}
9517message SysExitFtraceEvent {
9518  optional int64 id = 1;
9519  optional int64 ret = 2;
9520}
9521
9522// End of protos/perfetto/trace/ftrace/raw_syscalls.proto
9523
9524// Begin of protos/perfetto/trace/ftrace/regulator.proto
9525
9526message RegulatorDisableFtraceEvent {
9527  optional string name = 1;
9528}
9529message RegulatorDisableCompleteFtraceEvent {
9530  optional string name = 1;
9531}
9532message RegulatorEnableFtraceEvent {
9533  optional string name = 1;
9534}
9535message RegulatorEnableCompleteFtraceEvent {
9536  optional string name = 1;
9537}
9538message RegulatorEnableDelayFtraceEvent {
9539  optional string name = 1;
9540}
9541message RegulatorSetVoltageFtraceEvent {
9542  optional string name = 1;
9543  optional int32 min = 2;
9544  optional int32 max = 3;
9545}
9546message RegulatorSetVoltageCompleteFtraceEvent {
9547  optional string name = 1;
9548  optional uint32 val = 2;
9549}
9550
9551// End of protos/perfetto/trace/ftrace/regulator.proto
9552
9553// Begin of protos/perfetto/trace/ftrace/rpm.proto
9554
9555message RpmStatusFtraceEvent {
9556  optional string name = 1;
9557  optional int32 status = 2;
9558}
9559
9560// End of protos/perfetto/trace/ftrace/rpm.proto
9561
9562// Begin of protos/perfetto/trace/ftrace/samsung.proto
9563
9564message SamsungTracingMarkWriteFtraceEvent {
9565  optional int32 pid = 1;
9566  optional string trace_name = 2;
9567  optional uint32 trace_begin = 3;
9568  optional uint32 trace_type = 4;
9569  optional int32 value = 5;
9570}
9571
9572// End of protos/perfetto/trace/ftrace/samsung.proto
9573
9574// Begin of protos/perfetto/trace/ftrace/sched.proto
9575
9576message SchedSwitchFtraceEvent {
9577  optional string prev_comm = 1;
9578  optional int32 prev_pid = 2;
9579  optional int32 prev_prio = 3;
9580  optional int64 prev_state = 4;
9581  optional string next_comm = 5;
9582  optional int32 next_pid = 6;
9583  optional int32 next_prio = 7;
9584}
9585message SchedWakeupFtraceEvent {
9586  optional string comm = 1;
9587  optional int32 pid = 2;
9588  optional int32 prio = 3;
9589  optional int32 success = 4;
9590  optional int32 target_cpu = 5;
9591}
9592message SchedBlockedReasonFtraceEvent {
9593  optional int32 pid = 1;
9594  optional uint64 caller = 2;
9595  optional uint32 io_wait = 3;
9596}
9597message SchedCpuHotplugFtraceEvent {
9598  optional int32 affected_cpu = 1;
9599  optional int32 error = 2;
9600  optional int32 status = 3;
9601}
9602message SchedWakingFtraceEvent {
9603  optional string comm = 1;
9604  optional int32 pid = 2;
9605  optional int32 prio = 3;
9606  optional int32 success = 4;
9607  optional int32 target_cpu = 5;
9608}
9609message SchedWakeupNewFtraceEvent {
9610  optional string comm = 1;
9611  optional int32 pid = 2;
9612  optional int32 prio = 3;
9613  optional int32 success = 4;
9614  optional int32 target_cpu = 5;
9615}
9616message SchedProcessExecFtraceEvent {
9617  optional string filename = 1;
9618  optional int32 pid = 2;
9619  optional int32 old_pid = 3;
9620}
9621message SchedProcessExitFtraceEvent {
9622  optional string comm = 1;
9623  optional int32 pid = 2;
9624  optional int32 tgid = 3;
9625  optional int32 prio = 4;
9626}
9627message SchedProcessForkFtraceEvent {
9628  optional string parent_comm = 1;
9629  optional int32 parent_pid = 2;
9630  optional string child_comm = 3;
9631  optional int32 child_pid = 4;
9632}
9633message SchedProcessFreeFtraceEvent {
9634  optional string comm = 1;
9635  optional int32 pid = 2;
9636  optional int32 prio = 3;
9637}
9638message SchedProcessHangFtraceEvent {
9639  optional string comm = 1;
9640  optional int32 pid = 2;
9641}
9642message SchedProcessWaitFtraceEvent {
9643  optional string comm = 1;
9644  optional int32 pid = 2;
9645  optional int32 prio = 3;
9646}
9647message SchedPiSetprioFtraceEvent {
9648  optional string comm = 1;
9649  optional int32 newprio = 2;
9650  optional int32 oldprio = 3;
9651  optional int32 pid = 4;
9652}
9653message SchedCpuUtilCfsFtraceEvent {
9654  optional int32 active = 1;
9655  optional uint64 capacity = 2;
9656  optional uint64 capacity_orig = 3;
9657  optional uint32 cpu = 4;
9658  optional uint64 cpu_importance = 5;
9659  optional uint64 cpu_util = 6;
9660  optional uint32 exit_lat = 7;
9661  optional uint64 group_capacity = 8;
9662  optional uint32 grp_overutilized = 9;
9663  optional uint32 idle_cpu = 10;
9664  optional uint32 nr_running = 11;
9665  optional int64 spare_cap = 12;
9666  optional uint32 task_fits = 13;
9667  optional uint64 wake_group_util = 14;
9668  optional uint64 wake_util = 15;
9669}
9670message SchedMigrateTaskFtraceEvent {
9671  optional string comm = 1;
9672  optional int32 pid = 2;
9673  optional int32 prio = 3;
9674  optional int32 orig_cpu = 4;
9675  optional int32 dest_cpu = 5;
9676  optional int32 running = 6;
9677  optional uint32 load = 7;
9678}
9679
9680// End of protos/perfetto/trace/ftrace/sched.proto
9681
9682// Begin of protos/perfetto/trace/ftrace/scm.proto
9683
9684message ScmCallStartFtraceEvent {
9685  optional uint32 arginfo = 1;
9686  optional uint64 x0 = 2;
9687  optional uint64 x5 = 3;
9688}
9689message ScmCallEndFtraceEvent {}
9690
9691// End of protos/perfetto/trace/ftrace/scm.proto
9692
9693// Begin of protos/perfetto/trace/ftrace/sde.proto
9694
9695message SdeTracingMarkWriteFtraceEvent {
9696  optional int32 pid = 1;
9697  optional string trace_name = 2;
9698  optional uint32 trace_type = 3;
9699  optional int32 value = 4;
9700  optional uint32 trace_begin = 5;
9701}
9702message SdeSdeEvtlogFtraceEvent {
9703  optional string evtlog_tag = 1;
9704  optional int32 pid = 2;
9705  optional uint32 tag_id = 3;
9706}
9707message SdeSdePerfCalcCrtcFtraceEvent {
9708  optional uint64 bw_ctl_ebi = 1;
9709  optional uint64 bw_ctl_llcc = 2;
9710  optional uint64 bw_ctl_mnoc = 3;
9711  optional uint32 core_clk_rate = 4;
9712  optional uint32 crtc = 5;
9713  optional uint64 ib_ebi = 6;
9714  optional uint64 ib_llcc = 7;
9715  optional uint64 ib_mnoc = 8;
9716}
9717message SdeSdePerfCrtcUpdateFtraceEvent {
9718  optional uint64 bw_ctl_ebi = 1;
9719  optional uint64 bw_ctl_llcc = 2;
9720  optional uint64 bw_ctl_mnoc = 3;
9721  optional uint32 core_clk_rate = 4;
9722  optional uint32 crtc = 5;
9723  optional int32 params = 6;
9724  optional uint64 per_pipe_ib_ebi = 7;
9725  optional uint64 per_pipe_ib_llcc = 8;
9726  optional uint64 per_pipe_ib_mnoc = 9;
9727  optional uint32 stop_req = 10;
9728  optional uint32 update_bus = 11;
9729  optional uint32 update_clk = 12;
9730}
9731message SdeSdePerfSetQosLutsFtraceEvent {
9732  optional uint32 fl = 1;
9733  optional uint32 fmt = 2;
9734  optional uint64 lut = 3;
9735  optional uint32 lut_usage = 4;
9736  optional uint32 pnum = 5;
9737  optional uint32 rt = 6;
9738}
9739message SdeSdePerfUpdateBusFtraceEvent {
9740  optional uint64 ab_quota = 1;
9741  optional uint32 bus_id = 2;
9742  optional int32 client = 3;
9743  optional uint64 ib_quota = 4;
9744}
9745
9746// End of protos/perfetto/trace/ftrace/sde.proto
9747
9748// Begin of protos/perfetto/trace/ftrace/signal.proto
9749
9750message SignalDeliverFtraceEvent {
9751  optional int32 code = 1;
9752  optional uint64 sa_flags = 2;
9753  optional int32 sig = 3;
9754}
9755message SignalGenerateFtraceEvent {
9756  optional int32 code = 1;
9757  optional string comm = 2;
9758  optional int32 group = 3;
9759  optional int32 pid = 4;
9760  optional int32 result = 5;
9761  optional int32 sig = 6;
9762}
9763
9764// End of protos/perfetto/trace/ftrace/signal.proto
9765
9766// Begin of protos/perfetto/trace/ftrace/skb.proto
9767
9768message KfreeSkbFtraceEvent {
9769  optional uint64 location = 1;
9770  optional uint32 protocol = 2;
9771  optional uint64 skbaddr = 3;
9772}
9773
9774// End of protos/perfetto/trace/ftrace/skb.proto
9775
9776// Begin of protos/perfetto/trace/ftrace/sock.proto
9777
9778message InetSockSetStateFtraceEvent {
9779  optional uint32 daddr = 1;
9780  optional uint32 dport = 2;
9781  optional uint32 family = 3;
9782  optional int32 newstate = 4;
9783  optional int32 oldstate = 5;
9784  optional uint32 protocol = 6;
9785  optional uint32 saddr = 7;
9786  optional uint64 skaddr = 8;
9787  optional uint32 sport = 9;
9788}
9789
9790// End of protos/perfetto/trace/ftrace/sock.proto
9791
9792// Begin of protos/perfetto/trace/ftrace/sync.proto
9793
9794message SyncPtFtraceEvent {
9795  optional string timeline = 1;
9796  optional string value = 2;
9797}
9798message SyncTimelineFtraceEvent {
9799  optional string name = 1;
9800  optional string value = 2;
9801}
9802message SyncWaitFtraceEvent {
9803  optional string name = 1;
9804  optional int32 status = 2;
9805  optional uint32 begin = 3;
9806}
9807
9808// End of protos/perfetto/trace/ftrace/sync.proto
9809
9810// Begin of protos/perfetto/trace/ftrace/synthetic.proto
9811
9812message RssStatThrottledFtraceEvent {
9813  optional uint32 curr = 1;
9814  optional int32 member = 2;
9815  optional uint32 mm_id = 3;
9816  optional int64 size = 4;
9817}
9818message SuspendResumeMinimalFtraceEvent {
9819  optional uint32 start = 1;
9820}
9821
9822// End of protos/perfetto/trace/ftrace/synthetic.proto
9823
9824// Begin of protos/perfetto/trace/ftrace/systrace.proto
9825
9826message ZeroFtraceEvent {
9827  optional int32 flag = 1;
9828  optional string name = 2;
9829  optional int32 pid = 3;
9830  optional int64 value = 4;
9831}
9832
9833// End of protos/perfetto/trace/ftrace/systrace.proto
9834
9835// Begin of protos/perfetto/trace/ftrace/task.proto
9836
9837message TaskNewtaskFtraceEvent {
9838  optional int32 pid = 1;
9839  optional string comm = 2;
9840  optional uint64 clone_flags = 3;
9841  optional int32 oom_score_adj = 4;
9842}
9843message TaskRenameFtraceEvent {
9844  optional int32 pid = 1;
9845  optional string oldcomm = 2;
9846  optional string newcomm = 3;
9847  optional int32 oom_score_adj = 4;
9848}
9849
9850// End of protos/perfetto/trace/ftrace/task.proto
9851
9852// Begin of protos/perfetto/trace/ftrace/tcp.proto
9853
9854message TcpRetransmitSkbFtraceEvent {
9855  optional uint32 daddr = 1;
9856  optional uint32 dport = 2;
9857  optional uint32 saddr = 3;
9858  optional uint64 skaddr = 4;
9859  optional uint64 skbaddr = 5;
9860  optional uint32 sport = 6;
9861  optional int32 state = 7;
9862}
9863
9864// End of protos/perfetto/trace/ftrace/tcp.proto
9865
9866// Begin of protos/perfetto/trace/ftrace/thermal.proto
9867
9868message ThermalTemperatureFtraceEvent {
9869  optional int32 id = 1;
9870  optional int32 temp = 2;
9871  optional int32 temp_prev = 3;
9872  optional string thermal_zone = 4;
9873}
9874message CdevUpdateFtraceEvent {
9875  optional uint64 target = 1;
9876  optional string type = 2;
9877}
9878
9879// End of protos/perfetto/trace/ftrace/thermal.proto
9880
9881// Begin of protos/perfetto/trace/ftrace/trusty.proto
9882
9883message TrustySmcFtraceEvent {
9884  optional uint64 r0 = 1;
9885  optional uint64 r1 = 2;
9886  optional uint64 r2 = 3;
9887  optional uint64 r3 = 4;
9888}
9889message TrustySmcDoneFtraceEvent {
9890  optional uint64 ret = 1;
9891}
9892message TrustyStdCall32FtraceEvent {
9893  optional uint64 r0 = 1;
9894  optional uint64 r1 = 2;
9895  optional uint64 r2 = 3;
9896  optional uint64 r3 = 4;
9897}
9898message TrustyStdCall32DoneFtraceEvent {
9899  optional int64 ret = 1;
9900}
9901message TrustyShareMemoryFtraceEvent {
9902  optional uint64 len = 1;
9903  optional uint32 lend = 2;
9904  optional uint32 nents = 3;
9905}
9906message TrustyShareMemoryDoneFtraceEvent {
9907  optional uint64 handle = 1;
9908  optional uint64 len = 2;
9909  optional uint32 lend = 3;
9910  optional uint32 nents = 4;
9911  optional int32 ret = 5;
9912}
9913message TrustyReclaimMemoryFtraceEvent {
9914  optional uint64 id = 1;
9915}
9916message TrustyReclaimMemoryDoneFtraceEvent {
9917  optional uint64 id = 1;
9918  optional int32 ret = 2;
9919}
9920message TrustyIrqFtraceEvent {
9921  optional int32 irq = 1;
9922}
9923message TrustyIpcHandleEventFtraceEvent {
9924  optional uint32 chan = 1;
9925  optional uint32 event_id = 2;
9926  optional string srv_name = 3;
9927}
9928message TrustyIpcConnectFtraceEvent {
9929  optional uint32 chan = 1;
9930  optional string port = 2;
9931  optional int32 state = 3;
9932}
9933message TrustyIpcConnectEndFtraceEvent {
9934  optional uint32 chan = 1;
9935  optional int32 err = 2;
9936  optional int32 state = 3;
9937}
9938message TrustyIpcWriteFtraceEvent {
9939  optional uint64 buf_id = 1;
9940  optional uint32 chan = 2;
9941  optional int32 kind_shm = 3;
9942  optional int32 len_or_err = 4;
9943  optional uint64 shm_cnt = 5;
9944  optional string srv_name = 6;
9945}
9946message TrustyIpcPollFtraceEvent {
9947  optional uint32 chan = 1;
9948  optional uint32 poll_mask = 2;
9949  optional string srv_name = 3;
9950}
9951message TrustyIpcReadFtraceEvent {
9952  optional uint32 chan = 1;
9953  optional string srv_name = 2;
9954}
9955message TrustyIpcReadEndFtraceEvent {
9956  optional uint64 buf_id = 1;
9957  optional uint32 chan = 2;
9958  optional int32 len_or_err = 3;
9959  optional uint64 shm_cnt = 4;
9960  optional string srv_name = 5;
9961}
9962message TrustyIpcRxFtraceEvent {
9963  optional uint64 buf_id = 1;
9964  optional uint32 chan = 2;
9965  optional string srv_name = 3;
9966}
9967message TrustyEnqueueNopFtraceEvent {
9968  optional uint32 arg1 = 1;
9969  optional uint32 arg2 = 2;
9970  optional uint32 arg3 = 3;
9971}
9972
9973// End of protos/perfetto/trace/ftrace/trusty.proto
9974
9975// Begin of protos/perfetto/trace/ftrace/ufs.proto
9976
9977message UfshcdCommandFtraceEvent {
9978  optional string dev_name = 1;
9979  optional uint32 doorbell = 2;
9980  optional uint32 intr = 3;
9981  optional uint64 lba = 4;
9982  optional uint32 opcode = 5;
9983  optional string str = 6;
9984  optional uint32 tag = 7;
9985  optional int32 transfer_len = 8;
9986  optional uint32 group_id = 9;
9987  optional uint32 str_t = 10;
9988}
9989message UfshcdClkGatingFtraceEvent {
9990  optional string dev_name = 1;
9991  optional int32 state = 2;
9992}
9993
9994// End of protos/perfetto/trace/ftrace/ufs.proto
9995
9996// Begin of protos/perfetto/trace/ftrace/v4l2.proto
9997
9998message V4l2QbufFtraceEvent {
9999  optional uint32 bytesused = 1;
10000  optional uint32 field = 2;
10001  optional uint32 flags = 3;
10002  optional uint32 index = 4;
10003  optional int32 minor = 5;
10004  optional uint32 sequence = 6;
10005  optional uint32 timecode_flags = 7;
10006  optional uint32 timecode_frames = 8;
10007  optional uint32 timecode_hours = 9;
10008  optional uint32 timecode_minutes = 10;
10009  optional uint32 timecode_seconds = 11;
10010  optional uint32 timecode_type = 12;
10011  optional uint32 timecode_userbits0 = 13;
10012  optional uint32 timecode_userbits1 = 14;
10013  optional uint32 timecode_userbits2 = 15;
10014  optional uint32 timecode_userbits3 = 16;
10015  optional int64 timestamp = 17;
10016  optional uint32 type = 18;
10017}
10018message V4l2DqbufFtraceEvent {
10019  optional uint32 bytesused = 1;
10020  optional uint32 field = 2;
10021  optional uint32 flags = 3;
10022  optional uint32 index = 4;
10023  optional int32 minor = 5;
10024  optional uint32 sequence = 6;
10025  optional uint32 timecode_flags = 7;
10026  optional uint32 timecode_frames = 8;
10027  optional uint32 timecode_hours = 9;
10028  optional uint32 timecode_minutes = 10;
10029  optional uint32 timecode_seconds = 11;
10030  optional uint32 timecode_type = 12;
10031  optional uint32 timecode_userbits0 = 13;
10032  optional uint32 timecode_userbits1 = 14;
10033  optional uint32 timecode_userbits2 = 15;
10034  optional uint32 timecode_userbits3 = 16;
10035  optional int64 timestamp = 17;
10036  optional uint32 type = 18;
10037}
10038message Vb2V4l2BufQueueFtraceEvent {
10039  optional uint32 field = 1;
10040  optional uint32 flags = 2;
10041  optional int32 minor = 3;
10042  optional uint32 sequence = 4;
10043  optional uint32 timecode_flags = 5;
10044  optional uint32 timecode_frames = 6;
10045  optional uint32 timecode_hours = 7;
10046  optional uint32 timecode_minutes = 8;
10047  optional uint32 timecode_seconds = 9;
10048  optional uint32 timecode_type = 10;
10049  optional uint32 timecode_userbits0 = 11;
10050  optional uint32 timecode_userbits1 = 12;
10051  optional uint32 timecode_userbits2 = 13;
10052  optional uint32 timecode_userbits3 = 14;
10053  optional int64 timestamp = 15;
10054}
10055message Vb2V4l2BufDoneFtraceEvent {
10056  optional uint32 field = 1;
10057  optional uint32 flags = 2;
10058  optional int32 minor = 3;
10059  optional uint32 sequence = 4;
10060  optional uint32 timecode_flags = 5;
10061  optional uint32 timecode_frames = 6;
10062  optional uint32 timecode_hours = 7;
10063  optional uint32 timecode_minutes = 8;
10064  optional uint32 timecode_seconds = 9;
10065  optional uint32 timecode_type = 10;
10066  optional uint32 timecode_userbits0 = 11;
10067  optional uint32 timecode_userbits1 = 12;
10068  optional uint32 timecode_userbits2 = 13;
10069  optional uint32 timecode_userbits3 = 14;
10070  optional int64 timestamp = 15;
10071}
10072message Vb2V4l2QbufFtraceEvent {
10073  optional uint32 field = 1;
10074  optional uint32 flags = 2;
10075  optional int32 minor = 3;
10076  optional uint32 sequence = 4;
10077  optional uint32 timecode_flags = 5;
10078  optional uint32 timecode_frames = 6;
10079  optional uint32 timecode_hours = 7;
10080  optional uint32 timecode_minutes = 8;
10081  optional uint32 timecode_seconds = 9;
10082  optional uint32 timecode_type = 10;
10083  optional uint32 timecode_userbits0 = 11;
10084  optional uint32 timecode_userbits1 = 12;
10085  optional uint32 timecode_userbits2 = 13;
10086  optional uint32 timecode_userbits3 = 14;
10087  optional int64 timestamp = 15;
10088}
10089message Vb2V4l2DqbufFtraceEvent {
10090  optional uint32 field = 1;
10091  optional uint32 flags = 2;
10092  optional int32 minor = 3;
10093  optional uint32 sequence = 4;
10094  optional uint32 timecode_flags = 5;
10095  optional uint32 timecode_frames = 6;
10096  optional uint32 timecode_hours = 7;
10097  optional uint32 timecode_minutes = 8;
10098  optional uint32 timecode_seconds = 9;
10099  optional uint32 timecode_type = 10;
10100  optional uint32 timecode_userbits0 = 11;
10101  optional uint32 timecode_userbits1 = 12;
10102  optional uint32 timecode_userbits2 = 13;
10103  optional uint32 timecode_userbits3 = 14;
10104  optional int64 timestamp = 15;
10105}
10106
10107// End of protos/perfetto/trace/ftrace/v4l2.proto
10108
10109// Begin of protos/perfetto/trace/ftrace/virtio_gpu.proto
10110
10111message VirtioGpuCmdQueueFtraceEvent {
10112  optional uint32 ctx_id = 1;
10113  optional int32 dev = 2;
10114  optional uint64 fence_id = 3;
10115  optional uint32 flags = 4;
10116  optional string name = 5;
10117  optional uint32 num_free = 6;
10118  optional uint32 seqno = 7;
10119  optional uint32 type = 8;
10120  optional uint32 vq = 9;
10121}
10122message VirtioGpuCmdResponseFtraceEvent {
10123  optional uint32 ctx_id = 1;
10124  optional int32 dev = 2;
10125  optional uint64 fence_id = 3;
10126  optional uint32 flags = 4;
10127  optional string name = 5;
10128  optional uint32 num_free = 6;
10129  optional uint32 seqno = 7;
10130  optional uint32 type = 8;
10131  optional uint32 vq = 9;
10132}
10133
10134// End of protos/perfetto/trace/ftrace/virtio_gpu.proto
10135
10136// Begin of protos/perfetto/trace/ftrace/virtio_video.proto
10137
10138message VirtioVideoCmdFtraceEvent {
10139  optional uint32 stream_id = 1;
10140  optional uint32 type = 2;
10141}
10142message VirtioVideoCmdDoneFtraceEvent {
10143  optional uint32 stream_id = 1;
10144  optional uint32 type = 2;
10145}
10146message VirtioVideoResourceQueueFtraceEvent {
10147  optional uint32 data_size0 = 1;
10148  optional uint32 data_size1 = 2;
10149  optional uint32 data_size2 = 3;
10150  optional uint32 data_size3 = 4;
10151  optional uint32 queue_type = 5;
10152  optional int32 resource_id = 6;
10153  optional int32 stream_id = 7;
10154  optional uint64 timestamp = 8;
10155}
10156message VirtioVideoResourceQueueDoneFtraceEvent {
10157  optional uint32 data_size0 = 1;
10158  optional uint32 data_size1 = 2;
10159  optional uint32 data_size2 = 3;
10160  optional uint32 data_size3 = 4;
10161  optional uint32 queue_type = 5;
10162  optional int32 resource_id = 6;
10163  optional int32 stream_id = 7;
10164  optional uint64 timestamp = 8;
10165}
10166
10167// End of protos/perfetto/trace/ftrace/virtio_video.proto
10168
10169// Begin of protos/perfetto/trace/ftrace/vmscan.proto
10170
10171message MmVmscanDirectReclaimBeginFtraceEvent {
10172  optional int32 order = 1;
10173  optional int32 may_writepage = 2;
10174  optional uint32 gfp_flags = 3;
10175}
10176message MmVmscanDirectReclaimEndFtraceEvent {
10177  optional uint64 nr_reclaimed = 1;
10178}
10179message MmVmscanKswapdWakeFtraceEvent {
10180  optional int32 nid = 1;
10181  optional int32 order = 2;
10182  optional int32 zid = 3;
10183}
10184message MmVmscanKswapdSleepFtraceEvent {
10185  optional int32 nid = 1;
10186}
10187message MmShrinkSlabStartFtraceEvent {
10188  optional uint64 cache_items = 1;
10189  optional uint64 delta = 2;
10190  optional uint32 gfp_flags = 3;
10191  optional uint64 lru_pgs = 4;
10192  optional int64 nr_objects_to_shrink = 5;
10193  optional uint64 pgs_scanned = 6;
10194  optional uint64 shr = 7;
10195  optional uint64 shrink = 8;
10196  optional uint64 total_scan = 9;
10197  optional int32 nid = 10;
10198  optional int32 priority = 11;
10199}
10200message MmShrinkSlabEndFtraceEvent {
10201  optional int64 new_scan = 1;
10202  optional int32 retval = 2;
10203  optional uint64 shr = 3;
10204  optional uint64 shrink = 4;
10205  optional int64 total_scan = 5;
10206  optional int64 unused_scan = 6;
10207  optional int32 nid = 7;
10208}
10209
10210// End of protos/perfetto/trace/ftrace/vmscan.proto
10211
10212// Begin of protos/perfetto/trace/ftrace/workqueue.proto
10213
10214message WorkqueueActivateWorkFtraceEvent {
10215  optional uint64 work = 1;
10216}
10217message WorkqueueExecuteEndFtraceEvent {
10218  optional uint64 work = 1;
10219  optional uint64 function = 2;
10220}
10221message WorkqueueExecuteStartFtraceEvent {
10222  optional uint64 work = 1;
10223  optional uint64 function = 2;
10224}
10225message WorkqueueQueueWorkFtraceEvent {
10226  optional uint64 work = 1;
10227  optional uint64 function = 2;
10228  optional uint64 workqueue = 3;
10229  optional uint32 req_cpu = 4;
10230  optional uint32 cpu = 5;
10231}
10232
10233// End of protos/perfetto/trace/ftrace/workqueue.proto
10234
10235// Begin of protos/perfetto/trace/ftrace/ftrace_event.proto
10236
10237message FtraceEvent {
10238  // Timestamp in nanoseconds using .../tracing/trace_clock.
10239  optional uint64 timestamp = 1;
10240
10241  // Kernel pid (do not confuse with userspace pid aka tgid).
10242  optional uint32 pid = 2;
10243
10244  // Not populated in actual traces. Wire format might change.
10245  // Placeholder declaration so that the ftrace parsing code accepts the
10246  // existence of this common field. If this becomes needed for all events:
10247  // consider merging with common_preempt_count to avoid extra proto tags.
10248  optional uint32 common_flags = 5;
10249
10250  oneof event {
10251    PrintFtraceEvent print = 3;
10252    SchedSwitchFtraceEvent sched_switch = 4;
10253    // removed field with id 5;
10254    // removed field with id 6;
10255    // removed field with id 7;
10256    // removed field with id 8;
10257    // removed field with id 9;
10258    // removed field with id 10;
10259    CpuFrequencyFtraceEvent cpu_frequency = 11;
10260    CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12;
10261    CpuIdleFtraceEvent cpu_idle = 13;
10262    ClockEnableFtraceEvent clock_enable = 14;
10263    ClockDisableFtraceEvent clock_disable = 15;
10264    ClockSetRateFtraceEvent clock_set_rate = 16;
10265    SchedWakeupFtraceEvent sched_wakeup = 17;
10266    SchedBlockedReasonFtraceEvent sched_blocked_reason = 18;
10267    SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19;
10268    SchedWakingFtraceEvent sched_waking = 20;
10269    IpiEntryFtraceEvent ipi_entry = 21;
10270    IpiExitFtraceEvent ipi_exit = 22;
10271    IpiRaiseFtraceEvent ipi_raise = 23;
10272    SoftirqEntryFtraceEvent softirq_entry = 24;
10273    SoftirqExitFtraceEvent softirq_exit = 25;
10274    SoftirqRaiseFtraceEvent softirq_raise = 26;
10275    I2cReadFtraceEvent i2c_read = 27;
10276    I2cWriteFtraceEvent i2c_write = 28;
10277    I2cResultFtraceEvent i2c_result = 29;
10278    I2cReplyFtraceEvent i2c_reply = 30;
10279    SmbusReadFtraceEvent smbus_read = 31;
10280    SmbusWriteFtraceEvent smbus_write = 32;
10281    SmbusResultFtraceEvent smbus_result = 33;
10282    SmbusReplyFtraceEvent smbus_reply = 34;
10283    LowmemoryKillFtraceEvent lowmemory_kill = 35;
10284    IrqHandlerEntryFtraceEvent irq_handler_entry = 36;
10285    IrqHandlerExitFtraceEvent irq_handler_exit = 37;
10286    SyncPtFtraceEvent sync_pt = 38;
10287    SyncTimelineFtraceEvent sync_timeline = 39;
10288    SyncWaitFtraceEvent sync_wait = 40;
10289    Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41;
10290    Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42;
10291    Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43;
10292    Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44;
10293    BlockRqIssueFtraceEvent block_rq_issue = 45;
10294    MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46;
10295    MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47;
10296    MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48;
10297    MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49;
10298    BinderTransactionFtraceEvent binder_transaction = 50;
10299    BinderTransactionReceivedFtraceEvent binder_transaction_received = 51;
10300    BinderSetPriorityFtraceEvent binder_set_priority = 52;
10301    BinderLockFtraceEvent binder_lock = 53;
10302    BinderLockedFtraceEvent binder_locked = 54;
10303    BinderUnlockFtraceEvent binder_unlock = 55;
10304    WorkqueueActivateWorkFtraceEvent workqueue_activate_work = 56;
10305    WorkqueueExecuteEndFtraceEvent workqueue_execute_end = 57;
10306    WorkqueueExecuteStartFtraceEvent workqueue_execute_start = 58;
10307    WorkqueueQueueWorkFtraceEvent workqueue_queue_work = 59;
10308    RegulatorDisableFtraceEvent regulator_disable = 60;
10309    RegulatorDisableCompleteFtraceEvent regulator_disable_complete = 61;
10310    RegulatorEnableFtraceEvent regulator_enable = 62;
10311    RegulatorEnableCompleteFtraceEvent regulator_enable_complete = 63;
10312    RegulatorEnableDelayFtraceEvent regulator_enable_delay = 64;
10313    RegulatorSetVoltageFtraceEvent regulator_set_voltage = 65;
10314    RegulatorSetVoltageCompleteFtraceEvent regulator_set_voltage_complete = 66;
10315    CgroupAttachTaskFtraceEvent cgroup_attach_task = 67;
10316    CgroupMkdirFtraceEvent cgroup_mkdir = 68;
10317    CgroupRemountFtraceEvent cgroup_remount = 69;
10318    CgroupRmdirFtraceEvent cgroup_rmdir = 70;
10319    CgroupTransferTasksFtraceEvent cgroup_transfer_tasks = 71;
10320    CgroupDestroyRootFtraceEvent cgroup_destroy_root = 72;
10321    CgroupReleaseFtraceEvent cgroup_release = 73;
10322    CgroupRenameFtraceEvent cgroup_rename = 74;
10323    CgroupSetupRootFtraceEvent cgroup_setup_root = 75;
10324    MdpCmdKickoffFtraceEvent mdp_cmd_kickoff = 76;
10325    MdpCommitFtraceEvent mdp_commit = 77;
10326    MdpPerfSetOtFtraceEvent mdp_perf_set_ot = 78;
10327    MdpSsppChangeFtraceEvent mdp_sspp_change = 79;
10328    TracingMarkWriteFtraceEvent tracing_mark_write = 80;
10329    MdpCmdPingpongDoneFtraceEvent mdp_cmd_pingpong_done = 81;
10330    MdpCompareBwFtraceEvent mdp_compare_bw = 82;
10331    MdpPerfSetPanicLutsFtraceEvent mdp_perf_set_panic_luts = 83;
10332    MdpSsppSetFtraceEvent mdp_sspp_set = 84;
10333    MdpCmdReadptrDoneFtraceEvent mdp_cmd_readptr_done = 85;
10334    MdpMisrCrcFtraceEvent mdp_misr_crc = 86;
10335    MdpPerfSetQosLutsFtraceEvent mdp_perf_set_qos_luts = 87;
10336    MdpTraceCounterFtraceEvent mdp_trace_counter = 88;
10337    MdpCmdReleaseBwFtraceEvent mdp_cmd_release_bw = 89;
10338    MdpMixerUpdateFtraceEvent mdp_mixer_update = 90;
10339    MdpPerfSetWmLevelsFtraceEvent mdp_perf_set_wm_levels = 91;
10340    MdpVideoUnderrunDoneFtraceEvent mdp_video_underrun_done = 92;
10341    MdpCmdWaitPingpongFtraceEvent mdp_cmd_wait_pingpong = 93;
10342    MdpPerfPrefillCalcFtraceEvent mdp_perf_prefill_calc = 94;
10343    MdpPerfUpdateBusFtraceEvent mdp_perf_update_bus = 95;
10344    RotatorBwAoAsContextFtraceEvent rotator_bw_ao_as_context = 96;
10345    MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97;
10346    MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache =
10347        98;
10348    MmCompactionBeginFtraceEvent mm_compaction_begin = 99;
10349    MmCompactionDeferCompactionFtraceEvent mm_compaction_defer_compaction = 100;
10350    MmCompactionDeferredFtraceEvent mm_compaction_deferred = 101;
10351    MmCompactionDeferResetFtraceEvent mm_compaction_defer_reset = 102;
10352    MmCompactionEndFtraceEvent mm_compaction_end = 103;
10353    MmCompactionFinishedFtraceEvent mm_compaction_finished = 104;
10354    MmCompactionIsolateFreepagesFtraceEvent mm_compaction_isolate_freepages =
10355        105;
10356    MmCompactionIsolateMigratepagesFtraceEvent
10357        mm_compaction_isolate_migratepages = 106;
10358    MmCompactionKcompactdSleepFtraceEvent mm_compaction_kcompactd_sleep = 107;
10359    MmCompactionKcompactdWakeFtraceEvent mm_compaction_kcompactd_wake = 108;
10360    MmCompactionMigratepagesFtraceEvent mm_compaction_migratepages = 109;
10361    MmCompactionSuitableFtraceEvent mm_compaction_suitable = 110;
10362    MmCompactionTryToCompactPagesFtraceEvent
10363        mm_compaction_try_to_compact_pages = 111;
10364    MmCompactionWakeupKcompactdFtraceEvent mm_compaction_wakeup_kcompactd = 112;
10365    SuspendResumeFtraceEvent suspend_resume = 113;
10366    SchedWakeupNewFtraceEvent sched_wakeup_new = 114;
10367    BlockBioBackmergeFtraceEvent block_bio_backmerge = 115;
10368    BlockBioBounceFtraceEvent block_bio_bounce = 116;
10369    BlockBioCompleteFtraceEvent block_bio_complete = 117;
10370    BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118;
10371    BlockBioQueueFtraceEvent block_bio_queue = 119;
10372    BlockBioRemapFtraceEvent block_bio_remap = 120;
10373    BlockDirtyBufferFtraceEvent block_dirty_buffer = 121;
10374    BlockGetrqFtraceEvent block_getrq = 122;
10375    BlockPlugFtraceEvent block_plug = 123;
10376    BlockRqAbortFtraceEvent block_rq_abort = 124;
10377    BlockRqCompleteFtraceEvent block_rq_complete = 125;
10378    BlockRqInsertFtraceEvent block_rq_insert = 126;
10379    // removed field with id 127;
10380    BlockRqRemapFtraceEvent block_rq_remap = 128;
10381    BlockRqRequeueFtraceEvent block_rq_requeue = 129;
10382    BlockSleeprqFtraceEvent block_sleeprq = 130;
10383    BlockSplitFtraceEvent block_split = 131;
10384    BlockTouchBufferFtraceEvent block_touch_buffer = 132;
10385    BlockUnplugFtraceEvent block_unplug = 133;
10386    Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134;
10387    Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135;
10388    Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136;
10389    Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137;
10390    Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138;
10391    Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139;
10392    Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140;
10393    Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141;
10394    Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142;
10395    Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143;
10396    Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144;
10397    Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145;
10398    Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146;
10399    Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147;
10400    Ext4DropInodeFtraceEvent ext4_drop_inode = 148;
10401    Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149;
10402    Ext4EsFindDelayedExtentRangeEnterFtraceEvent
10403        ext4_es_find_delayed_extent_range_enter = 150;
10404    Ext4EsFindDelayedExtentRangeExitFtraceEvent
10405        ext4_es_find_delayed_extent_range_exit = 151;
10406    Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152;
10407    Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153;
10408    Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154;
10409    Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155;
10410    Ext4EsShrinkFtraceEvent ext4_es_shrink = 156;
10411    Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157;
10412    Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158;
10413    Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159;
10414    Ext4EvictInodeFtraceEvent ext4_evict_inode = 160;
10415    Ext4ExtConvertToInitializedEnterFtraceEvent
10416        ext4_ext_convert_to_initialized_enter = 161;
10417    Ext4ExtConvertToInitializedFastpathFtraceEvent
10418        ext4_ext_convert_to_initialized_fastpath = 162;
10419    Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents =
10420        163;
10421    Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164;
10422    Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165;
10423    Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166;
10424    Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167;
10425    Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168;
10426    Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169;
10427    Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170;
10428    Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171;
10429    Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172;
10430    Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173;
10431    Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174;
10432    Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175;
10433    Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176;
10434    Ext4ForgetFtraceEvent ext4_forget = 177;
10435    Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178;
10436    Ext4FreeInodeFtraceEvent ext4_free_inode = 179;
10437    Ext4GetImpliedClusterAllocExitFtraceEvent
10438        ext4_get_implied_cluster_alloc_exit = 180;
10439    Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc =
10440        181;
10441    Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182;
10442    Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183;
10443    Ext4InsertRangeFtraceEvent ext4_insert_range = 184;
10444    Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185;
10445    Ext4JournalStartFtraceEvent ext4_journal_start = 186;
10446    Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187;
10447    Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage =
10448        188;
10449    Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189;
10450    Ext4LoadInodeFtraceEvent ext4_load_inode = 190;
10451    Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191;
10452    Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192;
10453    Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193;
10454    Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194;
10455    Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195;
10456    Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196;
10457    Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197;
10458    Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198;
10459    Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199;
10460    Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200;
10461    Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201;
10462    Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202;
10463    Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203;
10464    Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204;
10465    Ext4PunchHoleFtraceEvent ext4_punch_hole = 205;
10466    Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206;
10467    Ext4ReadpageFtraceEvent ext4_readpage = 207;
10468    Ext4ReleasepageFtraceEvent ext4_releasepage = 208;
10469    Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209;
10470    Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210;
10471    Ext4RequestInodeFtraceEvent ext4_request_inode = 211;
10472    Ext4SyncFsFtraceEvent ext4_sync_fs = 212;
10473    Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213;
10474    Ext4TrimExtentFtraceEvent ext4_trim_extent = 214;
10475    Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215;
10476    Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216;
10477    Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217;
10478    Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218;
10479    Ext4WriteBeginFtraceEvent ext4_write_begin = 219;
10480    // removed field with id 220;
10481    // removed field with id 221;
10482    // removed field with id 222;
10483    // removed field with id 223;
10484    // removed field with id 224;
10485    // removed field with id 225;
10486    // removed field with id 226;
10487    // removed field with id 227;
10488    // removed field with id 228;
10489    // removed field with id 229;
10490    Ext4WriteEndFtraceEvent ext4_write_end = 230;
10491    Ext4WritepageFtraceEvent ext4_writepage = 231;
10492    Ext4WritepagesFtraceEvent ext4_writepages = 232;
10493    Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233;
10494    Ext4ZeroRangeFtraceEvent ext4_zero_range = 234;
10495    TaskNewtaskFtraceEvent task_newtask = 235;
10496    TaskRenameFtraceEvent task_rename = 236;
10497    SchedProcessExecFtraceEvent sched_process_exec = 237;
10498    SchedProcessExitFtraceEvent sched_process_exit = 238;
10499    SchedProcessForkFtraceEvent sched_process_fork = 239;
10500    SchedProcessFreeFtraceEvent sched_process_free = 240;
10501    SchedProcessHangFtraceEvent sched_process_hang = 241;
10502    SchedProcessWaitFtraceEvent sched_process_wait = 242;
10503    F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243;
10504    F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244;
10505    F2fsFallocateFtraceEvent f2fs_fallocate = 245;
10506    F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246;
10507    F2fsGetVictimFtraceEvent f2fs_get_victim = 247;
10508    F2fsIgetFtraceEvent f2fs_iget = 248;
10509    F2fsIgetExitFtraceEvent f2fs_iget_exit = 249;
10510    F2fsNewInodeFtraceEvent f2fs_new_inode = 250;
10511    F2fsReadpageFtraceEvent f2fs_readpage = 251;
10512    F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252;
10513    F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253;
10514    F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254;
10515    F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255;
10516    F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256;
10517    F2fsSyncFsFtraceEvent f2fs_sync_fs = 257;
10518    F2fsTruncateFtraceEvent f2fs_truncate = 258;
10519    F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259;
10520    F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260;
10521    F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range =
10522        261;
10523    F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter =
10524        262;
10525    F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit =
10526        263;
10527    F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264;
10528    F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265;
10529    F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266;
10530    F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267;
10531    F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268;
10532    F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269;
10533    F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270;
10534    F2fsWriteBeginFtraceEvent f2fs_write_begin = 271;
10535    F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272;
10536    F2fsWriteEndFtraceEvent f2fs_write_end = 273;
10537    AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274;
10538    AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275;
10539    AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276;
10540    AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277;
10541    AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278;
10542    AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279;
10543    DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280;
10544    IommuMapRangeFtraceEvent iommu_map_range = 281;
10545    IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282;
10546    IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283;
10547    IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284;
10548    IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285;
10549    IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286;
10550    IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287;
10551    IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288;
10552    IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289;
10553    IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290;
10554    IonPrefetchingFtraceEvent ion_prefetching = 291;
10555    IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292;
10556    IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start =
10557        293;
10558    IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294;
10559    IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295;
10560    IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296;
10561    IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start =
10562        297;
10563    KfreeFtraceEvent kfree = 298;
10564    KmallocFtraceEvent kmalloc = 299;
10565    KmallocNodeFtraceEvent kmalloc_node = 300;
10566    KmemCacheAllocFtraceEvent kmem_cache_alloc = 301;
10567    KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302;
10568    KmemCacheFreeFtraceEvent kmem_cache_free = 303;
10569    MigratePagesEndFtraceEvent migrate_pages_end = 304;
10570    MigratePagesStartFtraceEvent migrate_pages_start = 305;
10571    MigrateRetryFtraceEvent migrate_retry = 306;
10572    MmPageAllocFtraceEvent mm_page_alloc = 307;
10573    MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308;
10574    MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309;
10575    MmPageFreeFtraceEvent mm_page_free = 310;
10576    MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311;
10577    MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312;
10578    RssStatFtraceEvent rss_stat = 313;
10579    IonHeapShrinkFtraceEvent ion_heap_shrink = 314;
10580    IonHeapGrowFtraceEvent ion_heap_grow = 315;
10581    FenceInitFtraceEvent fence_init = 316;
10582    FenceDestroyFtraceEvent fence_destroy = 317;
10583    FenceEnableSignalFtraceEvent fence_enable_signal = 318;
10584    FenceSignaledFtraceEvent fence_signaled = 319;
10585    ClkEnableFtraceEvent clk_enable = 320;
10586    ClkDisableFtraceEvent clk_disable = 321;
10587    ClkSetRateFtraceEvent clk_set_rate = 322;
10588    BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323;
10589    SignalDeliverFtraceEvent signal_deliver = 324;
10590    SignalGenerateFtraceEvent signal_generate = 325;
10591    OomScoreAdjUpdateFtraceEvent oom_score_adj_update = 326;
10592    GenericFtraceEvent generic = 327;
10593    MmEventRecordFtraceEvent mm_event_record = 328;
10594    SysEnterFtraceEvent sys_enter = 329;
10595    SysExitFtraceEvent sys_exit = 330;
10596    ZeroFtraceEvent zero = 331;
10597    GpuFrequencyFtraceEvent gpu_frequency = 332;
10598    SdeTracingMarkWriteFtraceEvent sde_tracing_mark_write = 333;
10599    MarkVictimFtraceEvent mark_victim = 334;
10600    IonStatFtraceEvent ion_stat = 335;
10601    IonBufferCreateFtraceEvent ion_buffer_create = 336;
10602    IonBufferDestroyFtraceEvent ion_buffer_destroy = 337;
10603    ScmCallStartFtraceEvent scm_call_start = 338;
10604    ScmCallEndFtraceEvent scm_call_end = 339;
10605    GpuMemTotalFtraceEvent gpu_mem_total = 340;
10606    ThermalTemperatureFtraceEvent thermal_temperature = 341;
10607    CdevUpdateFtraceEvent cdev_update = 342;
10608    CpuhpExitFtraceEvent cpuhp_exit = 343;
10609    CpuhpMultiEnterFtraceEvent cpuhp_multi_enter = 344;
10610    CpuhpEnterFtraceEvent cpuhp_enter = 345;
10611    CpuhpLatencyFtraceEvent cpuhp_latency = 346;
10612    FastrpcDmaStatFtraceEvent fastrpc_dma_stat = 347;
10613    DpuTracingMarkWriteFtraceEvent dpu_tracing_mark_write = 348;
10614    G2dTracingMarkWriteFtraceEvent g2d_tracing_mark_write = 349;
10615    MaliTracingMarkWriteFtraceEvent mali_tracing_mark_write = 350;
10616    DmaHeapStatFtraceEvent dma_heap_stat = 351;
10617    CpuhpPauseFtraceEvent cpuhp_pause = 352;
10618    SchedPiSetprioFtraceEvent sched_pi_setprio = 353;
10619    SdeSdeEvtlogFtraceEvent sde_sde_evtlog = 354;
10620    SdeSdePerfCalcCrtcFtraceEvent sde_sde_perf_calc_crtc = 355;
10621    SdeSdePerfCrtcUpdateFtraceEvent sde_sde_perf_crtc_update = 356;
10622    SdeSdePerfSetQosLutsFtraceEvent sde_sde_perf_set_qos_luts = 357;
10623    SdeSdePerfUpdateBusFtraceEvent sde_sde_perf_update_bus = 358;
10624    RssStatThrottledFtraceEvent rss_stat_throttled = 359;
10625    NetifReceiveSkbFtraceEvent netif_receive_skb = 360;
10626    NetDevXmitFtraceEvent net_dev_xmit = 361;
10627    InetSockSetStateFtraceEvent inet_sock_set_state = 362;
10628    TcpRetransmitSkbFtraceEvent tcp_retransmit_skb = 363;
10629    CrosEcSensorhubDataFtraceEvent cros_ec_sensorhub_data = 364;
10630    NapiGroReceiveEntryFtraceEvent napi_gro_receive_entry = 365;
10631    NapiGroReceiveExitFtraceEvent napi_gro_receive_exit = 366;
10632    KfreeSkbFtraceEvent kfree_skb = 367;
10633    KvmAccessFaultFtraceEvent kvm_access_fault = 368;
10634    KvmAckIrqFtraceEvent kvm_ack_irq = 369;
10635    KvmAgeHvaFtraceEvent kvm_age_hva = 370;
10636    KvmAgePageFtraceEvent kvm_age_page = 371;
10637    KvmArmClearDebugFtraceEvent kvm_arm_clear_debug = 372;
10638    KvmArmSetDreg32FtraceEvent kvm_arm_set_dreg32 = 373;
10639    KvmArmSetRegsetFtraceEvent kvm_arm_set_regset = 374;
10640    KvmArmSetupDebugFtraceEvent kvm_arm_setup_debug = 375;
10641    KvmEntryFtraceEvent kvm_entry = 376;
10642    KvmExitFtraceEvent kvm_exit = 377;
10643    KvmFpuFtraceEvent kvm_fpu = 378;
10644    KvmGetTimerMapFtraceEvent kvm_get_timer_map = 379;
10645    KvmGuestFaultFtraceEvent kvm_guest_fault = 380;
10646    KvmHandleSysRegFtraceEvent kvm_handle_sys_reg = 381;
10647    KvmHvcArm64FtraceEvent kvm_hvc_arm64 = 382;
10648    KvmIrqLineFtraceEvent kvm_irq_line = 383;
10649    KvmMmioFtraceEvent kvm_mmio = 384;
10650    KvmMmioEmulateFtraceEvent kvm_mmio_emulate = 385;
10651    KvmSetGuestDebugFtraceEvent kvm_set_guest_debug = 386;
10652    KvmSetIrqFtraceEvent kvm_set_irq = 387;
10653    KvmSetSpteHvaFtraceEvent kvm_set_spte_hva = 388;
10654    KvmSetWayFlushFtraceEvent kvm_set_way_flush = 389;
10655    KvmSysAccessFtraceEvent kvm_sys_access = 390;
10656    KvmTestAgeHvaFtraceEvent kvm_test_age_hva = 391;
10657    KvmTimerEmulateFtraceEvent kvm_timer_emulate = 392;
10658    KvmTimerHrtimerExpireFtraceEvent kvm_timer_hrtimer_expire = 393;
10659    KvmTimerRestoreStateFtraceEvent kvm_timer_restore_state = 394;
10660    KvmTimerSaveStateFtraceEvent kvm_timer_save_state = 395;
10661    KvmTimerUpdateIrqFtraceEvent kvm_timer_update_irq = 396;
10662    KvmToggleCacheFtraceEvent kvm_toggle_cache = 397;
10663    KvmUnmapHvaRangeFtraceEvent kvm_unmap_hva_range = 398;
10664    KvmUserspaceExitFtraceEvent kvm_userspace_exit = 399;
10665    KvmVcpuWakeupFtraceEvent kvm_vcpu_wakeup = 400;
10666    KvmWfxArm64FtraceEvent kvm_wfx_arm64 = 401;
10667    TrapRegFtraceEvent trap_reg = 402;
10668    VgicUpdateIrqPendingFtraceEvent vgic_update_irq_pending = 403;
10669    WakeupSourceActivateFtraceEvent wakeup_source_activate = 404;
10670    WakeupSourceDeactivateFtraceEvent wakeup_source_deactivate = 405;
10671    UfshcdCommandFtraceEvent ufshcd_command = 406;
10672    UfshcdClkGatingFtraceEvent ufshcd_clk_gating = 407;
10673    ConsoleFtraceEvent console = 408;
10674    DrmVblankEventFtraceEvent drm_vblank_event = 409;
10675    DrmVblankEventDeliveredFtraceEvent drm_vblank_event_delivered = 410;
10676    DrmSchedJobFtraceEvent drm_sched_job = 411;
10677    DrmRunJobFtraceEvent drm_run_job = 412;
10678    DrmSchedProcessJobFtraceEvent drm_sched_process_job = 413;
10679    DmaFenceInitFtraceEvent dma_fence_init = 414;
10680    DmaFenceEmitFtraceEvent dma_fence_emit = 415;
10681    DmaFenceSignaledFtraceEvent dma_fence_signaled = 416;
10682    DmaFenceWaitStartFtraceEvent dma_fence_wait_start = 417;
10683    DmaFenceWaitEndFtraceEvent dma_fence_wait_end = 418;
10684    F2fsIostatFtraceEvent f2fs_iostat = 419;
10685    F2fsIostatLatencyFtraceEvent f2fs_iostat_latency = 420;
10686    SchedCpuUtilCfsFtraceEvent sched_cpu_util_cfs = 421;
10687    V4l2QbufFtraceEvent v4l2_qbuf = 422;
10688    V4l2DqbufFtraceEvent v4l2_dqbuf = 423;
10689    Vb2V4l2BufQueueFtraceEvent vb2_v4l2_buf_queue = 424;
10690    Vb2V4l2BufDoneFtraceEvent vb2_v4l2_buf_done = 425;
10691    Vb2V4l2QbufFtraceEvent vb2_v4l2_qbuf = 426;
10692    Vb2V4l2DqbufFtraceEvent vb2_v4l2_dqbuf = 427;
10693    DsiCmdFifoStatusFtraceEvent dsi_cmd_fifo_status = 428;
10694    DsiRxFtraceEvent dsi_rx = 429;
10695    DsiTxFtraceEvent dsi_tx = 430;
10696    AndroidFsDatareadEndFtraceEvent android_fs_dataread_end = 431;
10697    AndroidFsDatareadStartFtraceEvent android_fs_dataread_start = 432;
10698    AndroidFsDatawriteEndFtraceEvent android_fs_datawrite_end = 433;
10699    AndroidFsDatawriteStartFtraceEvent android_fs_datawrite_start = 434;
10700    AndroidFsFsyncEndFtraceEvent android_fs_fsync_end = 435;
10701    AndroidFsFsyncStartFtraceEvent android_fs_fsync_start = 436;
10702    FuncgraphEntryFtraceEvent funcgraph_entry = 437;
10703    FuncgraphExitFtraceEvent funcgraph_exit = 438;
10704    VirtioVideoCmdFtraceEvent virtio_video_cmd = 439;
10705    VirtioVideoCmdDoneFtraceEvent virtio_video_cmd_done = 440;
10706    VirtioVideoResourceQueueFtraceEvent virtio_video_resource_queue = 441;
10707    VirtioVideoResourceQueueDoneFtraceEvent virtio_video_resource_queue_done =
10708        442;
10709    MmShrinkSlabStartFtraceEvent mm_shrink_slab_start = 443;
10710    MmShrinkSlabEndFtraceEvent mm_shrink_slab_end = 444;
10711    TrustySmcFtraceEvent trusty_smc = 445;
10712    TrustySmcDoneFtraceEvent trusty_smc_done = 446;
10713    TrustyStdCall32FtraceEvent trusty_std_call32 = 447;
10714    TrustyStdCall32DoneFtraceEvent trusty_std_call32_done = 448;
10715    TrustyShareMemoryFtraceEvent trusty_share_memory = 449;
10716    TrustyShareMemoryDoneFtraceEvent trusty_share_memory_done = 450;
10717    TrustyReclaimMemoryFtraceEvent trusty_reclaim_memory = 451;
10718    TrustyReclaimMemoryDoneFtraceEvent trusty_reclaim_memory_done = 452;
10719    TrustyIrqFtraceEvent trusty_irq = 453;
10720    TrustyIpcHandleEventFtraceEvent trusty_ipc_handle_event = 454;
10721    TrustyIpcConnectFtraceEvent trusty_ipc_connect = 455;
10722    TrustyIpcConnectEndFtraceEvent trusty_ipc_connect_end = 456;
10723    TrustyIpcWriteFtraceEvent trusty_ipc_write = 457;
10724    TrustyIpcPollFtraceEvent trusty_ipc_poll = 458;
10725    // removed field with id 459;
10726    TrustyIpcReadFtraceEvent trusty_ipc_read = 460;
10727    TrustyIpcReadEndFtraceEvent trusty_ipc_read_end = 461;
10728    TrustyIpcRxFtraceEvent trusty_ipc_rx = 462;
10729    // removed field with id 463;
10730    TrustyEnqueueNopFtraceEvent trusty_enqueue_nop = 464;
10731    CmaAllocStartFtraceEvent cma_alloc_start = 465;
10732    CmaAllocInfoFtraceEvent cma_alloc_info = 466;
10733    LwisTracingMarkWriteFtraceEvent lwis_tracing_mark_write = 467;
10734    VirtioGpuCmdQueueFtraceEvent virtio_gpu_cmd_queue = 468;
10735    VirtioGpuCmdResponseFtraceEvent virtio_gpu_cmd_response = 469;
10736    MaliMaliKCPUCQSSETFtraceEvent mali_mali_KCPU_CQS_SET = 470;
10737    MaliMaliKCPUCQSWAITSTARTFtraceEvent mali_mali_KCPU_CQS_WAIT_START = 471;
10738    MaliMaliKCPUCQSWAITENDFtraceEvent mali_mali_KCPU_CQS_WAIT_END = 472;
10739    MaliMaliKCPUFENCESIGNALFtraceEvent mali_mali_KCPU_FENCE_SIGNAL = 473;
10740    MaliMaliKCPUFENCEWAITSTARTFtraceEvent mali_mali_KCPU_FENCE_WAIT_START = 474;
10741    MaliMaliKCPUFENCEWAITENDFtraceEvent mali_mali_KCPU_FENCE_WAIT_END = 475;
10742    HypEnterFtraceEvent hyp_enter = 476;
10743    HypExitFtraceEvent hyp_exit = 477;
10744    HostHcallFtraceEvent host_hcall = 478;
10745    HostSmcFtraceEvent host_smc = 479;
10746    HostMemAbortFtraceEvent host_mem_abort = 480;
10747    SuspendResumeMinimalFtraceEvent suspend_resume_minimal = 481;
10748    MaliMaliCSFINTERRUPTSTARTFtraceEvent mali_mali_CSF_INTERRUPT_START = 482;
10749    MaliMaliCSFINTERRUPTENDFtraceEvent mali_mali_CSF_INTERRUPT_END = 483;
10750    SamsungTracingMarkWriteFtraceEvent samsung_tracing_mark_write = 484;
10751    BinderCommandFtraceEvent binder_command = 485;
10752    BinderReturnFtraceEvent binder_return = 486;
10753    SchedSwitchWithCtrsFtraceEvent sched_switch_with_ctrs = 487;
10754    GpuWorkPeriodFtraceEvent gpu_work_period = 488;
10755    RpmStatusFtraceEvent rpm_status = 489;
10756    PanelWriteGenericFtraceEvent panel_write_generic = 490;
10757    SchedMigrateTaskFtraceEvent sched_migrate_task = 491;
10758    DpuDsiCmdFifoStatusFtraceEvent dpu_dsi_cmd_fifo_status = 492;
10759    DpuDsiRxFtraceEvent dpu_dsi_rx = 493;
10760    DpuDsiTxFtraceEvent dpu_dsi_tx = 494;
10761    F2fsBackgroundGcFtraceEvent f2fs_background_gc = 495;
10762    F2fsGcBeginFtraceEvent f2fs_gc_begin = 496;
10763    F2fsGcEndFtraceEvent f2fs_gc_end = 497;
10764    FastrpcDmaFreeFtraceEvent fastrpc_dma_free = 498;
10765    FastrpcDmaAllocFtraceEvent fastrpc_dma_alloc = 499;
10766    FastrpcDmaUnmapFtraceEvent fastrpc_dma_unmap = 500;
10767    FastrpcDmaMapFtraceEvent fastrpc_dma_map = 501;
10768  }
10769}
10770
10771// End of protos/perfetto/trace/ftrace/ftrace_event.proto
10772
10773// Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto
10774
10775// Per-CPU kernel buffer stats for the ftrace data source gathered from
10776// /sys/kernel/tracing/per_cpu/cpuX/stats.
10777message FtraceCpuStats {
10778  // CPU index.
10779  optional uint64 cpu = 1;
10780
10781  // Number of entries currently in the kernel buffer.
10782  optional uint64 entries = 2;
10783
10784  // Number of events lost in kernel buffers due to overwriting of old events
10785  // before userspace had a chance to drain them. Valid if the buffer is in
10786  // "overwrite" mode, otherwise see |dropped_events|.
10787  optional uint64 overrun = 3;
10788
10789  // This should always be zero. If not the buffer size is way too small or
10790  // something went wrong with the tracer. Quoting the kernel: "number of
10791  // commits failing due to the buffer wrapping around while there are
10792  // uncommitted events, such as during an interrupt storm".
10793  optional uint64 commit_overrun = 4;
10794
10795  // Size of entries currently in the kernel buffer (see |entries|) in bytes.
10796  // The field should be named "bytes", but is misnamed for historical reasons.
10797  // This value has known inaccuracies before Linux v6.6:
10798  // https://github.com/torvalds/linux/commit/45d99ea
10799  optional uint64 bytes_read = 5;
10800
10801  // The timestamp for the oldest event still in the ring buffer.
10802  // Unit: seconds for typical trace clocks (i.e. not tsc/counter).
10803  optional double oldest_event_ts = 6;
10804
10805  // The current timestamp.
10806  // Unit: seconds for typical trace clocks (i.e. not tsc/counter).
10807  optional double now_ts = 7;
10808
10809  // If the kernel buffer has overwrite mode disabled, this will show the number
10810  // of new events that were lost because the buffer was full. This is similar
10811  // to |overrun| but only for the overwrite=false case.
10812  optional uint64 dropped_events = 8;
10813
10814  // The number of events read (consumed) from the buffer by userspace.
10815  optional uint64 read_events = 9;
10816}
10817
10818// Errors and kernel buffer stats for the ftrace data source.
10819message FtraceStats {
10820  enum Phase {
10821    UNSPECIFIED = 0;
10822    START_OF_TRACE = 1;
10823    END_OF_TRACE = 2;
10824  }
10825
10826  // A pair of FtraceStats is written on every trace flush:
10827  // * START_OF_TRACE - stats recorded at the beginning of the trace.
10828  // * END_OF_TRACE - stats recorded during the flush. In other words shortly
10829  //                  before this packet was written. For simple traces this
10830  //                  will be once at the end of the trace.
10831  optional Phase phase = 1;
10832
10833  // Per-CPU stats (one entry for each CPU).
10834  repeated FtraceCpuStats cpu_stats = 2;
10835
10836  // When FtraceConfig.symbolize_ksyms = true, this records the number of
10837  // symbols parsed from /proc/kallsyms, whether they have been seen in the
10838  // trace or not. It can be used to debug kptr_restrict or security-related
10839  // errors.
10840  // Note: this will be valid only when phase = END_OF_TRACE. The symbolizer is
10841  // initialized. When START_OF_TRACE is emitted it is not ready yet.
10842  optional uint32 kernel_symbols_parsed = 3;
10843
10844  // The memory used by the kernel symbolizer (KernelSymbolMap.size_bytes()).
10845  optional uint32 kernel_symbols_mem_kb = 4;
10846
10847  // Atrace errors (even non-fatal ones) are reported here. A typical example is
10848  // one or more atrace categories not available on the device.
10849  optional string atrace_errors = 5;
10850
10851  // Ftrace events requested by the config but not present on device.
10852  repeated string unknown_ftrace_events = 6;
10853
10854  // Ftrace events requested by the config and present on device, but which we
10855  // failed to enable due to permissions, or due to a conflicting option
10856  // (currently FtraceConfig.disable_generic_events).
10857  repeated string failed_ftrace_events = 7;
10858
10859  // The data source was configured to preserve existing events in the ftrace
10860  // buffer before the start of the trace.
10861  optional bool preserve_ftrace_buffer = 8;
10862
10863  // Unique errors encountered during reading and parsing of the raw ftrace
10864  // data. Ring buffer ABI related errors will also be recorded in the
10865  // affected FtraceEventBundles with a timestamp.
10866  // Any traces with entries in this field should be investigated, as they
10867  // indicate a bug in perfetto or the kernel.
10868  repeated FtraceParseStatus ftrace_parse_errors = 9;
10869}
10870
10871enum FtraceParseStatus {
10872  FTRACE_STATUS_UNSPECIFIED = 0;
10873  // Not written, used for convenience of implementation:
10874  FTRACE_STATUS_OK = 1;
10875  // Issues with reading data out of the ftrace ring buffer:
10876  FTRACE_STATUS_UNEXPECTED_READ_ERROR = 2;
10877  FTRACE_STATUS_PARTIAL_PAGE_READ = 3;
10878  // Ring buffer binary data not matching our understanding of the layout:
10879  FTRACE_STATUS_ABI_INVALID_PAGE_HEADER = 4;
10880  FTRACE_STATUS_ABI_SHORT_EVENT_HEADER = 5;
10881  FTRACE_STATUS_ABI_NULL_PADDING = 6;
10882  FTRACE_STATUS_ABI_SHORT_PADDING_LENGTH = 7;
10883  FTRACE_STATUS_ABI_INVALID_PADDING_LENGTH = 8;
10884  FTRACE_STATUS_ABI_SHORT_TIME_EXTEND = 9;
10885  FTRACE_STATUS_ABI_SHORT_TIME_STAMP = 10;
10886  FTRACE_STATUS_ABI_SHORT_DATA_LENGTH = 11;
10887  FTRACE_STATUS_ABI_ZERO_DATA_LENGTH = 12;
10888  FTRACE_STATUS_ABI_INVALID_DATA_LENGTH = 13;
10889  FTRACE_STATUS_ABI_SHORT_EVENT_ID = 14;
10890  FTRACE_STATUS_ABI_END_OVERFLOW = 15;
10891  // Issues with parsing the event payload:
10892  FTRACE_STATUS_SHORT_COMPACT_EVENT = 16;
10893  FTRACE_STATUS_INVALID_EVENT = 17;
10894}
10895
10896// End of protos/perfetto/trace/ftrace/ftrace_stats.proto
10897
10898// Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
10899
10900// The result of tracing one or more ftrace data pages from a single per-cpu
10901// kernel ring buffer. If collating multiple pages' worth of events, all of
10902// them come from contiguous pages, with no kernel data loss in between.
10903message FtraceEventBundle {
10904  optional uint32 cpu = 1;
10905  repeated FtraceEvent event = 2;
10906
10907  // Set to true if there was data loss between the last time we've read from
10908  // the corresponding per-cpu kernel buffer, and the earliest event recorded
10909  // in this bundle.
10910  optional bool lost_events = 3;
10911
10912  // Optionally-enabled compact encoding of a batch of scheduling events. Only
10913  // a subset of events & their fields is recorded.
10914  // All fields (except comms) are stored in a structure-of-arrays form, one
10915  // entry in each repeated field per event.
10916  message CompactSched {
10917    // Interned table of unique strings for this bundle.
10918    repeated string intern_table = 5;
10919
10920    // Delta-encoded timestamps across all sched_switch events within this
10921    // bundle. The first is absolute, each next one is relative to its
10922    // predecessor.
10923    repeated uint64 switch_timestamp = 1 [packed = true];
10924    repeated int64 switch_prev_state = 2 [packed = true];
10925    repeated int32 switch_next_pid = 3 [packed = true];
10926    repeated int32 switch_next_prio = 4 [packed = true];
10927    // One per event, index into |intern_table| corresponding to the
10928    // next_comm field of the event.
10929    repeated uint32 switch_next_comm_index = 6 [packed = true];
10930
10931    // Delta-encoded timestamps across all sched_waking events within this
10932    // bundle. The first is absolute, each next one is relative to its
10933    // predecessor.
10934    repeated uint64 waking_timestamp = 7 [packed = true];
10935    repeated int32 waking_pid = 8 [packed = true];
10936    repeated int32 waking_target_cpu = 9 [packed = true];
10937    repeated int32 waking_prio = 10 [packed = true];
10938    // One per event, index into |intern_table| corresponding to the
10939    // comm field of the event.
10940    repeated uint32 waking_comm_index = 11 [packed = true];
10941    repeated uint32 waking_common_flags = 12 [packed = true];
10942  }
10943  optional CompactSched compact_sched = 4;
10944
10945  // traced_probes always sets the ftrace_clock to "boot". That is not available
10946  // in older kernels (v3.x). In that case we fallback on "global" or "local".
10947  // When we do that, we report the fallback clock in each bundle so we can do
10948  // proper clock syncing at parsing time in TraceProcessor. We cannot use the
10949  // TracePacket timestamp_clock_id because: (1) there is no per-packet
10950  // timestamp for ftrace bundles; (2) "global" does not match CLOCK_MONOTONIC.
10951  // Having a dedicated and explicit flag allows us to correct further misakes
10952  // in future by looking at the kernel version.
10953  // This field has been introduced in perfetto v19 / Android T (13).
10954  // This field is omitted when the ftrace clock is just "boot", as that is the
10955  // default assumption (and for consistency with the past).
10956  optional FtraceClock ftrace_clock = 5;
10957
10958  // The timestamp according to the ftrace clock, taken at the same instant
10959  // as |boot_timestamp|. This is used to sync ftrace events when a non-boot
10960  // clock is used as the ftrace clock. We don't use the ClockSnapshot packet
10961  // because the ftrace global/local clocks don't match any of the clock_gettime
10962  // domains and can be only read by traced_probes.
10963  //
10964  // Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
10965  //
10966  // Implementation note: Populated by reading the 'now ts:' field in
10967  // tracefs/per_cpu/cpuX/stat.
10968  optional int64 ftrace_timestamp = 6;
10969
10970  // The timestamp according to CLOCK_BOOTTIME, taken at the same instant as
10971  // |ftrace_timestamp|. See documentation of |ftrace_timestamp| for
10972  // more info.
10973  //
10974  // Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
10975  optional int64 boot_timestamp = 7;
10976
10977  // Errors encountered during parsing of the raw ftrace data. In case of ring
10978  // buffer layout errors, the parser skips the rest of the offending kernel
10979  // buffer page and continues from the next page.
10980  // See also FtraceStats.ftrace_parse_errors, which collates all unique errors
10981  // seen within the duration of the trace (even if the affected bundles get
10982  // overwritten in ring buffer mode).
10983  message FtraceError {
10984    // Timestamp of the data that we're unable to parse, in the ftrace clock
10985    // domain. Currently, we use the base timestamp of the tracing page
10986    // containing the bad record rather than the time of the record itself.
10987    optional uint64 timestamp = 1;
10988    optional FtraceParseStatus status = 2;
10989  }
10990  repeated FtraceError error = 8;
10991
10992  // The timestamp (ftrace clock) of the last event consumed from this per-cpu
10993  // kernel buffer prior to starting this bundle. In other words: the last
10994  // event in the previous bundle.
10995  // Lets the trace processing find an initial timestamp after which ftrace
10996  // data is known to be valid across all cpus. Of particular importance when
10997  // the perfetto trace buffer is a ring buffer as well, as the overwriting of
10998  // oldest bundles can skew the first valid timestamp per cpu significantly.
10999  // Added in: perfetto v44.
11000  optional uint64 last_read_event_timestamp = 9;
11001}
11002
11003enum FtraceClock {
11004  // There is no FTRACE_CLOCK_BOOT entry as that's the default assumption. When
11005  // the ftrace clock is "boot", it's just omitted (so UNSPECIFIED == BOOT).
11006  FTRACE_CLOCK_UNSPECIFIED = 0;
11007  FTRACE_CLOCK_UNKNOWN = 1;
11008  FTRACE_CLOCK_GLOBAL = 2;
11009  FTRACE_CLOCK_LOCAL = 3;
11010  FTRACE_CLOCK_MONO_RAW = 4;
11011}
11012
11013// End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
11014
11015// Begin of protos/perfetto/trace/gpu/gpu_counter_event.proto
11016
11017message GpuCounterEvent {
11018  // The first trace packet of each session should include counter_spec.
11019  optional GpuCounterDescriptor counter_descriptor = 1;
11020
11021  message GpuCounter {
11022    // required. Identifier for counter.
11023    optional uint32 counter_id = 1;
11024    // required. Value of the counter.
11025    oneof value {
11026      int64 int_value = 2;
11027      double double_value = 3;
11028    }
11029  }
11030  repeated GpuCounter counters = 2;
11031
11032  // optional. Identifier for GPU in a multi-gpu device.
11033  optional int32 gpu_id = 3;
11034}
11035
11036// End of protos/perfetto/trace/gpu/gpu_counter_event.proto
11037
11038// Begin of protos/perfetto/trace/gpu/gpu_log.proto
11039
11040// Message for logging events GPU data producer.
11041message GpuLog {
11042  enum Severity {
11043    LOG_SEVERITY_UNSPECIFIED = 0;
11044    LOG_SEVERITY_VERBOSE = 1;
11045    LOG_SEVERITY_DEBUG = 2;
11046    LOG_SEVERITY_INFO = 3;
11047    LOG_SEVERITY_WARNING = 4;
11048    LOG_SEVERITY_ERROR = 5;
11049  };
11050  optional Severity severity = 1;
11051
11052  optional string tag = 2;
11053
11054  optional string log_message = 3;
11055}
11056
11057// End of protos/perfetto/trace/gpu/gpu_log.proto
11058
11059// Begin of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
11060
11061// next id: 15
11062message GpuRenderStageEvent {
11063  // required. Unique ID for the event.
11064  optional uint64 event_id = 1;
11065
11066  // optional. Duration of the event in nanoseconds. If unset, this is a
11067  // single time point event.
11068  optional uint64 duration = 2;
11069
11070  // required. ID to a hardware queue description in the specifications.
11071  // InternedGpuRenderStageSpecification
11072  optional uint64 hw_queue_iid = 13;
11073
11074  // required. ID to a render stage description in the specifications.
11075  // InternedGpuRenderStageSpecification
11076  optional uint64 stage_iid = 14;
11077
11078  // optional. Identifier for GPU in a multi-gpu device.
11079  optional int32 gpu_id = 11;
11080
11081  // required. Graphics context for the event.
11082  // For OpenGL, this is the GL context.
11083  // For Vulkan, this is the VkDevice.
11084  optional uint64 context = 5;
11085
11086  // optional. The render target for this event.
11087  // For OpenGL, this is the GL frame buffer handle.
11088  // For Vulkan, this is the VkFrameBuffer handle.
11089  optional uint64 render_target_handle = 8;
11090
11091  // optional. Submission ID generated by the UMD.
11092  // For OpenGL, the ID should map to an API submission (e.g., glFlush,
11093  // glFinish, eglSwapBufffers) event.  The set of submissions to the HW due
11094  // to a single API submission should share the same ID.
11095  // For Vulkan, it should map 1:1 with a vkQueueSubmit.
11096  optional uint32 submission_id = 10;
11097
11098  // optional. Additional data for the user. This may include attributes for
11099  // the event like resource ids, shaders, etc.
11100  message ExtraData {
11101    optional string name = 1;
11102    optional string value = 2;
11103  }
11104  repeated ExtraData extra_data = 6;
11105
11106  // VULKAN SPECIFICS
11107
11108  // optional. The Vulkan render pass handle.
11109  optional uint64 render_pass_handle = 9;
11110
11111  // optional. A bit mask representing which render subpasses contributed to
11112  // this render stage event.  Subpass index 0 is represented by setting the
11113  // LSB of the mask.  Additional mask can be added for subpass index greater
11114  // than 63.
11115  repeated uint64 render_subpass_index_mask = 15;
11116
11117  // optional. The Vulkan command buffer handle.
11118  optional uint64 command_buffer_handle = 12;
11119
11120  // DEPRECATED
11121
11122  // Deprecated.  Use InternedGpuRenderStageSpecification instead.
11123  // The first trace packet of each session should include a Specifications
11124  // to enumerate *all* IDs that will be used. The timestamp of this packet
11125  // must be earlier than all other packets. Only one packet with Specifications
11126  // is expected.
11127  message Specifications {
11128    message ContextSpec {
11129      optional uint64 context = 1;
11130      optional int32 pid = 2;
11131    }
11132    optional ContextSpec context_spec = 1;
11133
11134    message Description {
11135      optional string name = 1;
11136      optional string description = 2;
11137    }
11138
11139    // Labels to categorize the hw Queue this event goes on.
11140    repeated Description hw_queue = 2;
11141
11142    // Labels to categorize render stage(binning, render, compute etc).
11143    repeated Description stage = 3;
11144  }
11145  // Deprecated.  Use hw_queue_iid and stage_iid to refer to
11146  // InternedGpuRenderStageSpecification instead.
11147  optional Specifications specifications = 7 [deprecated = true];
11148
11149  // Deprecated. Use hw_queue_iid instead;
11150  optional int32 hw_queue_id = 3 [deprecated = true];
11151
11152  // Deprecated. Use stage_iid instead;
11153  optional int32 stage_id = 4 [deprecated = true];
11154
11155  // Extension for vendor's custom proto.
11156  extensions 100;
11157}
11158
11159// Interned data.
11160
11161// The iid is the numeric value of either the GL Context or the VkDevice
11162// handle.
11163message InternedGraphicsContext {
11164  optional uint64 iid = 1;
11165  optional int32 pid = 2;
11166  enum Api {
11167    UNDEFINED = 0;
11168    OPEN_GL = 1;
11169    VULKAN = 2;
11170    OPEN_CL = 3;
11171  }
11172  optional Api api = 3;
11173}
11174
11175message InternedGpuRenderStageSpecification {
11176  optional uint64 iid = 1;
11177  optional string name = 2;
11178  optional string description = 3;
11179
11180  enum RenderStageCategory {
11181    OTHER = 0;
11182    GRAPHICS = 1;
11183    COMPUTE = 2;
11184  }
11185  optional RenderStageCategory category = 4;
11186}
11187
11188// End of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
11189
11190// Begin of protos/perfetto/trace/gpu/vulkan_api_event.proto
11191
11192// Message for recording the Vulkan call.
11193message VulkanApiEvent {
11194  oneof event {
11195    VkDebugUtilsObjectName vk_debug_utils_object_name = 1;
11196    VkQueueSubmit vk_queue_submit = 2;
11197  }
11198
11199  // For recording vkSetDebugUtilsObjectNameEXT and
11200  // vkDebugMarkerSetObjectNameEXT
11201  message VkDebugUtilsObjectName {
11202    optional uint32 pid = 1;
11203    optional uint64 vk_device = 2;
11204    // VkObjectType.  Value must match
11205    // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkObjectType.html.
11206    optional int32 object_type = 3;
11207    optional uint64 object = 4;
11208    optional string object_name = 5;
11209  }
11210
11211  // For recording vkQueueSubmit call.
11212  message VkQueueSubmit {
11213    optional uint64 duration_ns = 1;
11214    optional uint32 pid = 2;
11215    optional uint32 tid = 3;
11216    optional uint64 vk_queue = 4;
11217    repeated uint64 vk_command_buffers = 5;
11218    // Submission ID.  An identifier unique to each vkQueueSubmit call.  This
11219    // submission_id must match GpuRenderStageEvent.submission_id if the
11220    // GpuRenderStageEvent is created due to this vkQueueSubmit.
11221    optional uint32 submission_id = 6;
11222  }
11223}
11224
11225// End of protos/perfetto/trace/gpu/vulkan_api_event.proto
11226
11227// Begin of protos/perfetto/trace/gpu/vulkan_memory_event.proto
11228
11229// All the information that cannot be sent within a VulkanMemoryEvent message,
11230// are sent as annotations to the main memory event. One example is the
11231// properties of the object that consumes the allocated memory, for example, a
11232// buffer or an image.
11233// key_iid and string_iid are both interned strings. Original string value is
11234// stored in vulkan_memory_keys from
11235// protos/perfetto/trace/interned_data/interned_data.proto.
11236message VulkanMemoryEventAnnotation {
11237  optional uint64 key_iid = 1;
11238  oneof value {
11239    int64 int_value = 2;
11240    double double_value = 3;
11241    uint64 string_iid = 4;
11242  }
11243}
11244
11245// Each VulkanMemoryEvent encompasses information regarding one single function
11246// call that results in reserving, binding or freeing host or GPU memory. There
11247// is a special message type, ANNOTATIONS, which is used to communicate
11248// information that are not directly related to a memory event, nonetheless are
11249// essential to understand the memory usage. An example is the size and memory
11250// types of the memory heaps.
11251//
11252// Next reserved id: 10 (up to 15).
11253// Next id: 21.
11254message VulkanMemoryEvent {
11255  enum Source {
11256    SOURCE_UNSPECIFIED = 0;
11257    SOURCE_DRIVER = 1;
11258    SOURCE_DEVICE = 2;
11259    SOURCE_DEVICE_MEMORY = 3;
11260    SOURCE_BUFFER = 4;
11261    SOURCE_IMAGE = 5;
11262  }
11263
11264  enum Operation {
11265    OP_UNSPECIFIED = 0;
11266
11267    // alloc, create
11268    OP_CREATE = 1;
11269
11270    // free, destroy(non-bound)
11271    OP_DESTROY = 2;
11272
11273    // bind buffer and image
11274    OP_BIND = 3;
11275
11276    // destroy (bound)
11277    OP_DESTROY_BOUND = 4;
11278
11279    // only annotations
11280    OP_ANNOTATIONS = 5;
11281  }
11282
11283  enum AllocationScope {
11284    SCOPE_UNSPECIFIED = 0;
11285    SCOPE_COMMAND = 1;
11286    SCOPE_OBJECT = 2;
11287    SCOPE_CACHE = 3;
11288    SCOPE_DEVICE = 4;
11289    SCOPE_INSTANCE = 5;
11290  }
11291
11292  optional Source source = 1;
11293  optional Operation operation = 2;
11294  optional int64 timestamp = 3;
11295  optional uint32 pid = 4;
11296  optional fixed64 memory_address = 5;
11297  optional uint64 memory_size = 6;
11298  // Interned string. Original string value is stored in function_names from
11299  // protos/perfetto/trace/interned_data/interned_data.proto.
11300  optional uint64 caller_iid = 7;
11301  optional AllocationScope allocation_scope = 8;
11302  // Extra related information, e.g., create configs, etc.
11303  repeated VulkanMemoryEventAnnotation annotations = 9;
11304
11305  // Field IDs used for device memory (low sampling rate)
11306  optional fixed64 device = 16;
11307  optional fixed64 device_memory = 17;
11308  optional uint32 memory_type = 18;
11309  optional uint32 heap = 19;
11310  optional fixed64 object_handle = 20;
11311}
11312
11313// End of protos/perfetto/trace/gpu/vulkan_memory_event.proto
11314
11315// Begin of protos/perfetto/trace/profiling/profile_common.proto
11316
11317// TODO(fmayer): Figure out naming thoroughout this file to get a
11318// nomenclature that works between Windows and Linux.
11319
11320// The interning fields in this file can refer to 2 different intern tables,
11321// depending on the message they are used in. If the interned fields are present
11322// in ProfilePacket proto, then the intern tables included in the ProfilePacket
11323// should be used. If the intered fields are present in the
11324// StreamingProfilePacket proto, then the intern tables included in all of the
11325// previous InternedData message with same sequence ID should be used.
11326// TODO(fmayer): Move to the intern tables to a common location.
11327message InternedString {
11328  optional uint64 iid = 1;
11329  optional bytes str = 2;
11330}
11331
11332// A symbol field that is emitted after the trace is written. These tables would
11333// be appended as the last packets in the trace that the profiler will use, so
11334// that the actual trace need not be rewritten to symbolize the profiles.
11335message ProfiledFrameSymbols {
11336  // Use the frame id as the interning key for the symbols.
11337  optional uint64 frame_iid = 1;
11338
11339  // These are repeated because when inlining happens, multiple functions'
11340  // frames can be at a single address. Imagine function Foo calling the
11341  // std::vector<int> constructor, which gets inlined at 0xf00. We then get
11342  // both Foo and the std::vector<int> constructor when we symbolize the
11343  // address.
11344
11345  // key to InternedString
11346  repeated uint64 function_name_id = 2;
11347
11348  // key to InternedString
11349  repeated uint64 file_name_id = 3;
11350
11351  repeated uint32 line_number = 4;
11352}
11353
11354message Line {
11355  optional string function_name = 1;
11356  optional string source_file_name = 2;
11357  optional uint32 line_number = 3;
11358}
11359
11360// Symbols for a given address in a module.
11361message AddressSymbols {
11362  optional uint64 address = 1;
11363
11364  // Source lines that correspond to this address.
11365  //
11366  // These are repeated because when inlining happens, multiple functions'
11367  // frames can be at a single address. Imagine function Foo calling the
11368  // std::vector<int> constructor, which gets inlined at 0xf00. We then get
11369  // both Foo and the std::vector<int> constructor when we symbolize the
11370  // address.
11371  repeated Line lines = 2;
11372}
11373
11374// Symbols for addresses seen in a module.
11375message ModuleSymbols {
11376  // Fully qualified path to the mapping.
11377  // E.g. /system/lib64/libc.so.
11378  optional string path = 1;
11379
11380  // .note.gnu.build-id on Linux (not hex encoded).
11381  // uuid on MacOS.
11382  // Module GUID on Windows.
11383  optional string build_id = 2;
11384  repeated AddressSymbols address_symbols = 3;
11385}
11386
11387message Mapping {
11388  // Interning key.
11389  optional uint64 iid = 1;
11390
11391  // Interning key.
11392  optional uint64 build_id = 2;
11393
11394  // The linker may create multiple memory mappings for the same shared
11395  // library.
11396  // This is so that the ELF header is mapped as read only, while the
11397  // executable memory is mapped as executable only.
11398  // The details of this depend on the linker, a possible mapping of an ELF
11399  // file is this:
11400  //         +----------------------+
11401  // ELF     |xxxxxxxxxyyyyyyyyyyyyy|
11402  //         +---------+------------+
11403  //         |         |
11404  //         | read    | executable
11405  //         v mapping v mapping
11406  //         +----------------------+
11407  // Memory  |xxxxxxxxx|yyyyyyyyyyyy|
11408  //         +------------------+---+
11409  //         ^         ^        ^
11410  //         +         +        +
11411  //       start     exact    relpc
11412  //       offset   offset    0x1800
11413  //       0x0000   0x1000
11414  //
11415  // exact_offset is the offset into the library file of this mapping.
11416  // start_offset is the offset into the library file of the first mapping
11417  // for that library. For native libraries (.so files) this should be 0.
11418
11419  // This is not set on Android 10.
11420  optional uint64 exact_offset = 8;
11421
11422  optional uint64 start_offset = 3;
11423  optional uint64 start = 4;
11424  optional uint64 end = 5;
11425  optional uint64 load_bias = 6;
11426
11427  // E.g. ["system", "lib64", "libc.so"]
11428  // id of string.
11429  repeated uint64 path_string_ids = 7;
11430}
11431
11432message Frame {
11433  // Interning key
11434  optional uint64 iid = 1;
11435
11436  // E.g. "fopen"
11437  // id of string.
11438  optional uint64 function_name_id = 2;
11439
11440  optional uint64 mapping_id = 3;
11441  optional uint64 rel_pc = 4;
11442}
11443
11444message Callstack {
11445  optional uint64 iid = 1;
11446  // Frames of this callstack. Bottom frame first.
11447  repeated uint64 frame_ids = 2;
11448}
11449
11450// End of protos/perfetto/trace/profiling/profile_common.proto
11451
11452// Begin of protos/perfetto/trace/track_event/chrome_histogram_sample.proto
11453
11454message HistogramName {
11455  optional uint64 iid = 1;
11456  optional string name = 2;
11457}
11458
11459// An individual histogram sample logged via Chrome's UMA metrics system.
11460message ChromeHistogramSample {
11461  // MD5 hash of the metric name. Either |name_hash| or |name|/|name_iid| or
11462  // both must be present.
11463  optional uint64 name_hash = 1;
11464  optional string name = 2;
11465  optional int64 sample = 3;
11466  // Interned HistogramName. Only one of |name|, |name_iid| can be set.
11467  optional uint64 name_iid = 4;
11468}
11469
11470// End of protos/perfetto/trace/track_event/chrome_histogram_sample.proto
11471
11472// Begin of protos/perfetto/trace/track_event/debug_annotation.proto
11473
11474// Proto representation of untyped key/value annotations provided in TRACE_EVENT
11475// macros. Users of the Perfetto SDK should prefer to use the
11476// perfetto::TracedValue API to fill these protos, rather than filling them
11477// manually.
11478//
11479// Debug annotations are intended for debug use and are not considered a stable
11480// API of the trace contents. Trace-based metrics that use debug annotation
11481// values are prone to breakage, so please rely on typed TrackEvent fields for
11482// these instead.
11483//
11484// DebugAnnotations support nested arrays and dictionaries. Each entry is
11485// encoded as a single DebugAnnotation message. Only dictionary entries
11486// set the "name" field. The TrackEvent message forms an implicit root
11487// dictionary.
11488//
11489// Example TrackEvent with nested annotations:
11490//   track_event {
11491//     debug_annotations {
11492//       name: "foo"
11493//       dict_entries {
11494//         name: "a"
11495//         bool_value: true
11496//       }
11497//       dict_entries {
11498//         name: "b"
11499//         int_value: 123
11500//       }
11501//     }
11502//     debug_annotations {
11503//       name: "bar"
11504//       array_values {
11505//         string_value: "hello"
11506//       }
11507//       array_values {
11508//         string_value: "world"
11509//       }
11510//     }
11511//   }
11512//
11513// Next ID: 18.
11514// Reserved ID: 15
11515message DebugAnnotation {
11516  // Name fields are set only for dictionary entries.
11517  oneof name_field {
11518    // interned DebugAnnotationName.
11519    uint64 name_iid = 1;
11520    // non-interned variant.
11521    string name = 10;
11522  }
11523
11524  oneof value {
11525    bool bool_value = 2;
11526    uint64 uint_value = 3;
11527    int64 int_value = 4;
11528    double double_value = 5;
11529    // Pointers are stored in a separate type as the JSON output treats them
11530    // differently from other uint64 values.
11531    uint64 pointer_value = 7;
11532
11533    // Deprecated. Use dict_entries / array_values instead.
11534    NestedValue nested_value = 8;
11535
11536    // Legacy instrumentation may not support conversion of nested data to
11537    // NestedValue yet.
11538    string legacy_json_value = 9;
11539
11540    // interned and non-interned variants of strings.
11541    string string_value = 6;
11542    // Corresponds to |debug_annotation_string_values| field in InternedData.
11543    uint64 string_value_iid = 17;
11544  }
11545
11546  // Used to embed arbitrary proto messages (which are also typically used to
11547  // represent typed TrackEvent arguments). |proto_type_name| or
11548  // |proto_type_name_iid| are storing the full name of the proto messages (e.g.
11549  // .perfetto.protos.DebugAnnotation) and |proto_value| contains the serialised
11550  // proto messages. See |TracedValue::WriteProto| for more details.
11551  oneof proto_type_descriptor {
11552    string proto_type_name = 16;
11553    // interned DebugAnnotationValueTypeName.
11554    uint64 proto_type_name_iid = 13;
11555  }
11556  optional bytes proto_value = 14;
11557
11558  repeated DebugAnnotation dict_entries = 11;
11559  repeated DebugAnnotation array_values = 12;
11560
11561  // Deprecated legacy way to use nested values. Only kept for
11562  // backwards-compatibility in TraceProcessor. May be removed in the future -
11563  // code filling protos should use |dict_entries| and |array_values| instead.
11564  message NestedValue {
11565    enum NestedType {
11566      // leaf value.
11567      UNSPECIFIED = 0;
11568      DICT = 1;
11569      ARRAY = 2;
11570    }
11571    optional NestedType nested_type = 1;
11572
11573    repeated string dict_keys = 2;
11574    repeated NestedValue dict_values = 3;
11575    repeated NestedValue array_values = 4;
11576    optional int64 int_value = 5;
11577    optional double double_value = 6;
11578    optional bool bool_value = 7;
11579    optional string string_value = 8;
11580  }
11581}
11582
11583// --------------------
11584// Interned data types:
11585// --------------------
11586
11587message DebugAnnotationName {
11588  optional uint64 iid = 1;
11589  optional string name = 2;
11590}
11591
11592// See the |proto_type_descriptor| comment.
11593message DebugAnnotationValueTypeName {
11594  optional uint64 iid = 1;
11595  optional string name = 2;
11596}
11597
11598// End of protos/perfetto/trace/track_event/debug_annotation.proto
11599
11600// Begin of protos/perfetto/trace/track_event/log_message.proto
11601
11602message LogMessage {
11603  // interned SourceLocation.
11604  optional uint64 source_location_iid = 1;
11605  // interned LogMessageBody.
11606  optional uint64 body_iid = 2;
11607  enum Priority {
11608    PRIO_UNSPECIFIED = 0;
11609    PRIO_UNUSED = 1;
11610    PRIO_VERBOSE = 2;
11611    PRIO_DEBUG = 3;
11612    PRIO_INFO = 4;
11613    PRIO_WARN = 5;
11614    PRIO_ERROR = 6;
11615    PRIO_FATAL = 7;
11616  }
11617  optional Priority prio = 3;
11618}
11619
11620// --------------------
11621// Interned data types:
11622// --------------------
11623
11624message LogMessageBody {
11625  optional uint64 iid = 1;
11626  optional string body = 2;
11627}
11628
11629// End of protos/perfetto/trace/track_event/log_message.proto
11630
11631// Begin of protos/perfetto/trace/track_event/source_location.proto
11632
11633// --------------------
11634// Interned data types:
11635// --------------------
11636
11637// A source location, represented as a native symbol.
11638// This is similar to `message Frame` from
11639// protos/perfetto/trace/profiling/profile_common.proto, but for abitrary
11640// source code locations (for example in track event args), not stack frames.
11641message UnsymbolizedSourceLocation {
11642  optional uint64 iid = 1;
11643  optional uint64 mapping_id = 2;
11644  optional uint64 rel_pc = 3;
11645}
11646
11647message SourceLocation {
11648  optional uint64 iid = 1;
11649  optional string file_name = 2;
11650  optional string function_name = 3;
11651  optional uint32 line_number = 4;
11652}
11653
11654// End of protos/perfetto/trace/track_event/source_location.proto
11655
11656// Begin of protos/perfetto/trace/track_event/chrome_active_processes.proto
11657
11658// A list of processes connected to the tracing service.
11659message ChromeActiveProcesses {
11660  repeated int32 pid = 1;
11661}
11662// End of protos/perfetto/trace/track_event/chrome_active_processes.proto
11663
11664// Begin of protos/perfetto/trace/track_event/chrome_application_state_info.proto
11665
11666
11667// Trace event arguments for application state changes.
11668message ChromeApplicationStateInfo {
11669  // Enum definition taken from:
11670  // https://source.chromium.org/chromium/chromium/src/+/master:base/android/application_status_listener.h
11671  enum ChromeApplicationState {
11672    APPLICATION_STATE_UNKNOWN = 0;
11673    APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1;
11674    APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2;
11675    APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3;
11676    APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4;
11677  };
11678  optional ChromeApplicationState application_state = 1;
11679}
11680
11681// End of protos/perfetto/trace/track_event/chrome_application_state_info.proto
11682
11683// Begin of protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.proto
11684
11685// Describes Chrome's Compositor scheduler's current state and associated
11686// variables.
11687//
11688// These protos and enums were adapted from the corresponding original JSON
11689// trace event for the scheduler state. In contrast to the JSON, we use strongly
11690// typed enum values instead of strings for many fields, and
11691// microsecond-granularity timestamps.
11692//
11693// The original format was generated in JSON by the code at
11694// https://cs.chromium.org/chromium/src/cc/scheduler/scheduler.cc?l=870&rcl=5e15eabc9c0eec8daf94fdf78e93f13b6e3b63dd
11695//
11696// And is now generated as protozero:
11697// https://cs.chromium.org/chromium/src/cc/scheduler/scheduler.cc?q=Scheduler::AsPro
11698//
11699// All non-delta-timestamps are absolute CLOCK_MONOTONIC timestamps.
11700
11701enum ChromeCompositorSchedulerAction {
11702  CC_SCHEDULER_ACTION_UNSPECIFIED = 0;
11703  CC_SCHEDULER_ACTION_NONE = 1;
11704  CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2;
11705  CC_SCHEDULER_ACTION_COMMIT = 3;
11706  CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4;
11707  CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5;
11708  CC_SCHEDULER_ACTION_DRAW_FORCED = 6;
11709  CC_SCHEDULER_ACTION_DRAW_ABORT = 7;
11710  CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8;
11711  CC_SCHEDULER_ACTION_PREPARE_TILES = 9;
11712  CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10;
11713  CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11;
11714  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12;
11715  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13;
11716}
11717
11718// Next id: 18
11719message ChromeCompositorSchedulerState {
11720  enum BeginImplFrameDeadlineMode {
11721    DEADLINE_MODE_UNSPECIFIED = 0;
11722    DEADLINE_MODE_NONE = 1;
11723    DEADLINE_MODE_IMMEDIATE = 2;
11724    DEADLINE_MODE_REGULAR = 3;
11725    DEADLINE_MODE_LATE = 4;
11726    DEADLINE_MODE_BLOCKED = 5;
11727  }
11728  optional ChromeCompositorStateMachine state_machine = 1;
11729  optional bool observing_begin_frame_source = 2;
11730  optional bool begin_impl_frame_deadline_task = 3;
11731  optional bool pending_begin_frame_task = 4;
11732  optional bool skipped_last_frame_missed_exceeded_deadline = 5;
11733  optional ChromeCompositorSchedulerAction inside_action = 7;
11734  optional BeginImplFrameDeadlineMode deadline_mode = 8;
11735  optional int64 deadline_us = 9;
11736  optional int64 deadline_scheduled_at_us = 10;
11737  optional int64 now_us = 11;
11738  optional int64 now_to_deadline_delta_us = 12;
11739  optional int64 now_to_deadline_scheduled_at_delta_us = 13;
11740  optional BeginImplFrameArgs begin_impl_frame_args = 14;
11741  optional BeginFrameObserverState begin_frame_observer_state = 15;
11742  optional BeginFrameSourceState begin_frame_source_state = 16;
11743  optional CompositorTimingHistory compositor_timing_history = 17;
11744
11745  reserved 6;
11746}
11747
11748// Describes the current values stored in the Chrome Compositor state machine.
11749// Next id: 3
11750message ChromeCompositorStateMachine {
11751  // Next id: 6
11752  message MajorState {
11753    enum BeginImplFrameState {
11754      BEGIN_IMPL_FRAME_UNSPECIFIED = 0;
11755      BEGIN_IMPL_FRAME_IDLE = 1;
11756      BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2;
11757      BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3;
11758    }
11759    enum BeginMainFrameState {
11760      BEGIN_MAIN_FRAME_UNSPECIFIED = 0;
11761      BEGIN_MAIN_FRAME_IDLE = 1;
11762      BEGIN_MAIN_FRAME_SENT = 2;
11763      BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3;
11764    }
11765    enum LayerTreeFrameSinkState {
11766      LAYER_TREE_FRAME_UNSPECIFIED = 0;
11767      LAYER_TREE_FRAME_NONE = 1;
11768      LAYER_TREE_FRAME_ACTIVE = 2;
11769      LAYER_TREE_FRAME_CREATING = 3;
11770      LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4;
11771      LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5;
11772    }
11773    enum ForcedRedrawOnTimeoutState {
11774      FORCED_REDRAW_UNSPECIFIED = 0;
11775      FORCED_REDRAW_IDLE = 1;
11776      FORCED_REDRAW_WAITING_FOR_COMMIT = 2;
11777      FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3;
11778      FORCED_REDRAW_WAITING_FOR_DRAW = 4;
11779    }
11780    optional ChromeCompositorSchedulerAction next_action = 1;
11781    optional BeginImplFrameState begin_impl_frame_state = 2;
11782    optional BeginMainFrameState begin_main_frame_state = 3;
11783    optional LayerTreeFrameSinkState layer_tree_frame_sink_state = 4;
11784    optional ForcedRedrawOnTimeoutState forced_redraw_state = 5;
11785  }
11786  optional MajorState major_state = 1;
11787
11788  // Next id: 47
11789  message MinorState {
11790    enum TreePriority {
11791      TREE_PRIORITY_UNSPECIFIED = 0;
11792      TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1;
11793      TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2;
11794      TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3;
11795    }
11796    enum ScrollHandlerState {
11797      SCROLL_HANDLER_UNSPECIFIED = 0;
11798      SCROLL_AFFECTS_SCROLL_HANDLER = 1;
11799      SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2;
11800    }
11801    optional int32 commit_count = 1;
11802    optional int32 current_frame_number = 2;
11803    optional int32 last_frame_number_submit_performed = 3;
11804    optional int32 last_frame_number_draw_performed = 4;
11805    optional int32 last_frame_number_begin_main_frame_sent = 5;
11806    optional bool did_draw = 6;
11807    optional bool did_send_begin_main_frame_for_current_frame = 7;
11808    optional bool did_notify_begin_main_frame_not_expected_until = 8;
11809    optional bool did_notify_begin_main_frame_not_expected_soon = 9;
11810    optional bool wants_begin_main_frame_not_expected = 10;
11811    optional bool did_commit_during_frame = 11;
11812    optional bool did_invalidate_layer_tree_frame_sink = 12;
11813    optional bool did_perform_impl_side_invalidaion = 13;
11814    optional bool did_prepare_tiles = 14;
11815    optional int32 consecutive_checkerboard_animations = 15;
11816    optional int32 pending_submit_frames = 16;
11817    optional int32 submit_frames_with_current_layer_tree_frame_sink = 17;
11818    optional bool needs_redraw = 18;
11819    optional bool needs_prepare_tiles = 19;
11820    optional bool needs_begin_main_frame = 20;
11821    optional bool needs_one_begin_impl_frame = 21;
11822    optional bool visible = 22;
11823    optional bool begin_frame_source_paused = 23;
11824    optional bool can_draw = 24;
11825    optional bool resourceless_draw = 25;
11826    optional bool has_pending_tree = 26;
11827    optional bool pending_tree_is_ready_for_activation = 27;
11828    optional bool active_tree_needs_first_draw = 28;
11829    optional bool active_tree_is_ready_to_draw = 29;
11830    optional bool did_create_and_initialize_first_layer_tree_frame_sink = 30;
11831    optional TreePriority tree_priority = 31;
11832    optional ScrollHandlerState scroll_handler_state = 32;
11833    optional bool critical_begin_main_frame_to_activate_is_fast = 33;
11834    optional bool main_thread_missed_last_deadline = 34;
11835    optional bool video_needs_begin_frames = 36;
11836    optional bool defer_begin_main_frame = 37;
11837    optional bool last_commit_had_no_updates = 38;
11838    optional bool did_draw_in_last_frame = 39;
11839    optional bool did_submit_in_last_frame = 40;
11840    optional bool needs_impl_side_invalidation = 41;
11841    optional bool current_pending_tree_is_impl_side = 42;
11842    optional bool previous_pending_tree_was_impl_side = 43;
11843    optional bool processing_animation_worklets_for_active_tree = 44;
11844    optional bool processing_animation_worklets_for_pending_tree = 45;
11845    optional bool processing_paint_worklets_for_pending_tree = 46;
11846
11847    reserved 35;
11848  }
11849  optional MinorState minor_state = 2;
11850}
11851
11852// Next id: 13
11853message BeginFrameArgs {
11854  // JSON format has a "type" field that was always just "BeginFrameArgs" we
11855  // drop this in the proto representation, and instead make the JSON format
11856  // "subtype" field become the type field.
11857  enum BeginFrameArgsType {
11858    BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0;
11859    BEGIN_FRAME_ARGS_TYPE_INVALID = 1;
11860    BEGIN_FRAME_ARGS_TYPE_NORMAL = 2;
11861    BEGIN_FRAME_ARGS_TYPE_MISSED = 3;
11862  }
11863  optional BeginFrameArgsType type = 1;
11864  optional uint64 source_id = 2;
11865  optional uint64 sequence_number = 3;
11866  optional int64 frame_time_us = 4;
11867  optional int64 deadline_us = 5;
11868  optional int64 interval_delta_us = 6;
11869  optional bool on_critical_path = 7;
11870  optional bool animate_only = 8;
11871  oneof created_from {
11872    // The interned SourceLocation.
11873    uint64 source_location_iid = 9;
11874    // The SourceLocation that this args was created from.
11875    // TODO(nuskos): Eventually we will support interning inside of
11876    // TypedArgument TraceEvents and then we shouldn't need this SourceLocation
11877    // since we can emit it as part of the InternedData message. When we can
11878    // remove this |source_location|.
11879    SourceLocation source_location = 10;
11880  }
11881  optional int64 frames_throttled_since_last = 12;
11882}
11883
11884// Next id: 7
11885message BeginImplFrameArgs {
11886  optional int64 updated_at_us = 1;
11887  optional int64 finished_at_us = 2;
11888  enum State {
11889    BEGIN_FRAME_FINISHED = 0;
11890    BEGIN_FRAME_USING = 1;
11891  }
11892  optional State state = 3;
11893  oneof args {
11894    // Only set if |state| is BEGIN_FRAME_FINISHED.
11895    BeginFrameArgs current_args = 4;
11896    // Only set if |state| is BEGIN_FRAME_USING.
11897    BeginFrameArgs last_args = 5;
11898  }
11899  message TimestampsInUs {
11900    optional int64 interval_delta = 1;
11901    optional int64 now_to_deadline_delta = 2;
11902    optional int64 frame_time_to_now_delta = 3;
11903    optional int64 frame_time_to_deadline_delta = 4;
11904    optional int64 now = 5;
11905    optional int64 frame_time = 6;
11906    optional int64 deadline = 7;
11907  }
11908  optional TimestampsInUs timestamps_in_us = 6;
11909}
11910
11911message BeginFrameObserverState {
11912  optional int64 dropped_begin_frame_args = 1;
11913  optional BeginFrameArgs last_begin_frame_args = 2;
11914}
11915
11916message BeginFrameSourceState {
11917  optional uint32 source_id = 1;
11918  optional bool paused = 2;
11919  optional uint32 num_observers = 3;
11920  optional BeginFrameArgs last_begin_frame_args = 4;
11921}
11922
11923message CompositorTimingHistory {
11924  optional int64 begin_main_frame_queue_critical_estimate_delta_us = 1;
11925  optional int64 begin_main_frame_queue_not_critical_estimate_delta_us = 2;
11926  optional int64 begin_main_frame_start_to_ready_to_commit_estimate_delta_us =
11927      3;
11928  optional int64 commit_to_ready_to_activate_estimate_delta_us = 4;
11929  optional int64 prepare_tiles_estimate_delta_us = 5;
11930  optional int64 activate_estimate_delta_us = 6;
11931  optional int64 draw_estimate_delta_us = 7;
11932}
11933
11934// End of protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.proto
11935
11936// Begin of protos/perfetto/trace/track_event/chrome_content_settings_event_info.proto
11937
11938// Details about ContentSettings trace events.
11939message ChromeContentSettingsEventInfo {
11940  // The number of user defined hostname patterns for content settings at
11941  // browser start. Similar to UMA histogram
11942  // 'ContentSettings.NumberOfExceptions'.
11943  optional uint32 number_of_exceptions = 1;
11944}
11945// End of protos/perfetto/trace/track_event/chrome_content_settings_event_info.proto
11946
11947// Begin of protos/perfetto/trace/track_event/chrome_frame_reporter.proto
11948
11949message ChromeFrameReporter {
11950  enum State {
11951    // The frame did not have any updates to present.
11952    STATE_NO_UPDATE_DESIRED = 0;
11953
11954    // The frame presented all the desired updates (i.e. any updates requested
11955    // from both the compositor thread and main-threads were handled).
11956    STATE_PRESENTED_ALL = 1;
11957
11958    // The frame was presented with some updates, but also missed some updates
11959    // (e.g. missed updates from the main-thread, but included updates from the
11960    // compositor thread).
11961    STATE_PRESENTED_PARTIAL = 2;
11962
11963    // The frame was dropped, i.e. some updates were desired for the frame, but
11964    // was not presented.
11965    STATE_DROPPED = 3;
11966  };
11967
11968  optional State state = 1;
11969
11970  enum FrameDropReason {
11971    REASON_UNSPECIFIED = 0;
11972
11973    // Frame was dropped by the display-compositor.
11974    // The display-compositor may drop a frame some times (e.g. the frame missed
11975    // the deadline, or was blocked on surface-sync, etc.)
11976    REASON_DISPLAY_COMPOSITOR = 1;
11977
11978    // Frame was dropped because of the main-thread.
11979    // The main-thread may cause a frame to be dropped, e.g. if the main-thread
11980    // is running expensive javascript, or doing a lot of layout updates, etc.
11981    REASON_MAIN_THREAD = 2;
11982
11983    // Frame was dropped by the client compositor.
11984    // The client compositor can drop some frames too (e.g. attempting to
11985    // recover latency, missing the deadline, etc.).
11986    REASON_CLIENT_COMPOSITOR = 3;
11987  };
11988
11989  // The reason is set only if |state| is not |STATE_UPDATED_ALL|.
11990  optional FrameDropReason reason = 2;
11991
11992  optional uint64 frame_source = 3;
11993  optional uint64 frame_sequence = 4;
11994
11995  // If this is a droped frame (i.e. if |state| is set to |STATE_DROPPED| or
11996  // |STATE_PRESENTED_PARTIAL|), then indicates whether this frame impacts
11997  // smoothness.
11998  optional bool affects_smoothness = 5;
11999
12000  enum ScrollState {
12001    SCROLL_NONE = 0;
12002    SCROLL_MAIN_THREAD = 1;
12003    SCROLL_COMPOSITOR_THREAD = 2;
12004
12005    // Used when it can't be determined whether a scroll is in progress or not.
12006    SCROLL_UNKNOWN = 3;
12007  }
12008
12009  // The type of active scroll.
12010  optional ScrollState scroll_state = 6;
12011
12012  // If any main thread animation is active during this frame.
12013  optional bool has_main_animation = 7;
12014  // If any compositor thread animation is active during this frame.
12015  optional bool has_compositor_animation = 8;
12016  // If any touch-driven UX (not scroll) is active during this frame.
12017  optional bool has_smooth_input_main = 9;
12018
12019  // Whether the frame contained any missing content (i.e. whether there was
12020  // checkerboarding in the frame).
12021  optional bool has_missing_content = 10;
12022
12023  // The id of layer_tree_host that the frame has been produced for.
12024  optional uint64 layer_tree_host_id = 11;
12025
12026  // If total latency of PipelineReporter exceeds a certain limit.
12027  optional bool has_high_latency = 12;
12028
12029  enum FrameType {
12030    FORKED = 0;
12031    BACKFILL = 1;
12032  }
12033
12034  // Indicate if the frame is "FORKED" (i.e. a PipelineReporter event starts at
12035  // the same frame sequence as another PipelineReporter) or "BACKFILL"
12036  // (i.e. dropped frames when there are no partial compositor updates).
12037  optional FrameType frame_type = 13;
12038
12039  // The breakdown stage of PipelineReporter that is most likely accountable for
12040  // high latency.
12041  repeated string high_latency_contribution_stage = 14;
12042}
12043
12044// End of protos/perfetto/trace/track_event/chrome_frame_reporter.proto
12045
12046// Begin of protos/perfetto/trace/track_event/chrome_keyed_service.proto
12047
12048// Details about one of Chrome's keyed services associated with the event.
12049message ChromeKeyedService {
12050  // Name of the service, e.g. "MediaRouter", "PreviewsService", etc. (in
12051  // Chrome, these are static strings known at compile time).
12052  optional string name = 1;
12053}
12054
12055// End of protos/perfetto/trace/track_event/chrome_keyed_service.proto
12056
12057// Begin of protos/perfetto/trace/track_event/chrome_latency_info.proto
12058
12059message ChromeLatencyInfo {
12060  optional int64 trace_id = 1;
12061
12062  // NEXT ID: 12
12063  // All step are optional but the enum is ordered (not by number) below in the
12064  // order we expect them to appear if they are emitted in trace in a blocking
12065  // fashion.
12066  enum Step {
12067    STEP_UNSPECIFIED = 0;
12068    // Emitted on the browser main thread.
12069    STEP_SEND_INPUT_EVENT_UI = 3;
12070    // Happens on the renderer's compositor.
12071    STEP_HANDLE_INPUT_EVENT_IMPL = 5;
12072    STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8;
12073    // Occurs on the Renderer's main thread.
12074    STEP_HANDLE_INPUT_EVENT_MAIN = 4;
12075    STEP_MAIN_THREAD_SCROLL_UPDATE = 2;
12076    STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1;
12077    // Could be emitted on both the renderer's main OR compositor.
12078    STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9;
12079    // Optionally sometimes HANDLED_INPUT_EVENT_MAIN_OR_IMPL will proxy to the
12080    // renderer's compositor and this will be emitted.
12081    STEP_HANDLED_INPUT_EVENT_IMPL = 10;
12082    // Renderer's compositor.
12083    STEP_SWAP_BUFFERS = 6;
12084    // Happens on the VizCompositor in the GPU process.
12085    STEP_DRAW_AND_SWAP = 7;
12086    // Happens on the GPU main thread after the swap has completed.
12087    STEP_FINISHED_SWAP_BUFFERS = 11;
12088    // See above for NEXT ID, enum steps are not ordered by tag number.
12089  };
12090
12091  optional Step step = 2;
12092  optional int32 frame_tree_node_id = 3;
12093
12094  // This enum is a copy of LatencyComponentType enum in Chrome, located in
12095  // ui/latency/latency_info.h, modulo added UNKNOWN value per protobuf
12096  // practices.
12097  enum LatencyComponentType {
12098    COMPONENT_UNSPECIFIED = 0;
12099    COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1;
12100    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2;
12101    COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3;
12102    COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4;
12103    COMPONENT_INPUT_EVENT_LATENCY_UI = 5;
12104    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6;
12105    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7;
12106    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8;
12107    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9;
12108    COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10;
12109    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11;
12110    COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12;
12111    COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13;
12112    COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14;
12113  }
12114
12115  message ComponentInfo {
12116    optional LatencyComponentType component_type = 1;
12117
12118    // Microsecond timestamp in CLOCK_MONOTONIC domain
12119    optional uint64 time_us = 2;
12120  };
12121
12122  repeated ComponentInfo component_info = 4;
12123  optional bool is_coalesced = 5;
12124  optional int64 gesture_scroll_id = 6;
12125  optional int64 touch_id = 7;
12126}
12127
12128// End of protos/perfetto/trace/track_event/chrome_latency_info.proto
12129
12130// Begin of protos/perfetto/trace/track_event/chrome_legacy_ipc.proto
12131
12132// Details about a legacy Chrome IPC message that is either sent by the event.
12133// TODO(eseckler): Also use this message on the receiving side?
12134message ChromeLegacyIpc {
12135  enum MessageClass {
12136    CLASS_UNSPECIFIED = 0;
12137    CLASS_AUTOMATION = 1;
12138    CLASS_FRAME = 2;
12139    CLASS_PAGE = 3;
12140    CLASS_VIEW = 4;
12141    CLASS_WIDGET = 5;
12142    CLASS_INPUT = 6;
12143    CLASS_TEST = 7;
12144    CLASS_WORKER = 8;
12145    CLASS_NACL = 9;
12146    CLASS_GPU_CHANNEL = 10;
12147    CLASS_MEDIA = 11;
12148    CLASS_PPAPI = 12;
12149    CLASS_CHROME = 13;
12150    CLASS_DRAG = 14;
12151    CLASS_PRINT = 15;
12152    CLASS_EXTENSION = 16;
12153    CLASS_TEXT_INPUT_CLIENT = 17;
12154    CLASS_BLINK_TEST = 18;
12155    CLASS_ACCESSIBILITY = 19;
12156    CLASS_PRERENDER = 20;
12157    CLASS_CHROMOTING = 21;
12158    CLASS_BROWSER_PLUGIN = 22;
12159    CLASS_ANDROID_WEB_VIEW = 23;
12160    CLASS_NACL_HOST = 24;
12161    CLASS_ENCRYPTED_MEDIA = 25;
12162    CLASS_CAST = 26;
12163    CLASS_GIN_JAVA_BRIDGE = 27;
12164    CLASS_CHROME_UTILITY_PRINTING = 28;
12165    CLASS_OZONE_GPU = 29;
12166    CLASS_WEB_TEST = 30;
12167    CLASS_NETWORK_HINTS = 31;
12168    CLASS_EXTENSIONS_GUEST_VIEW = 32;
12169    CLASS_GUEST_VIEW = 33;
12170    CLASS_MEDIA_PLAYER_DELEGATE = 34;
12171    CLASS_EXTENSION_WORKER = 35;
12172    CLASS_SUBRESOURCE_FILTER = 36;
12173    CLASS_UNFREEZABLE_FRAME = 37;
12174  }
12175
12176  // Corresponds to the message class type defined in Chrome's IPCMessageStart
12177  // enum, e.g. FrameMsgStart,
12178  optional MessageClass message_class = 1;
12179
12180  // Line number of the message definition. See Chrome's IPC_MESSAGE_ID and
12181  // IPC_MESSAGE_START macros.
12182  optional uint32 message_line = 2;
12183}
12184
12185// End of protos/perfetto/trace/track_event/chrome_legacy_ipc.proto
12186
12187// Begin of protos/perfetto/trace/track_event/chrome_message_pump.proto
12188
12189// Details about Chrome message pump events
12190message ChromeMessagePump {
12191  // True if there are sent messages in the queue.
12192  optional bool sent_messages_in_queue = 1;
12193  // Interned SourceLocation of IO handler that MessagePumpForIO is about to
12194  // invoke.
12195  optional uint64 io_handler_location_iid = 2;
12196}
12197
12198// End of protos/perfetto/trace/track_event/chrome_message_pump.proto
12199
12200// Begin of protos/perfetto/trace/track_event/chrome_mojo_event_info.proto
12201
12202// Contains information to identify mojo handling events. The trace events in
12203// mojo are common for all mojo interfaces and this information is used to
12204// identify who is the caller or callee.
12205message ChromeMojoEventInfo {
12206  // Contains the interface name or the file name of the creator of a mojo
12207  // handle watcher, recorded when an event if notified to the watcher. The code
12208  // that runs within the track event belongs to the interface.
12209  optional string watcher_notify_interface_tag = 1;
12210
12211  // The hash of the IPC message that is being handled.
12212  optional uint32 ipc_hash = 2;
12213
12214  // A static string representing the mojo interface name of the message that is
12215  // being handled.
12216  optional string mojo_interface_tag = 3;
12217
12218  // Refers to an interned UnsymbolizedSourceLocation.
12219  // The UnsymbolizedSourceLocation contains the interface method that's being
12220  // handled, represented as a native symbol.
12221  // The native symbol can be symbolized after the trace is recorded.
12222  // Not using a symbolized source location for official Chromium builds to
12223  // reduce binary size - emitting file/function names as strings into the
12224  // trace requires storing them in the binary, which causes a significant
12225  // binary size bloat for Chromium.
12226  optional uint64 mojo_interface_method_iid = 4;
12227
12228  // Indicate whether this is a message or reply.
12229  optional bool is_reply = 5;
12230
12231  // The payload size of the message being sent through mojo messages.
12232  optional uint64 payload_size = 6;
12233
12234  // Represents the size of the message. Includes all headers and user payload.
12235  optional uint64 data_num_bytes = 7;
12236}
12237
12238// End of protos/perfetto/trace/track_event/chrome_mojo_event_info.proto
12239
12240// Begin of protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.proto
12241
12242// Describes the state of the RendererScheduler for a given Renderer Process.
12243
12244// RAIL Mode is an indication of the kind of work that a Renderer is currently
12245// performing which is in turn used to prioritise work accordingly.
12246// A fuller description of these modes can be found https://web.dev/rail/
12247enum ChromeRAILMode {
12248  RAIL_MODE_NONE = 0;
12249  RAIL_MODE_RESPONSE = 1;
12250  RAIL_MODE_ANIMATION = 2;
12251  RAIL_MODE_IDLE = 3;
12252  RAIL_MODE_LOAD = 4;
12253}
12254
12255message ChromeRendererSchedulerState {
12256  optional ChromeRAILMode rail_mode = 1;
12257
12258  optional bool is_backgrounded = 2;
12259  optional bool is_hidden = 3;
12260}
12261
12262// End of protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.proto
12263
12264// Begin of protos/perfetto/trace/track_event/chrome_user_event.proto
12265
12266// Details about a UI interaction initiated by the user, such as opening or
12267// closing a tab or a context menu.
12268message ChromeUserEvent {
12269  // Name of the action, e.g. "NewTab", "ShowBookmarkManager", etc. (in
12270  // Chrome, these are usually static strings known at compile time, or
12271  // concatenations of multiple such static strings).
12272  optional string action = 1;
12273
12274  // MD5 hash of the action string.
12275  optional uint64 action_hash = 2;
12276}
12277
12278// End of protos/perfetto/trace/track_event/chrome_user_event.proto
12279
12280// Begin of protos/perfetto/trace/track_event/chrome_window_handle_event_info.proto
12281
12282// Details about HWNDMessageHandler trace events.
12283message ChromeWindowHandleEventInfo {
12284  optional uint32 dpi = 1;
12285  optional uint32 message_id = 2;
12286  optional fixed64 hwnd_ptr = 3;
12287}
12288
12289// End of protos/perfetto/trace/track_event/chrome_window_handle_event_info.proto
12290
12291// Begin of protos/perfetto/trace/track_event/pixel_modem.proto
12292
12293// Event insights emitted by the Pixel modem.
12294message PixelModemEventInsight {
12295  // Opaque string containing arguments from the modem.
12296  optional string detokenized_message = 1;
12297}
12298
12299// End of protos/perfetto/trace/track_event/pixel_modem.proto
12300
12301// Begin of protos/perfetto/trace/track_event/screenshot.proto
12302
12303message Screenshot {
12304  optional bytes jpg_image = 1;
12305}
12306
12307// End of protos/perfetto/trace/track_event/screenshot.proto
12308
12309// Begin of protos/perfetto/trace/track_event/task_execution.proto
12310
12311// TrackEvent arguments describing the execution of a task.
12312message TaskExecution {
12313  // Source location that the task was posted from.
12314  // interned SourceLocation.
12315  optional uint64 posted_from_iid = 1;
12316}
12317// End of protos/perfetto/trace/track_event/task_execution.proto
12318
12319// Begin of protos/perfetto/trace/track_event/track_event.proto
12320
12321// NOTE: Full TrackEvent support in the client lib and chrome is WIP, thus these
12322// protos are still subject to change. Don't depend on them staying as they are.
12323
12324// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
12325// which describe activity on a track, such as a thread or asynchronous event
12326// track. The track is specified using separate TrackDescriptor messages and
12327// referred to via the track's UUID.
12328//
12329// A simple TrackEvent packet specifies a timestamp, category, name and type:
12330// ```protobuf
12331//   trace_packet {
12332//     timestamp: 1000
12333//     track_event {
12334//       categories: ["my_cat"]
12335//       name: "my_event"
12336//       type: TYPE_INSTANT
12337//      }
12338//    }
12339// ```
12340//
12341// To associate an event with a custom track (e.g. a thread), the track is
12342// defined in a separate packet and referred to from the TrackEvent by its UUID:
12343// ```protobuf
12344//   trace_packet {
12345//     track_descriptor {
12346//       track_uuid: 1234
12347//       name: "my_track"
12348//
12349//       // Optionally, associate the track with a thread.
12350//       thread_descriptor {
12351//         pid: 10
12352//         tid: 10
12353//         ..
12354//       }
12355//     }
12356//   }
12357// ```
12358//
12359// A pair of TYPE_SLICE_BEGIN and _END events form a slice on the track:
12360//
12361// ```protobuf
12362//   trace_packet {
12363//     timestamp: 1200
12364//     track_event {
12365//       track_uuid: 1234
12366//       categories: ["my_cat"]
12367//       name: "my_slice"
12368//       type: TYPE_SLICE_BEGIN
12369//     }
12370//   }
12371//   trace_packet {
12372//     timestamp: 1400
12373//     track_event {
12374//       track_uuid: 1234
12375//       type: TYPE_SLICE_END
12376//     }
12377//   }
12378// ```
12379// TrackEvents also support optimizations to reduce data repetition and encoded
12380// data size, e.g. through data interning (names, categories, ...) and delta
12381// encoding of timestamps/counters. For details, see the InternedData message.
12382// Further, default values for attributes of events on the same sequence (e.g.
12383// their default track association) can be emitted as part of a
12384// TrackEventDefaults message.
12385//
12386// Next reserved id: 13 (up to 15). Next id: 52.
12387message TrackEvent {
12388  // Names of categories of the event. In the client library, categories are a
12389  // way to turn groups of individual events on or off.
12390  // interned EventCategoryName.
12391  repeated uint64 category_iids = 3;
12392  // non-interned variant.
12393  repeated string categories = 22;
12394
12395  // Optional name of the event for its display in trace viewer. May be left
12396  // unspecified for events with typed arguments.
12397  //
12398  // Note that metrics should not rely on event names, as they are prone to
12399  // changing. Instead, they should use typed arguments to identify the events
12400  // they are interested in.
12401  oneof name_field {
12402    // interned EventName.
12403    uint64 name_iid = 10;
12404    // non-interned variant.
12405    string name = 23;
12406  }
12407
12408  // TODO(eseckler): Support using binary symbols for category/event names.
12409
12410  // Type of the TrackEvent (required if |phase| in LegacyEvent is not set).
12411  enum Type {
12412    TYPE_UNSPECIFIED = 0;
12413
12414    // Slice events are events that have a begin and end timestamp, i.e. a
12415    // duration. They can be nested similar to a callstack: If, on the same
12416    // track, event B begins after event A, but before A ends, B is a child
12417    // event of A and will be drawn as a nested event underneath A in the UI.
12418    // Note that child events should always end before their parents (e.g. B
12419    // before A).
12420    //
12421    // Each slice event is formed by a pair of BEGIN + END events. The END event
12422    // does not need to repeat any TrackEvent fields it has in common with its
12423    // corresponding BEGIN event. Arguments and debug annotations of the BEGIN +
12424    // END pair will be merged during trace import.
12425    //
12426    // Note that we deliberately chose not to support COMPLETE events (which
12427    // would specify a duration directly) since clients would need to delay
12428    // writing them until the slice is completed, which can result in reordered
12429    // events in the trace and loss of unfinished events at the end of a trace.
12430    TYPE_SLICE_BEGIN = 1;
12431    TYPE_SLICE_END = 2;
12432
12433    // Instant events are nestable events without duration. They can be children
12434    // of slice events on the same track.
12435    TYPE_INSTANT = 3;
12436
12437    // Event that provides a value for a counter track. |track_uuid| should
12438    // refer to a counter track and |counter_value| set to the new value. Note
12439    // that most other TrackEvent fields (e.g. categories, name, ..) are not
12440    // supported for TYPE_COUNTER events. See also CounterDescriptor.
12441    TYPE_COUNTER = 4;
12442  }
12443  optional Type type = 9;
12444
12445  // Identifies the track of the event. The default value may be overridden
12446  // using TrackEventDefaults, e.g., to specify the track of the TraceWriter's
12447  // sequence (in most cases sequence = one thread). If no value is specified
12448  // here or in TrackEventDefaults, the TrackEvent will be associated with an
12449  // implicit trace-global track (uuid 0). See TrackDescriptor::uuid.
12450  optional uint64 track_uuid = 11;
12451
12452  // A new value for a counter track. |track_uuid| should refer to a track with
12453  // a CounterDescriptor, and |type| should be TYPE_COUNTER. For a more
12454  // efficient encoding of counter values that are sampled at the beginning/end
12455  // of a slice, see |extra_counter_values| and |extra_counter_track_uuids|.
12456  // Counter values can optionally be encoded in as delta values (positive or
12457  // negative) on each packet sequence (see CounterIncrementalBase).
12458  oneof counter_value_field {
12459    int64 counter_value = 30;
12460    double double_counter_value = 44;
12461  }
12462
12463  // To encode counter values more efficiently, we support attaching additional
12464  // counter values to a TrackEvent of any type. All values will share the same
12465  // timestamp specified in the TracePacket. The value at
12466  // extra_counter_values[N] is for the counter track referenced by
12467  // extra_counter_track_uuids[N].
12468  //
12469  // |extra_counter_track_uuids| may also be set via TrackEventDefaults. There
12470  // should always be equal or more uuids than values. It is valid to set more
12471  // uuids (e.g. via defaults) than values. If uuids are specified in
12472  // TrackEventDefaults and a TrackEvent, the TrackEvent uuids override the
12473  // default uuid list.
12474  //
12475  // For example, this allows snapshotting the thread time clock at each
12476  // thread-track BEGIN and END event to capture the cpu time delta of a slice.
12477  repeated uint64 extra_counter_track_uuids = 31;
12478  repeated int64 extra_counter_values = 12;
12479
12480  // Counter snapshots using floating point instead of integer values.
12481  repeated uint64 extra_double_counter_track_uuids = 45;
12482  repeated double extra_double_counter_values = 46;
12483
12484  // IDs of flows originating, passing through, or ending at this event.
12485  // Flow IDs are global within a trace.
12486  //
12487  // A flow connects a sequence of TrackEvents within or across tracks, e.g.
12488  // an input event may be handled on one thread but cause another event on
12489  // a different thread - a flow between the two events can associate them.
12490  //
12491  // The direction of the flows between events is inferred from the events'
12492  // timestamps. The earliest event with the same flow ID becomes the source
12493  // of the flow. Any events thereafter are intermediate steps of the flow,
12494  // until the flow terminates at the last event with the flow ID.
12495  //
12496  // Flows can also be explicitly terminated (see |terminating_flow_ids|), so
12497  // that the same ID can later be reused for another flow.
12498  // DEPRECATED. Only kept for backwards compatibility. Use |flow_ids|.
12499  repeated uint64 flow_ids_old = 36 [deprecated = true];
12500  // TODO(b/204341740): replace "flow_ids_old" with "flow_ids" to reduce memory
12501  // consumption.
12502  repeated fixed64 flow_ids = 47;
12503
12504  // List of flow ids which should terminate on this event, otherwise same as
12505  // |flow_ids|.
12506  // Any one flow ID should be either listed as part of |flow_ids| OR
12507  // |terminating_flow_ids|, not both.
12508  // DEPRECATED. Only kept for backwards compatibility.  Use
12509  // |terminating_flow_ids|.
12510  repeated uint64 terminating_flow_ids_old = 42 [deprecated = true];
12511  // TODO(b/204341740): replace "terminating_flow_ids_old" with
12512  // "terminating_flow_ids" to reduce memory consumption.
12513  repeated fixed64 terminating_flow_ids = 48;
12514
12515  // ---------------------------------------------------------------------------
12516  // TrackEvent arguments:
12517  // ---------------------------------------------------------------------------
12518
12519  // Unstable key/value annotations shown in the trace viewer but not intended
12520  // for metrics use.
12521  repeated DebugAnnotation debug_annotations = 4;
12522
12523  // Typed event arguments:
12524  optional TaskExecution task_execution = 5;
12525  optional LogMessage log_message = 21;
12526  optional ChromeCompositorSchedulerState cc_scheduler_state = 24;
12527  optional ChromeUserEvent chrome_user_event = 25;
12528  optional ChromeKeyedService chrome_keyed_service = 26;
12529  optional ChromeLegacyIpc chrome_legacy_ipc = 27;
12530  optional ChromeHistogramSample chrome_histogram_sample = 28;
12531  optional ChromeLatencyInfo chrome_latency_info = 29;
12532  optional ChromeFrameReporter chrome_frame_reporter = 32;
12533  optional ChromeApplicationStateInfo chrome_application_state_info = 39;
12534  optional ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40;
12535  optional ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41;
12536  optional ChromeContentSettingsEventInfo chrome_content_settings_event_info =
12537      43;
12538  optional ChromeActiveProcesses chrome_active_processes = 49;
12539  optional Screenshot screenshot = 50;
12540  optional PixelModemEventInsight pixel_modem_event_insight = 51;
12541
12542  // This field is used only if the source location represents the function that
12543  // executes during this event.
12544  oneof source_location_field {
12545    // Non-interned field.
12546    SourceLocation source_location = 33;
12547    // Interned field.
12548    uint64 source_location_iid = 34;
12549  }
12550
12551  optional ChromeMessagePump chrome_message_pump = 35;
12552  optional ChromeMojoEventInfo chrome_mojo_event_info = 38;
12553
12554  // New argument types go here :)
12555
12556  // Extension range for typed events defined externally.
12557  // See docs/design-docs/extensions.md for more details.
12558  //
12559  // Extension support is work-in-progress, in the future the way to reserve a
12560  // subrange for a particular project will be described here and in the design
12561  // document linked above.
12562  //
12563  // Contact [email protected] if you are interested in a subrange
12564  // for your project.
12565
12566  // Extension range reserved for chromium:
12567  // https://source.chromium.org/chromium/chromium/src/+/main:base/tracing/protos/chrome_track_event.proto
12568  extensions 1000 to 1999;
12569  // Extension range reserved for https://b.corp.google.com/issues/301227627.
12570  extensions 2000 to 2000;
12571  // Extension range for future use.
12572  extensions 2001 to 9899;
12573  // Reserved for Perfetto unit and integration tests.
12574  extensions 9900 to 10000;
12575
12576  // ---------------------------------------------------------------------------
12577  // Deprecated / legacy event fields, which will be removed in the future:
12578  // ---------------------------------------------------------------------------
12579
12580  // Deprecated. Use the |timestamp| and |timestamp_clock_id| fields in
12581  // TracePacket instead.
12582  //
12583  // Timestamp in microseconds (usually CLOCK_MONOTONIC).
12584  oneof timestamp {
12585    // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
12586    // calculate the absolute timestamp value, sum up all delta values of the
12587    // preceding TrackEvents since the last ThreadDescriptor and add the sum to
12588    // the |reference_timestamp| in ThreadDescriptor. This value should always
12589    // be positive.
12590    int64 timestamp_delta_us = 1;
12591    // Absolute value (e.g. a manually specified timestamp in the macro).
12592    // This is a one-off value that does not affect delta timestamp computation
12593    // in subsequent TrackEvents.
12594    int64 timestamp_absolute_us = 16;
12595  }
12596
12597  // Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to
12598  // encode thread time instead.
12599  //
12600  // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
12601  // microseconds.
12602  oneof thread_time {
12603    // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
12604    // calculate the absolute timestamp value, sum up all delta values of the
12605    // preceding TrackEvents since the last ThreadDescriptor and add the sum to
12606    // the |reference_timestamp| in ThreadDescriptor. This value should always
12607    // be positive.
12608    int64 thread_time_delta_us = 2;
12609    // This is a one-off absolute value that does not affect delta timestamp
12610    // computation in subsequent TrackEvents.
12611    int64 thread_time_absolute_us = 17;
12612  }
12613
12614  // Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to
12615  // encode thread instruction count instead.
12616  //
12617  // Value of the instruction counter for the current thread.
12618  oneof thread_instruction_count {
12619    // Same encoding as |thread_time| field above.
12620    int64 thread_instruction_count_delta = 8;
12621    int64 thread_instruction_count_absolute = 20;
12622  }
12623
12624  // Apart from {category, time, thread time, tid, pid}, other legacy trace
12625  // event attributes are initially simply proxied for conversion to a JSON
12626  // trace. We intend to gradually transition these attributes to similar native
12627  // features in TrackEvent (e.g. async + flow events), or deprecate them
12628  // without replacement where transition is unsuitable.
12629  //
12630  // Next reserved id: 16 (up to 16).
12631  // Next id: 20.
12632  message LegacyEvent {
12633    // Deprecated, use TrackEvent::name(_iid) instead.
12634    // interned EventName.
12635    optional uint64 name_iid = 1;
12636    optional int32 phase = 2;
12637    optional int64 duration_us = 3;
12638    optional int64 thread_duration_us = 4;
12639
12640    // Elapsed retired instruction count during the event.
12641    optional int64 thread_instruction_delta = 15;
12642
12643    // used to be |flags|.
12644    reserved 5;
12645
12646    oneof id {
12647      uint64 unscoped_id = 6;
12648      uint64 local_id = 10;
12649      uint64 global_id = 11;
12650    }
12651    // Additional optional scope for |id|.
12652    optional string id_scope = 7;
12653
12654    // Consider the thread timestamps for async BEGIN/END event pairs as valid.
12655    optional bool use_async_tts = 9;
12656
12657    // Idenfifies a flow. Flow events with the same bind_id are connected.
12658    optional uint64 bind_id = 8;
12659    // Use the enclosing slice as binding point for a flow end event instead of
12660    // the next slice. Flow start/step events always bind to the enclosing
12661    // slice.
12662    optional bool bind_to_enclosing = 12;
12663
12664    enum FlowDirection {
12665      FLOW_UNSPECIFIED = 0;
12666      FLOW_IN = 1;
12667      FLOW_OUT = 2;
12668      FLOW_INOUT = 3;
12669    }
12670    optional FlowDirection flow_direction = 13;
12671
12672    enum InstantEventScope {
12673      SCOPE_UNSPECIFIED = 0;
12674      SCOPE_GLOBAL = 1;
12675      SCOPE_PROCESS = 2;
12676      SCOPE_THREAD = 3;
12677    }
12678    optional InstantEventScope instant_event_scope = 14;
12679
12680    // Override the pid/tid if the writer needs to emit events on behalf of
12681    // another process/thread. This should be the exception. Normally, the
12682    // pid+tid from ThreadDescriptor is used.
12683    optional int32 pid_override = 18;
12684    optional int32 tid_override = 19;
12685  }
12686
12687  optional LegacyEvent legacy_event = 6;
12688}
12689
12690// Default values for fields of all TrackEvents on the same packet sequence.
12691// Should be emitted as part of TracePacketDefaults whenever incremental state
12692// is cleared. It's defined here because field IDs should match those of the
12693// corresponding fields in TrackEvent.
12694message TrackEventDefaults {
12695  optional uint64 track_uuid = 11;
12696  repeated uint64 extra_counter_track_uuids = 31;
12697  repeated uint64 extra_double_counter_track_uuids = 45;
12698
12699  // TODO(eseckler): Support default values for more TrackEvent fields.
12700}
12701
12702// --------------------
12703// Interned data types:
12704// --------------------
12705
12706message EventCategory {
12707  optional uint64 iid = 1;
12708  optional string name = 2;
12709}
12710
12711message EventName {
12712  optional uint64 iid = 1;
12713  optional string name = 2;
12714}
12715
12716// End of protos/perfetto/trace/track_event/track_event.proto
12717
12718// Begin of protos/perfetto/trace/interned_data/interned_data.proto
12719
12720// ------------------------------ DATA INTERNING: ------------------------------
12721// Interning indexes are built up gradually by adding the entries contained in
12722// each TracePacket of the same packet sequence (packets emitted by the same
12723// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
12724// can only refer to interned data from other packets in the same sequence.
12725//
12726// The writer will emit new entries when it encounters new internable values
12727// that aren't yet in the index. Data in current and subsequent TracePackets can
12728// then refer to the entry by its position (interning ID, abbreviated "iid") in
12729// its index. An interning ID with value 0 is considered invalid (not set).
12730//
12731// Because of the incremental build-up, the interning index will miss data when
12732// TracePackets are lost, e.g. because a chunk was overridden in the central
12733// ring buffer. To avoid invalidation of the whole trace in such a case, the
12734// index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED).
12735// When packet loss occurs, the reader will only lose interning data up to the
12736// next reset.
12737// -----------------------------------------------------------------------------
12738
12739// Message that contains new entries for the interning indices of a packet
12740// sequence.
12741//
12742// The writer will usually emit new entries in the same TracePacket that first
12743// refers to them (since the last reset of interning state). They may also be
12744// emitted proactively in advance of referring to them in later packets.
12745//
12746// Next reserved id: 8 (up to 15).
12747// Next id: 36.
12748message InternedData {
12749  // TODO(eseckler): Replace iid fields inside interned messages with
12750  // map<iid, message> type fields in InternedData.
12751
12752  // Each field's message type needs to specify an |iid| field, which is the ID
12753  // of the entry in the field's interning index. Each field constructs its own
12754  // index, thus interning IDs are scoped to the tracing session and field
12755  // (usually as a counter for efficient var-int encoding), and optionally to
12756  // the incremental state generation of the packet sequence.
12757  repeated EventCategory event_categories = 1;
12758  repeated EventName event_names = 2;
12759  repeated DebugAnnotationName debug_annotation_names = 3;
12760  repeated DebugAnnotationValueTypeName debug_annotation_value_type_names = 27;
12761  repeated SourceLocation source_locations = 4;
12762  repeated UnsymbolizedSourceLocation unsymbolized_source_locations = 28;
12763  repeated LogMessageBody log_message_body = 20;
12764  repeated HistogramName histogram_names = 25;
12765
12766  // Note: field IDs up to 15 should be used for frequent data only.
12767
12768  // Build IDs of exectuable files.
12769  repeated InternedString build_ids = 16;
12770  // Paths to executable files.
12771  repeated InternedString mapping_paths = 17;
12772  // Paths to source files.
12773  repeated InternedString source_paths = 18;
12774  // Names of functions used in frames below.
12775  repeated InternedString function_names = 5;
12776  // Symbols that were added to this trace after the fact.
12777  repeated ProfiledFrameSymbols profiled_frame_symbols = 21;
12778
12779  // Executable files mapped into processes.
12780  repeated Mapping mappings = 19;
12781  // Frames of callstacks of a program.
12782  repeated Frame frames = 6;
12783  // A callstack of a program.
12784  repeated Callstack callstacks = 7;
12785
12786  // Additional Vulkan information sent in a VulkanMemoryEvent message
12787  repeated InternedString vulkan_memory_keys = 22;
12788
12789  // Graphics context of a render stage event.  This represent the GL
12790  // context for an OpenGl app or the VkDevice for a Vulkan app.
12791  repeated InternedGraphicsContext graphics_contexts = 23;
12792
12793  // Description of a GPU hardware queue or render stage.
12794  repeated InternedGpuRenderStageSpecification gpu_specifications = 24;
12795
12796  // This is set when FtraceConfig.symbolize_ksyms = true.
12797  // The id of each symbol the number that will be reported in ftrace events
12798  // like sched_block_reason.caller and is obtained from a monotonic counter.
12799  // The same symbol can have different indexes in different bundles.
12800  // This is is NOT the real address. This is to avoid disclosing KASLR through
12801  // traces.
12802  repeated InternedString kernel_symbols = 26;
12803
12804  // Interned string values in the DebugAnnotation proto.
12805  repeated InternedString debug_annotation_string_values = 29;
12806
12807  // Interned packet context for android.network_packets.
12808  repeated NetworkPacketContext packet_context = 30;
12809
12810  // Interned name of a js function. We only intern js functions as there is a
12811  // lot of duplication for them, but less so for other strings in the V8 data
12812  // source.
12813  repeated InternedV8String v8_js_function_name = 31;
12814  // Js functions can be emitted multiple times for various compilation tiers,
12815  // so it makes sense to deduplicate all this.
12816  repeated InternedV8JsFunction v8_js_function = 32;
12817  // Interned JS script (there is one associated with each JS function)
12818  repeated InternedV8JsScript v8_js_script = 33;
12819  // Interned Wasm script (there is one associated with each Wasm function)
12820  repeated InternedV8WasmScript v8_wasm_script = 34;
12821  // Every V8 event is associated with an isolate, intern the isolate to remove
12822  // duplication.
12823  repeated InternedV8Isolate v8_isolate = 35;
12824
12825  // Interned protolog strings args.
12826  repeated InternedString protolog_string_args = 36;
12827  // Interned protolog stacktraces.
12828  repeated InternedString protolog_stacktrace = 37;
12829}
12830
12831// End of protos/perfetto/trace/interned_data/interned_data.proto
12832
12833// Begin of protos/perfetto/trace/memory_graph.proto
12834
12835// Message definitions for app-reported memory breakdowns. At the moment, this
12836// is a Chrome-only tracing feature, historically known as 'memory-infra'. See
12837// https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/ .
12838// This is unrelated to the native or java heap profilers (those protos live
12839// in //protos/perfetto/trace/profiling/).
12840
12841message MemoryTrackerSnapshot {
12842  // Memory snapshot of a process. The snapshot contains memory data that is
12843  // from 2 different sources, namely system stats and instrumentation stats.
12844  // The system memory usage stats come from the OS based on standard API
12845  // available in the platform to query memory usage. The instrumentation stats
12846  // are added by instrumenting specific piece of code which tracks memory
12847  // allocations and deallocations made by a small sub-system within the
12848  // application.
12849  // The system stats of the global memory snapshot are recorded as part of
12850  // ProcessStats and SmapsPacket fields in trace packet with the same
12851  // timestamp.
12852  message ProcessSnapshot {
12853    // Process ID of the process
12854    optional int32 pid = 1;
12855
12856    // Memory dumps are represented as a graph of memory nodes which contain
12857    // statistics. To avoid double counting the same memory across different
12858    // nodes, edges are used to mark nodes that account for the same memory. See
12859    // this doc for examples of the usage:
12860    // https://docs.google.com/document/d/1WGQRJ1sjJrfVkNcgPVY6frm64UqPc94tsxUOXImZUZI
12861
12862    // A single node in the memory graph.
12863    message MemoryNode {
12864      // Unique ID of the node across all processes involved in the global
12865      // memory dump. The ID is only unique within this particular global dump
12866      // identified by GlobalMemoryDumpPacket.global_dump_id.
12867      optional uint64 id = 1;
12868
12869      // Absolute name is a unique name for the memory node within the process
12870      // with ProcessMemoryDump.pid. The name can contain multiple parts
12871      // separated by '/', which traces the edges of the node from the root
12872      // node.
12873      // Eg: "partition_allocator/array_buffers/buffer1" refers to the child
12874      // node "buffer1" in a graph structure of:
12875      //   root -> partition_allocator -> array_buffers -> buffer1.
12876      optional string absolute_name = 2;
12877
12878      // A weak node means that the instrumentation that added the current node
12879      // is unsure about the existence of the actual memory. Unless a "strong"
12880      // (non-weak is default) node that has an edge to the current node exists
12881      // in the current global dump, the current node will be discarded.
12882      optional bool weak = 3;
12883
12884      // Size of the node in bytes, used to compute the effective size of the
12885      // nodes without double counting.
12886      optional uint64 size_bytes = 4;
12887
12888      // Entries in the memory node that contain statistics and additional
12889      // debuggable information about the memory. The size of the node is
12890      // tracked separately in the |size_bytes| field.
12891      message MemoryNodeEntry {
12892        optional string name = 1;
12893
12894        enum Units {
12895          UNSPECIFIED = 0;
12896          BYTES = 1;
12897          COUNT = 2;
12898        }
12899        optional Units units = 2;
12900
12901        // Contains either one of uint64 or string value.
12902        optional uint64 value_uint64 = 3;
12903        optional string value_string = 4;
12904      }
12905      repeated MemoryNodeEntry entries = 5;
12906    }
12907    repeated MemoryNode allocator_dumps = 2;
12908
12909    // A directed edge that connects any 2 nodes in the graph above. These are
12910    // in addition to the inherent edges added due to the tree structure of the
12911    // node's absolute names.
12912    // Node with id |source_id| owns the node with id |target_id|, and has the
12913    // effect of attributing the memory usage of target to source. |importance|
12914    // is optional and relevant only for the cases of co-ownership, where it
12915    // acts as a z-index: the owner with the highest importance will be
12916    // attributed target's memory.
12917    message MemoryEdge {
12918      optional uint64 source_id = 1;
12919      optional uint64 target_id = 2;
12920      optional uint32 importance = 3;
12921      optional bool overridable = 4;
12922    }
12923    repeated MemoryEdge memory_edges = 3;
12924  }
12925
12926  // Unique ID that represents the global memory dump.
12927  optional uint64 global_dump_id = 1;
12928
12929  enum LevelOfDetail {
12930    DETAIL_FULL = 0;
12931    DETAIL_LIGHT = 1;
12932    DETAIL_BACKGROUND = 2;
12933  }
12934  optional LevelOfDetail level_of_detail = 2;
12935
12936  repeated ProcessSnapshot process_memory_dumps = 3;
12937}
12938
12939// End of protos/perfetto/trace/memory_graph.proto
12940
12941// Begin of protos/perfetto/trace/perfetto/perfetto_metatrace.proto
12942
12943// Used to trace the execution of perfetto itself.
12944message PerfettoMetatrace {
12945  // See base/metatrace_events.h for definitions.
12946  oneof record_type {
12947    uint32 event_id = 1;
12948    uint32 counter_id = 2;
12949
12950    // For trace processor metatracing.
12951    string event_name = 8;
12952    uint64 event_name_iid = 11;
12953
12954    string counter_name = 9;
12955  }
12956  message Arg {
12957    oneof key_or_interned_key {
12958      string key = 1;
12959      uint64 key_iid = 3;
12960    }
12961    oneof value_or_interned_value {
12962      string value = 2;
12963      uint64 value_iid = 4;
12964    }
12965  }
12966
12967  // Only when using |event_id|.
12968  optional uint64 event_duration_ns = 3;
12969
12970  // Only when using |counter_id|.
12971  optional int32 counter_value = 4;
12972
12973  // ID of the thread that emitted the event.
12974  optional uint32 thread_id = 5;
12975
12976  // If true the meta-tracing ring buffer had overruns and hence some data is
12977  // missing from this point.
12978  optional bool has_overruns = 6;
12979
12980  // Args for the event.
12981  repeated Arg args = 7;
12982
12983  // Interned strings corresponding to the |event_name_iid|, |key_iid| and
12984  // |value_iid| above.
12985  message InternedString {
12986    optional uint64 iid = 1;
12987    optional string value = 2;
12988  };
12989  repeated InternedString interned_strings = 10;
12990}
12991
12992// End of protos/perfetto/trace/perfetto/perfetto_metatrace.proto
12993
12994// Begin of protos/perfetto/trace/perfetto/tracing_service_event.proto
12995
12996// Events emitted by the tracing service.
12997message TracingServiceEvent {
12998  oneof event_type {
12999    // When each of the following booleans are set to true, they report the
13000    // point in time (through TracePacket's timestamp) where the condition
13001    // they describe happened.
13002    // The order of the booleans below matches the timestamp ordering
13003    // they would generally be expected to have.
13004
13005    // Emitted when we start tracing and specifically, this will be before any
13006    // producer is notified about the existence of this trace. This is always
13007    // emitted before the all_data_sources_started event. This event is also
13008    // guaranteed to be seen (byte-offset wise) before any data packets from
13009    // producers.
13010    bool tracing_started = 2;
13011
13012    // Emitted after all data sources saw the start event and ACKed it.
13013    // This identifies the point in time when it's safe to assume that all data
13014    // sources have been recording events.
13015    bool all_data_sources_started = 1;
13016
13017    // Emitted when all data sources have been flushed successfully or with an
13018    // error (including timeouts). This can generally happen many times over the
13019    // course of the trace.
13020    bool all_data_sources_flushed = 3;
13021
13022    // Emitted when reading back the central tracing buffers has been completed.
13023    // If |write_into_file| is specified, this can happen many times over the
13024    // course of the trace.
13025    bool read_tracing_buffers_completed = 4;
13026
13027    // Emitted after tracing has been disabled and specifically, this will be
13028    // after all packets from producers have been included in the central
13029    // tracing buffer.
13030    bool tracing_disabled = 5;
13031
13032    // Emitted if perfetto --save-for-bugreport was invoked while the current
13033    // tracing session was running and it had the highest bugreport_score. In
13034    // this case the original consumer will see a nearly empty trace, because
13035    // the contents are routed onto the bugreport file. This event flags the
13036    // situation explicitly. Traces that contain this marker should be discarded
13037    // by test infrastructures / pipelines.
13038    // Deprecated since Android U, where --save-for-bugreport uses
13039    // non-destructive cloning.
13040    bool seized_for_bugreport = 6;
13041  }
13042}
13043
13044// End of protos/perfetto/trace/perfetto/tracing_service_event.proto
13045
13046// Begin of protos/perfetto/common/android_energy_consumer_descriptor.proto
13047
13048// Energy consumer based on aidl class:
13049// android.hardware.power.stats.EnergyConsumer.
13050message AndroidEnergyConsumer {
13051  // Unique ID of this energy consumer.  Matches the ID in a
13052  // AndroidEnergyEstimationBreakdown.
13053  optional int32 energy_consumer_id = 1;
13054
13055  // For a group of energy consumers of the same logical type, sorting by
13056  // ordinal gives their physical order. Ordinals must be consecutive integers
13057  // starting from 0.
13058  optional int32 ordinal = 2;
13059
13060  // Type of this energy consumer.
13061  optional string type = 3;
13062
13063  // Unique name of this energy consumer. Vendor/device specific. Opaque to
13064  // framework.
13065  optional string name = 4;
13066}
13067
13068message AndroidEnergyConsumerDescriptor {
13069  repeated AndroidEnergyConsumer energy_consumers = 1;
13070}
13071
13072// End of protos/perfetto/common/android_energy_consumer_descriptor.proto
13073
13074// Begin of protos/perfetto/trace/power/android_energy_estimation_breakdown.proto
13075
13076// Energy data retrieve using the ODPM(On Device Power Monitor) API.
13077// This proto represents the aidl class:
13078// android.hardware.power.stats.EnergyConsumerResult.
13079message AndroidEnergyEstimationBreakdown {
13080  // The first trace packet of each session should include a energy consumer
13081  // descriptor.
13082  optional AndroidEnergyConsumerDescriptor energy_consumer_descriptor = 1;
13083
13084  // ID of the AndroidEnergyConsumer associated with this result.  Matches
13085  // the energy_consumer_id in the AndroidEnergyConsumerDescriptor that
13086  // should be sent at the beginning of a trace.
13087  optional int32 energy_consumer_id = 2;
13088
13089  // Total accumulated energy since boot in microwatt-seconds (uWs)
13090  optional int64 energy_uws = 3;
13091
13092  message EnergyUidBreakdown {
13093    // Android ID/Linux UID, the accumulated energy is attributed to.
13094    optional int32 uid = 1;
13095
13096    // Accumulated energy since boot in microwatt-seconds (uWs).
13097    optional int64 energy_uws = 2;
13098  }
13099  // Optional attributed energy per Android ID / Linux UID for this
13100  // EnergyConsumer. Sum total of attributed energy must be less than or equal
13101  // to total accumulated energy.
13102  repeated EnergyUidBreakdown per_uid_breakdown = 4;
13103}
13104
13105// End of protos/perfetto/trace/power/android_energy_estimation_breakdown.proto
13106
13107// Begin of protos/perfetto/trace/power/android_entity_state_residency.proto
13108
13109message EntityStateResidency {
13110  message PowerEntityState {
13111    // Index corresponding to the entity
13112    optional int32 entity_index = 1;
13113
13114    // Index corresponding to the state
13115    optional int32 state_index = 2;
13116
13117    // Name of the entity. This is device-specific, determined by the PowerStats
13118    // HAL, and cannot be configured by the user. An example would be
13119    // "Bluetooth".
13120    optional string entity_name = 3;
13121
13122    // Name of the state. This is device-specific, determined by the PowerStats
13123    // HAL, and cannot be configured by the user. An example would be
13124    // "Active".
13125    optional string state_name = 4;
13126  }
13127
13128  // This is only emitted at the beginning of the trace.
13129  repeated PowerEntityState power_entity_state = 1;
13130
13131  message StateResidency {
13132    // Index corresponding to PowerEntityState.entity_index
13133    optional int32 entity_index = 1;
13134
13135    // Index corresponding to PowerEntityState.state_index
13136    optional int32 state_index = 2;
13137
13138    // Time since boot that this entity has been in this state
13139    optional uint64 total_time_in_state_ms = 3;
13140
13141    // Total number of times since boot that the entity has entered this state
13142    optional uint64 total_state_entry_count = 4;
13143
13144    // Timestamp of the last time the entity entered this state
13145    optional uint64 last_entry_timestamp_ms = 5;
13146  }
13147
13148  repeated StateResidency residency = 2;
13149}
13150
13151// End of protos/perfetto/trace/power/android_entity_state_residency.proto
13152
13153// Begin of protos/perfetto/trace/power/battery_counters.proto
13154
13155message BatteryCounters {
13156  // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
13157  optional int64 charge_counter_uah = 1;
13158
13159  // Remaining battery capacity percentage of total capacity
13160  optional float capacity_percent = 2;
13161
13162  // Instantaneous battery current in microamperes(µA).
13163  // Negative values indicate current being drained from the battery and
13164  // positive values indicate current feeding the battery from a charge source
13165  // (USB).
13166  //
13167  // See https://perfetto.dev/docs/data-sources/battery-counters for more info.
13168  optional int64 current_ua = 3;
13169
13170  // Instantaneous battery current in microamperes(µA).
13171  optional int64 current_avg_ua = 4;
13172
13173  // Battery name, emitted only on multiple batteries.
13174  optional string name = 5;
13175
13176  // Battery capacity in microwatt-hours(µWh).
13177  optional int64 energy_counter_uwh = 6;
13178
13179  // Battery voltage in microvolts(µV).
13180  optional int64 voltage_uv = 7;
13181}
13182
13183// End of protos/perfetto/trace/power/battery_counters.proto
13184
13185// Begin of protos/perfetto/trace/power/power_rails.proto
13186
13187message PowerRails {
13188
13189  message RailDescriptor {
13190    // Index corresponding to the rail
13191    optional uint32 index = 1;
13192
13193    // Name of the rail
13194    optional string rail_name = 2;
13195
13196    // Name of the subsystem to which this rail belongs
13197    optional string subsys_name = 3;
13198
13199    // Hardware sampling rate (Hz).
13200    optional uint32 sampling_rate = 4;
13201  }
13202
13203  // This is only emitted at the beginning of the trace.
13204  repeated RailDescriptor rail_descriptor = 1;
13205
13206  message EnergyData {
13207    // Index corresponding to RailDescriptor.index
13208    optional uint32 index = 1;
13209
13210    // Time since device boot(CLOCK_BOOTTIME) in milli-seconds.
13211    optional uint64 timestamp_ms = 2;
13212
13213    // Accumulated energy since device boot in microwatt-seconds (uWs).
13214    optional uint64 energy = 3;
13215  }
13216
13217  repeated EnergyData energy_data = 2;
13218}
13219
13220// End of protos/perfetto/trace/power/power_rails.proto
13221
13222// Begin of protos/perfetto/trace/profiling/deobfuscation.proto
13223
13224message ObfuscatedMember {
13225  // This is the obfuscated field name relative to the class containing the
13226  // ObfuscatedMember.
13227  optional string obfuscated_name = 1;
13228  // If this is fully qualified (i.e. contains a '.') this is the deobfuscated
13229  // field name including its class. Otherwise, this is this the unqualified
13230  // deobfuscated field name relative to the class containing this
13231  // ObfuscatedMember.
13232  optional string deobfuscated_name = 2;
13233}
13234
13235message ObfuscatedClass {
13236  optional string obfuscated_name = 1;
13237  optional string deobfuscated_name = 2;
13238  // fields.
13239  repeated ObfuscatedMember obfuscated_members = 3;
13240  repeated ObfuscatedMember obfuscated_methods = 4;
13241}
13242
13243message DeobfuscationMapping {
13244  optional string package_name = 1;
13245  optional int64 version_code = 2;
13246  repeated ObfuscatedClass obfuscated_classes = 3;
13247}
13248// End of protos/perfetto/trace/profiling/deobfuscation.proto
13249
13250// Begin of protos/perfetto/trace/profiling/heap_graph.proto
13251
13252message HeapGraphRoot {
13253  enum Type {
13254    ROOT_UNKNOWN = 0;
13255    ROOT_JNI_GLOBAL = 1;
13256    ROOT_JNI_LOCAL = 2;
13257    ROOT_JAVA_FRAME = 3;
13258    ROOT_NATIVE_STACK = 4;
13259    ROOT_STICKY_CLASS = 5;
13260    ROOT_THREAD_BLOCK = 6;
13261    ROOT_MONITOR_USED = 7;
13262    ROOT_THREAD_OBJECT = 8;
13263    ROOT_INTERNED_STRING = 9;
13264    ROOT_FINALIZING = 10;
13265    ROOT_DEBUGGER = 11;
13266    ROOT_REFERENCE_CLEANUP = 12;
13267    ROOT_VM_INTERNAL = 13;
13268    ROOT_JNI_MONITOR = 14;
13269  };
13270  // Objects retained by this root.
13271  repeated uint64 object_ids = 1 [packed = true];
13272
13273  optional Type root_type = 2;
13274}
13275
13276message HeapGraphType {
13277  enum Kind {
13278    KIND_UNKNOWN = 0;
13279    KIND_NORMAL = 1;
13280    KIND_NOREFERENCES = 2;
13281    KIND_STRING = 3;
13282    KIND_ARRAY = 4;
13283    KIND_CLASS = 5;
13284    KIND_CLASSLOADER = 6;
13285    KIND_DEXCACHE = 7;
13286    KIND_SOFT_REFERENCE = 8;
13287    KIND_WEAK_REFERENCE = 9;
13288    KIND_FINALIZER_REFERENCE = 10;
13289    KIND_PHANTOM_REFERENCE = 11;
13290  };
13291  // TODO(fmayer): Consider removing this and using the index in the repeaed
13292  // field to save space.
13293  optional uint64 id = 1;
13294  optional uint64 location_id = 2;
13295  optional string class_name = 3;
13296  // Size of objects of this type.
13297  optional uint64 object_size = 4;
13298  optional uint64 superclass_id = 5;
13299  // Indices for InternedData.field_names for the names of the fields of
13300  // instances of this class. This does NOT include the fields from
13301  // superclasses. The consumer of this data needs to walk all super
13302  // classes to get a full lists of fields. Objects always write the
13303  // fields in order of most specific class to the furthest up superclass.
13304  repeated uint64 reference_field_id = 6 [packed = true];
13305  optional Kind kind = 7;
13306  optional uint64 classloader_id = 8;
13307}
13308
13309message HeapGraphObject {
13310  oneof identifier {
13311    uint64 id = 1;
13312    uint64 id_delta = 7;
13313  }
13314
13315  // Index for InternedData.types for the name of the type of this object.
13316  optional uint64 type_id = 2;
13317
13318  // Bytes occupied by this objects.
13319  optional uint64 self_size = 3;
13320
13321  // Add this to all non-zero values in reference_object_id. This is used to
13322  // get more compact varint encoding.
13323  //
13324  // The name is confusing, but this has always been used as a base for
13325  // reference_object_id. The field should be named reference_object_id_base.
13326  optional uint64 reference_field_id_base = 6;
13327
13328  // Indices for InternedData.field_names for the name of the field referring
13329  // to the object. For Android S+ and for instances of normal classes (e.g.
13330  // not instances of java.lang.Class or arrays), this is instead set in the
13331  // corresponding HeapGraphType, and this is left empty.
13332  repeated uint64 reference_field_id = 4 [packed = true];
13333
13334  // Ids of the Object that is referred to.
13335  repeated uint64 reference_object_id = 5 [packed = true];
13336
13337  // If this object is an instance of `libcore.util.NativeAllocationRegistry`,
13338  // the value of the `size` field.
13339  //
13340  // N.B. This is not the native size of this object.
13341  optional int64 native_allocation_registry_size_field = 8;
13342}
13343
13344message HeapGraph {
13345  optional int32 pid = 1;
13346
13347  // This contains all objects at the time this dump was taken. Some of these
13348  // will be live, some of those unreachable (garbage). To find the live
13349  // objects, the client needs to build the transitive closure of objects
13350  // reachable from |roots|.
13351  // All objects not contained within that transitive closure are garbage that
13352  // has not yet been collected.
13353  repeated HeapGraphObject objects = 2;
13354
13355  // Roots at the time this dump was taken.
13356  // All live objects are reachable from the roots. All other objects are
13357  // garbage.
13358  repeated HeapGraphRoot roots = 7;
13359
13360  // Types used in HeapGraphObjects.
13361  repeated HeapGraphType types = 9;
13362
13363  reserved 3;
13364
13365  // Field names for references in managed heap graph.
13366  repeated InternedString field_names = 4;
13367
13368  // Paths of files used in managed heap graph.
13369  repeated InternedString location_names = 8;
13370
13371  optional bool continued = 5;
13372  optional uint64 index = 6;
13373}
13374
13375// End of protos/perfetto/trace/profiling/heap_graph.proto
13376
13377// Begin of protos/perfetto/trace/profiling/profile_packet.proto
13378
13379// This file contains a mixture of messages emitted by various sampling
13380// profilers:
13381//
13382// Memory allocator profiling
13383// ----------------
13384// ProfilePacket:
13385//   The packet emitted by heapprofd, which started off as a native heap
13386//   (malloc/free) profiler, but now supports custom allocators as well. Each
13387//   packet contains a preaggregated state of the heap at snapshot time, which
13388//   report the total allocated/free bytes per callstack (plus other info such
13389//   as the number of samples).
13390// StreamingAllocation/StreamingFree:
13391//   Emitted by heapprofd when configured in streaming mode (i.e. when
13392//   stream_allocations = true). This is only for local testing, and doesn't
13393//   report callstacks (only address time and size of each alloc/free). It can
13394//   lead to enormous traces, as it contains the stream of each alloc/free call.
13395//
13396// Callstack sampling
13397// ------------------
13398// StreamingProfilePacket:
13399//   The packet emitted by the chromium in-process sampling profiler, which is
13400//   based on periodically sending a signal to itself, and unwinding the stack
13401//   in the signal handler. Each packet contains a series of individual stack
13402//   samples for a Chromium thread.
13403//
13404// Callstack and performance counter sampling
13405// ---------------------
13406// PerfSample:
13407//   The packet emitted by traced_perf sampling performance profiler based on
13408//   the perf_event_open syscall. Each packet represents an individual sample
13409//   of a performance counter (which might be a timer), and optionally a
13410//   callstack of the process that was scheduled at the time of the sample.
13411//
13412
13413// The packet emitted by heapprofd for each heap snapshot. A snapshot can
13414// involve more than one ProfilePacket if the snapshot is big (when |continued|
13415// is true). The cardinality and grouping is as follows:
13416// A ProfilePacket contains:
13417//  - 1+ per-process heap snapshots (ProcessHeapSamples). Normally there is only
13418//    one heap per process (the main malloc/free heap), but there can be more if
13419//    the process is using the heapprofd API to profile custom allocators.
13420//  - Globally interned strings, mappings and frames (to allow de-duplicating
13421//    frames/mapping in common between different processes).
13422// A ProcessHeapSamples contains:
13423//  - The process and heap identifier.
13424//  - A number of HeapSample, one for each callsite that had some alloc/frees.
13425//  - Statistics about heapprofd internals (e.g., sampling/unwinding timings).
13426// A HeapSample contains statistics about callsites:
13427//  - Total number of bytes allocated and freed from that callsite.
13428//  - Total number of alloc/free calls sampled.
13429//  - Stats at the local maximum when dump_at_max = true.
13430// See https://perfetto.dev/docs/data-sources/native-heap-profiler for more.
13431message ProfilePacket {
13432  // The following interning tables are only used in Android version Q.
13433  // In newer versions, these tables are in InternedData
13434  // (see protos/perfetto/trace/interned_data) and are shared across
13435  // multiple ProfilePackets.
13436  // For backwards compatibility, consumers need to first look up interned
13437  // data in the tables within the ProfilePacket, and then, if they are empty,
13438  // look up in the InternedData instead.
13439  repeated InternedString strings = 1;
13440  repeated Mapping mappings = 4;
13441  repeated Frame frames = 2;
13442  repeated Callstack callstacks = 3;
13443
13444  // Next ID: 9
13445  message HeapSample {
13446    optional uint64 callstack_id = 1;
13447    // bytes allocated at this callstack.
13448    optional uint64 self_allocated = 2;
13449    // bytes allocated at this callstack that have been freed.
13450    optional uint64 self_freed = 3;
13451    // deprecated self_idle.
13452    reserved 7;
13453    // Bytes allocated by this callstack but not freed at the time the malloc
13454    // heap usage of this process was maximal. This is only set if dump_at_max
13455    // is true in HeapprofdConfig. In that case, self_allocated, self_freed and
13456    // self_idle will not be set.
13457    optional uint64 self_max = 8;
13458    // Number of allocations that were sampled at this callstack but not freed
13459    // at the time the malloc heap usage of this process was maximal. This is
13460    // only set if dump_at_max is true in HeapprofdConfig. In that case,
13461    // self_allocated, self_freed and self_idle will not be set.
13462    optional uint64 self_max_count = 9;
13463    // timestamp [opt]
13464    optional uint64 timestamp = 4;
13465    // Number of allocations that were sampled at this callstack.
13466    optional uint64 alloc_count = 5;
13467    // Number of allocations that were sampled at this callstack that have been
13468    // freed.
13469    optional uint64 free_count = 6;
13470  }
13471
13472  message Histogram {
13473    message Bucket {
13474      // This bucket counts values from the previous bucket's (or -infinity if
13475      // this is the first bucket) upper_limit (inclusive) to this upper_limit
13476      // (exclusive).
13477      optional uint64 upper_limit = 1;
13478      // This is the highest bucket. This is set instead of the upper_limit. Any
13479      // values larger or equal to the previous bucket's upper_limit are counted
13480      // in this bucket.
13481      optional bool max_bucket = 2;
13482      // Number of values that fall into this range.
13483      optional uint64 count = 3;
13484    }
13485    repeated Bucket buckets = 1;
13486  }
13487
13488  message ProcessStats {
13489    optional uint64 unwinding_errors = 1;
13490    optional uint64 heap_samples = 2;
13491    optional uint64 map_reparses = 3;
13492    optional Histogram unwinding_time_us = 4;
13493    optional uint64 total_unwinding_time_us = 5;
13494    optional uint64 client_spinlock_blocked_us = 6;
13495  }
13496
13497  repeated ProcessHeapSamples process_dumps = 5;
13498  message ProcessHeapSamples {
13499    enum ClientError {
13500      CLIENT_ERROR_NONE = 0;
13501      CLIENT_ERROR_HIT_TIMEOUT = 1;
13502      CLIENT_ERROR_INVALID_STACK_BOUNDS = 2;
13503    }
13504    optional uint64 pid = 1;
13505
13506    // This process was profiled from startup.
13507    // If false, this process was already running when profiling started.
13508    optional bool from_startup = 3;
13509
13510    // This process was not profiled because a concurrent session was active.
13511    // If this is true, samples will be empty.
13512    optional bool rejected_concurrent = 4;
13513
13514    // This process disconnected while it was profiled.
13515    // If false, the process outlived the profiling session.
13516    optional bool disconnected = 6;
13517
13518    // If disconnected, this disconnect was caused by the client overrunning
13519    // the buffer.
13520    // Equivalent to client_error == CLIENT_ERROR_HIT_TIMEOUT
13521    // on new S builds.
13522    optional bool buffer_overran = 7;
13523
13524    optional ClientError client_error = 14;
13525
13526    // If disconnected, this disconnected was caused by the shared memory
13527    // buffer being corrupted. THIS IS ALWAYS A BUG IN HEAPPROFD OR CLIENT
13528    // MEMORY CORRUPTION.
13529    optional bool buffer_corrupted = 8;
13530
13531    // If disconnected, this disconnect was caused by heapprofd exceeding
13532    // guardrails during this profiling session.
13533    optional bool hit_guardrail = 10;
13534
13535    optional string heap_name = 11;
13536    optional uint64 sampling_interval_bytes = 12;
13537    optional uint64 orig_sampling_interval_bytes = 13;
13538
13539    // Timestamp of the state of the target process that this dump represents.
13540    // This can be different to the timestamp of the TracePackets for various
13541    // reasons:
13542    // * If disconnected is set above, this is the timestamp of last state
13543    //   heapprofd had of the process before it disconnected.
13544    // * Otherwise, if the rate of events produced by the process is high,
13545    //   heapprofd might be behind.
13546    //
13547    // TODO(fmayer): This is MONOTONIC_COARSE. Refactor ClockSnapshot::Clock
13548    //               to have a type enum that we can reuse here.
13549    optional uint64 timestamp = 9;
13550
13551    // Metadata about heapprofd.
13552    optional ProcessStats stats = 5;
13553
13554    repeated HeapSample samples = 2;
13555  }
13556
13557  // If this is true, the next ProfilePacket in this package_sequence_id is a
13558  // continuation of this one.
13559  // To get all samples for a process, accummulate its
13560  // ProcessHeapSamples.samples until you see continued=false.
13561  optional bool continued = 6;
13562
13563  // Index of this ProfilePacket on its package_sequence_id. Can be used
13564  // to detect dropped data.
13565  // Verify these are consecutive.
13566  optional uint64 index = 7;
13567}
13568
13569// Packet emitted by heapprofd when stream_allocations = true. Only for local
13570// testing. Doesn't report the callsite.
13571message StreamingAllocation {
13572  // TODO(fmayer): Add callstack.
13573  repeated uint64 address = 1;
13574  repeated uint64 size = 2;
13575  repeated uint64 sample_size = 3;
13576  repeated uint64 clock_monotonic_coarse_timestamp = 4;
13577  repeated uint32 heap_id = 5;
13578  repeated uint64 sequence_number = 6;
13579};
13580
13581// Packet emitted by heapprofd when stream_allocations = true. Only for local
13582// testing. Doesn't report the callsite.
13583message StreamingFree {
13584  // TODO(fmayer): Add callstack.
13585  repeated uint64 address = 1;
13586  repeated uint32 heap_id = 2;
13587  repeated uint64 sequence_number = 3;
13588};
13589
13590// Packet emitted by the chromium in-process signal-based callstack sampler.
13591// Represents a series of individual stack samples (sampled at discrete points
13592// in time), rather than aggregated over an interval.
13593message StreamingProfilePacket {
13594  // Index into InternedData.callstacks
13595  repeated uint64 callstack_iid = 1;
13596  // TODO(eseckler): ThreadDescriptor-based timestamps are deprecated. Replace
13597  // this with ClockSnapshot-based delta encoding instead.
13598  repeated int64 timestamp_delta_us = 2;
13599  optional int32 process_priority = 3;
13600}
13601
13602// Namespace for the contained enums.
13603message Profiling {
13604  enum CpuMode {
13605    MODE_UNKNOWN = 0;
13606    MODE_KERNEL = 1;
13607    MODE_USER = 2;
13608    // The following values aren't expected, but included for completeness:
13609    MODE_HYPERVISOR = 3;
13610    MODE_GUEST_KERNEL = 4;
13611    MODE_GUEST_USER = 5;
13612  }
13613
13614  // Enumeration of libunwindstack's error codes.
13615  // NB: the integral representations of the two enums are different.
13616  enum StackUnwindError {
13617    UNWIND_ERROR_UNKNOWN = 0;
13618    UNWIND_ERROR_NONE = 1;
13619    UNWIND_ERROR_MEMORY_INVALID = 2;
13620    UNWIND_ERROR_UNWIND_INFO = 3;
13621    UNWIND_ERROR_UNSUPPORTED = 4;
13622    UNWIND_ERROR_INVALID_MAP = 5;
13623    UNWIND_ERROR_MAX_FRAMES_EXCEEDED = 6;
13624    UNWIND_ERROR_REPEATED_FRAME = 7;
13625    UNWIND_ERROR_INVALID_ELF = 8;
13626    UNWIND_ERROR_SYSTEM_CALL = 9;
13627    UNWIND_ERROR_THREAD_TIMEOUT = 10;
13628    UNWIND_ERROR_THREAD_DOES_NOT_EXIST = 11;
13629    UNWIND_ERROR_BAD_ARCH = 12;
13630    UNWIND_ERROR_MAPS_PARSE = 13;
13631    UNWIND_ERROR_INVALID_PARAMETER = 14;
13632    UNWIND_ERROR_PTRACE_CALL = 15;
13633  }
13634}
13635
13636// Packet emitted by the traced_perf sampling performance profiler, which
13637// gathers data via the perf_event_open syscall. Each packet contains an
13638// individual sample with a counter value, and optionally a
13639// callstack.
13640//
13641// Timestamps are within the root packet. The config can specify the clock, or
13642// the implementation will default to CLOCK_MONOTONIC_RAW. Within the Android R
13643// timeframe, the default was CLOCK_BOOTTIME.
13644//
13645// There are several distinct views of this message:
13646// * indication of kernel buffer data loss (kernel_records_lost set)
13647// * indication of skipped samples (sample_skipped_reason set)
13648// * notable event in the sampling implementation (producer_event set)
13649// * normal sample (timebase_count set, typically also callstack_iid)
13650message PerfSample {
13651  optional uint32 cpu = 1;
13652  optional uint32 pid = 2;
13653  optional uint32 tid = 3;
13654
13655  // Execution state that the process was sampled at.
13656  optional Profiling.CpuMode cpu_mode = 5;
13657
13658  // Value of the timebase counter (since the event was configured, no deltas).
13659  optional uint64 timebase_count = 6;
13660
13661  // Unwound callstack. Might be partial, in which case a synthetic "error"
13662  // frame is appended, and |unwind_error| is set accordingly.
13663  optional uint64 callstack_iid = 4;
13664
13665  // If set, stack unwinding was incomplete due to an error.
13666  // Unset values should be treated as UNWIND_ERROR_NONE.
13667  oneof optional_unwind_error { Profiling.StackUnwindError unwind_error = 16; };
13668
13669  // If set, indicates that this message is not a sample, but rather an
13670  // indication of data loss in the ring buffer allocated for |cpu|. Such data
13671  // loss occurs when the kernel has insufficient ring buffer capacity to write
13672  // a record (which gets discarded). A record in this context is an individual
13673  // ring buffer entry, and counts more than just sample records.
13674  //
13675  // The |timestamp| of the packet corresponds to the time that the producer
13676  // wrote the packet for trace-sorting purposes alone, and should not be
13677  // interpreted relative to the sample timestamps. This field is sufficient to
13678  // detect that *some* kernel data loss happened within the trace, but not the
13679  // specific time bounds of that loss (which would require tracking precedessor
13680  // & successor timestamps, which is not deemed necessary at the moment).
13681  optional uint64 kernel_records_lost = 17;
13682
13683  // If set, indicates that the profiler encountered a sample that was relevant,
13684  // but was skipped.
13685  enum SampleSkipReason {
13686    PROFILER_SKIP_UNKNOWN = 0;
13687    PROFILER_SKIP_READ_STAGE = 1;
13688    PROFILER_SKIP_UNWIND_STAGE = 2;
13689    PROFILER_SKIP_UNWIND_ENQUEUE = 3;
13690  }
13691  oneof optional_sample_skipped_reason {
13692    SampleSkipReason sample_skipped_reason = 18;
13693  };
13694
13695  // A notable event within the sampling implementation.
13696  message ProducerEvent {
13697    enum DataSourceStopReason {
13698      PROFILER_STOP_UNKNOWN = 0;
13699      PROFILER_STOP_GUARDRAIL = 1;
13700    }
13701    oneof optional_source_stop_reason {
13702      DataSourceStopReason source_stop_reason = 1;
13703    }
13704  }
13705  optional ProducerEvent producer_event = 19;
13706}
13707
13708// Submessage for TracePacketDefaults.
13709message PerfSampleDefaults {
13710  // The sampling timebase. Might not be identical to the data source config if
13711  // the implementation decided to default/override some parameters.
13712  optional PerfEvents.Timebase timebase = 1;
13713
13714  // If the config requested process sharding, report back the count and which
13715  // of those bins was selected. Never changes for the duration of a trace.
13716  optional uint32 process_shard_count = 2;
13717  optional uint32 chosen_process_shard = 3;
13718}
13719
13720// End of protos/perfetto/trace/profiling/profile_packet.proto
13721
13722// Begin of protos/perfetto/trace/profiling/smaps.proto
13723
13724message SmapsEntry {
13725  optional string path = 1;
13726  optional uint64 size_kb = 2;
13727  optional uint64 private_dirty_kb = 3;
13728  optional uint64 swap_kb = 4;
13729
13730  // for field upload (instead of path).
13731  optional string file_name = 5;
13732
13733  // TODO(crbug.com/1098746): Consider encoding this as incremental values.
13734  optional uint64 start_address = 6;
13735  optional uint64 module_timestamp = 7;
13736  optional string module_debugid = 8;
13737  optional string module_debug_path = 9;
13738  optional uint32 protection_flags = 10;
13739
13740  optional uint64 private_clean_resident_kb = 11;
13741  optional uint64 shared_dirty_resident_kb = 12;
13742  optional uint64 shared_clean_resident_kb = 13;
13743  optional uint64 locked_kb = 14;
13744  optional uint64 proportional_resident_kb = 15;
13745};
13746
13747message SmapsPacket {
13748  optional uint32 pid = 1;
13749  repeated SmapsEntry entries = 2;
13750};
13751
13752// End of protos/perfetto/trace/profiling/smaps.proto
13753
13754// Begin of protos/perfetto/trace/ps/process_stats.proto
13755
13756// Per-process periodically sampled stats. These samples are wrapped in a
13757// dedicated message (as opposite to be fields in process_tree.proto) because
13758// they are dumped at a different rate than cmdline and thread list.
13759// Note: not all of these stats will be present in every ProcessStats message
13760// and sometimes processes may be missing. This is because counters are
13761// cached to reduce emission of counters which do not change.
13762message ProcessStats {
13763  // Per-thread periodically sampled stats.
13764  // Note: not all of these stats will be present in every message. See the note
13765  // for ProcessStats.
13766  message Thread {
13767    optional int32 tid = 1;
13768
13769    // DEPRECATED cpu_freq_indices
13770    reserved 2;
13771
13772    // DEPRECATED cpu_freq_ticks
13773    reserved 3;
13774
13775    // DEPRECATED cpu_freq_full
13776    reserved 4;
13777  }
13778
13779  message FDInfo {
13780    optional uint64 fd = 1;
13781    optional string path = 2;
13782  }
13783
13784  message Process {
13785    optional int32 pid = 1;
13786
13787    repeated Thread threads = 11;
13788
13789    // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
13790    optional uint64 vm_size_kb = 2;
13791    optional uint64 vm_rss_kb = 3;
13792    optional uint64 rss_anon_kb = 4;
13793    optional uint64 rss_file_kb = 5;
13794    optional uint64 rss_shmem_kb = 6;
13795    optional uint64 vm_swap_kb = 7;
13796    optional uint64 vm_locked_kb = 8;
13797    optional uint64 vm_hwm_kb = 9;
13798    // When adding a new field remember to update kProcMemCounterSize in
13799    // the trace processor.
13800
13801    optional int64 oom_score_adj = 10;
13802
13803    // The peak resident set size is resettable in newer Posix kernels.
13804    // This field specifies if reset is supported and if the writer had reset
13805    // the peaks after each process stats recording.
13806    optional bool is_peak_rss_resettable = 12;
13807
13808    // Private, shared and swap footprint of the process as measured by
13809    // Chrome. To know more about these metrics refer to:
13810    // https://docs.google.com/document/d/1_WmgE1F5WUrhwkPqJis3dWyOiUmQKvpXp5cd4w86TvA
13811    optional uint32 chrome_private_footprint_kb = 13;
13812    optional uint32 chrome_peak_resident_set_kb = 14;
13813
13814    repeated FDInfo fds = 15;
13815
13816    // These fields are set only when scan_smaps_rollup=true
13817    optional uint64 smr_rss_kb = 16;
13818    optional uint64 smr_pss_kb = 17;
13819    optional uint64 smr_pss_anon_kb = 18;
13820    optional uint64 smr_pss_file_kb = 19;
13821    optional uint64 smr_pss_shmem_kb = 20;
13822
13823    // Time spent scheduled in user mode in nanoseconds. Parsed from utime in
13824    // /proc/pid/stat. Recorded if record_process_runtime config option is set.
13825    // Resolution of "clock ticks", usually 10ms.
13826    optional uint64 runtime_user_mode = 21;
13827
13828    // Time spent scheduled in kernel mode in nanoseconds. Parsed from stime in
13829    // /proc/pid/stat. Recorded if record_process_runtime config option is set.
13830    // Resolution of "clock ticks", usually 10ms.
13831    optional uint64 runtime_kernel_mode = 22;
13832  }
13833  repeated Process processes = 1;
13834
13835  // The time at which we finish collecting this batch of samples;
13836  // the top-level packet timestamp is the time at which
13837  // we begin collection.
13838  optional uint64 collection_end_timestamp = 2;
13839}
13840
13841// End of protos/perfetto/trace/ps/process_stats.proto
13842
13843// Begin of protos/perfetto/trace/ps/process_tree.proto
13844
13845// Metadata about the processes and threads in the trace.
13846// Note: this proto was designed to be filled in by traced_probes and should
13847// only be populated with accurate information coming from the system. Other
13848// trace writers should prefer to fill ThreadDescriptor and ProcessDescriptor
13849// in TrackDescriptor.
13850message ProcessTree {
13851  // Representation of a thread.
13852  message Thread {
13853    // The thread ID (as per gettid()) in the root PID namespace.
13854    optional int32 tid = 1;
13855
13856    // Thread group id (i.e. the PID of the process, == TID of the main thread)
13857    optional int32 tgid = 3;
13858
13859    // The name of the thread.
13860    optional string name = 2;
13861
13862    // The non-root-level thread IDs if the thread runs in a PID namespace. Read
13863    // from the NSpid entry of /proc/<tid>/status, with the first element (root-
13864    // level thread ID) omitted.
13865    repeated int32 nstid = 4;
13866  }
13867
13868  // Representation of a process.
13869  message Process {
13870    // The UNIX process ID, aka thread group ID (as per getpid()) in the root
13871    // PID namespace.
13872    optional int32 pid = 1;
13873
13874    // The parent process ID, as per getppid().
13875    optional int32 ppid = 2;
13876
13877    // The command line for the process, as per /proc/pid/cmdline.
13878    // If it is a kernel thread there will only be one cmdline field
13879    // and it will contain /proc/pid/comm.
13880    repeated string cmdline = 3;
13881
13882    // The uid for the process, as per /proc/pid/status.
13883    optional int32 uid = 5;
13884
13885    // The non-root-level process IDs if the process runs in a PID namespace.
13886    // Read from the NSpid entry of /proc/<pid>/status, with the first element
13887    // (root-level process ID) omitted.
13888    repeated int32 nspid = 6;
13889
13890    // Timestamp of when the process was created, in nanoseconds
13891    // from boot. Parsed from starttime in /proc/pid/stat.
13892    // Recorded if record_process_age config option is set.
13893    // Resolution of "clock ticks", usually 10ms.
13894    optional uint64 process_start_from_boot = 7;
13895
13896    // threads_deprecated
13897    reserved 4;
13898  }
13899
13900  // List of processes and threads in the client. These lists are incremental
13901  // and not exhaustive. A process and its threads might show up separately in
13902  // different ProcessTree messages. A thread might event not show up at all, if
13903  // no sched_switch activity was detected, for instance:
13904  // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
13905  // #1 { threads: [{pid: 12, tgid: 10}] }
13906  // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
13907  repeated Process processes = 1;
13908  repeated Thread threads = 2;
13909
13910  // The time at which we finish collecting this process tree;
13911  // the top-level packet timestamp is the time at which
13912  // we begin collection.
13913  optional uint64 collection_end_timestamp = 3;
13914}
13915
13916// End of protos/perfetto/trace/ps/process_tree.proto
13917
13918// Begin of protos/perfetto/trace/remote_clock_sync.proto
13919
13920// Records the parameters for aligning clock readings between machines.
13921message RemoteClockSync {
13922  // Synchronized clock snapshots taken on both sides of the relay port (the
13923  // tracing service and the relay service). A round of clock synchronization
13924  // IPC takes emits 2 SyncedClocks messages, i.e., client snapshot -> host
13925  // snapshot -> client snapshot -> host snapshot.
13926  message SyncedClocks {
13927    optional ClockSnapshot client_clocks = 2;
13928    optional ClockSnapshot host_clocks = 3;
13929  }
13930
13931  repeated SyncedClocks synced_clocks = 1;
13932}
13933
13934// End of protos/perfetto/trace/remote_clock_sync.proto
13935
13936// Begin of protos/perfetto/trace/statsd/statsd_atom.proto
13937
13938// Deliberate empty message. See comment on StatsdAtom#atom below.
13939message Atom {}
13940
13941// One or more statsd atoms. This must continue to match:
13942// perfetto/protos/third_party/statsd/shell_data.proto
13943// So that we can efficiently add data from statsd directly to the
13944// trace.
13945message StatsdAtom {
13946  // Atom should be filled with an Atom proto from:
13947  // https://cs.android.com/android/platform/superproject/main/+/main:frameworks/proto_logging/stats/atoms.proto?q=f:stats%2Fatoms.proto$%20message%5C%20Atom
13948  // We don't reference Atom directly here since we don't want to import
13949  // Atom.proto and all its transitive dependencies into Perfetto.
13950  // atom and timestamp_nanos have the same cardinality
13951  repeated Atom atom = 1;
13952  repeated int64 timestamp_nanos = 2;
13953}
13954
13955// End of protos/perfetto/trace/statsd/statsd_atom.proto
13956
13957// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto
13958
13959// Various Linux system stat counters from /proc.
13960// The fields in this message can be reported at different rates and with
13961// different granularity. See sys_stats_config.proto.
13962message SysStats {
13963  // Counters from /proc/meminfo. Values are in KB.
13964  message MeminfoValue {
13965    optional MeminfoCounters key = 1;
13966    optional uint64 value = 2;
13967  };
13968  repeated MeminfoValue meminfo = 1;
13969
13970  // Counter from /proc/vmstat. Units are often pages, not KB.
13971  message VmstatValue {
13972    optional VmstatCounters key = 1;
13973    optional uint64 value = 2;
13974  };
13975  repeated VmstatValue vmstat = 2;
13976
13977  // Times in each mode, since boot. Unit: nanoseconds.
13978  message CpuTimes {
13979    optional uint32 cpu_id = 1;
13980
13981    // Time spent in user mode.
13982    optional uint64 user_ns = 2;
13983
13984    // Time spent in user mode (low prio).
13985    optional uint64 user_nice_ns = 3;
13986
13987    // Time spent in system mode.
13988    optional uint64 system_mode_ns = 4;
13989
13990    // Time spent in the idle task.
13991    optional uint64 idle_ns = 5;
13992
13993    // Time spent waiting for I/O.
13994    optional uint64 io_wait_ns = 6;
13995
13996    // Time spent servicing interrupts.
13997    optional uint64 irq_ns = 7;
13998
13999    // Time spent servicing softirqs.
14000    optional uint64 softirq_ns = 8;
14001  }
14002  // One entry per cpu.
14003  repeated CpuTimes cpu_stat = 3;
14004
14005  // Num processes forked since boot.
14006  // Populated only if FORK_COUNT in config.stat_counters.
14007  optional uint64 num_forks = 4;
14008
14009  message InterruptCount {
14010    optional int32 irq = 1;
14011    optional uint64 count = 2;
14012  }
14013
14014  // Number of interrupts, broken by IRQ number.
14015  // Populated only if IRQ_COUNTS in config.stat_counters.
14016
14017  // Total num of irqs serviced since boot.
14018  optional uint64 num_irq_total = 5;
14019  repeated InterruptCount num_irq = 6;
14020
14021  // Number of softirqs, broken by softirq number.
14022  // Populated only if SOFTIRQ_COUNTS in config.stat_counters.
14023
14024  // Total num of softirqs since boot.
14025  optional uint64 num_softirq_total = 7;
14026
14027  // Per-softirq count.
14028  repeated InterruptCount num_softirq = 8;
14029
14030  // The time at which we finish collecting this set of samples;
14031  // the top-level packet timestamp is the time at which
14032  // we begin collection.
14033  optional uint64 collection_end_timestamp = 9;
14034
14035  // Frequencies for /sys/class/devfreq/ entries in kHz.
14036  message DevfreqValue {
14037    optional string key = 1;
14038    optional uint64 value = 2;
14039  };
14040
14041  // One entry per device.
14042  repeated DevfreqValue devfreq = 10;
14043
14044  // Cpu current frequency from
14045  // /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq in kHz.
14046  // One entry per cpu. Report 0 for offline cpu
14047  repeated uint32 cpufreq_khz = 11;
14048
14049  message BuddyInfo {
14050    optional string node = 1;
14051    optional string zone = 2;
14052    repeated uint32 order_pages = 3;
14053  }
14054  // One entry per each node's zones.
14055  repeated BuddyInfo buddy_info = 12;
14056
14057  // Counters from /proc/diskstats.
14058  message DiskStat {
14059    optional string device_name = 1;
14060    optional uint64 read_sectors = 2;
14061    optional uint64 read_time_ms = 3;
14062    optional uint64 write_sectors = 4;
14063    optional uint64 write_time_ms = 5;
14064    optional uint64 discard_sectors = 6;
14065    optional uint64 discard_time_ms = 7;
14066    optional uint64 flush_count = 8;
14067    optional uint64 flush_time_ms = 9;
14068  }
14069  // One entry per disk device.
14070  repeated DiskStat disk_stat = 13;
14071
14072  // Reading from /proc/pressure/*.
14073  message PsiSample {
14074    // Type of resource that may have exhibited pressure stalls.
14075    //    * _SOME indicates some resource tasks stalled.
14076    //    * _FULL indicates all non-idle resource tasks stalled simultaneously.
14077    enum PsiResource {
14078      PSI_RESOURCE_UNSPECIFIED = 0;
14079      PSI_RESOURCE_CPU_SOME = 1;
14080      PSI_RESOURCE_CPU_FULL = 2;
14081      PSI_RESOURCE_IO_SOME = 3;
14082      PSI_RESOURCE_IO_FULL = 4;
14083      PSI_RESOURCE_MEMORY_SOME = 5;
14084      PSI_RESOURCE_MEMORY_FULL = 6;
14085    }
14086    optional PsiResource resource = 1;
14087
14088    // Total absolute stall time (in nanos) for a given resource.
14089    // While PSI readings are in micros, we store in nanos for consistency with
14090    // most other time-based counters.
14091    optional uint64 total_ns = 2;
14092
14093    // Note that /proc/pressure/* exposes historical average utilization values
14094    // (as a %), but we don't yet sample those. They could easily be added as
14095    // additional fields should the total stall time readings be insufficient.
14096  }
14097  // One entry per PsiResource type.
14098  repeated PsiSample psi = 14;
14099}
14100
14101// End of protos/perfetto/trace/sys_stats/sys_stats.proto
14102
14103// Begin of protos/perfetto/trace/system_info.proto
14104
14105message Utsname {
14106  optional string sysname = 1;
14107  optional string version = 2;
14108  optional string release = 3;
14109  optional string machine = 4;
14110}
14111
14112message SystemInfo {
14113  optional Utsname utsname = 1;
14114  optional string android_build_fingerprint = 2;
14115
14116  // The version of traced (the same returned by `traced --version`).
14117  // This is a human readable string with and its format varies depending on
14118  // the build system and the repo (standalone vs AOSP).
14119  // This is intended for human debugging only.
14120  optional string tracing_service_version = 4;
14121
14122  // The Android SDK vesion (e.g. 21 for L, 31 for S etc).
14123  // Introduced in Android T.
14124  optional uint64 android_sdk_version = 5;
14125
14126  // Kernel page size - sysconf(_SC_PAGESIZE).
14127  optional uint32 page_size = 6;
14128
14129  // Number of cpus - sysconf(_SC_NPROCESSORS_CONF).
14130  // Might be different to the number of online cpus.
14131  // Introduced in perfetto v44.
14132  optional uint32 num_cpus = 8;
14133
14134  // The timezone offset from UTC, as per strftime("%z"), in minutes.
14135  // Introduced in v38 / Android V.
14136  optional int32 timezone_off_mins = 7;
14137
14138  // Ticks per second - sysconf(_SC_CLK_TCK).
14139  // Not serialised as of perfetto v44.
14140  optional int64 hz = 3;
14141}
14142
14143// End of protos/perfetto/trace/system_info.proto
14144
14145// Begin of protos/perfetto/trace/system_info/cpu_info.proto
14146
14147// Information about CPUs from procfs and sysfs.
14148message CpuInfo {
14149  // Information about a single CPU.
14150  message Cpu {
14151    // Value of "Processor" field from /proc/cpuinfo for this CPU.
14152    // Example: "AArch64 Processor rev 12 (aarch64)"
14153    optional string processor = 1;
14154
14155    // Frequencies from
14156    // /sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies
14157    // where X is the index of this CPU.
14158    repeated uint32 frequencies = 2;
14159  }
14160
14161  // Describes available CPUs, one entry per CPU.
14162  repeated Cpu cpus = 1;
14163}
14164
14165// End of protos/perfetto/trace/system_info/cpu_info.proto
14166
14167// Begin of protos/perfetto/trace/test_event.proto
14168
14169// Event used by testing code.
14170message TestEvent {
14171  // Arbitrary string used in tests.
14172  optional string str = 1;
14173
14174  // The current value of the random number sequence used in tests.
14175  optional uint32 seq_value = 2;
14176
14177  // Monotonically increased on each packet.
14178  optional uint64 counter = 3;
14179
14180  // No more packets should follow (from the current sequence).
14181  optional bool is_last = 4;
14182
14183  message TestPayload {
14184    repeated string str = 1;
14185    repeated TestPayload nested = 2;
14186
14187    optional string single_string = 4;
14188
14189    optional int32 single_int = 5;
14190    repeated int32 repeated_ints = 6;
14191
14192    // When 0 this is the bottom-most nested message.
14193    optional uint32 remaining_nesting_depth = 3;
14194
14195    repeated DebugAnnotation debug_annotations = 7;
14196  }
14197  optional TestPayload payload = 5;
14198}
14199
14200// End of protos/perfetto/trace/test_event.proto
14201
14202// Begin of protos/perfetto/trace/trace_packet_defaults.proto
14203
14204// Default values for TracePacket fields that hold for a particular TraceWriter
14205// packet sequence. This message contains a subset of the TracePacket fields
14206// with matching IDs. When provided, these fields define the default values
14207// that should be applied, at import time, to all TracePacket(s) with the same
14208// |trusted_packet_sequence_id|, unless otherwise specified in each packet.
14209//
14210// Should be reemitted whenever incremental state is cleared on the sequence.
14211message TracePacketDefaults {
14212  optional uint32 timestamp_clock_id = 58;
14213
14214  // Default values for TrackEvents (e.g. default track).
14215  optional TrackEventDefaults track_event_defaults = 11;
14216
14217  // Defaults for perf profiler packets (PerfSample).
14218  optional PerfSampleDefaults perf_sample_defaults = 12;
14219
14220  // Defaults for V8 code packets (V8JsCode, V8InternalCode, V8WasmCode,
14221  // V8RegexpCode)
14222  optional V8CodeDefaults v8_code_defaults = 99;
14223}
14224// End of protos/perfetto/trace/trace_packet_defaults.proto
14225
14226// Begin of protos/perfetto/trace/trace_uuid.proto
14227
14228// A random unique ID that identifies the trace.
14229// This message has been introduced in v32. Prior to that, the UUID was
14230// only (optionally) present in the TraceConfig.trace_uuid_msb/lsb fields.
14231// This has been moved to a standalone packet to deal with new use-cases for
14232// go/gapless-aot, where the same tracing session can be serialized several
14233// times, in which case the UUID is changed on each snapshot and does not match
14234// the one in the TraceConfig.
14235message TraceUuid {
14236  optional int64 msb = 1;
14237  optional int64 lsb = 2;
14238}
14239
14240// End of protos/perfetto/trace/trace_uuid.proto
14241
14242// Begin of protos/perfetto/trace/track_event/process_descriptor.proto
14243
14244// Describes a process's attributes. Emitted as part of a TrackDescriptor,
14245// usually by the process's main thread.
14246//
14247// Next id: 9.
14248message ProcessDescriptor {
14249  optional int32 pid = 1;
14250  repeated string cmdline = 2;
14251  optional string process_name = 6;
14252
14253  optional int32 process_priority = 5;
14254  // Process start time in nanoseconds.
14255  // The timestamp refers to the trace clock by default. Other clock IDs
14256  // provided in TracePacket are not supported.
14257  optional int64 start_timestamp_ns = 7;
14258
14259  // ---------------------------------------------------------------------------
14260  // Deprecated / legacy fields, which will be removed in the future:
14261  // ---------------------------------------------------------------------------
14262
14263  // See chromium's content::ProcessType.
14264  enum ChromeProcessType {
14265    PROCESS_UNSPECIFIED = 0;
14266    PROCESS_BROWSER = 1;
14267    PROCESS_RENDERER = 2;
14268    PROCESS_UTILITY = 3;
14269    PROCESS_ZYGOTE = 4;
14270    PROCESS_SANDBOX_HELPER = 5;
14271    PROCESS_GPU = 6;
14272    PROCESS_PPAPI_PLUGIN = 7;
14273    PROCESS_PPAPI_BROKER = 8;
14274  }
14275  optional ChromeProcessType chrome_process_type = 4;
14276
14277  // To support old UI. New UI should determine default sorting by process_type.
14278  optional int32 legacy_sort_index = 3;
14279
14280  // Labels can be used to further describe properties of the work performed by
14281  // the process. For example, these can be used by Chrome renderer process to
14282  // provide titles of frames being rendered.
14283  repeated string process_labels = 8;
14284}
14285
14286// End of protos/perfetto/trace/track_event/process_descriptor.proto
14287
14288// Begin of protos/perfetto/trace/track_event/range_of_interest.proto
14289
14290// This message specifies the "range of interest" for track events. With the
14291// `drop_track_event_data_before` option set to `kTrackEventRangeOfInterest`,
14292// Trace Processor drops track events outside of this range.
14293message TrackEventRangeOfInterest {
14294  optional int64 start_us = 1;
14295}
14296// End of protos/perfetto/trace/track_event/range_of_interest.proto
14297
14298// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
14299
14300// Describes a thread's attributes. Emitted as part of a TrackDescriptor,
14301// usually by the thread's trace writer.
14302//
14303// Next id: 9.
14304message ThreadDescriptor {
14305  optional int32 pid = 1;
14306  optional int32 tid = 2;
14307
14308  optional string thread_name = 5;
14309
14310  // ---------------------------------------------------------------------------
14311  // Deprecated / legacy fields, which will be removed in the future:
14312  // ---------------------------------------------------------------------------
14313
14314  enum ChromeThreadType {
14315    CHROME_THREAD_UNSPECIFIED = 0;
14316
14317    CHROME_THREAD_MAIN = 1;
14318    CHROME_THREAD_IO = 2;
14319
14320    // Scheduler:
14321    CHROME_THREAD_POOL_BG_WORKER = 3;
14322    CHROME_THREAD_POOL_FG_WORKER = 4;
14323    CHROME_THREAD_POOL_FB_BLOCKING = 5;
14324    CHROME_THREAD_POOL_BG_BLOCKING = 6;
14325    CHROME_THREAD_POOL_SERVICE = 7;
14326
14327    // Compositor:
14328    CHROME_THREAD_COMPOSITOR = 8;
14329    CHROME_THREAD_VIZ_COMPOSITOR = 9;
14330    CHROME_THREAD_COMPOSITOR_WORKER = 10;
14331
14332    // Renderer:
14333    CHROME_THREAD_SERVICE_WORKER = 11;
14334
14335    // Tracing related threads:
14336    CHROME_THREAD_MEMORY_INFRA = 50;
14337    CHROME_THREAD_SAMPLING_PROFILER = 51;
14338  };
14339  optional ChromeThreadType chrome_thread_type = 4;
14340
14341  // Deprecated. Use ClockSnapshot in combination with TracePacket's timestamp
14342  // and timestamp_clock_id fields instead.
14343  optional int64 reference_timestamp_us = 6;
14344
14345  // Absolute reference values. Clock values in subsequent TrackEvents can be
14346  // encoded accumulatively and relative to these. This reduces their var-int
14347  // encoding size.
14348  // TODO(eseckler): Deprecated. Replace these with ClockSnapshot encoding.
14349  optional int64 reference_thread_time_us = 7;
14350  optional int64 reference_thread_instruction_count = 8;
14351
14352  // To support old UI. New UI should determine default sorting by thread_type.
14353  optional int32 legacy_sort_index = 3;
14354}
14355
14356// End of protos/perfetto/trace/track_event/thread_descriptor.proto
14357
14358// Begin of protos/perfetto/trace/track_event/chrome_process_descriptor.proto
14359
14360// Describes the attributes for a Chrome process. Must be paired with a
14361// ProcessDescriptor in the same TrackDescriptor.
14362//
14363// Next id: 6.
14364message ChromeProcessDescriptor {
14365  // See chromium's content::ProcessType.
14366  enum ProcessType {
14367    PROCESS_UNSPECIFIED = 0;
14368    PROCESS_BROWSER = 1;
14369    PROCESS_RENDERER = 2;
14370    PROCESS_UTILITY = 3;
14371    PROCESS_ZYGOTE = 4;
14372    PROCESS_SANDBOX_HELPER = 5;
14373    PROCESS_GPU = 6;
14374    PROCESS_PPAPI_PLUGIN = 7;
14375    PROCESS_PPAPI_BROKER = 8;
14376    PROCESS_SERVICE_NETWORK = 9;
14377    PROCESS_SERVICE_TRACING = 10;
14378    PROCESS_SERVICE_STORAGE = 11;
14379    PROCESS_SERVICE_AUDIO = 12;
14380    PROCESS_SERVICE_DATA_DECODER = 13;
14381    PROCESS_SERVICE_UTIL_WIN = 14;
14382    PROCESS_SERVICE_PROXY_RESOLVER = 15;
14383    PROCESS_SERVICE_CDM = 16;
14384    PROCESS_SERVICE_VIDEO_CAPTURE = 17;
14385    PROCESS_SERVICE_UNZIPPER = 18;
14386    PROCESS_SERVICE_MIRRORING = 19;
14387    PROCESS_SERVICE_FILEPATCHER = 20;
14388    PROCESS_SERVICE_TTS = 21;
14389    PROCESS_SERVICE_PRINTING = 22;
14390    PROCESS_SERVICE_QUARANTINE = 23;
14391    PROCESS_SERVICE_CROS_LOCALSEARCH = 24;
14392    PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = 25;
14393    PROCESS_SERVICE_FILEUTIL = 26;
14394    PROCESS_SERVICE_PRINTCOMPOSITOR = 27;
14395    PROCESS_SERVICE_PAINTPREVIEW = 28;
14396    PROCESS_SERVICE_SPEECHRECOGNITION = 29;
14397    PROCESS_SERVICE_XRDEVICE = 30;
14398    PROCESS_SERVICE_READICON = 31;
14399    PROCESS_SERVICE_LANGUAGEDETECTION = 32;
14400    PROCESS_SERVICE_SHARING = 33;
14401    PROCESS_SERVICE_MEDIAPARSER = 34;
14402    PROCESS_SERVICE_QRCODEGENERATOR = 35;
14403    PROCESS_SERVICE_PROFILEIMPORT = 36;
14404    PROCESS_SERVICE_IME = 37;
14405    PROCESS_SERVICE_RECORDING = 38;
14406    PROCESS_SERVICE_SHAPEDETECTION = 39;
14407    PROCESS_RENDERER_EXTENSION = 40;
14408    PROCESS_SERVICE_MEDIA_FOUNDATION = 41;
14409  }
14410  optional ProcessType process_type = 1;
14411  optional int32 process_priority = 2;
14412
14413  // To support old UI. New UI should determine default sorting by process_type.
14414  optional int32 legacy_sort_index = 3;
14415
14416  // Name of the hosting app for WebView. Used to match renderer processes to
14417  // their hosting apps.
14418  optional string host_app_package_name = 4;
14419
14420  // The ID to link crashes to trace.
14421  // Notes:
14422  // * The ID is per process. So, each trace may contain many IDs, and you need
14423  //   to look for the ID from crashed process to find the crash report.
14424  // * Having a "chrome-trace-id" in crash doesn't necessarily mean we can
14425  //   get an uploaded trace, since uploads could have failed.
14426  // * On the other hand, if there was a crash during the session and trace was
14427  //   uploaded, it is very likely to find a crash report with the trace ID.
14428  // * This is not crash ID or trace ID. It is just a random 64-bit number
14429  //   recorded in both traces and crashes. It is possible to have collisions,
14430  //   though very rare.
14431  optional uint64 crash_trace_id = 5;
14432}
14433
14434// End of protos/perfetto/trace/track_event/chrome_process_descriptor.proto
14435
14436// Begin of protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
14437
14438// Describes a Chrome thread's attributes. Emitted as part of a TrackDescriptor,
14439// usually by the thread's trace writer. Must be paired with a ThreadDescriptor
14440// in the same TrackDescriptor.
14441//
14442// Next id: 3.
14443message ChromeThreadDescriptor {
14444  enum ThreadType {
14445    THREAD_UNSPECIFIED = 0;
14446
14447    THREAD_MAIN = 1;
14448    THREAD_IO = 2;
14449
14450    THREAD_POOL_BG_WORKER = 3;
14451    THREAD_POOL_FG_WORKER = 4;
14452    THREAD_POOL_FG_BLOCKING = 5;
14453    THREAD_POOL_BG_BLOCKING = 6;
14454    THREAD_POOL_SERVICE = 7;
14455
14456    THREAD_COMPOSITOR = 8;
14457    THREAD_VIZ_COMPOSITOR = 9;
14458    THREAD_COMPOSITOR_WORKER = 10;
14459
14460    THREAD_SERVICE_WORKER = 11;
14461    THREAD_NETWORK_SERVICE = 12;
14462
14463    THREAD_CHILD_IO = 13;
14464    THREAD_BROWSER_IO = 14;
14465
14466    THREAD_BROWSER_MAIN = 15;
14467    THREAD_RENDERER_MAIN = 16;
14468    THREAD_UTILITY_MAIN = 17;
14469    THREAD_GPU_MAIN = 18;
14470
14471    THREAD_CACHE_BLOCKFILE = 19;
14472    THREAD_MEDIA = 20;
14473    THREAD_AUDIO_OUTPUTDEVICE = 21;
14474    THREAD_AUDIO_INPUTDEVICE = 22;
14475    THREAD_GPU_MEMORY = 23;
14476    THREAD_GPU_VSYNC = 24;
14477    THREAD_DXA_VIDEODECODER = 25;
14478    THREAD_BROWSER_WATCHDOG = 26;
14479    THREAD_WEBRTC_NETWORK = 27;
14480    THREAD_WINDOW_OWNER = 28;
14481    THREAD_WEBRTC_SIGNALING = 29;
14482    THREAD_WEBRTC_WORKER = 30;
14483    THREAD_PPAPI_MAIN = 31;
14484    THREAD_GPU_WATCHDOG = 32;
14485    THREAD_SWAPPER = 33;
14486    THREAD_GAMEPAD_POLLING = 34;
14487    THREAD_WEBCRYPTO = 35;
14488    THREAD_DATABASE = 36;
14489    THREAD_PROXYRESOLVER = 37;
14490    THREAD_DEVTOOLSADB = 38;
14491    THREAD_NETWORKCONFIGWATCHER = 39;
14492    THREAD_WASAPI_RENDER = 40;
14493    THREAD_LOADER_LOCK_SAMPLER = 41;
14494
14495    THREAD_MEMORY_INFRA = 50;
14496    THREAD_SAMPLING_PROFILER = 51;
14497  };
14498
14499  optional ThreadType thread_type = 1;
14500
14501  // To support old UI. New UI should determine default sorting by thread_type.
14502  optional int32 legacy_sort_index = 2;
14503}
14504
14505// End of protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
14506
14507// Begin of protos/perfetto/trace/track_event/counter_descriptor.proto
14508
14509// Defines properties of a counter track, e.g. for built-in counters (thread
14510// time, instruction count, ..) or user-specified counters (e.g. memory usage of
14511// a specific app component).
14512//
14513// Counter tracks only support TYPE_COUNTER track events, which specify new
14514// values for the counter. For counters that require per-slice values, counter
14515// values can instead be provided in a more efficient encoding via TrackEvent's
14516// |extra_counter_track_uuids| and |extra_counter_values| fields. However,
14517// slice-type events cannot be emitted onto a counter track.
14518//
14519// Values for counters that are only emitted on a single packet sequence can
14520// optionally be delta-encoded, see |is_incremental|.
14521//
14522// Next id: 7.
14523message CounterDescriptor {
14524  // Built-in counters, usually with special meaning in the client library,
14525  // trace processor, legacy JSON format, or UI. Trace processor will infer a
14526  // track name from the enum value if none is provided in TrackDescriptor.
14527  enum BuiltinCounterType {
14528    COUNTER_UNSPECIFIED = 0;
14529
14530    // Thread-scoped counters. The thread's track should be specified via
14531    // |parent_uuid| in the TrackDescriptor for such a counter.
14532
14533    // implies UNIT_TIME_NS.
14534    COUNTER_THREAD_TIME_NS = 1;
14535
14536    // implies UNIT_COUNT.
14537    COUNTER_THREAD_INSTRUCTION_COUNT = 2;
14538  }
14539
14540  // Type of the values for the counters - to supply lower granularity units,
14541  // see also |unit_multiplier|.
14542  enum Unit {
14543    UNIT_UNSPECIFIED = 0;
14544    UNIT_TIME_NS = 1;
14545    UNIT_COUNT = 2;
14546    UNIT_SIZE_BYTES = 3;
14547    // TODO(eseckler): Support more units as necessary.
14548  }
14549
14550  // For built-in counters (e.g. thread time). Custom user-specified counters
14551  // (e.g. those emitted by TRACE_COUNTER macros of the client library)
14552  // shouldn't set this, and instead provide a counter name via TrackDescriptor.
14553  optional BuiltinCounterType type = 1;
14554
14555  // Names of categories of the counter (usually for user-specified counters).
14556  // In the client library, categories are a way to turn groups of individual
14557  // counters (or events) on or off.
14558  repeated string categories = 2;
14559
14560  // Type of the counter's values. Built-in counters imply a value for this
14561  // field.
14562  optional Unit unit = 3;
14563
14564  // In order to use a unit not defined as a part of |Unit|, a free-form unit
14565  // name can be used instead.
14566  optional string unit_name = 6;
14567
14568  // Multiplication factor of this counter's values, e.g. to supply
14569  // COUNTER_THREAD_TIME_NS timestamps in microseconds instead.
14570  optional int64 unit_multiplier = 4;
14571
14572  // Whether values for this counter are provided as delta values. Only
14573  // supported for counters that are emitted on a single packet-sequence (e.g.
14574  // thread time). Counter values in subsequent packets on the current packet
14575  // sequence will be interpreted as delta values from the sequence's most
14576  // recent value for the counter. When incremental state is cleared, the
14577  // counter value is considered to be reset to 0. Thus, the first value after
14578  // incremental state is cleared is effectively an absolute value.
14579  optional bool is_incremental = 5;
14580
14581  // TODO(eseckler): Support arguments describing the counter (?).
14582  // repeated DebugAnnotation debug_annotations;
14583}
14584
14585// End of protos/perfetto/trace/track_event/counter_descriptor.proto
14586
14587// Begin of protos/perfetto/trace/track_event/track_descriptor.proto
14588
14589// Defines a track for TrackEvents. Slices and instant events on the same track
14590// will be nested based on their timestamps, see TrackEvent::Type.
14591//
14592// A TrackDescriptor only needs to be emitted by one trace writer / producer and
14593// is valid for the entirety of the trace. To ensure the descriptor isn't lost
14594// when the ring buffer wraps, it should be reemitted whenever incremental state
14595// is cleared.
14596//
14597// As a fallback, TrackEvents emitted without an explicit track association will
14598// be associated with an implicit trace-global track (uuid = 0), see also
14599// |TrackEvent::track_uuid|. It is possible but not necessary to emit a
14600// TrackDescriptor for this implicit track.
14601//
14602// Next id: 10.
14603message TrackDescriptor {
14604  // Unique ID that identifies this track. This ID is global to the whole trace.
14605  // Producers should ensure that it is unlikely to clash with IDs emitted by
14606  // other producers. A value of 0 denotes the implicit trace-global track.
14607  //
14608  // For example, legacy TRACE_EVENT macros may use a hash involving the async
14609  // event id + id_scope, pid, and/or tid to compute this ID.
14610  optional uint64 uuid = 1;
14611
14612  // A parent track reference can be used to describe relationships between
14613  // tracks. For example, to define an asynchronous track which is scoped to a
14614  // specific process, specify the uuid for that process's process track here.
14615  // Similarly, to associate a COUNTER_THREAD_TIME_NS counter track with a
14616  // thread, specify the uuid for that thread's thread track here.
14617  optional uint64 parent_uuid = 5;
14618
14619  // Name of the track. Optional - if unspecified, it may be derived from the
14620  // process/thread name (process/thread tracks), the first event's name (async
14621  // tracks), or counter name (counter tracks).
14622  optional string name = 2;
14623
14624  // Associate the track with a process, making it the process-global track.
14625  // There should only be one such track per process (usually for instant
14626  // events; trace processor uses this fact to detect pid reuse). If you need
14627  // more (e.g. for asynchronous events), create child tracks using parent_uuid.
14628  //
14629  // Trace processor will merge events on a process track with slice-type events
14630  // from other sources (e.g. ftrace) for the same process into a single
14631  // timeline view.
14632  optional ProcessDescriptor process = 3;
14633  optional ChromeProcessDescriptor chrome_process = 6;
14634
14635  // Associate the track with a thread, indicating that the track's events
14636  // describe synchronous code execution on the thread. There should only be one
14637  // such track per thread (trace processor uses this fact to detect tid reuse).
14638  //
14639  // Trace processor will merge events on a thread track with slice-type events
14640  // from other sources (e.g. ftrace) for the same thread into a single timeline
14641  // view.
14642  optional ThreadDescriptor thread = 4;
14643  optional ChromeThreadDescriptor chrome_thread = 7;
14644
14645  // Descriptor for a counter track. If set, the track will only support
14646  // TYPE_COUNTER TrackEvents (and values provided via TrackEvent's
14647  // |extra_counter_values|).
14648  optional CounterDescriptor counter = 8;
14649
14650  // If true, forces Trace Processor to use separate tracks for track events
14651  // and system events for the same thread.
14652  // Track events timestamps in Chrome have microsecond resolution, while
14653  // system events use nanoseconds. It results in broken event nesting when
14654  // track events and system events share a track.
14655  optional bool disallow_merging_with_system_tracks = 9;
14656}
14657
14658// End of protos/perfetto/trace/track_event/track_descriptor.proto
14659
14660// Begin of protos/perfetto/trace/translation/translation_table.proto
14661
14662// Translation rules for the trace processor.
14663// See the comments for each rule type for specific meaning.
14664message TranslationTable {
14665  oneof table {
14666    ChromeHistorgramTranslationTable chrome_histogram = 1;
14667    ChromeUserEventTranslationTable chrome_user_event = 2;
14668    ChromePerformanceMarkTranslationTable chrome_performance_mark = 3;
14669    SliceNameTranslationTable slice_name = 4;
14670  }
14671}
14672
14673// Chrome histogram sample hash -> name translation rules.
14674message ChromeHistorgramTranslationTable {
14675  map<uint64, string> hash_to_name = 1;
14676}
14677
14678// Chrome user event action hash -> name translation rules.
14679message ChromeUserEventTranslationTable {
14680  map<uint64, string> action_hash_to_name = 1;
14681}
14682
14683// Chrome performance mark translation rules.
14684message ChromePerformanceMarkTranslationTable {
14685  map<uint32, string> site_hash_to_name = 1;
14686  map<uint32, string> mark_hash_to_name = 2;
14687};
14688
14689// Raw -> deobfuscated slice name translation rules.
14690message SliceNameTranslationTable {
14691  map<string, string> raw_to_deobfuscated_name = 1;
14692};
14693
14694// End of protos/perfetto/trace/translation/translation_table.proto
14695
14696// Begin of protos/perfetto/trace/trigger.proto
14697
14698// When a TracingSession receives a trigger it records the boot time nanoseconds
14699// in the TracePacket's timestamp field as well as the name of the producer that
14700// triggered it. We emit this data so filtering can be done on triggers received
14701// in the trace.
14702message Trigger {
14703  // Name of the trigger which was received.
14704  optional string trigger_name = 1;
14705  // The actual producer that activated |trigger|.
14706  optional string producer_name = 2;
14707  // The verified UID of the producer.
14708  optional int32 trusted_producer_uid = 3;
14709}
14710
14711// End of protos/perfetto/trace/trigger.proto
14712
14713// Begin of protos/perfetto/trace/ui_state.proto
14714
14715// Common state for UIs visualizing Perfetto traces.
14716// This message can be appended as a TracePacket by UIs to save the
14717// visible state (e.g. scroll position/zoom state) for future opening
14718// of the trace.
14719// Design doc: go/trace-ui-state.
14720message UiState {
14721  // The start and end bounds of the viewport of the UI in nanoseconds.
14722  //
14723  // This is the absolute time associated to slices and other events in
14724  // trace processor tables (i.e. the |ts| column of most tables)
14725  optional int64 timeline_start_ts = 1;
14726  optional int64 timeline_end_ts = 2;
14727
14728  // Indicates that the given process should be highlighted by the UI.
14729  message HighlightProcess {
14730    oneof selector {
14731      // The pid of the process to highlight. This is useful for UIs to focus
14732      // on tracks of a particular process in the trace.
14733      //
14734      // If more than one process in a trace has the same pid, it is UI
14735      // implementation specific how the process to be focused will be
14736      // chosen.
14737      uint32 pid = 1;
14738
14739      // The command line of the process to highlight; for most Android apps,
14740      // this is the package name of the app. This is useful for UIs to focus
14741      // on a particular app in the trace.
14742      //
14743      // If more than one process hasthe same cmdline, it is UI implementation
14744      // specific how the process to be focused will be chosen.
14745      string cmdline = 2;
14746    }
14747  }
14748  optional HighlightProcess highlight_process = 3;
14749}
14750// End of protos/perfetto/trace/ui_state.proto
14751
14752// Begin of protos/perfetto/trace/trace_packet.proto
14753
14754// TracePacket is the root object of a Perfetto trace.
14755// A Perfetto trace is a linear sequence of TracePacket(s).
14756//
14757// The tracing service guarantees that all TracePacket(s) written by a given
14758// TraceWriter are seen in-order, without gaps or duplicates. If, for any
14759// reason, a TraceWriter sequence becomes invalid, no more packets are returned
14760// to the Consumer (or written into the trace file).
14761// TracePacket(s) written by different TraceWriter(s), hence even different
14762// data sources, can be seen in arbitrary order.
14763// The consumer can re-establish a total order, if interested, using the packet
14764// timestamps, after having synchronized the different clocks onto a global
14765// clock.
14766//
14767// The tracing service is agnostic of the content of TracePacket, with the
14768// exception of few fields (e.g.. trusted_*, trace_config) that are written by
14769// the service itself.
14770//
14771// See the [Buffers and Dataflow](/docs/concepts/buffers.md) doc for details.
14772//
14773// Next reserved id: 14 (up to 15).
14774// Next id: 112.
14775message TracePacket {
14776  // The timestamp of the TracePacket.
14777  // By default this timestamps refers to the trace clock (CLOCK_BOOTTIME on
14778  // Android). It can be overridden using a different timestamp_clock_id.
14779  // The clock domain definition in ClockSnapshot can also override:
14780  // - The unit (default: 1ns).
14781  // - The absolute vs delta encoding (default: absolute timestamp).
14782  optional uint64 timestamp = 8;
14783
14784  // Specifies the ID of the clock used for the TracePacket |timestamp|. Can be
14785  // one of the built-in types from ClockSnapshot::BuiltinClocks, or a
14786  // producer-defined clock id.
14787  // If unspecified and if no default per-sequence value has been provided via
14788  // TracePacketDefaults, it defaults to BuiltinClocks::BOOTTIME.
14789  optional uint32 timestamp_clock_id = 58;
14790
14791  oneof data {
14792    ProcessTree process_tree = 2;
14793    ProcessStats process_stats = 9;
14794    InodeFileMap inode_file_map = 4;
14795    ChromeEventBundle chrome_events = 5;
14796    ClockSnapshot clock_snapshot = 6;
14797    SysStats sys_stats = 7;
14798    TrackEvent track_event = 11;
14799
14800    // IDs up to 15 are reserved. They take only one byte to encode their
14801    // preamble so should be used for frequent events.
14802
14803    TraceUuid trace_uuid = 89;
14804    TraceConfig trace_config = 33;
14805    FtraceStats ftrace_stats = 34;
14806    TraceStats trace_stats = 35;
14807    ProfilePacket profile_packet = 37;
14808    StreamingAllocation streaming_allocation = 74;
14809    StreamingFree streaming_free = 75;
14810    BatteryCounters battery = 38;
14811    PowerRails power_rails = 40;
14812    AndroidLogPacket android_log = 39;
14813    SystemInfo system_info = 45;
14814    Trigger trigger = 46;
14815    ChromeTrigger chrome_trigger = 109;
14816    PackagesList packages_list = 47;
14817    ChromeBenchmarkMetadata chrome_benchmark_metadata = 48;
14818    PerfettoMetatrace perfetto_metatrace = 49;
14819    ChromeMetadataPacket chrome_metadata = 51;
14820    GpuCounterEvent gpu_counter_event = 52;
14821    GpuRenderStageEvent gpu_render_stage_event = 53;
14822    StreamingProfilePacket streaming_profile_packet = 54;
14823    HeapGraph heap_graph = 56;
14824    GraphicsFrameEvent graphics_frame_event = 57;
14825    VulkanMemoryEvent vulkan_memory_event = 62;
14826    GpuLog gpu_log = 63;
14827    VulkanApiEvent vulkan_api_event = 65;
14828    PerfSample perf_sample = 66;
14829    CpuInfo cpu_info = 67;
14830    SmapsPacket smaps_packet = 68;
14831    TracingServiceEvent service_event = 69;
14832    InitialDisplayState initial_display_state = 70;
14833    GpuMemTotalEvent gpu_mem_total_event = 71;
14834    MemoryTrackerSnapshot memory_tracker_snapshot = 73;
14835    FrameTimelineEvent frame_timeline_event = 76;
14836    AndroidEnergyEstimationBreakdown android_energy_estimation_breakdown = 77;
14837    UiState ui_state = 78;
14838    AndroidCameraFrameEvent android_camera_frame_event = 80;
14839    AndroidCameraSessionStats android_camera_session_stats = 81;
14840    TranslationTable translation_table = 82;
14841    AndroidGameInterventionList android_game_intervention_list = 83;
14842    StatsdAtom statsd_atom = 84;
14843    AndroidSystemProperty android_system_property = 86;
14844    EntityStateResidency entity_state_residency = 91;
14845
14846    // Only used in profile packets.
14847    ProfiledFrameSymbols profiled_frame_symbols = 55;
14848    ModuleSymbols module_symbols = 61;
14849    DeobfuscationMapping deobfuscation_mapping = 64;
14850
14851    // Only used by TrackEvent.
14852    TrackDescriptor track_descriptor = 60;
14853
14854    // Deprecated, use TrackDescriptor instead.
14855    ProcessDescriptor process_descriptor = 43;
14856
14857    // Deprecated, use TrackDescriptor instead.
14858    ThreadDescriptor thread_descriptor = 44;
14859
14860    // Events from the Linux kernel ftrace infrastructure.
14861    FtraceEventBundle ftrace_events = 1;
14862
14863    // This field is emitted at periodic intervals (~10s) and
14864    // contains always the binary representation of the UUID
14865    // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
14866    // efficiently partition long traces without having to fully parse them.
14867    bytes synchronization_marker = 36;
14868
14869    // Zero or more proto encoded trace packets compressed using deflate.
14870    // Each compressed_packets TracePacket (including the two field ids and
14871    // sizes) should be less than 512KB.
14872    bytes compressed_packets = 50;
14873
14874    // Data sources can extend the trace proto with custom extension protos (see
14875    // docs/design-docs/extensions.md). When they do that, the descriptor of
14876    // their extension proto descriptor is serialized in this packet. This
14877    // allows trace_processor to deserialize extended messages using reflection
14878    // even if the extension proto is not checked in the Perfetto repo.
14879    ExtensionDescriptor extension_descriptor = 72;
14880
14881    // Represents a single packet sent or received by the network.
14882    NetworkPacketEvent network_packet = 88;
14883
14884    // Represents one or more packets sent or received by the network.
14885    NetworkPacketBundle network_packet_bundle = 92;
14886
14887    // The "range of interest" for track events. See the message definition
14888    // comments for more details.
14889    TrackEventRangeOfInterest track_event_range_of_interest = 90;
14890
14891    // Winscope traces
14892    LayersSnapshotProto surfaceflinger_layers_snapshot = 93;
14893    TransactionTraceEntry surfaceflinger_transactions = 94;
14894    ShellTransition shell_transition = 96;
14895    ShellHandlerMappings shell_handler_mappings = 97;
14896    ProtoLogMessage protolog_message = 104;
14897    ProtoLogViewerConfig protolog_viewer_config = 105;
14898
14899    // Events from the Windows etw infrastructure.
14900    EtwTraceEventBundle etw_events = 95;
14901
14902    V8JsCode v8_js_code = 99;
14903    V8InternalCode v8_internal_code = 100;
14904    V8WasmCode v8_wasm_code = 101;
14905    V8RegExpCode v8_reg_exp_code = 102;
14906    V8CodeMove v8_code_move = 103;
14907
14908    // InputFlinger traces
14909    AndroidInputEvent android_input_event = 106;
14910
14911    // Clock synchronization with remote machines.
14912    RemoteClockSync remote_clock_sync = 107;
14913
14914    PixelModemEvents pixel_modem_events = 110;
14915    PixelModemTokenDatabase pixel_modem_token_database = 111;
14916
14917    // This field is only used for testing.
14918    // In previous versions of this proto this field had the id 268435455
14919    // This caused many problems:
14920    // - protozero decoder does not handle field ids larger than 999.
14921    // - old versions of protoc produce Java bindings with syntax errors when
14922    //   the field id is large enough.
14923    TestEvent for_testing = 900;
14924  }
14925
14926  // Trusted user id of the producer which generated this packet. Keep in sync
14927  // with TrustedPacket.trusted_uid.
14928  //
14929  // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
14930  // instead.
14931  oneof optional_trusted_uid { int32 trusted_uid = 3; };
14932
14933  // Service-assigned identifier of the packet sequence this packet belongs to.
14934  // Uniquely identifies a producer + writer pair within the tracing session. A
14935  // value of zero denotes an invalid ID. Keep in sync with
14936  // TrustedPacket.trusted_packet_sequence_id.
14937  oneof optional_trusted_packet_sequence_id {
14938    uint32 trusted_packet_sequence_id = 10;
14939  }
14940
14941  // Trusted process id of the producer which generated this packet, written by
14942  // the service.
14943  optional int32 trusted_pid = 79;
14944
14945  // Incrementally emitted interned data, valid only on the packet's sequence
14946  // (packets with the same |trusted_packet_sequence_id|). The writer will
14947  // usually emit new interned data in the same TracePacket that first refers to
14948  // it (since the last reset of interning state). It may also be emitted
14949  // proactively in advance of referring to them in later packets.
14950  optional InternedData interned_data = 12;
14951
14952  enum SequenceFlags {
14953    SEQ_UNSPECIFIED = 0;
14954
14955    // Set by the writer to indicate that it will re-emit any incremental data
14956    // for the packet's sequence before referring to it again. This includes
14957    // interned data as well as periodically emitted data like
14958    // Process/ThreadDescriptors. This flag only affects the current packet
14959    // sequence (see |trusted_packet_sequence_id|).
14960    //
14961    // When set, this TracePacket and subsequent TracePackets on the same
14962    // sequence will not refer to any incremental data emitted before this
14963    // TracePacket. For example, previously emitted interned data will be
14964    // re-emitted if it is referred to again.
14965    //
14966    // When the reader detects packet loss (|previous_packet_dropped|), it needs
14967    // to skip packets in the sequence until the next one with this flag set, to
14968    // ensure intact incremental data.
14969    SEQ_INCREMENTAL_STATE_CLEARED = 1;
14970
14971    // This packet requires incremental state, such as TracePacketDefaults or
14972    // InternedData, to be parsed correctly. The trace reader should skip this
14973    // packet if incremental state is not valid on this sequence, i.e. if no
14974    // packet with the SEQ_INCREMENTAL_STATE_CLEARED flag has been seen on the
14975    // current |trusted_packet_sequence_id|.
14976    SEQ_NEEDS_INCREMENTAL_STATE = 2;
14977  };
14978  optional uint32 sequence_flags = 13;
14979
14980  // DEPRECATED. Moved to SequenceFlags::SEQ_INCREMENTAL_STATE_CLEARED.
14981  optional bool incremental_state_cleared = 41;
14982
14983  // Default values for fields of later TracePackets emitted on this packet's
14984  // sequence (TracePackets with the same |trusted_packet_sequence_id|).
14985  // It must be reemitted when incremental state is cleared (see
14986  // |incremental_state_cleared|).
14987  // Requires that any future packet emitted on the same sequence specifies
14988  // the SEQ_NEEDS_INCREMENTAL_STATE flag.
14989  // TracePacketDefaults always override the global defaults for any future
14990  // packet on this sequence (regardless of SEQ_NEEDS_INCREMENTAL_STATE).
14991  optional TracePacketDefaults trace_packet_defaults = 59;
14992
14993  // Flag set by the service if, for the current packet sequence (see
14994  // |trusted_packet_sequence_id|), either:
14995  // * this is the first packet, or
14996  // * one or multiple packets were dropped since the last packet that the
14997  //   consumer read from the sequence. This can happen if chunks in the trace
14998  //   buffer are overridden before the consumer could read them when the trace
14999  //   is configured in ring buffer mode.
15000  //
15001  // When packet loss occurs, incrementally emitted data (including interned
15002  // data) on the sequence should be considered invalid up until the next packet
15003  // with SEQ_INCREMENTAL_STATE_CLEARED set.
15004  optional bool previous_packet_dropped = 42;
15005
15006  // Flag set by a producer (starting from SDK v29) if, for the current packet
15007  // sequence (see |trusted_packet_sequence_id|), this is the first packet.
15008  //
15009  // This flag can be used for distinguishing the two situations when
15010  // processing the trace:
15011  // 1. There are no prior events for the sequence because of data loss, e.g.
15012  //    due to ring buffer wrapping.
15013  // 2. There are no prior events for the sequence because it didn't start
15014  //    before this packet (= there's definitely no preceding data loss).
15015  //
15016  // Given that older SDK versions do not support this flag, this flag not
15017  // being present for a particular sequence does not necessarily imply data
15018  // loss.
15019  optional bool first_packet_on_sequence = 87;
15020
15021  // The machine ID for identifying trace packets in a multi-machine tracing
15022  // session. Is emitted by the tracing service for producers running on a
15023  // remote host (e.g. a VM guest). For more context: go/crosetto-vm-tracing.
15024  optional uint32 machine_id = 98;
15025}
15026
15027// End of protos/perfetto/trace/trace_packet.proto
15028
15029// Begin of protos/perfetto/trace/trace.proto
15030
15031message Trace {
15032  repeated TracePacket packet = 1;
15033
15034  // Do NOT add any other field here. This is just a convenience wrapper for
15035  // the use case of a trace being saved to a file. There are other cases
15036  // (streaming) where TracePacket are directly streamed without being wrapped
15037  // in a Trace proto. Nothing should ever rely on the full trace, all the
15038  // logic should be based on TracePacket(s).
15039}
15040
15041// End of protos/perfetto/trace/trace.proto
15042