• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  // Optional specification about available GPU counters.
202  optional GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true];
203
204  optional TrackEventDescriptor track_event_descriptor = 6 [lazy = true];
205
206  optional FtraceDescriptor ftrace_descriptor = 8 [lazy = true];
207}
208
209// End of protos/perfetto/common/data_source_descriptor.proto
210
211// Begin of protos/perfetto/common/tracing_service_state.proto
212
213// Reports the state of the tracing service. Used to gather details about the
214// data sources connected.
215// See ConsumerPort::QueryServiceState().
216message TracingServiceState {
217  // Describes a producer process.
218  message Producer {
219    // Unique ID of the producer (monotonic counter).
220    optional int32 id = 1;
221
222    // Typically matches the process name.
223    optional string name = 2;
224
225    // Unix pid of the remote process. Supported only on Linux-based systems.
226    // Introduced in v24 / Android T.
227    optional int32 pid = 5;
228
229    // Unix uid of the remote process.
230    optional int32 uid = 3;
231
232    // The version of the client library used by the producer.
233    // This is a human readable string with and its format varies depending on
234    // the build system and the repo (standalone vs AOSP).
235    // This is intended for human debugging only.
236    optional string sdk_version = 4;
237  }
238
239  // Describes a data source registered by a producer. Data sources are listed
240  // regardless of the fact that they are being used or not.
241  message DataSource {
242    // Descriptor passed by the data source when calling RegisterDataSource().
243    optional DataSourceDescriptor ds_descriptor = 1;
244
245    // ID of the producer, as per Producer.id.
246    optional int32 producer_id = 2;
247  }
248
249  message TracingSession {
250    // The TracingSessionID.
251    optional uint64 id = 1;
252
253    // The Unix uid of the consumer that started the session.
254    // This is meaningful only if the caller is root. In all other cases only
255    // tracing sessions that match the caller UID will be displayed.
256    optional int32 consumer_uid = 2;
257
258    // Internal state of the tracing session.
259    // These strings are FYI only and subjected to change.
260    optional string state = 3;
261
262    // The unique_session_name as set in the trace config (might be empty).
263    optional string unique_session_name = 4;
264
265    // The number and size of each buffer.
266    repeated uint32 buffer_size_kb = 5;
267
268    // Duration, as specified in the TraceConfig.duration_ms.
269    optional uint32 duration_ms = 6;
270
271    // Number of data sources involved in the session.
272    optional uint32 num_data_sources = 7;
273
274    // Time when the session was started, in the CLOCK_REALTIME domain.
275    // Available only on Linux-based systems.
276    optional int64 start_realtime_ns = 8;
277  }
278
279  // Lists all the producers connected.
280  repeated Producer producers = 1;
281
282  // Lists the data sources available.
283  repeated DataSource data_sources = 2;
284
285  // Lists the tracing sessions active AND owned by a consumer that has the same
286  // UID of the caller (or all of them if the caller is root).
287  // Introduced in v24 / Android T.
288  repeated TracingSession tracing_sessions = 6;
289
290  // This is always set to true from v24 and beyond. This flag is only used to
291  // tell the difference between: (1) talking to a recent service which happens
292  // to have no tracing session active; (2) talking to an older version of the
293  // service which will never report any tracing session.
294  optional bool supports_tracing_sessions = 7;
295
296  // Total number of tracing sessions.
297  optional int32 num_sessions = 3;
298
299  // Number of tracing sessions in the started state. Always <= num_sessions.
300  optional int32 num_sessions_started = 4;
301
302  // The version of traced (the same returned by `traced --version`).
303  // This is a human readable string with and its format varies depending on
304  // the build system and the repo (standalone vs AOSP).
305  // This is intended for human debugging only.
306  optional string tracing_service_version = 5;
307}
308
309// End of protos/perfetto/common/tracing_service_state.proto
310
311// Begin of protos/perfetto/common/builtin_clock.proto
312
313enum BuiltinClock {
314  BUILTIN_CLOCK_UNKNOWN = 0;
315  BUILTIN_CLOCK_REALTIME = 1;
316  BUILTIN_CLOCK_REALTIME_COARSE = 2;
317  BUILTIN_CLOCK_MONOTONIC = 3;
318  BUILTIN_CLOCK_MONOTONIC_COARSE = 4;
319  BUILTIN_CLOCK_MONOTONIC_RAW = 5;
320  BUILTIN_CLOCK_BOOTTIME = 6;
321  BUILTIN_CLOCK_MAX_ID = 63;
322
323  reserved 7, 8;
324
325  // An internal CL (ag/16521245) has taken this for BUILTIN_CLOCK_TSC.
326  // That might get upstreamed later on. Avoid diverging on this ID in future.
327  reserved 9;
328}
329
330// End of protos/perfetto/common/builtin_clock.proto
331
332// Begin of protos/perfetto/config/android/android_game_intervention_list_config.proto
333
334// Data source that lists game modes and game interventions of games
335// on an Android device.
336message AndroidGameInterventionListConfig {
337  // If not empty, emit info about only the following list of package names
338  // (exact match, no regex). Otherwise, emit info about all packages.
339  repeated string package_name_filter = 1;
340}
341
342// End of protos/perfetto/config/android/android_game_intervention_list_config.proto
343
344// Begin of protos/perfetto/common/android_log_constants.proto
345
346// Values from NDK's android/log.h.
347enum AndroidLogId {
348  // MAIN.
349  LID_DEFAULT = 0;
350
351  LID_RADIO = 1;
352  LID_EVENTS = 2;
353  LID_SYSTEM = 3;
354  LID_CRASH = 4;
355  LID_STATS = 5;
356  LID_SECURITY = 6;
357  LID_KERNEL = 7;
358}
359
360enum AndroidLogPriority {
361  PRIO_UNSPECIFIED = 0;
362
363  // _DEFAULT, but should never be seen in logs.
364  PRIO_UNUSED = 1;
365
366  PRIO_VERBOSE = 2;
367  PRIO_DEBUG = 3;
368  PRIO_INFO = 4;
369  PRIO_WARN = 5;
370  PRIO_ERROR = 6;
371  PRIO_FATAL = 7;
372}
373
374// End of protos/perfetto/common/android_log_constants.proto
375
376// Begin of protos/perfetto/config/android/android_log_config.proto
377
378message AndroidLogConfig {
379  repeated AndroidLogId log_ids = 1;
380
381  // Was |poll_ms|, deprecated.
382  reserved 2;
383
384  // If set ignores all log messages whose prio is < the given value.
385  optional AndroidLogPriority min_prio = 3;
386
387  // If non-empty ignores all log messages whose tag doesn't match one of the
388  // specified values.
389  repeated string filter_tags = 4;
390}
391
392// End of protos/perfetto/config/android/android_log_config.proto
393
394// Begin of protos/perfetto/config/android/android_polled_state_config.proto
395
396// Data source that polls for display state. This should only be used for
397// backward-compatibility; AndroidSystemPropertyConfig should be preferred.
398message AndroidPolledStateConfig {
399  // Frequency of polling. If absent the state will be recorded once, at the
400  // start of the trace.
401  // This is required to be > 100ms to avoid excessive CPU usage.
402  optional uint32 poll_ms = 1;
403}
404
405// End of protos/perfetto/config/android/android_polled_state_config.proto
406
407// Begin of protos/perfetto/config/android/android_system_property_config.proto
408
409// Data source that polls for system properties.
410message AndroidSystemPropertyConfig {
411  // Frequency of polling. If absent the state will be recorded once, at the
412  // start of the trace.
413  // This is required to be > 100ms to avoid excessive CPU usage.
414  optional uint32 poll_ms = 1;
415
416  // Properties to poll. All property names must start with "debug.tracing.".
417  repeated string property_name = 2;
418}
419
420// End of protos/perfetto/config/android/android_system_property_config.proto
421
422// Begin of protos/perfetto/config/android/network_trace_config.proto
423
424// Network tracing data source that records details on all packets sent or
425// received by the network.
426message NetworkPacketTraceConfig {
427  // Polling frequency in milliseconds. Network tracing writes to a fixed size
428  // ring buffer. The polling interval should be such that the ring buffer is
429  // unlikely to fill in that interval (or that filling is an acceptable risk).
430  // The minimum polling rate is 100ms (values below this are ignored).
431  // Introduced in Android 14 (U).
432  optional uint32 poll_ms = 1;
433
434  // The aggregation_threshold is the number of packets at which an event will
435  // switch from per-packet details to aggregate details. For example, a value
436  // of 50 means that if a particular event (grouped by the unique combinations
437  // of metadata fields: {interface, direction, uid, etc}) has fewer than 50
438  // packets, the exact timestamp and length are recorded for each packet. If
439  // there were 50 or more packets in an event, it would only record the total
440  // duration, packets, and length. A value of zero or unspecified will always
441  /// record per-packet details. A value of 1 always records aggregate details.
442  optional uint32 aggregation_threshold = 2;
443
444  // Specifies the maximum number of packet contexts to intern at a time. This
445  // prevents the interning table from growing too large and controls whether
446  // interning is enabled or disabled (a value of zero disables interning and
447  // is the default). When a data sources interning table reaches this amount,
448  // packet contexts will be inlined into NetworkPacketEvents.
449  optional uint32 intern_limit = 3;
450
451  // The following fields specify whether certain fields should be dropped from
452  // the output. Dropping fields improves normalization results, reduces the
453  // size of the interning table, and slightly reduces event size.
454  optional bool drop_local_port = 4;
455  optional bool drop_remote_port = 5;
456  optional bool drop_tcp_flags = 6;
457}
458
459// End of protos/perfetto/config/android/network_trace_config.proto
460
461// Begin of protos/perfetto/config/android/packages_list_config.proto
462
463// Data source that lists details (such as version code) about packages on an
464// Android device.
465message PackagesListConfig {
466  // If not empty, emit info about only the following list of package names
467  // (exact match, no regex). Otherwise, emit info about all packages.
468  repeated string package_name_filter = 1;
469}
470
471// End of protos/perfetto/config/android/packages_list_config.proto
472
473// Begin of protos/perfetto/config/chrome/chrome_config.proto
474
475message ChromeConfig {
476  optional string trace_config = 1;
477
478  // When enabled, the data source should only fill in fields in the output that
479  // are not potentially privacy sensitive.
480  optional bool privacy_filtering_enabled = 2;
481
482  // Instead of emitting binary protobuf, convert the trace data to the legacy
483  // JSON format. Note that the trace data will still be returned as a series of
484  // TracePackets, but the embedded data will be JSON instead of serialized
485  // protobuf.
486  optional bool convert_to_legacy_json = 3;
487
488  // Priority of the tracing session client. A higher priority session may
489  // preempt a lower priority one in configurations where concurrent sessions
490  // aren't supported.
491  enum ClientPriority {
492    UNKNOWN = 0;
493    BACKGROUND = 1;
494    USER_INITIATED = 2;
495  }
496  optional ClientPriority client_priority = 4;
497
498  // Applicable only when using legacy JSON format.
499  // If |json_agent_label_filter| is not empty, only data pertaining to
500  // the specified tracing agent label (e.g. "traceEvents") will be returned.
501  optional string json_agent_label_filter = 5;
502}
503
504// End of protos/perfetto/config/chrome/chrome_config.proto
505
506// Begin of protos/perfetto/config/ftrace/ftrace_config.proto
507
508// Next id: 26.
509message FtraceConfig {
510  repeated string ftrace_events = 1;
511  repeated string atrace_categories = 2;
512  repeated string atrace_apps = 3;
513  // *Per-CPU* buffer size.
514  optional uint32 buffer_size_kb = 10;
515  optional uint32 drain_period_ms = 11;
516
517  // Configuration for compact encoding of scheduler events. When enabled (and
518  // recording the relevant ftrace events), specific high-volume events are
519  // encoded in a denser format than normal.
520  message CompactSchedConfig {
521    // If true, and sched_switch or sched_waking ftrace events are enabled,
522    // record those events in the compact format.
523    optional bool enabled = 1;
524  }
525  optional CompactSchedConfig compact_sched = 12;
526
527  // Optional filter for "ftrace/print" events.
528  //
529  // The filter consists of multiple rules. As soon as a rule matches (the rules
530  // are processed in order), its `allow` field will be used as the outcome: if
531  // `allow` is true, the event will be included in the trace, otherwise it will
532  // be discarded. If an event does not match any rule, it will be allowed by
533  // default (a rule with an empty prefix and allow=false, disallows everything
534  // by default).
535  message PrintFilter {
536    message Rule {
537      // Matches an atrace message of the form:
538      // <type>|pid|<prefix>...
539      message AtraceMessage {
540        optional string type = 1;
541        optional string prefix = 2;
542      }
543      oneof match {
544        // This rule matches if `prefix` matches exactly with the beginning of
545        // the "ftrace/print" "buf" field.
546        string prefix = 1;
547        // This rule matches if the "buf" field contains an atrace-style print
548        // message as specified in `atrace_msg`.
549        AtraceMessage atrace_msg = 3;
550      }
551      optional bool allow = 2;
552    }
553    repeated Rule rules = 1;
554  }
555  optional PrintFilter print_filter = 22;
556
557  // Enables symbol name resolution against /proc/kallsyms.
558  // It requires that either traced_probes is running as root or that
559  // kptr_restrict has been manually lowered.
560  // It does not disclose KASLR, symbol addresses are mangled.
561  optional bool symbolize_ksyms = 13;
562
563  // When symbolize_ksyms=true, determines whether the traced_probes daemon
564  // should keep the symbol map in memory (and reuse it for future tracing
565  // sessions) or clear it (saving memory) and re-create it on each tracing
566  // session (wasting cpu and wall time).
567  // The tradeoff is roughly:
568  //  KSYMS_RETAIN: pay a fixed ~1.2 MB cost after the first trace.
569  //  KSYMS_CLEANUP_ON_STOP: pay a ~300-500ms cost when starting each trace.
570  // Default behavior: KSYMS_CLEANUP_ON_STOP.
571  enum KsymsMemPolicy {
572    KSYMS_UNSPECIFIED = 0;
573    KSYMS_CLEANUP_ON_STOP = 1;
574    KSYMS_RETAIN = 2;
575  }
576  optional KsymsMemPolicy ksyms_mem_policy = 17;
577
578  // By default the kernel symbolizer is lazily initialized on a deferred task
579  // to reduce ftrace's time-to-start-recording. Unfortunately that makes
580  // ksyms integration tests hard. This flag forces the kernel symbolizer to be
581  // initialized synchronously on the data source start and hence avoiding
582  // timing races in tests.
583  // DEPRECATED in v28 / Android U. This is now the default behavior, setting it
584  // to true is a no-op.
585  optional bool initialize_ksyms_synchronously_for_testing = 14
586      [deprecated = true];
587
588  // When this boolean is true AND the ftrace_events contains "kmem/rss_stat",
589  // this option causes traced_probes to enable the "kmem/rss_stat_throttled"
590  // event instead if present, and fall back to "kmem/rss_stat" if not present.
591  // The historical context for this is the following:
592  // - Up to Android S (12), the rss_stat was internally throttled in its
593  //   kernel implementation.
594  // - A change introduced in the kernels after S has introduced a new
595  //   "rss_stat_throttled" making the original "rss_stat" event unthrottled
596  //   (hence very spammy).
597  // - Not all Android T/13 devices will receive a new kernel though, hence we
598  //   need to deal with both cases.
599  // For more context: go/rss-stat-throttled.
600  optional bool throttle_rss_stat = 15;
601
602  // If true, avoid enabling events that aren't statically known by
603  // traced_probes. Otherwise, the default is to emit such events as
604  // GenericFtraceEvent protos.
605  // Prefer to keep this flag at its default. This was added for Android
606  // tracing, where atrace categories and/or atrace HAL requested events can
607  // expand to events that aren't of interest to the tracing user.
608  // Introduced in: Android T.
609  optional bool disable_generic_events = 16;
610
611  // The list of syscalls that should be recorded by sys_{enter,exit} ftrace
612  // events. When empty, all syscalls are recorded. If neither sys_{enter,exit}
613  // are enabled, this setting has no effect. Example: ["sys_read", "sys_open"].
614  // Introduced in: Android U.
615  repeated string syscall_events = 18;
616
617  // If true, enable the "function_graph" kernel tracer that emits events
618  // whenever a kernel function is entered and exited
619  // (funcgraph_entry/funcgraph_exit).
620  // Notes on use:
621  // * Requires |symbolize_ksyms| for function name resolution.
622  // * Use |function_filters| or |function_graph_roots| to constrain the traced
623  //   set of functions, otherwise the event bandwidth will be too high for
624  //   practical use.
625  // * The data source might be rejected if there is already a concurrent
626  //   ftrace data source that does not use function graph itself, as we do not
627  //   support switching kernel tracers mid-trace.
628  // * Requires a kernel compiled with CONFIG_FUNCTION_GRAPH_TRACER. This is
629  //   enabled if "cat /sys/kernel/tracing/available_tracers" includes
630  //   "function_graph".
631  // Android:
632  // * Available only on debuggable builds.
633  // * Introduced in: Android U.
634  optional bool enable_function_graph = 19;
635
636  // Constrains the set of functions traced when |enable_function_graph| is
637  // true. Supports globs, e.g. "sched*". You can specify multiple filters,
638  // in which case all matching functions will be traced. See kernel
639  // documentation on ftrace "set_ftrace_filter" file for more details.
640  // Android:
641  // * Available only on debuggable builds.
642  // * Introduced in: Android U.
643  repeated string function_filters = 20;
644
645  // If |enable_function_graph| is true, trace this set of functions *and* all
646  // of its callees. Supports globs. Can be set together with
647  // |function_filters|, in which case only callees matching the filter will be
648  // traced. If setting both, you most likely want all roots to also be
649  // included in |function_filters|.
650  // Android:
651  // * Available only on debuggable builds.
652  // * Introduced in: Android U.
653  repeated string function_graph_roots = 21;
654
655  // If true, does not clear ftrace buffers before the start of the program.
656  // This makes sense only if this is the first ftrace data source instance
657  // created after the daemon has been started. Can be useful for gathering boot
658  // traces, if ftrace has been separately configured (e.g. via kernel
659  // commandline).
660  optional bool preserve_ftrace_buffer = 23;
661
662  // If true, overrides the default timestamp clock and uses a raw hardware
663  // based monotonic clock for getting timestamps.
664  // * Introduced in: Android U.
665  optional bool use_monotonic_raw_clock = 24;
666
667  // Caution: under development as of 2023/03/01.
668  // If |instance_name| is not empty, then attempt to use that tracefs instance
669  // for event recording. Normally, this means
670  // `/sys/kernel/tracing/instances/$instance_name`.
671  //
672  // The name "hyp" is reserved.
673  //
674  // The instance must already exist, the tracing daemon *will not* create it
675  // for you as it typically doesn't have such permissions.
676  // Only a subset of features is guaranteed to work with non-default instances,
677  // at the time of writing:
678  //  * ftrace_events
679  //  * buffer_size_kb
680  // TODO(b/249050813): reword comment once instance support is stable.
681  optional string instance_name = 25;
682}
683
684// End of protos/perfetto/config/ftrace/ftrace_config.proto
685
686// Begin of protos/perfetto/config/gpu/gpu_counter_config.proto
687
688message GpuCounterConfig {
689  // Desired sampling interval for counters.
690  optional uint64 counter_period_ns = 1;
691
692  // List of counters to be sampled. Counter IDs correspond to the ones
693  // described in GpuCounterSpec in the data source descriptor.
694  repeated uint32 counter_ids = 2;
695
696  // Sample counters by instrumenting command buffers.
697  optional bool instrumented_sampling = 3;
698
699  // Fix gpu clock rate during trace session.
700  optional bool fix_gpu_clock = 4;
701}
702
703// End of protos/perfetto/config/gpu/gpu_counter_config.proto
704
705// Begin of protos/perfetto/config/gpu/vulkan_memory_config.proto
706
707message VulkanMemoryConfig {
708  // Tracking driver memory usage events
709  optional bool track_driver_memory_usage = 1;
710
711  // Tracking device memory usage events
712  optional bool track_device_memory_usage = 2;
713}
714
715// End of protos/perfetto/config/gpu/vulkan_memory_config.proto
716
717// Begin of protos/perfetto/config/inode_file/inode_file_config.proto
718
719message InodeFileConfig {
720  message MountPointMappingEntry {
721    optional string mountpoint = 1;
722    repeated string scan_roots = 2;
723  }
724
725  // How long to pause between batches.
726  optional uint32 scan_interval_ms = 1;
727
728  // How long to wait before the first scan in order to accumulate inodes.
729  optional uint32 scan_delay_ms = 2;
730
731  // How many inodes to scan in one batch.
732  optional uint32 scan_batch_size = 3;
733
734  // Do not scan for inodes not found in the static map.
735  optional bool do_not_scan = 4;
736
737  // If non-empty, only scan inodes corresponding to block devices named in
738  // this list.
739  repeated string scan_mount_points = 5;
740
741  // When encountering an inode belonging to a block device corresponding
742  // to one of the mount points in this map, scan its scan_roots instead.
743  repeated MountPointMappingEntry mount_point_mapping = 6;
744}
745
746// End of protos/perfetto/config/inode_file/inode_file_config.proto
747
748// Begin of protos/perfetto/config/interceptors/console_config.proto
749
750message ConsoleConfig {
751  enum Output {
752    OUTPUT_UNSPECIFIED = 0;
753    OUTPUT_STDOUT = 1;
754    OUTPUT_STDERR = 2;
755  }
756  optional Output output = 1;
757  optional bool enable_colors = 2;
758}
759
760// End of protos/perfetto/config/interceptors/console_config.proto
761
762// Begin of protos/perfetto/config/interceptor_config.proto
763
764// Configuration for trace packet interception. Used for diverting trace data to
765// non-Perfetto sources (e.g., logging to the console, ETW) when using the
766// Perfetto SDK.
767message InterceptorConfig {
768  // Matches the name given to RegisterInterceptor().
769  optional string name = 1;
770
771  optional ConsoleConfig console_config = 100 [lazy = true];
772}
773
774// End of protos/perfetto/config/interceptor_config.proto
775
776// Begin of protos/perfetto/config/power/android_power_config.proto
777
778message AndroidPowerConfig {
779  enum BatteryCounters {
780    BATTERY_COUNTER_UNSPECIFIED = 0;
781
782    // Coulomb counter.
783    BATTERY_COUNTER_CHARGE = 1;
784
785    // Charge (%).
786    BATTERY_COUNTER_CAPACITY_PERCENT = 2;
787
788    // Instantaneous current.
789    BATTERY_COUNTER_CURRENT = 3;
790
791    // Avg current.
792    BATTERY_COUNTER_CURRENT_AVG = 4;
793  }
794  optional uint32 battery_poll_ms = 1;
795  repeated BatteryCounters battery_counters = 2;
796
797  // Where available enables per-power-rail measurements.
798  optional bool collect_power_rails = 3;
799
800  // Provides a breakdown of energy estimation for various subsystem (e.g. GPU).
801  // Available from Android S.
802  optional bool collect_energy_estimation_breakdown = 4;
803
804  // Provides a breakdown of time in state for various subsystems.
805  // Available from Android U.
806  optional bool collect_entity_state_residency = 5;
807}
808
809// End of protos/perfetto/config/power/android_power_config.proto
810
811// Begin of protos/perfetto/config/process_stats/process_stats_config.proto
812
813message ProcessStatsConfig {
814  enum Quirks {
815    QUIRKS_UNSPECIFIED = 0;
816
817    // This has been deprecated and ignored as per 2018-05-01. Full scan at
818    // startup is now disabled by default and can be re-enabled using the
819    // |scan_all_processes_on_start| arg.
820    DISABLE_INITIAL_DUMP = 1 [deprecated = true];
821
822    DISABLE_ON_DEMAND = 2;
823  }
824
825  repeated Quirks quirks = 1;
826
827  // If enabled all processes will be scanned and dumped when the trace starts.
828  optional bool scan_all_processes_on_start = 2;
829
830  // If enabled thread names are also recoded (this is redundant if sched_switch
831  // is enabled).
832  optional bool record_thread_names = 3;
833
834  // If > 0 samples counters (see process_stats.proto) from
835  // /proc/pid/status and oom_score_adj every X ms.
836  // It will also sample /proc/pid/smaps_rollup if scan_smaps_rollup = true.
837  // This is required to be > 100ms to avoid excessive CPU usage.
838  // TODO(primiano): add CPU cost for change this value.
839  optional uint32 proc_stats_poll_ms = 4;
840
841  // If empty samples stats for all processes. If non empty samples stats only
842  // for processes matching the given string in their argv0 (i.e. the first
843  // entry of /proc/pid/cmdline).
844  // TODO(primiano): implement this feature.
845  // repeated string proc_stats_filter = 5;
846
847  // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
848  // (default: |proc_stats_poll_ms|). If = 0, will be set to
849  // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
850  // multiple.
851  optional uint32 proc_stats_cache_ttl_ms = 6;
852
853  // DEPRECATED record_thread_time_in_state
854  reserved 7;
855
856  // DEPRECATED thread_time_in_state_cache_size
857  reserved 8;
858
859  // If true this will resolve filedescriptors for each process so these
860  // can be mapped to their actual device or file.
861  // Requires raw_syscalls/sys_exit ftrace events to be enabled or
862  // new fds opened after initially scanning a process will not be
863  // recognized.
864  optional bool resolve_process_fds = 9;
865
866  // If enabled memory stats from /proc/pid/smaps_rollup will be included
867  // in process stats.
868  optional bool scan_smaps_rollup = 10;
869}
870
871// End of protos/perfetto/config/process_stats/process_stats_config.proto
872
873// Begin of protos/perfetto/config/profiling/heapprofd_config.proto
874
875// Configuration for go/heapprofd.
876// Next id: 28
877message HeapprofdConfig {
878  message ContinuousDumpConfig {
879    // ms to wait before first dump.
880    optional uint32 dump_phase_ms = 5;
881    // ms to wait between following dumps.
882    optional uint32 dump_interval_ms = 6;
883  }
884
885  // Sampling rate for all heaps not specified via heap_sampling_intervals.
886  //
887  // These are:
888  // * All heaps if heap_sampling_intervals is empty.
889  // * Those profiled due to all_heaps and not named in heaps if
890  //   heap_sampling_intervals is not empty.
891  // * The implicit libc.malloc heap if heaps is empty.
892  //
893  // Set to 1 for perfect accuracy.
894  // Otherwise, sample every sample_interval_bytes on average.
895  //
896  // See
897  // https://perfetto.dev/docs/data-sources/native-heap-profiler#sampling-interval
898  // for more details.
899  //
900  // BUGS
901  // Before Android 12, setting this to 0 would crash the target process.
902  //
903  // N.B. This must be explicitly set to a non-zero value for all heaps (with
904  // this field or with heap_sampling_intervals), otherwise the producer will
905  // not start.
906  optional uint64 sampling_interval_bytes = 1;
907
908  // If less than the given numbers of bytes are left free in the shared
909  // memory buffer, increase sampling interval by a factor of two.
910  // Adaptive sampling is disabled when set to 0.
911  optional uint64 adaptive_sampling_shmem_threshold = 24;
912  // Stop doubling the sampling_interval once the sampling interval has reached
913  // this value.
914  optional uint64 adaptive_sampling_max_sampling_interval_bytes = 25;
915
916  // E.g. surfaceflinger, com.android.phone
917  // This input is normalized in the following way: if it contains slashes,
918  // everything up to the last slash is discarded. If it contains "@",
919  // everything after the first @ is discared.
920  // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger.
921  // This transformation is also applied to the processes' command lines when
922  // matching.
923  repeated string process_cmdline = 2;
924
925  // For watermark based triggering or local debugging.
926  repeated uint64 pid = 4;
927
928  // Only profile target if it was installed by one of the packages given.
929  // Special values are:
930  // * @system: installed on the system partition
931  // * @product: installed on the product partition
932  // * @null: sideloaded
933  // Supported on Android 12+.
934  repeated string target_installed_by = 26;
935
936  // Which heaps to sample, e.g. "libc.malloc". If left empty, only samples
937  // "malloc".
938  //
939  // Introduced in Android 12.
940  repeated string heaps = 20;
941
942  // Which heaps not to sample, e.g. "libc.malloc". This is useful when used in
943  // combination with all_heaps;
944  //
945  // Introduced in Android 12.
946  repeated string exclude_heaps = 27;
947
948  optional bool stream_allocations = 23;
949
950  // If given, needs to be the same length as heaps and gives the sampling
951  // interval for the respective entry in heaps.
952  //
953  // Otherwise, sampling_interval_bytes is used.
954  //
955  // It is recommended to set sampling_interval_bytes to a reasonable default
956  // value when using this, as a value of 0 for sampling_interval_bytes will
957  // crash the target process before Android 12.
958  //
959  // Introduced in Android 12.
960  //
961  // All values must be non-zero or the producer will not start.
962  repeated uint64 heap_sampling_intervals = 22;
963
964  // Sample all heaps registered by target process. Introduced in Android 12.
965  optional bool all_heaps = 21;
966
967  // Profile all processes eligible for profiling on the system.
968  // See
969  // https://perfetto.dev/docs/data-sources/native-heap-profiler#heapprofd-targets
970  // for which processes are eligible.
971  //
972  // On unmodified userdebug builds, this will lead to system crashes. Zygote
973  // will crash when trying to launch a new process as it will have an
974  // unexpected open socket to heapprofd.
975  //
976  // heapprofd will likely be overloaded by the amount of data for low
977  // sampling intervals.
978  optional bool all = 5;
979
980  // Do not profile processes whose anon RSS + swap < given value.
981  // Introduced in Android 11.
982  optional uint32 min_anonymous_memory_kb = 15;
983
984  // Stop profile if heapprofd memory usage goes beyond the given value.
985  // Introduced in Android 11.
986  optional uint32 max_heapprofd_memory_kb = 16;
987
988  // Stop profile if heapprofd CPU time since start of this data-source
989  // goes beyond given value.
990  // Introduced in Android 11.
991  optional uint64 max_heapprofd_cpu_secs = 17;
992
993  // Do not emit function names for mappings starting with this prefix.
994  // E.g. /system to not emit symbols for any system libraries.
995  repeated string skip_symbol_prefix = 7;
996
997  // Dump at a predefined interval.
998  optional ContinuousDumpConfig continuous_dump_config = 6;
999
1000  // Size of the shared memory buffer between the profiled processes and
1001  // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500
1002  // MiB.
1003  //
1004  // Needs to be:
1005  // * at least 8192,
1006  // * a power of two,
1007  // * a multiple of 4096.
1008  optional uint64 shmem_size_bytes = 8;
1009
1010  // When the shmem buffer is full, block the client instead of ending the
1011  // trace. Use with caution as this will significantly slow down the target
1012  // process.
1013  optional bool block_client = 9;
1014
1015  // If set, stop the trace session after blocking the client for this
1016  // timeout. Needs to be larger than 100 us, otherwise no retries are done.
1017  // Introduced in Android 11.
1018  optional uint32 block_client_timeout_us = 14;
1019
1020  // Do not profile processes from startup, only match already running
1021  // processes.
1022  //
1023  // Can not be set at the same time as no_running.
1024  // Introduced in Android 11.
1025  optional bool no_startup = 10;
1026
1027  // Do not profile running processes. Only match processes on startup.
1028  //
1029  // Can not be set at the same time as no_startup.
1030  // Introduced in Android 11.
1031  optional bool no_running = 11;
1032
1033  // deprecated idle_allocations.
1034  reserved 12;
1035
1036  // Cause heapprofd to emit a single dump at the end, showing the memory usage
1037  // at the point in time when the sampled heap usage of the process was at its
1038  // maximum. This causes ProfilePacket.HeapSample.self_max to be set, and
1039  // self_allocated and self_freed to not be set.
1040  // Introduced in Android 11.
1041  optional bool dump_at_max = 13;
1042
1043  // FEATURE FLAGS. THERE BE DRAGONS.
1044
1045  // Escape hatch if the session is being torn down because of a forked child
1046  // that shares memory space, but is not correctly identified as a vforked
1047  // child.
1048  // Introduced in Android 11.
1049  optional bool disable_fork_teardown = 18;
1050
1051  // We try to automatically detect when a target applicatation vforks but then
1052  // does a memory allocation (or free). This auto-detection can be disabled
1053  // with this.
1054  // Introduced in Android 11.
1055  optional bool disable_vfork_detection = 19;
1056}
1057
1058// End of protos/perfetto/config/profiling/heapprofd_config.proto
1059
1060// Begin of protos/perfetto/config/profiling/java_hprof_config.proto
1061
1062// Configuration for managed app heap graph snapshots.
1063message JavaHprofConfig {
1064  // If dump_interval_ms != 0, the following configuration is used.
1065  message ContinuousDumpConfig {
1066    // ms to wait before first continuous dump.
1067    // A dump is always created at the beginning of the trace.
1068    optional uint32 dump_phase_ms = 1;
1069    // ms to wait between following dumps.
1070    optional uint32 dump_interval_ms = 2;
1071    // If true, scans all the processes to find `process_cmdline` and filter by
1072    // `min_anonymous_memory_kb` only at data source start. Default on Android
1073    // S-.
1074    //
1075    // If false, rescans all the processes to find on every dump. Default on
1076    // Android T+.
1077    optional bool scan_pids_only_on_start = 3;
1078  }
1079
1080  // Command line allowlist, matched against the /proc/<pid>/cmdline (not the
1081  // comm string). The semantics of this field were changed since its original
1082  // introduction.
1083  //
1084  // On Android T+ (13+), this field can specify a single wildcard (*), and
1085  // the profiler will attempt to match it in two possible ways:
1086  // * if the pattern starts with a '/', then it is matched against the first
1087  //   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
1088  //   "/bin/echo".
1089  // * otherwise the pattern is matched against the part of argv0
1090  //   corresponding to the binary name (this is unrelated to /proc/pid/exe).
1091  //   For example "echo" would match "/bin/echo".
1092  //
1093  // On Android S (12) and below, both this pattern and /proc/pid/cmdline get
1094  // normalized prior to an exact string comparison. Normalization is as
1095  // follows: (1) trim everything beyond the first null or "@" byte; (2) if
1096  // the string contains forward slashes, trim everything up to and including
1097  // the last one.
1098  //
1099  // Implementation note: in either case, at most 511 characters of cmdline
1100  // are considered.
1101  repeated string process_cmdline = 1;
1102
1103  // For watermark based triggering or local debugging.
1104  repeated uint64 pid = 2;
1105
1106  // Only profile target if it was installed by one of the packages given.
1107  // Special values are:
1108  // * @system: installed on the system partition
1109  // * @product: installed on the product partition
1110  // * @null: sideloaded
1111  // Supported on Android 12+.
1112  repeated string target_installed_by = 7;
1113
1114  // Dump at a predefined interval.
1115  optional ContinuousDumpConfig continuous_dump_config = 3;
1116
1117  // Do not profile processes whose anon RSS + swap < given value.
1118  optional uint32 min_anonymous_memory_kb = 4;
1119
1120  // Include the process' /proc/self/smaps.
1121  // This only shows maps that:
1122  // * start with /system
1123  // * start with /vendor
1124  // * start with /data/app
1125  // * contain "extracted in memory from Y", where Y matches any of the above
1126  optional bool dump_smaps = 5;
1127
1128  // Exclude objects of the following types from the profile. This can be
1129  // useful if lots of uninteresting objects, e.g. "sun.misc.Cleaner".
1130  repeated string ignored_types = 6;
1131}
1132
1133// End of protos/perfetto/config/profiling/java_hprof_config.proto
1134
1135// Begin of protos/perfetto/common/perf_events.proto
1136
1137// Next id: 12
1138message PerfEvents {
1139  // What event to sample on, and how often. Commented from the perspective of
1140  // its use in |PerfEventConfig|.
1141  message Timebase {
1142    // How often the per-cpu sampling will occur. Not guaranteed to be honored
1143    // as the kernel can throttle the sampling rate if it's too high.
1144    // If unset, an implementation-defined default is used.
1145    oneof interval {
1146      // Per-cpu sampling frequency in Hz, as requested from the kernel. Not the
1147      // same as 1/period.
1148      // Details: the actual sampling will still be based on a period, but the
1149      // kernel will dynamically adjust it based on the observed event rate, to
1150      // approximate this frequency. Works best with steady-rate events like
1151      // timers.
1152      uint64 frequency = 2;
1153
1154      // Per-cpu sampling will occur every |period| counts of |event|.
1155      // Prefer |frequency| by default, as it's easier to oversample with a
1156      // fixed period.
1157      uint64 period = 1;
1158    }
1159
1160    // Counting event to use as a timebase for the sampling.
1161    // If unset, implies the CPU timer (SW_CPU_CLOCK) as the event,
1162    // which is what you usually want.
1163    // See common/perf_events.proto for the definitions.
1164    oneof event {
1165      Counter counter = 4;
1166      Tracepoint tracepoint = 3;
1167      RawEvent raw_event = 5;
1168    }
1169
1170    // If set, samples will be timestamped with the given clock.
1171    // If unset, the clock is chosen by the implementation.
1172    // For software events, prefer PERF_CLOCK_BOOTTIME. However it cannot be
1173    // used for hardware events (due to interrupt safety), for which the
1174    // recommendation is to use one of the monotonic clocks.
1175    optional PerfClock timestamp_clock = 11;
1176
1177    // Optional arbitrary name for the event, to identify it in the parsed
1178    // trace. Does *not* affect the profiling itself. If unset, the trace
1179    // parser will choose a suitable name.
1180    optional string name = 10;
1181  }
1182
1183  // Builtin counter names from the uapi header. Commented with their perf tool
1184  // aliases.
1185  // TODO(rsavitski): consider generating enums for cache events (should be
1186  // finite), and generally make this list as extensive as possible. Excluding
1187  // things like dynamic PMUs since those don't fit into a static enum.
1188  // Next id: 21
1189  enum Counter {
1190    UNKNOWN_COUNTER = 0;
1191
1192    // cpu-clock
1193    SW_CPU_CLOCK = 1;
1194    // page-faults, faults
1195    SW_PAGE_FAULTS = 2;
1196    // task-clock
1197    SW_TASK_CLOCK = 3;
1198    // context-switches, cs
1199    SW_CONTEXT_SWITCHES = 4;
1200    // cpu-migrations, migrations
1201    SW_CPU_MIGRATIONS = 5;
1202    // minor-faults
1203    SW_PAGE_FAULTS_MIN = 6;
1204    // major-faults
1205    SW_PAGE_FAULTS_MAJ = 7;
1206    // alignment-faults
1207    SW_ALIGNMENT_FAULTS = 8;
1208    // emulation-faults
1209    SW_EMULATION_FAULTS = 9;
1210    // dummy
1211    SW_DUMMY = 20;
1212
1213    // cpu-cycles, cycles
1214    HW_CPU_CYCLES = 10;
1215    // instructions
1216    HW_INSTRUCTIONS = 11;
1217    // cache-references
1218    HW_CACHE_REFERENCES = 12;
1219    // cache-misses
1220    HW_CACHE_MISSES = 13;
1221    // branch-instructions, branches
1222    HW_BRANCH_INSTRUCTIONS = 14;
1223    // branch-misses
1224    HW_BRANCH_MISSES = 15;
1225    // bus-cycles
1226    HW_BUS_CYCLES = 16;
1227    // stalled-cycles-frontend, idle-cycles-frontend
1228    HW_STALLED_CYCLES_FRONTEND = 17;
1229    // stalled-cycles-backend, idle-cycles-backend
1230    HW_STALLED_CYCLES_BACKEND = 18;
1231    // ref-cycles
1232    HW_REF_CPU_CYCLES = 19;
1233  }
1234
1235  message Tracepoint {
1236    // Group and name for the tracepoint, acceptable forms:
1237    // * "sched/sched_switch"
1238    // * "sched:sched_switch"
1239    optional string name = 1;
1240
1241    // Optional field-level filter for the tracepoint. Only events matching this
1242    // filter will be counted (and therefore contribute to the sampling period).
1243    // Example: "prev_pid >= 42 && next_pid == 0".
1244    // For full syntax, see kernel documentation on "Event filtering":
1245    // https://www.kernel.org/doc/Documentation/trace/events.txt
1246    optional string filter = 2;
1247  }
1248
1249  // Syscall-level description of the event, propagated to the perf_event_attr
1250  // struct. Primarily for local use-cases, since the event availability and
1251  // encoding is hardware-specific.
1252  message RawEvent {
1253    optional uint32 type = 1;
1254    optional uint64 config = 2;
1255    optional uint64 config1 = 3;
1256    optional uint64 config2 = 4;
1257  }
1258
1259  // Subset of clocks that is supported by perf timestamping.
1260  // CLOCK_TAI is excluded since it's not expected to be used in practice, but
1261  // would require additions to the trace clock synchronisation logic.
1262  enum PerfClock {
1263    UNKNOWN_PERF_CLOCK = 0;
1264    PERF_CLOCK_REALTIME = 1;
1265    PERF_CLOCK_MONOTONIC = 2;
1266    PERF_CLOCK_MONOTONIC_RAW = 3;
1267    PERF_CLOCK_BOOTTIME = 4;
1268  }
1269}
1270
1271// End of protos/perfetto/common/perf_events.proto
1272
1273// Begin of protos/perfetto/config/profiling/perf_event_config.proto
1274
1275// Configuration for the traced_perf profiler.
1276//
1277// Example config for basic cpu profiling:
1278//   perf_event_config {
1279//     timebase {
1280//       frequency: 80
1281//     }
1282//     callstack_sampling {
1283//       scope {
1284//         target_cmdline: "surfaceflinger"
1285//         target_cmdline: "system_server"
1286//       }
1287//       kernel_frames: true
1288//     }
1289//   }
1290//
1291// Next id: 19
1292message PerfEventConfig {
1293  // What event to sample on, and how often.
1294  // Defined in common/perf_events.proto.
1295  optional PerfEvents.Timebase timebase = 15;
1296
1297  // If set, the profiler will sample userspace processes' callstacks at the
1298  // interval specified by the |timebase|.
1299  // If unset, the profiler will record only the event counts.
1300  optional CallstackSampling callstack_sampling = 16;
1301
1302  //
1303  // Kernel <-> userspace ring buffer options:
1304  //
1305
1306  // How often the per-cpu ring buffers are read by the producer.
1307  // If unset, an implementation-defined default is used.
1308  optional uint32 ring_buffer_read_period_ms = 8;
1309
1310  // Size (in 4k pages) of each per-cpu ring buffer that is filled by the
1311  // kernel. If set, must be a power of two.
1312  // If unset, an implementation-defined default is used.
1313  optional uint32 ring_buffer_pages = 3;
1314
1315  //
1316  // Daemon's resource usage limits:
1317  //
1318
1319  // Drop samples if the heap memory held by the samples in the unwinder queue
1320  // is above the given limit. This counts the memory across all concurrent data
1321  // sources (not just this one's), and there is no fairness guarantee - the
1322  // whole quota might be used up by a concurrent source.
1323  optional uint64 max_enqueued_footprint_kb = 17;
1324
1325  // Stop the data source if traced_perf's combined {RssAnon + Swap} memory
1326  // footprint exceeds this value.
1327  optional uint32 max_daemon_memory_kb = 13;
1328
1329  //
1330  // Uncommon options:
1331  //
1332
1333  // Timeout for the remote /proc/<pid>/{maps,mem} file descriptors for a
1334  // sampled process. This is primarily for Android, where this lookup is
1335  // asynchronous. As long as the producer is waiting, the associated samples
1336  // will be kept enqueued (putting pressure on the capacity of the shared
1337  // unwinding queue). Once a lookup for a process expires, all associated
1338  // samples are discarded. However, if the lookup still succeeds after the
1339  // timeout, future samples will be handled normally.
1340  // If unset, an implementation-defined default is used.
1341  optional uint32 remote_descriptor_timeout_ms = 9;
1342
1343  // Optional period for clearing state cached by the unwinder. This is a heavy
1344  // operation that is only necessary for traces that target a wide set of
1345  // processes, and require the memory footprint to be reset periodically.
1346  // If unset, the cached state will not be cleared.
1347  optional uint32 unwind_state_clear_period_ms = 10;
1348
1349  // If set, only profile target if it was installed by a package with one of
1350  // these names. Special values:
1351  // * "@system": installed on the system partition
1352  // * "@product": installed on the product partition
1353  // * "@null": sideloaded
1354  // Supported on Android 12+.
1355  repeated string target_installed_by = 18;
1356
1357  //
1358  // Deprecated (superseded by options above):
1359  //
1360  // Do not set *any* of these fields in new configs.
1361  //
1362
1363  // Note: legacy configs had to set |all_cpus| to true to pass parsing.
1364  // We rely on this to detect such configs.
1365  optional bool all_cpus = 1;
1366  optional uint32 sampling_frequency = 2;
1367  optional bool kernel_frames = 12;
1368  repeated int32 target_pid = 4;
1369  repeated string target_cmdline = 5;
1370  repeated int32 exclude_pid = 6;
1371  repeated string exclude_cmdline = 7;
1372  optional uint32 additional_cmdline_count = 11;
1373  // previously |tracepoint|
1374  reserved 14;
1375
1376  //
1377  // Sub-messages (nested for generated code namespacing).
1378  //
1379
1380  message CallstackSampling {
1381    // Defines a set of processes for which samples are retained/skipped. If
1382    // unset, all samples are kept, but beware that it will be very heavy on the
1383    // stack unwinder, which might start dropping samples due to overload.
1384    optional Scope scope = 1;
1385
1386    // If true, callstacks will include the kernel-space frames. Such frames can
1387    // be identified by a magical "kernel" string as their mapping name.
1388    // Requires traced_perf to be running as root, or kptr_restrict to have been
1389    // manually unrestricted. On Android, the platform should do the right thing
1390    // on debug builds.
1391    // This does *not* disclose KASLR, as only the function names are emitted.
1392    optional bool kernel_frames = 2;
1393
1394    // Whether to record and unwind userspace callstacks. If unset, defaults to
1395    // including userspace (UNWIND_DWARF) both for backwards compatibility and
1396    // as the most common default (this defaulting is only applicable if the
1397    // outer CallstackSampling message is explicitly set).
1398    optional UnwindMode user_frames = 3;
1399  }
1400
1401  message Scope {
1402    // Process ID (TGID) allowlist. If this list is not empty, only matching
1403    // samples will be retained. If multiple allow/deny-lists are
1404    // specified by the config, then all of them are evaluated for each sampled
1405    // process.
1406    repeated int32 target_pid = 1;
1407
1408    // Command line allowlist, matched against the /proc/<pid>/cmdline (not the
1409    // comm string). The semantics of this field were changed since its original
1410    // introduction.
1411    //
1412    // On Android T+ (13+), this field can specify a single wildcard (*), and
1413    // the profiler will attempt to match it in two possible ways:
1414    // * if the pattern starts with a '/', then it is matched against the first
1415    //   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
1416    //   "/bin/echo".
1417    // * otherwise the pattern is matched against the part of argv0
1418    //   corresponding to the binary name (this is unrelated to /proc/pid/exe).
1419    //   For example "echo" would match "/bin/echo".
1420    //
1421    // On Android S (12) and below, both this pattern and /proc/pid/cmdline get
1422    // normalized prior to an exact string comparison. Normalization is as
1423    // follows: (1) trim everything beyond the first null or "@" byte; (2) if
1424    // the string contains forward slashes, trim everything up to and including
1425    // the last one.
1426    //
1427    // Implementation note: in either case, at most 511 characters of cmdline
1428    // are considered.
1429    repeated string target_cmdline = 2;
1430
1431    // List of excluded pids.
1432    repeated int32 exclude_pid = 3;
1433
1434    // List of excluded cmdlines. See description of |target_cmdline| for how
1435    // this is handled.
1436    repeated string exclude_cmdline = 4;
1437
1438    // Niche features for systemwide callstacks:
1439
1440    // Number of additional command lines to sample. Only those which are
1441    // neither explicitly included nor excluded will be considered. Processes
1442    // are accepted on a first come, first served basis.
1443    optional uint32 additional_cmdline_count = 5;
1444
1445    // If set to N, all encountered processes will be put into one of the N
1446    // possible bins, and only one randomly-chosen bin will be selected for
1447    // unwinding. The binning is simply "pid % N", under the assumption that
1448    // low-order bits of pids are roughly uniformly distributed. Other explicit
1449    // inclusions/exclusions in this |Scope| message are still respected.
1450    //
1451    // The profiler will report the chosen shard in PerfSampleDefaults, and the
1452    // values will be queryable in trace processor under the "stats" table as
1453    // "perf_process_shard_count" and "perf_chosen_process_shard".
1454    //
1455    // NB: all data sources in a config that set |process_shard_count| must set
1456    // it to the same value. The profiler will choose one bin for all those data
1457    // sources.
1458    optional uint32 process_shard_count = 6;
1459  }
1460
1461  // Userspace unwinding mode. A possible future addition is kernel-unwound
1462  // callchains for frame pointer based systems.
1463  enum UnwindMode {
1464    UNWIND_UNKNOWN = 0;
1465    // Do not unwind userspace:
1466    UNWIND_SKIP = 1;
1467    // Use libunwindstack (default):
1468    UNWIND_DWARF = 2;
1469  }
1470}
1471
1472// End of protos/perfetto/config/profiling/perf_event_config.proto
1473
1474// Begin of protos/perfetto/config/statsd/atom_ids.proto
1475
1476// This enum is obtained by post-processing
1477// AOSP/frameworks/proto_logging/stats/atoms.proto through
1478// AOSP/external/perfetto/tools/update-statsd-descriptor, which extracts one
1479// enum value for each proto field defined in the upstream atoms.proto.
1480enum AtomId {
1481  ATOM_UNSPECIFIED = 0;
1482  ATOM_BLE_SCAN_STATE_CHANGED = 2;
1483  ATOM_PROCESS_STATE_CHANGED = 3;
1484  ATOM_BLE_SCAN_RESULT_RECEIVED = 4;
1485  ATOM_SENSOR_STATE_CHANGED = 5;
1486  ATOM_GPS_SCAN_STATE_CHANGED = 6;
1487  ATOM_SYNC_STATE_CHANGED = 7;
1488  ATOM_SCHEDULED_JOB_STATE_CHANGED = 8;
1489  ATOM_SCREEN_BRIGHTNESS_CHANGED = 9;
1490  ATOM_WAKELOCK_STATE_CHANGED = 10;
1491  ATOM_LONG_PARTIAL_WAKELOCK_STATE_CHANGED = 11;
1492  ATOM_MOBILE_RADIO_POWER_STATE_CHANGED = 12;
1493  ATOM_WIFI_RADIO_POWER_STATE_CHANGED = 13;
1494  ATOM_ACTIVITY_MANAGER_SLEEP_STATE_CHANGED = 14;
1495  ATOM_MEMORY_FACTOR_STATE_CHANGED = 15;
1496  ATOM_EXCESSIVE_CPU_USAGE_REPORTED = 16;
1497  ATOM_CACHED_KILL_REPORTED = 17;
1498  ATOM_PROCESS_MEMORY_STAT_REPORTED = 18;
1499  ATOM_LAUNCHER_EVENT = 19;
1500  ATOM_BATTERY_SAVER_MODE_STATE_CHANGED = 20;
1501  ATOM_DEVICE_IDLE_MODE_STATE_CHANGED = 21;
1502  ATOM_DEVICE_IDLING_MODE_STATE_CHANGED = 22;
1503  ATOM_AUDIO_STATE_CHANGED = 23;
1504  ATOM_MEDIA_CODEC_STATE_CHANGED = 24;
1505  ATOM_CAMERA_STATE_CHANGED = 25;
1506  ATOM_FLASHLIGHT_STATE_CHANGED = 26;
1507  ATOM_UID_PROCESS_STATE_CHANGED = 27;
1508  ATOM_PROCESS_LIFE_CYCLE_STATE_CHANGED = 28;
1509  ATOM_SCREEN_STATE_CHANGED = 29;
1510  ATOM_BATTERY_LEVEL_CHANGED = 30;
1511  ATOM_CHARGING_STATE_CHANGED = 31;
1512  ATOM_PLUGGED_STATE_CHANGED = 32;
1513  ATOM_INTERACTIVE_STATE_CHANGED = 33;
1514  ATOM_TOUCH_EVENT_REPORTED = 34;
1515  ATOM_WAKEUP_ALARM_OCCURRED = 35;
1516  ATOM_KERNEL_WAKEUP_REPORTED = 36;
1517  ATOM_WIFI_LOCK_STATE_CHANGED = 37;
1518  ATOM_WIFI_SIGNAL_STRENGTH_CHANGED = 38;
1519  ATOM_WIFI_SCAN_STATE_CHANGED = 39;
1520  ATOM_PHONE_SIGNAL_STRENGTH_CHANGED = 40;
1521  ATOM_SETTING_CHANGED = 41;
1522  ATOM_ACTIVITY_FOREGROUND_STATE_CHANGED = 42;
1523  ATOM_ISOLATED_UID_CHANGED = 43;
1524  ATOM_PACKET_WAKEUP_OCCURRED = 44;
1525  ATOM_WALL_CLOCK_TIME_SHIFTED = 45;
1526  ATOM_ANOMALY_DETECTED = 46;
1527  ATOM_APP_BREADCRUMB_REPORTED = 47;
1528  ATOM_APP_START_OCCURRED = 48;
1529  ATOM_APP_START_CANCELED = 49;
1530  ATOM_APP_START_FULLY_DRAWN = 50;
1531  ATOM_LMK_KILL_OCCURRED = 51;
1532  ATOM_PICTURE_IN_PICTURE_STATE_CHANGED = 52;
1533  ATOM_WIFI_MULTICAST_LOCK_STATE_CHANGED = 53;
1534  ATOM_LMK_STATE_CHANGED = 54;
1535  ATOM_APP_START_MEMORY_STATE_CAPTURED = 55;
1536  ATOM_SHUTDOWN_SEQUENCE_REPORTED = 56;
1537  ATOM_BOOT_SEQUENCE_REPORTED = 57;
1538  ATOM_DAVEY_OCCURRED = 58;
1539  ATOM_OVERLAY_STATE_CHANGED = 59;
1540  ATOM_FOREGROUND_SERVICE_STATE_CHANGED = 60;
1541  ATOM_CALL_STATE_CHANGED = 61;
1542  ATOM_KEYGUARD_STATE_CHANGED = 62;
1543  ATOM_KEYGUARD_BOUNCER_STATE_CHANGED = 63;
1544  ATOM_KEYGUARD_BOUNCER_PASSWORD_ENTERED = 64;
1545  ATOM_APP_DIED = 65;
1546  ATOM_RESOURCE_CONFIGURATION_CHANGED = 66;
1547  ATOM_BLUETOOTH_ENABLED_STATE_CHANGED = 67;
1548  ATOM_BLUETOOTH_CONNECTION_STATE_CHANGED = 68;
1549  ATOM_GPS_SIGNAL_QUALITY_CHANGED = 69;
1550  ATOM_USB_CONNECTOR_STATE_CHANGED = 70;
1551  ATOM_SPEAKER_IMPEDANCE_REPORTED = 71;
1552  ATOM_HARDWARE_FAILED = 72;
1553  ATOM_PHYSICAL_DROP_DETECTED = 73;
1554  ATOM_CHARGE_CYCLES_REPORTED = 74;
1555  ATOM_MOBILE_CONNECTION_STATE_CHANGED = 75;
1556  ATOM_MOBILE_RADIO_TECHNOLOGY_CHANGED = 76;
1557  ATOM_USB_DEVICE_ATTACHED = 77;
1558  ATOM_APP_CRASH_OCCURRED = 78;
1559  ATOM_ANR_OCCURRED = 79;
1560  ATOM_WTF_OCCURRED = 80;
1561  ATOM_LOW_MEM_REPORTED = 81;
1562  ATOM_GENERIC_ATOM = 82;
1563  ATOM_VIBRATOR_STATE_CHANGED = 84;
1564  ATOM_DEFERRED_JOB_STATS_REPORTED = 85;
1565  ATOM_THERMAL_THROTTLING = 86;
1566  ATOM_BIOMETRIC_ACQUIRED = 87;
1567  ATOM_BIOMETRIC_AUTHENTICATED = 88;
1568  ATOM_BIOMETRIC_ERROR_OCCURRED = 89;
1569  ATOM_UI_EVENT_REPORTED = 90;
1570  ATOM_BATTERY_HEALTH_SNAPSHOT = 91;
1571  ATOM_SLOW_IO = 92;
1572  ATOM_BATTERY_CAUSED_SHUTDOWN = 93;
1573  ATOM_PHONE_SERVICE_STATE_CHANGED = 94;
1574  ATOM_PHONE_STATE_CHANGED = 95;
1575  ATOM_USER_RESTRICTION_CHANGED = 96;
1576  ATOM_SETTINGS_UI_CHANGED = 97;
1577  ATOM_CONNECTIVITY_STATE_CHANGED = 98;
1578  ATOM_SERVICE_STATE_CHANGED = 99;
1579  ATOM_SERVICE_LAUNCH_REPORTED = 100;
1580  ATOM_FLAG_FLIP_UPDATE_OCCURRED = 101;
1581  ATOM_BINARY_PUSH_STATE_CHANGED = 102;
1582  ATOM_DEVICE_POLICY_EVENT = 103;
1583  ATOM_DOCS_UI_FILE_OP_CANCELED = 104;
1584  ATOM_DOCS_UI_FILE_OP_COPY_MOVE_MODE_REPORTED = 105;
1585  ATOM_DOCS_UI_FILE_OP_FAILURE = 106;
1586  ATOM_DOCS_UI_PROVIDER_FILE_OP = 107;
1587  ATOM_DOCS_UI_INVALID_SCOPED_ACCESS_REQUEST = 108;
1588  ATOM_DOCS_UI_LAUNCH_REPORTED = 109;
1589  ATOM_DOCS_UI_ROOT_VISITED = 110;
1590  ATOM_DOCS_UI_STARTUP_MS = 111;
1591  ATOM_DOCS_UI_USER_ACTION_REPORTED = 112;
1592  ATOM_WIFI_ENABLED_STATE_CHANGED = 113;
1593  ATOM_WIFI_RUNNING_STATE_CHANGED = 114;
1594  ATOM_APP_COMPACTED = 115;
1595  ATOM_NETWORK_DNS_EVENT_REPORTED = 116;
1596  ATOM_DOCS_UI_PICKER_LAUNCHED_FROM_REPORTED = 117;
1597  ATOM_DOCS_UI_PICK_RESULT_REPORTED = 118;
1598  ATOM_DOCS_UI_SEARCH_MODE_REPORTED = 119;
1599  ATOM_DOCS_UI_SEARCH_TYPE_REPORTED = 120;
1600  ATOM_DATA_STALL_EVENT = 121;
1601  ATOM_RESCUE_PARTY_RESET_REPORTED = 122;
1602  ATOM_SIGNED_CONFIG_REPORTED = 123;
1603  ATOM_GNSS_NI_EVENT_REPORTED = 124;
1604  ATOM_BLUETOOTH_LINK_LAYER_CONNECTION_EVENT = 125;
1605  ATOM_BLUETOOTH_ACL_CONNECTION_STATE_CHANGED = 126;
1606  ATOM_BLUETOOTH_SCO_CONNECTION_STATE_CHANGED = 127;
1607  ATOM_APP_DOWNGRADED = 128;
1608  ATOM_APP_OPTIMIZED_AFTER_DOWNGRADED = 129;
1609  ATOM_LOW_STORAGE_STATE_CHANGED = 130;
1610  ATOM_GNSS_NFW_NOTIFICATION_REPORTED = 131;
1611  ATOM_GNSS_CONFIGURATION_REPORTED = 132;
1612  ATOM_USB_PORT_OVERHEAT_EVENT_REPORTED = 133;
1613  ATOM_NFC_ERROR_OCCURRED = 134;
1614  ATOM_NFC_STATE_CHANGED = 135;
1615  ATOM_NFC_BEAM_OCCURRED = 136;
1616  ATOM_NFC_CARDEMULATION_OCCURRED = 137;
1617  ATOM_NFC_TAG_OCCURRED = 138;
1618  ATOM_NFC_HCE_TRANSACTION_OCCURRED = 139;
1619  ATOM_SE_STATE_CHANGED = 140;
1620  ATOM_SE_OMAPI_REPORTED = 141;
1621  ATOM_BROADCAST_DISPATCH_LATENCY_REPORTED = 142;
1622  ATOM_ATTENTION_MANAGER_SERVICE_RESULT_REPORTED = 143;
1623  ATOM_ADB_CONNECTION_CHANGED = 144;
1624  ATOM_SPEECH_DSP_STAT_REPORTED = 145;
1625  ATOM_USB_CONTAMINANT_REPORTED = 146;
1626  ATOM_WATCHDOG_ROLLBACK_OCCURRED = 147;
1627  ATOM_BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED = 148;
1628  ATOM_BUBBLE_UI_CHANGED = 149;
1629  ATOM_SCHEDULED_JOB_CONSTRAINT_CHANGED = 150;
1630  ATOM_BLUETOOTH_ACTIVE_DEVICE_CHANGED = 151;
1631  ATOM_BLUETOOTH_A2DP_PLAYBACK_STATE_CHANGED = 152;
1632  ATOM_BLUETOOTH_A2DP_CODEC_CONFIG_CHANGED = 153;
1633  ATOM_BLUETOOTH_A2DP_CODEC_CAPABILITY_CHANGED = 154;
1634  ATOM_BLUETOOTH_A2DP_AUDIO_UNDERRUN_REPORTED = 155;
1635  ATOM_BLUETOOTH_A2DP_AUDIO_OVERRUN_REPORTED = 156;
1636  ATOM_BLUETOOTH_DEVICE_RSSI_REPORTED = 157;
1637  ATOM_BLUETOOTH_DEVICE_FAILED_CONTACT_COUNTER_REPORTED = 158;
1638  ATOM_BLUETOOTH_DEVICE_TX_POWER_LEVEL_REPORTED = 159;
1639  ATOM_BLUETOOTH_HCI_TIMEOUT_REPORTED = 160;
1640  ATOM_BLUETOOTH_QUALITY_REPORT_REPORTED = 161;
1641  ATOM_BLUETOOTH_DEVICE_INFO_REPORTED = 162;
1642  ATOM_BLUETOOTH_REMOTE_VERSION_INFO_REPORTED = 163;
1643  ATOM_BLUETOOTH_SDP_ATTRIBUTE_REPORTED = 164;
1644  ATOM_BLUETOOTH_BOND_STATE_CHANGED = 165;
1645  ATOM_BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED = 166;
1646  ATOM_BLUETOOTH_SMP_PAIRING_EVENT_REPORTED = 167;
1647  ATOM_SCREEN_TIMEOUT_EXTENSION_REPORTED = 168;
1648  ATOM_PROCESS_START_TIME = 169;
1649  ATOM_PERMISSION_GRANT_REQUEST_RESULT_REPORTED = 170;
1650  ATOM_BLUETOOTH_SOCKET_CONNECTION_STATE_CHANGED = 171;
1651  ATOM_DEVICE_IDENTIFIER_ACCESS_DENIED = 172;
1652  ATOM_BUBBLE_DEVELOPER_ERROR_REPORTED = 173;
1653  ATOM_ASSIST_GESTURE_STAGE_REPORTED = 174;
1654  ATOM_ASSIST_GESTURE_FEEDBACK_REPORTED = 175;
1655  ATOM_ASSIST_GESTURE_PROGRESS_REPORTED = 176;
1656  ATOM_TOUCH_GESTURE_CLASSIFIED = 177;
1657  ATOM_HIDDEN_API_USED = 178;
1658  ATOM_STYLE_UI_CHANGED = 179;
1659  ATOM_PRIVACY_INDICATORS_INTERACTED = 180;
1660  ATOM_APP_INSTALL_ON_EXTERNAL_STORAGE_REPORTED = 181;
1661  ATOM_NETWORK_STACK_REPORTED = 182;
1662  ATOM_APP_MOVED_STORAGE_REPORTED = 183;
1663  ATOM_BIOMETRIC_ENROLLED = 184;
1664  ATOM_SYSTEM_SERVER_WATCHDOG_OCCURRED = 185;
1665  ATOM_TOMB_STONE_OCCURRED = 186;
1666  ATOM_BLUETOOTH_CLASS_OF_DEVICE_REPORTED = 187;
1667  ATOM_INTELLIGENCE_EVENT_REPORTED = 188;
1668  ATOM_THERMAL_THROTTLING_SEVERITY_STATE_CHANGED = 189;
1669  ATOM_ROLE_REQUEST_RESULT_REPORTED = 190;
1670  ATOM_MEDIAMETRICS_AUDIOPOLICY_REPORTED = 191;
1671  ATOM_MEDIAMETRICS_AUDIORECORD_REPORTED = 192;
1672  ATOM_MEDIAMETRICS_AUDIOTHREAD_REPORTED = 193;
1673  ATOM_MEDIAMETRICS_AUDIOTRACK_REPORTED = 194;
1674  ATOM_MEDIAMETRICS_CODEC_REPORTED = 195;
1675  ATOM_MEDIAMETRICS_DRM_WIDEVINE_REPORTED = 196;
1676  ATOM_MEDIAMETRICS_EXTRACTOR_REPORTED = 197;
1677  ATOM_MEDIAMETRICS_MEDIADRM_REPORTED = 198;
1678  ATOM_MEDIAMETRICS_NUPLAYER_REPORTED = 199;
1679  ATOM_MEDIAMETRICS_RECORDER_REPORTED = 200;
1680  ATOM_MEDIAMETRICS_DRMMANAGER_REPORTED = 201;
1681  ATOM_CAR_POWER_STATE_CHANGED = 203;
1682  ATOM_GARAGE_MODE_INFO = 204;
1683  ATOM_TEST_ATOM_REPORTED = 205;
1684  ATOM_CONTENT_CAPTURE_CALLER_MISMATCH_REPORTED = 206;
1685  ATOM_CONTENT_CAPTURE_SERVICE_EVENTS = 207;
1686  ATOM_CONTENT_CAPTURE_SESSION_EVENTS = 208;
1687  ATOM_CONTENT_CAPTURE_FLUSHED = 209;
1688  ATOM_LOCATION_MANAGER_API_USAGE_REPORTED = 210;
1689  ATOM_REVIEW_PERMISSIONS_FRAGMENT_RESULT_REPORTED = 211;
1690  ATOM_RUNTIME_PERMISSIONS_UPGRADE_RESULT = 212;
1691  ATOM_GRANT_PERMISSIONS_ACTIVITY_BUTTON_ACTIONS = 213;
1692  ATOM_LOCATION_ACCESS_CHECK_NOTIFICATION_ACTION = 214;
1693  ATOM_APP_PERMISSION_FRAGMENT_ACTION_REPORTED = 215;
1694  ATOM_APP_PERMISSION_FRAGMENT_VIEWED = 216;
1695  ATOM_APP_PERMISSIONS_FRAGMENT_VIEWED = 217;
1696  ATOM_PERMISSION_APPS_FRAGMENT_VIEWED = 218;
1697  ATOM_TEXT_SELECTION_EVENT = 219;
1698  ATOM_TEXT_LINKIFY_EVENT = 220;
1699  ATOM_CONVERSATION_ACTIONS_EVENT = 221;
1700  ATOM_LANGUAGE_DETECTION_EVENT = 222;
1701  ATOM_EXCLUSION_RECT_STATE_CHANGED = 223;
1702  ATOM_BACK_GESTURE_REPORTED_REPORTED = 224;
1703  ATOM_UPDATE_ENGINE_UPDATE_ATTEMPT_REPORTED = 225;
1704  ATOM_UPDATE_ENGINE_SUCCESSFUL_UPDATE_REPORTED = 226;
1705  ATOM_CAMERA_ACTION_EVENT = 227;
1706  ATOM_APP_COMPATIBILITY_CHANGE_REPORTED = 228;
1707  ATOM_PERFETTO_UPLOADED = 229;
1708  ATOM_VMS_CLIENT_CONNECTION_STATE_CHANGED = 230;
1709  ATOM_MEDIA_PROVIDER_SCAN_OCCURRED = 233;
1710  ATOM_MEDIA_CONTENT_DELETED = 234;
1711  ATOM_MEDIA_PROVIDER_PERMISSION_REQUESTED = 235;
1712  ATOM_MEDIA_PROVIDER_SCHEMA_CHANGED = 236;
1713  ATOM_MEDIA_PROVIDER_IDLE_MAINTENANCE_FINISHED = 237;
1714  ATOM_REBOOT_ESCROW_RECOVERY_REPORTED = 238;
1715  ATOM_BOOT_TIME_EVENT_DURATION_REPORTED = 239;
1716  ATOM_BOOT_TIME_EVENT_ELAPSED_TIME_REPORTED = 240;
1717  ATOM_BOOT_TIME_EVENT_UTC_TIME_REPORTED = 241;
1718  ATOM_BOOT_TIME_EVENT_ERROR_CODE_REPORTED = 242;
1719  ATOM_USERSPACE_REBOOT_REPORTED = 243;
1720  ATOM_NOTIFICATION_REPORTED = 244;
1721  ATOM_NOTIFICATION_PANEL_REPORTED = 245;
1722  ATOM_NOTIFICATION_CHANNEL_MODIFIED = 246;
1723  ATOM_INTEGRITY_CHECK_RESULT_REPORTED = 247;
1724  ATOM_INTEGRITY_RULES_PUSHED = 248;
1725  ATOM_CB_MESSAGE_REPORTED = 249;
1726  ATOM_CB_MESSAGE_ERROR = 250;
1727  ATOM_WIFI_HEALTH_STAT_REPORTED = 251;
1728  ATOM_WIFI_FAILURE_STAT_REPORTED = 252;
1729  ATOM_WIFI_CONNECTION_RESULT_REPORTED = 253;
1730  ATOM_APP_FREEZE_CHANGED = 254;
1731  ATOM_SNAPSHOT_MERGE_REPORTED = 255;
1732  ATOM_FOREGROUND_SERVICE_APP_OP_SESSION_ENDED = 256;
1733  ATOM_DISPLAY_JANK_REPORTED = 257;
1734  ATOM_APP_STANDBY_BUCKET_CHANGED = 258;
1735  ATOM_SHARESHEET_STARTED = 259;
1736  ATOM_RANKING_SELECTED = 260;
1737  ATOM_TVSETTINGS_UI_INTERACTED = 261;
1738  ATOM_LAUNCHER_SNAPSHOT = 262;
1739  ATOM_PACKAGE_INSTALLER_V2_REPORTED = 263;
1740  ATOM_USER_LIFECYCLE_JOURNEY_REPORTED = 264;
1741  ATOM_USER_LIFECYCLE_EVENT_OCCURRED = 265;
1742  ATOM_ACCESSIBILITY_SHORTCUT_REPORTED = 266;
1743  ATOM_ACCESSIBILITY_SERVICE_REPORTED = 267;
1744  ATOM_DOCS_UI_DRAG_AND_DROP_REPORTED = 268;
1745  ATOM_APP_USAGE_EVENT_OCCURRED = 269;
1746  ATOM_AUTO_REVOKE_NOTIFICATION_CLICKED = 270;
1747  ATOM_AUTO_REVOKE_FRAGMENT_APP_VIEWED = 271;
1748  ATOM_AUTO_REVOKED_APP_INTERACTION = 272;
1749  ATOM_APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION = 273;
1750  ATOM_EVS_USAGE_STATS_REPORTED = 274;
1751  ATOM_AUDIO_POWER_USAGE_DATA_REPORTED = 275;
1752  ATOM_TV_TUNER_STATE_CHANGED = 276;
1753  ATOM_MEDIAOUTPUT_OP_SWITCH_REPORTED = 277;
1754  ATOM_CB_MESSAGE_FILTERED = 278;
1755  ATOM_TV_TUNER_DVR_STATUS = 279;
1756  ATOM_TV_CAS_SESSION_OPEN_STATUS = 280;
1757  ATOM_ASSISTANT_INVOCATION_REPORTED = 281;
1758  ATOM_DISPLAY_WAKE_REPORTED = 282;
1759  ATOM_CAR_USER_HAL_MODIFY_USER_REQUEST_REPORTED = 283;
1760  ATOM_CAR_USER_HAL_MODIFY_USER_RESPONSE_REPORTED = 284;
1761  ATOM_CAR_USER_HAL_POST_SWITCH_RESPONSE_REPORTED = 285;
1762  ATOM_CAR_USER_HAL_INITIAL_USER_INFO_REQUEST_REPORTED = 286;
1763  ATOM_CAR_USER_HAL_INITIAL_USER_INFO_RESPONSE_REPORTED = 287;
1764  ATOM_CAR_USER_HAL_USER_ASSOCIATION_REQUEST_REPORTED = 288;
1765  ATOM_CAR_USER_HAL_SET_USER_ASSOCIATION_RESPONSE_REPORTED = 289;
1766  ATOM_NETWORK_IP_PROVISIONING_REPORTED = 290;
1767  ATOM_NETWORK_DHCP_RENEW_REPORTED = 291;
1768  ATOM_NETWORK_VALIDATION_REPORTED = 292;
1769  ATOM_NETWORK_STACK_QUIRK_REPORTED = 293;
1770  ATOM_MEDIAMETRICS_AUDIORECORDDEVICEUSAGE_REPORTED = 294;
1771  ATOM_MEDIAMETRICS_AUDIOTHREADDEVICEUSAGE_REPORTED = 295;
1772  ATOM_MEDIAMETRICS_AUDIOTRACKDEVICEUSAGE_REPORTED = 296;
1773  ATOM_MEDIAMETRICS_AUDIODEVICECONNECTION_REPORTED = 297;
1774  ATOM_BLOB_COMMITTED = 298;
1775  ATOM_BLOB_LEASED = 299;
1776  ATOM_BLOB_OPENED = 300;
1777  ATOM_CONTACTS_PROVIDER_STATUS_REPORTED = 301;
1778  ATOM_KEYSTORE_KEY_EVENT_REPORTED = 302;
1779  ATOM_NETWORK_TETHERING_REPORTED = 303;
1780  ATOM_IME_TOUCH_REPORTED = 304;
1781  ATOM_UI_INTERACTION_FRAME_INFO_REPORTED = 305;
1782  ATOM_UI_ACTION_LATENCY_REPORTED = 306;
1783  ATOM_WIFI_DISCONNECT_REPORTED = 307;
1784  ATOM_WIFI_CONNECTION_STATE_CHANGED = 308;
1785  ATOM_HDMI_CEC_ACTIVE_SOURCE_CHANGED = 309;
1786  ATOM_HDMI_CEC_MESSAGE_REPORTED = 310;
1787  ATOM_AIRPLANE_MODE = 311;
1788  ATOM_MODEM_RESTART = 312;
1789  ATOM_CARRIER_ID_MISMATCH_REPORTED = 313;
1790  ATOM_CARRIER_ID_TABLE_UPDATED = 314;
1791  ATOM_DATA_STALL_RECOVERY_REPORTED = 315;
1792  ATOM_MEDIAMETRICS_MEDIAPARSER_REPORTED = 316;
1793  ATOM_TLS_HANDSHAKE_REPORTED = 317;
1794  ATOM_TEXT_CLASSIFIER_API_USAGE_REPORTED = 318;
1795  ATOM_CAR_WATCHDOG_KILL_STATS_REPORTED = 319;
1796  ATOM_MEDIAMETRICS_PLAYBACK_REPORTED = 320;
1797  ATOM_MEDIA_NETWORK_INFO_CHANGED = 321;
1798  ATOM_MEDIA_PLAYBACK_STATE_CHANGED = 322;
1799  ATOM_MEDIA_PLAYBACK_ERROR_REPORTED = 323;
1800  ATOM_MEDIA_PLAYBACK_TRACK_CHANGED = 324;
1801  ATOM_WIFI_SCAN_REPORTED = 325;
1802  ATOM_WIFI_PNO_SCAN_REPORTED = 326;
1803  ATOM_TIF_TUNE_CHANGED = 327;
1804  ATOM_AUTO_ROTATE_REPORTED = 328;
1805  ATOM_PERFETTO_TRIGGER = 329;
1806  ATOM_TRANSCODING_DATA = 330;
1807  ATOM_IMS_SERVICE_ENTITLEMENT_UPDATED = 331;
1808  ATOM_ART_DATUM_REPORTED = 332;
1809  ATOM_DEVICE_ROTATED = 333;
1810  ATOM_SIM_SPECIFIC_SETTINGS_RESTORED = 334;
1811  ATOM_TEXT_CLASSIFIER_DOWNLOAD_REPORTED = 335;
1812  ATOM_PIN_STORAGE_EVENT = 336;
1813  ATOM_FACE_DOWN_REPORTED = 337;
1814  ATOM_BLUETOOTH_HAL_CRASH_REASON_REPORTED = 338;
1815  ATOM_REBOOT_ESCROW_PREPARATION_REPORTED = 339;
1816  ATOM_REBOOT_ESCROW_LSKF_CAPTURE_REPORTED = 340;
1817  ATOM_REBOOT_ESCROW_REBOOT_REPORTED = 341;
1818  ATOM_BINDER_LATENCY_REPORTED = 342;
1819  ATOM_MEDIAMETRICS_AAUDIOSTREAM_REPORTED = 343;
1820  ATOM_MEDIA_TRANSCODING_SESSION_ENDED = 344;
1821  ATOM_MAGNIFICATION_USAGE_REPORTED = 345;
1822  ATOM_MAGNIFICATION_MODE_WITH_IME_ON_REPORTED = 346;
1823  ATOM_APP_SEARCH_CALL_STATS_REPORTED = 347;
1824  ATOM_APP_SEARCH_PUT_DOCUMENT_STATS_REPORTED = 348;
1825  ATOM_DEVICE_CONTROL_CHANGED = 349;
1826  ATOM_DEVICE_STATE_CHANGED = 350;
1827  ATOM_INPUTDEVICE_REGISTERED = 351;
1828  ATOM_SMARTSPACE_CARD_REPORTED = 352;
1829  ATOM_AUTH_PROMPT_AUTHENTICATE_INVOKED = 353;
1830  ATOM_AUTH_MANAGER_CAN_AUTHENTICATE_INVOKED = 354;
1831  ATOM_AUTH_ENROLL_ACTION_INVOKED = 355;
1832  ATOM_AUTH_DEPRECATED_API_USED = 356;
1833  ATOM_UNATTENDED_REBOOT_OCCURRED = 357;
1834  ATOM_LONG_REBOOT_BLOCKING_REPORTED = 358;
1835  ATOM_LOCATION_TIME_ZONE_PROVIDER_STATE_CHANGED = 359;
1836  ATOM_FDTRACK_EVENT_OCCURRED = 364;
1837  ATOM_TIMEOUT_AUTO_EXTENDED_REPORTED = 365;
1838  ATOM_ODREFRESH_REPORTED = 366;
1839  ATOM_ALARM_BATCH_DELIVERED = 367;
1840  ATOM_ALARM_SCHEDULED = 368;
1841  ATOM_CAR_WATCHDOG_IO_OVERUSE_STATS_REPORTED = 369;
1842  ATOM_USER_LEVEL_HIBERNATION_STATE_CHANGED = 370;
1843  ATOM_APP_SEARCH_INITIALIZE_STATS_REPORTED = 371;
1844  ATOM_APP_SEARCH_QUERY_STATS_REPORTED = 372;
1845  ATOM_APP_PROCESS_DIED = 373;
1846  ATOM_NETWORK_IP_REACHABILITY_MONITOR_REPORTED = 374;
1847  ATOM_SLOW_INPUT_EVENT_REPORTED = 375;
1848  ATOM_ANR_OCCURRED_PROCESSING_STARTED = 376;
1849  ATOM_APP_SEARCH_REMOVE_STATS_REPORTED = 377;
1850  ATOM_MEDIA_CODEC_REPORTED = 378;
1851  ATOM_PERMISSION_USAGE_FRAGMENT_INTERACTION = 379;
1852  ATOM_PERMISSION_DETAILS_INTERACTION = 380;
1853  ATOM_PRIVACY_SENSOR_TOGGLE_INTERACTION = 381;
1854  ATOM_PRIVACY_TOGGLE_DIALOG_INTERACTION = 382;
1855  ATOM_APP_SEARCH_OPTIMIZE_STATS_REPORTED = 383;
1856  ATOM_NON_A11Y_TOOL_SERVICE_WARNING_REPORT = 384;
1857  ATOM_APP_SEARCH_SET_SCHEMA_STATS_REPORTED = 385;
1858  ATOM_APP_COMPAT_STATE_CHANGED = 386;
1859  ATOM_SIZE_COMPAT_RESTART_BUTTON_EVENT_REPORTED = 387;
1860  ATOM_SPLITSCREEN_UI_CHANGED = 388;
1861  ATOM_NETWORK_DNS_HANDSHAKE_REPORTED = 389;
1862  ATOM_BLUETOOTH_CODE_PATH_COUNTER = 390;
1863  ATOM_BLUETOOTH_LE_BATCH_SCAN_REPORT_DELAY = 392;
1864  ATOM_ACCESSIBILITY_FLOATING_MENU_UI_CHANGED = 393;
1865  ATOM_NEURALNETWORKS_COMPILATION_COMPLETED = 394;
1866  ATOM_NEURALNETWORKS_EXECUTION_COMPLETED = 395;
1867  ATOM_NEURALNETWORKS_COMPILATION_FAILED = 396;
1868  ATOM_NEURALNETWORKS_EXECUTION_FAILED = 397;
1869  ATOM_CONTEXT_HUB_BOOTED = 398;
1870  ATOM_CONTEXT_HUB_RESTARTED = 399;
1871  ATOM_CONTEXT_HUB_LOADED_NANOAPP_SNAPSHOT_REPORTED = 400;
1872  ATOM_CHRE_CODE_DOWNLOAD_TRANSACTED = 401;
1873  ATOM_UWB_SESSION_INITED = 402;
1874  ATOM_UWB_SESSION_CLOSED = 403;
1875  ATOM_UWB_FIRST_RANGING_RECEIVED = 404;
1876  ATOM_UWB_RANGING_MEASUREMENT_RECEIVED = 405;
1877  ATOM_TEXT_CLASSIFIER_DOWNLOAD_WORK_SCHEDULED = 406;
1878  ATOM_TEXT_CLASSIFIER_DOWNLOAD_WORK_COMPLETED = 407;
1879  ATOM_CLIPBOARD_CLEARED = 408;
1880  ATOM_VM_CREATION_REQUESTED = 409;
1881  ATOM_NEARBY_DEVICE_SCAN_STATE_CHANGED = 410;
1882  ATOM_CAMERA_COMPAT_CONTROL_EVENT_REPORTED = 411;
1883  ATOM_APPLICATION_LOCALES_CHANGED = 412;
1884  ATOM_MEDIAMETRICS_AUDIOTRACKSTATUS_REPORTED = 413;
1885  ATOM_FOLD_STATE_DURATION_REPORTED = 414;
1886  ATOM_LOCATION_TIME_ZONE_PROVIDER_CONTROLLER_STATE_CHANGED = 415;
1887  ATOM_DISPLAY_HBM_STATE_CHANGED = 416;
1888  ATOM_DISPLAY_HBM_BRIGHTNESS_CHANGED = 417;
1889  ATOM_PERSISTENT_URI_PERMISSIONS_FLUSHED = 418;
1890  ATOM_EARLY_BOOT_COMP_OS_ARTIFACTS_CHECK_REPORTED = 419;
1891  ATOM_VBMETA_DIGEST_REPORTED = 420;
1892  ATOM_APEX_INFO_GATHERED = 421;
1893  ATOM_PVM_INFO_GATHERED = 422;
1894  ATOM_WEAR_SETTINGS_UI_INTERACTED = 423;
1895  ATOM_TRACING_SERVICE_REPORT_EVENT = 424;
1896  ATOM_MEDIAMETRICS_AUDIORECORDSTATUS_REPORTED = 425;
1897  ATOM_LAUNCHER_LATENCY = 426;
1898  ATOM_DROPBOX_ENTRY_DROPPED = 427;
1899  ATOM_WIFI_P2P_CONNECTION_REPORTED = 428;
1900  ATOM_GAME_STATE_CHANGED = 429;
1901  ATOM_HOTWORD_DETECTOR_CREATE_REQUESTED = 430;
1902  ATOM_HOTWORD_DETECTION_SERVICE_INIT_RESULT_REPORTED = 431;
1903  ATOM_HOTWORD_DETECTION_SERVICE_RESTARTED = 432;
1904  ATOM_HOTWORD_DETECTOR_KEYPHRASE_TRIGGERED = 433;
1905  ATOM_HOTWORD_DETECTOR_EVENTS = 434;
1906  ATOM_BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED = 437;
1907  ATOM_CONTACTS_INDEXER_UPDATE_STATS_REPORTED = 440;
1908  ATOM_APP_BACKGROUND_RESTRICTIONS_INFO = 441;
1909  ATOM_MMS_SMS_PROVIDER_GET_THREAD_ID_FAILED = 442;
1910  ATOM_MMS_SMS_DATABASE_HELPER_ON_UPGRADE_FAILED = 443;
1911  ATOM_PERMISSION_REMINDER_NOTIFICATION_INTERACTED = 444;
1912  ATOM_RECENT_PERMISSION_DECISIONS_INTERACTED = 445;
1913  ATOM_GNSS_PSDS_DOWNLOAD_REPORTED = 446;
1914  ATOM_LE_AUDIO_CONNECTION_SESSION_REPORTED = 447;
1915  ATOM_LE_AUDIO_BROADCAST_SESSION_REPORTED = 448;
1916  ATOM_DREAM_UI_EVENT_REPORTED = 449;
1917  ATOM_TASK_MANAGER_EVENT_REPORTED = 450;
1918  ATOM_CDM_ASSOCIATION_ACTION = 451;
1919  ATOM_MAGNIFICATION_TRIPLE_TAP_AND_HOLD_ACTIVATED_SESSION_REPORTED = 452;
1920  ATOM_MAGNIFICATION_FOLLOW_TYPING_FOCUS_ACTIVATED_SESSION_REPORTED = 453;
1921  ATOM_ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED = 454;
1922  ATOM_WIFI_SETUP_FAILURE_CRASH_REPORTED = 455;
1923  ATOM_UWB_DEVICE_ERROR_REPORTED = 456;
1924  ATOM_ISOLATED_COMPILATION_SCHEDULED = 457;
1925  ATOM_ISOLATED_COMPILATION_ENDED = 458;
1926  ATOM_ONS_OPPORTUNISTIC_ESIM_PROVISIONING_COMPLETE = 459;
1927  ATOM_TELEPHONY_ANOMALY_DETECTED = 461;
1928  ATOM_LETTERBOX_POSITION_CHANGED = 462;
1929  ATOM_REMOTE_KEY_PROVISIONING_ATTEMPT = 463;
1930  ATOM_REMOTE_KEY_PROVISIONING_NETWORK_INFO = 464;
1931  ATOM_REMOTE_KEY_PROVISIONING_TIMING = 465;
1932  ATOM_MEDIAOUTPUT_OP_INTERACTION_REPORT = 466;
1933  ATOM_BACKGROUND_DEXOPT_JOB_ENDED = 467;
1934  ATOM_SYNC_EXEMPTION_OCCURRED = 468;
1935  ATOM_AUTOFILL_PRESENTATION_EVENT_REPORTED = 469;
1936  ATOM_DOCK_STATE_CHANGED = 470;
1937  ATOM_BROADCAST_DELIVERY_EVENT_REPORTED = 475;
1938  ATOM_SERVICE_REQUEST_EVENT_REPORTED = 476;
1939  ATOM_PROVIDER_ACQUISITION_EVENT_REPORTED = 477;
1940  ATOM_BLUETOOTH_DEVICE_NAME_REPORTED = 478;
1941  ATOM_VIBRATION_REPORTED = 487;
1942  ATOM_UWB_RANGING_START = 489;
1943  ATOM_DISPLAY_BRIGHTNESS_CHANGED = 494;
1944  ATOM_ACTIVITY_ACTION_BLOCKED = 495;
1945  ATOM_NETWORK_DNS_SERVER_SUPPORT_REPORTED = 504;
1946  ATOM_VM_BOOTED = 505;
1947  ATOM_VM_EXITED = 506;
1948  ATOM_AMBIENT_BRIGHTNESS_STATS_REPORTED = 507;
1949  ATOM_MEDIAMETRICS_SPATIALIZERCAPABILITIES_REPORTED = 508;
1950  ATOM_MEDIAMETRICS_SPATIALIZERDEVICEENABLED_REPORTED = 509;
1951  ATOM_MEDIAMETRICS_HEADTRACKERDEVICEENABLED_REPORTED = 510;
1952  ATOM_MEDIAMETRICS_HEADTRACKERDEVICESUPPORTED_REPORTED = 511;
1953  ATOM_HEARING_AID_INFO_REPORTED = 513;
1954  ATOM_DEVICE_WIDE_JOB_CONSTRAINT_CHANGED = 514;
1955  ATOM_IWLAN_SETUP_DATA_CALL_RESULT_REPORTED = 519;
1956  ATOM_IWLAN_PDN_DISCONNECTED_REASON_REPORTED = 520;
1957  ATOM_AIRPLANE_MODE_SESSION_REPORTED = 521;
1958  ATOM_VM_CPU_STATUS_REPORTED = 522;
1959  ATOM_VM_MEM_STATUS_REPORTED = 523;
1960  ATOM_DEFAULT_NETWORK_REMATCH_INFO = 525;
1961  ATOM_NETWORK_SELECTION_PERFORMANCE = 526;
1962  ATOM_NETWORK_NSD_REPORTED = 527;
1963  ATOM_BLUETOOTH_DISCONNECTION_REASON_REPORTED = 529;
1964  ATOM_BLUETOOTH_LOCAL_VERSIONS_REPORTED = 530;
1965  ATOM_BLUETOOTH_REMOTE_SUPPORTED_FEATURES_REPORTED = 531;
1966  ATOM_BLUETOOTH_LOCAL_SUPPORTED_FEATURES_REPORTED = 532;
1967  ATOM_BLUETOOTH_GATT_APP_INFO = 533;
1968  ATOM_BRIGHTNESS_CONFIGURATION_UPDATED = 534;
1969  ATOM_LAUNCHER_IMPRESSION_EVENT = 547;
1970  ATOM_ODSIGN_REPORTED = 548;
1971  ATOM_ART_DEVICE_DATUM_REPORTED = 550;
1972  ATOM_NETWORK_SLICE_SESSION_ENDED = 558;
1973  ATOM_NETWORK_SLICE_DAILY_DATA_USAGE_REPORTED = 559;
1974  ATOM_NFC_TAG_TYPE_OCCURRED = 560;
1975  ATOM_NFC_AID_CONFLICT_OCCURRED = 561;
1976  ATOM_NFC_READER_CONFLICT_OCCURRED = 562;
1977  ATOM_ART_DATUM_DELTA_REPORTED = 565;
1978  ATOM_MEDIA_DRM_CREATED = 568;
1979  ATOM_MEDIA_DRM_ERRORED = 569;
1980  ATOM_MEDIA_DRM_SESSION_OPENED = 570;
1981  ATOM_MEDIA_DRM_SESSION_CLOSED = 571;
1982  ATOM_PERFORMANCE_HINT_SESSION_REPORTED = 574;
1983  ATOM_HOTWORD_AUDIO_EGRESS_EVENT_REPORTED = 578;
1984  ATOM_NETWORK_VALIDATION_FAILURE_STATS_DAILY_REPORTED = 601;
1985  ATOM_WIFI_BYTES_TRANSFER = 10000;
1986  ATOM_WIFI_BYTES_TRANSFER_BY_FG_BG = 10001;
1987  ATOM_MOBILE_BYTES_TRANSFER = 10002;
1988  ATOM_MOBILE_BYTES_TRANSFER_BY_FG_BG = 10003;
1989  ATOM_BLUETOOTH_BYTES_TRANSFER = 10006;
1990  ATOM_KERNEL_WAKELOCK = 10004;
1991  ATOM_SUBSYSTEM_SLEEP_STATE = 10005;
1992  ATOM_CPU_TIME_PER_UID = 10009;
1993  ATOM_CPU_TIME_PER_UID_FREQ = 10010;
1994  ATOM_WIFI_ACTIVITY_INFO = 10011;
1995  ATOM_MODEM_ACTIVITY_INFO = 10012;
1996  ATOM_BLUETOOTH_ACTIVITY_INFO = 10007;
1997  ATOM_PROCESS_MEMORY_STATE = 10013;
1998  ATOM_SYSTEM_ELAPSED_REALTIME = 10014;
1999  ATOM_SYSTEM_UPTIME = 10015;
2000  ATOM_CPU_ACTIVE_TIME = 10016;
2001  ATOM_CPU_CLUSTER_TIME = 10017;
2002  ATOM_DISK_SPACE = 10018;
2003  ATOM_REMAINING_BATTERY_CAPACITY = 10019;
2004  ATOM_FULL_BATTERY_CAPACITY = 10020;
2005  ATOM_TEMPERATURE = 10021;
2006  ATOM_BINDER_CALLS = 10022;
2007  ATOM_BINDER_CALLS_EXCEPTIONS = 10023;
2008  ATOM_LOOPER_STATS = 10024;
2009  ATOM_DISK_STATS = 10025;
2010  ATOM_DIRECTORY_USAGE = 10026;
2011  ATOM_APP_SIZE = 10027;
2012  ATOM_CATEGORY_SIZE = 10028;
2013  ATOM_PROC_STATS = 10029;
2014  ATOM_BATTERY_VOLTAGE = 10030;
2015  ATOM_NUM_FINGERPRINTS_ENROLLED = 10031;
2016  ATOM_DISK_IO = 10032;
2017  ATOM_POWER_PROFILE = 10033;
2018  ATOM_PROC_STATS_PKG_PROC = 10034;
2019  ATOM_PROCESS_CPU_TIME = 10035;
2020  ATOM_CPU_TIME_PER_THREAD_FREQ = 10037;
2021  ATOM_ON_DEVICE_POWER_MEASUREMENT = 10038;
2022  ATOM_DEVICE_CALCULATED_POWER_USE = 10039;
2023  ATOM_PROCESS_MEMORY_HIGH_WATER_MARK = 10042;
2024  ATOM_BATTERY_LEVEL = 10043;
2025  ATOM_BUILD_INFORMATION = 10044;
2026  ATOM_BATTERY_CYCLE_COUNT = 10045;
2027  ATOM_DEBUG_ELAPSED_CLOCK = 10046;
2028  ATOM_DEBUG_FAILING_ELAPSED_CLOCK = 10047;
2029  ATOM_NUM_FACES_ENROLLED = 10048;
2030  ATOM_ROLE_HOLDER = 10049;
2031  ATOM_DANGEROUS_PERMISSION_STATE = 10050;
2032  ATOM_TRAIN_INFO = 10051;
2033  ATOM_TIME_ZONE_DATA_INFO = 10052;
2034  ATOM_EXTERNAL_STORAGE_INFO = 10053;
2035  ATOM_GPU_STATS_GLOBAL_INFO = 10054;
2036  ATOM_GPU_STATS_APP_INFO = 10055;
2037  ATOM_SYSTEM_ION_HEAP_SIZE = 10056;
2038  ATOM_APPS_ON_EXTERNAL_STORAGE_INFO = 10057;
2039  ATOM_FACE_SETTINGS = 10058;
2040  ATOM_COOLING_DEVICE = 10059;
2041  ATOM_APP_OPS = 10060;
2042  ATOM_PROCESS_SYSTEM_ION_HEAP_SIZE = 10061;
2043  ATOM_SURFACEFLINGER_STATS_GLOBAL_INFO = 10062;
2044  ATOM_SURFACEFLINGER_STATS_LAYER_INFO = 10063;
2045  ATOM_PROCESS_MEMORY_SNAPSHOT = 10064;
2046  ATOM_VMS_CLIENT_STATS = 10065;
2047  ATOM_NOTIFICATION_REMOTE_VIEWS = 10066;
2048  ATOM_DANGEROUS_PERMISSION_STATE_SAMPLED = 10067;
2049  ATOM_GRAPHICS_STATS = 10068;
2050  ATOM_RUNTIME_APP_OP_ACCESS = 10069;
2051  ATOM_ION_HEAP_SIZE = 10070;
2052  ATOM_PACKAGE_NOTIFICATION_PREFERENCES = 10071;
2053  ATOM_PACKAGE_NOTIFICATION_CHANNEL_PREFERENCES = 10072;
2054  ATOM_PACKAGE_NOTIFICATION_CHANNEL_GROUP_PREFERENCES = 10073;
2055  ATOM_GNSS_STATS = 10074;
2056  ATOM_ATTRIBUTED_APP_OPS = 10075;
2057  ATOM_VOICE_CALL_SESSION = 10076;
2058  ATOM_VOICE_CALL_RAT_USAGE = 10077;
2059  ATOM_SIM_SLOT_STATE = 10078;
2060  ATOM_SUPPORTED_RADIO_ACCESS_FAMILY = 10079;
2061  ATOM_SETTING_SNAPSHOT = 10080;
2062  ATOM_BLOB_INFO = 10081;
2063  ATOM_DATA_USAGE_BYTES_TRANSFER = 10082;
2064  ATOM_BYTES_TRANSFER_BY_TAG_AND_METERED = 10083;
2065  ATOM_DND_MODE_RULE = 10084;
2066  ATOM_GENERAL_EXTERNAL_STORAGE_ACCESS_STATS = 10085;
2067  ATOM_INCOMING_SMS = 10086;
2068  ATOM_OUTGOING_SMS = 10087;
2069  ATOM_CARRIER_ID_TABLE_VERSION = 10088;
2070  ATOM_DATA_CALL_SESSION = 10089;
2071  ATOM_CELLULAR_SERVICE_STATE = 10090;
2072  ATOM_CELLULAR_DATA_SERVICE_SWITCH = 10091;
2073  ATOM_SYSTEM_MEMORY = 10092;
2074  ATOM_IMS_REGISTRATION_TERMINATION = 10093;
2075  ATOM_IMS_REGISTRATION_STATS = 10094;
2076  ATOM_CPU_TIME_PER_CLUSTER_FREQ = 10095;
2077  ATOM_CPU_CYCLES_PER_UID_CLUSTER = 10096;
2078  ATOM_DEVICE_ROTATED_DATA = 10097;
2079  ATOM_CPU_CYCLES_PER_THREAD_GROUP_CLUSTER = 10098;
2080  ATOM_MEDIA_DRM_ACTIVITY_INFO = 10099;
2081  ATOM_OEM_MANAGED_BYTES_TRANSFER = 10100;
2082  ATOM_GNSS_POWER_STATS = 10101;
2083  ATOM_TIME_ZONE_DETECTOR_STATE = 10102;
2084  ATOM_KEYSTORE2_STORAGE_STATS = 10103;
2085  ATOM_RKP_POOL_STATS = 10104;
2086  ATOM_PROCESS_DMABUF_MEMORY = 10105;
2087  ATOM_PENDING_ALARM_INFO = 10106;
2088  ATOM_USER_LEVEL_HIBERNATED_APPS = 10107;
2089  ATOM_LAUNCHER_LAYOUT_SNAPSHOT = 10108;
2090  ATOM_GLOBAL_HIBERNATED_APPS = 10109;
2091  ATOM_INPUT_EVENT_LATENCY_SKETCH = 10110;
2092  ATOM_BATTERY_USAGE_STATS_BEFORE_RESET = 10111;
2093  ATOM_BATTERY_USAGE_STATS_SINCE_RESET = 10112;
2094  ATOM_BATTERY_USAGE_STATS_SINCE_RESET_USING_POWER_PROFILE_MODEL = 10113;
2095  ATOM_INSTALLED_INCREMENTAL_PACKAGE = 10114;
2096  ATOM_TELEPHONY_NETWORK_REQUESTS = 10115;
2097  ATOM_APP_SEARCH_STORAGE_INFO = 10116;
2098  ATOM_VMSTAT = 10117;
2099  ATOM_KEYSTORE2_KEY_CREATION_WITH_GENERAL_INFO = 10118;
2100  ATOM_KEYSTORE2_KEY_CREATION_WITH_AUTH_INFO = 10119;
2101  ATOM_KEYSTORE2_KEY_CREATION_WITH_PURPOSE_AND_MODES_INFO = 10120;
2102  ATOM_KEYSTORE2_ATOM_WITH_OVERFLOW = 10121;
2103  ATOM_KEYSTORE2_KEY_OPERATION_WITH_PURPOSE_AND_MODES_INFO = 10122;
2104  ATOM_KEYSTORE2_KEY_OPERATION_WITH_GENERAL_INFO = 10123;
2105  ATOM_RKP_ERROR_STATS = 10124;
2106  ATOM_KEYSTORE2_CRASH_STATS = 10125;
2107  ATOM_VENDOR_APEX_INFO = 10126;
2108  ATOM_ACCESSIBILITY_SHORTCUT_STATS = 10127;
2109  ATOM_ACCESSIBILITY_FLOATING_MENU_STATS = 10128;
2110  ATOM_DATA_USAGE_BYTES_TRANSFER_V2 = 10129;
2111  ATOM_MEDIA_CAPABILITIES = 10130;
2112  ATOM_CAR_WATCHDOG_SYSTEM_IO_USAGE_SUMMARY = 10131;
2113  ATOM_CAR_WATCHDOG_UID_IO_USAGE_SUMMARY = 10132;
2114  ATOM_IMS_REGISTRATION_FEATURE_TAG_STATS = 10133;
2115  ATOM_RCS_CLIENT_PROVISIONING_STATS = 10134;
2116  ATOM_RCS_ACS_PROVISIONING_STATS = 10135;
2117  ATOM_SIP_DELEGATE_STATS = 10136;
2118  ATOM_SIP_TRANSPORT_FEATURE_TAG_STATS = 10137;
2119  ATOM_SIP_MESSAGE_RESPONSE = 10138;
2120  ATOM_SIP_TRANSPORT_SESSION = 10139;
2121  ATOM_IMS_DEDICATED_BEARER_LISTENER_EVENT = 10140;
2122  ATOM_IMS_DEDICATED_BEARER_EVENT = 10141;
2123  ATOM_IMS_REGISTRATION_SERVICE_DESC_STATS = 10142;
2124  ATOM_UCE_EVENT_STATS = 10143;
2125  ATOM_PRESENCE_NOTIFY_EVENT = 10144;
2126  ATOM_GBA_EVENT = 10145;
2127  ATOM_PER_SIM_STATUS = 10146;
2128  ATOM_GPU_WORK_PER_UID = 10147;
2129  ATOM_PERSISTENT_URI_PERMISSIONS_AMOUNT_PER_PACKAGE = 10148;
2130  ATOM_SIGNED_PARTITION_INFO = 10149;
2131  ATOM_PINNED_FILE_SIZES_PER_PACKAGE = 10150;
2132  ATOM_PENDING_INTENTS_PER_PACKAGE = 10151;
2133  ATOM_USER_INFO = 10152;
2134  ATOM_TELEPHONY_NETWORK_REQUESTS_V2 = 10153;
2135  ATOM_DEVICE_TELEPHONY_PROPERTIES = 10154;
2136  ATOM_REMOTE_KEY_PROVISIONING_ERROR_COUNTS = 10155;
2137  ATOM_INCOMING_MMS = 10157;
2138  ATOM_OUTGOING_MMS = 10158;
2139  ATOM_MULTI_USER_INFO = 10160;
2140  ATOM_NETWORK_BPF_MAP_INFO = 10161;
2141  ATOM_CONNECTIVITY_STATE_SAMPLE = 10163;
2142  ATOM_NETWORK_SELECTION_REMATCH_REASONS_INFO = 10164;
2143  ATOM_NETWORK_SLICE_REQUEST_COUNT = 10168;
2144  ATOM_ADPF_SYSTEM_COMPONENT_INFO = 10173;
2145  ATOM_NOTIFICATION_MEMORY_USE = 10174;
2146}
2147// End of protos/perfetto/config/statsd/atom_ids.proto
2148
2149// Begin of protos/perfetto/config/statsd/statsd_tracing_config.proto
2150
2151// This file is named 'statsd_tracing_config.proto' rather than
2152// 'statsd_config.proto' (which would be more consistent with the other
2153// config protos) so it doesn't show up and confuse folks looking for
2154// the existing statsd_config.proto for configuring statsd itself.
2155// Same for the config proto itself.
2156message StatsdTracingConfig {
2157  // This is for the common case of the atom id being known in the enum AtomId.
2158  repeated AtomId push_atom_id = 1;
2159
2160  // Escape hatch for Atom IDs that are not yet in the AtomId enum
2161  // (e.g. non-upstream atoms that don't exist in AOSP).
2162  repeated int32 raw_push_atom_id = 2;
2163  repeated StatsdPullAtomConfig pull_config = 3;
2164}
2165
2166message StatsdPullAtomConfig {
2167  repeated AtomId pull_atom_id = 1;
2168  repeated int32 raw_pull_atom_id = 2;
2169
2170  optional int32 pull_frequency_ms = 3;
2171  repeated string packages = 4;
2172}
2173
2174// End of protos/perfetto/config/statsd/statsd_tracing_config.proto
2175
2176// Begin of protos/perfetto/common/sys_stats_counters.proto
2177
2178// When editing entries here remember also to update "sys_stats_counters.h" with
2179// the corresponding string definitions for the actual /proc files parser.
2180
2181// Counter definitions for Linux's /proc/meminfo.
2182enum MeminfoCounters {
2183  MEMINFO_UNSPECIFIED = 0;
2184  MEMINFO_MEM_TOTAL = 1;
2185  MEMINFO_MEM_FREE = 2;
2186  MEMINFO_MEM_AVAILABLE = 3;
2187  MEMINFO_BUFFERS = 4;
2188  MEMINFO_CACHED = 5;
2189  MEMINFO_SWAP_CACHED = 6;
2190  MEMINFO_ACTIVE = 7;
2191  MEMINFO_INACTIVE = 8;
2192  MEMINFO_ACTIVE_ANON = 9;
2193  MEMINFO_INACTIVE_ANON = 10;
2194  MEMINFO_ACTIVE_FILE = 11;
2195  MEMINFO_INACTIVE_FILE = 12;
2196  MEMINFO_UNEVICTABLE = 13;
2197  MEMINFO_MLOCKED = 14;
2198  MEMINFO_SWAP_TOTAL = 15;
2199  MEMINFO_SWAP_FREE = 16;
2200  MEMINFO_DIRTY = 17;
2201  MEMINFO_WRITEBACK = 18;
2202  MEMINFO_ANON_PAGES = 19;
2203  MEMINFO_MAPPED = 20;
2204  MEMINFO_SHMEM = 21;
2205  MEMINFO_SLAB = 22;
2206  MEMINFO_SLAB_RECLAIMABLE = 23;
2207  MEMINFO_SLAB_UNRECLAIMABLE = 24;
2208  MEMINFO_KERNEL_STACK = 25;
2209  MEMINFO_PAGE_TABLES = 26;
2210  MEMINFO_COMMIT_LIMIT = 27;
2211  MEMINFO_COMMITED_AS = 28;
2212  MEMINFO_VMALLOC_TOTAL = 29;
2213  MEMINFO_VMALLOC_USED = 30;
2214  MEMINFO_VMALLOC_CHUNK = 31;
2215  MEMINFO_CMA_TOTAL = 32;
2216  MEMINFO_CMA_FREE = 33;
2217}
2218
2219// Counter definitions for Linux's /proc/vmstat.
2220enum VmstatCounters {
2221  VMSTAT_UNSPECIFIED = 0;
2222  VMSTAT_NR_FREE_PAGES = 1;
2223  VMSTAT_NR_ALLOC_BATCH = 2;
2224  VMSTAT_NR_INACTIVE_ANON = 3;
2225  VMSTAT_NR_ACTIVE_ANON = 4;
2226  VMSTAT_NR_INACTIVE_FILE = 5;
2227  VMSTAT_NR_ACTIVE_FILE = 6;
2228  VMSTAT_NR_UNEVICTABLE = 7;
2229  VMSTAT_NR_MLOCK = 8;
2230  VMSTAT_NR_ANON_PAGES = 9;
2231  VMSTAT_NR_MAPPED = 10;
2232  VMSTAT_NR_FILE_PAGES = 11;
2233  VMSTAT_NR_DIRTY = 12;
2234  VMSTAT_NR_WRITEBACK = 13;
2235  VMSTAT_NR_SLAB_RECLAIMABLE = 14;
2236  VMSTAT_NR_SLAB_UNRECLAIMABLE = 15;
2237  VMSTAT_NR_PAGE_TABLE_PAGES = 16;
2238  VMSTAT_NR_KERNEL_STACK = 17;
2239  VMSTAT_NR_OVERHEAD = 18;
2240  VMSTAT_NR_UNSTABLE = 19;
2241  VMSTAT_NR_BOUNCE = 20;
2242  VMSTAT_NR_VMSCAN_WRITE = 21;
2243  VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22;
2244  VMSTAT_NR_WRITEBACK_TEMP = 23;
2245  VMSTAT_NR_ISOLATED_ANON = 24;
2246  VMSTAT_NR_ISOLATED_FILE = 25;
2247  VMSTAT_NR_SHMEM = 26;
2248  VMSTAT_NR_DIRTIED = 27;
2249  VMSTAT_NR_WRITTEN = 28;
2250  VMSTAT_NR_PAGES_SCANNED = 29;
2251  VMSTAT_WORKINGSET_REFAULT = 30;
2252  VMSTAT_WORKINGSET_ACTIVATE = 31;
2253  VMSTAT_WORKINGSET_NODERECLAIM = 32;
2254  VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33;
2255  VMSTAT_NR_FREE_CMA = 34;
2256  VMSTAT_NR_SWAPCACHE = 35;
2257  VMSTAT_NR_DIRTY_THRESHOLD = 36;
2258  VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37;
2259  VMSTAT_PGPGIN = 38;
2260  VMSTAT_PGPGOUT = 39;
2261  VMSTAT_PGPGOUTCLEAN = 40;
2262  VMSTAT_PSWPIN = 41;
2263  VMSTAT_PSWPOUT = 42;
2264  VMSTAT_PGALLOC_DMA = 43;
2265  VMSTAT_PGALLOC_NORMAL = 44;
2266  VMSTAT_PGALLOC_MOVABLE = 45;
2267  VMSTAT_PGFREE = 46;
2268  VMSTAT_PGACTIVATE = 47;
2269  VMSTAT_PGDEACTIVATE = 48;
2270  VMSTAT_PGFAULT = 49;
2271  VMSTAT_PGMAJFAULT = 50;
2272  VMSTAT_PGREFILL_DMA = 51;
2273  VMSTAT_PGREFILL_NORMAL = 52;
2274  VMSTAT_PGREFILL_MOVABLE = 53;
2275  VMSTAT_PGSTEAL_KSWAPD_DMA = 54;
2276  VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55;
2277  VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56;
2278  VMSTAT_PGSTEAL_DIRECT_DMA = 57;
2279  VMSTAT_PGSTEAL_DIRECT_NORMAL = 58;
2280  VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59;
2281  VMSTAT_PGSCAN_KSWAPD_DMA = 60;
2282  VMSTAT_PGSCAN_KSWAPD_NORMAL = 61;
2283  VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62;
2284  VMSTAT_PGSCAN_DIRECT_DMA = 63;
2285  VMSTAT_PGSCAN_DIRECT_NORMAL = 64;
2286  VMSTAT_PGSCAN_DIRECT_MOVABLE = 65;
2287  VMSTAT_PGSCAN_DIRECT_THROTTLE = 66;
2288  VMSTAT_PGINODESTEAL = 67;
2289  VMSTAT_SLABS_SCANNED = 68;
2290  VMSTAT_KSWAPD_INODESTEAL = 69;
2291  VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70;
2292  VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71;
2293  VMSTAT_PAGEOUTRUN = 72;
2294  VMSTAT_ALLOCSTALL = 73;
2295  VMSTAT_PGROTATED = 74;
2296  VMSTAT_DROP_PAGECACHE = 75;
2297  VMSTAT_DROP_SLAB = 76;
2298  VMSTAT_PGMIGRATE_SUCCESS = 77;
2299  VMSTAT_PGMIGRATE_FAIL = 78;
2300  VMSTAT_COMPACT_MIGRATE_SCANNED = 79;
2301  VMSTAT_COMPACT_FREE_SCANNED = 80;
2302  VMSTAT_COMPACT_ISOLATED = 81;
2303  VMSTAT_COMPACT_STALL = 82;
2304  VMSTAT_COMPACT_FAIL = 83;
2305  VMSTAT_COMPACT_SUCCESS = 84;
2306  VMSTAT_COMPACT_DAEMON_WAKE = 85;
2307  VMSTAT_UNEVICTABLE_PGS_CULLED = 86;
2308  VMSTAT_UNEVICTABLE_PGS_SCANNED = 87;
2309  VMSTAT_UNEVICTABLE_PGS_RESCUED = 88;
2310  VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89;
2311  VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90;
2312  VMSTAT_UNEVICTABLE_PGS_CLEARED = 91;
2313  VMSTAT_UNEVICTABLE_PGS_STRANDED = 92;
2314  VMSTAT_NR_ZSPAGES = 93;
2315  VMSTAT_NR_ION_HEAP = 94;
2316  VMSTAT_NR_GPU_HEAP = 95;
2317  VMSTAT_ALLOCSTALL_DMA = 96;
2318  VMSTAT_ALLOCSTALL_MOVABLE = 97;
2319  VMSTAT_ALLOCSTALL_NORMAL = 98;
2320  VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99;
2321  VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100;
2322  VMSTAT_NR_FASTRPC = 101;
2323  VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102;
2324  VMSTAT_NR_ION_HEAP_POOL = 103;
2325  VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104;
2326  VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105;
2327  VMSTAT_NR_SHMEM_HUGEPAGES = 106;
2328  VMSTAT_NR_SHMEM_PMDMAPPED = 107;
2329  VMSTAT_NR_UNRECLAIMABLE_PAGES = 108;
2330  VMSTAT_NR_ZONE_ACTIVE_ANON = 109;
2331  VMSTAT_NR_ZONE_ACTIVE_FILE = 110;
2332  VMSTAT_NR_ZONE_INACTIVE_ANON = 111;
2333  VMSTAT_NR_ZONE_INACTIVE_FILE = 112;
2334  VMSTAT_NR_ZONE_UNEVICTABLE = 113;
2335  VMSTAT_NR_ZONE_WRITE_PENDING = 114;
2336  VMSTAT_OOM_KILL = 115;
2337  VMSTAT_PGLAZYFREE = 116;
2338  VMSTAT_PGLAZYFREED = 117;
2339  VMSTAT_PGREFILL = 118;
2340  VMSTAT_PGSCAN_DIRECT = 119;
2341  VMSTAT_PGSCAN_KSWAPD = 120;
2342  VMSTAT_PGSKIP_DMA = 121;
2343  VMSTAT_PGSKIP_MOVABLE = 122;
2344  VMSTAT_PGSKIP_NORMAL = 123;
2345  VMSTAT_PGSTEAL_DIRECT = 124;
2346  VMSTAT_PGSTEAL_KSWAPD = 125;
2347  VMSTAT_SWAP_RA = 126;
2348  VMSTAT_SWAP_RA_HIT = 127;
2349  VMSTAT_WORKINGSET_RESTORE = 128;
2350}
2351// End of protos/perfetto/common/sys_stats_counters.proto
2352
2353// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto
2354
2355// This file defines the configuration for the Linux /proc poller data source,
2356// which injects counters in the trace.
2357// Counters that are needed in the trace must be explicitly listed in the
2358// *_counters fields. This is to avoid spamming the trace with all counters
2359// at all times.
2360// The sampling rate is configurable. All polling rates (*_period_ms) need
2361// to be integer multiples of each other.
2362// OK:     [10ms, 10ms, 10ms],  [10ms, 20ms, 10ms],  [10ms, 20ms, 60ms]
2363// Not OK: [10ms, 10ms, 11ms],  [10ms, 15ms, 20ms]
2364message SysStatsConfig {
2365  // Polls /proc/meminfo every X ms, if non-zero.
2366  // This is required to be > 10ms to avoid excessive CPU usage.
2367  // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
2368  optional uint32 meminfo_period_ms = 1;
2369
2370  // If empty all known counters are reported. Otherwise, only the counters
2371  // specified below are reported.
2372  repeated MeminfoCounters meminfo_counters = 2;
2373
2374  // Polls /proc/vmstat every X ms, if non-zero.
2375  // This is required to be > 10ms to avoid excessive CPU usage.
2376  // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
2377  optional uint32 vmstat_period_ms = 3;
2378  repeated VmstatCounters vmstat_counters = 4;
2379
2380  // Pols /proc/stat every X ms, if non-zero.
2381  // This is required to be > 10ms to avoid excessive CPU usage.
2382  // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
2383  optional uint32 stat_period_ms = 5;
2384  enum StatCounters {
2385    STAT_UNSPECIFIED = 0;
2386    STAT_CPU_TIMES = 1;
2387    STAT_IRQ_COUNTS = 2;
2388    STAT_SOFTIRQ_COUNTS = 3;
2389    STAT_FORK_COUNT = 4;
2390  }
2391  repeated StatCounters stat_counters = 6;
2392
2393  // Polls /sys/devfreq/*/curfreq every X ms, if non-zero.
2394  // This is required to be > 10ms to avoid excessive CPU usage.
2395  // This option can be used to record unchanging values.
2396  // Updates from frequency changes can come from ftrace/set_clock_rate.
2397  optional uint32 devfreq_period_ms = 7;
2398
2399  // Polls /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq every X ms.
2400  // This is required to be > 10ms to avoid excessive CPU usage.
2401  optional uint32 cpufreq_period_ms = 8;
2402
2403  // Polls /proc/buddyinfo every X ms, if non-zero.
2404  // This is required to be > 10ms to avoid excessive CPU usage.
2405  optional uint32 buddyinfo_period_ms = 9;
2406
2407  // Polls /proc/diskstats every X ms, if non-zero.
2408  // This is required to be > 10ms to avoid excessive CPU usage.
2409  optional uint32 diskstat_period_ms = 10;
2410}
2411
2412// End of protos/perfetto/config/sys_stats/sys_stats_config.proto
2413
2414// Begin of protos/perfetto/config/system_info/system_info.proto
2415
2416// This data-source does a one-off recording of system information when
2417// the trace starts.
2418// Currently this includes:
2419// - Values of
2420// /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies This
2421// datasource has no configuration options at present.
2422message SystemInfoConfig {}
2423
2424// End of protos/perfetto/config/system_info/system_info.proto
2425
2426// Begin of protos/perfetto/config/test_config.proto
2427
2428// The configuration for a fake producer used in tests.
2429message TestConfig {
2430  message DummyFields {
2431    optional uint32 field_uint32 = 1;
2432    optional int32 field_int32 = 2;
2433    optional uint64 field_uint64 = 3;
2434    optional int64 field_int64 = 4;
2435    optional fixed64 field_fixed64 = 5;
2436    optional sfixed64 field_sfixed64 = 6;
2437    optional fixed32 field_fixed32 = 7;
2438    optional sfixed32 field_sfixed32 = 8;
2439    optional double field_double = 9;
2440    optional float field_float = 10;
2441    optional sint64 field_sint64 = 11;
2442    optional sint32 field_sint32 = 12;
2443    optional string field_string = 13;
2444    optional bytes field_bytes = 14;
2445  }
2446
2447  // The number of messages the fake producer should send.
2448  optional uint32 message_count = 1;
2449
2450  // The maximum number of messages which should be sent each second.
2451  // The actual obserced speed may be lower if the producer is unable to
2452  // work fast enough.
2453  // If this is zero or unset, the producer will send as fast as possible.
2454  optional uint32 max_messages_per_second = 2;
2455
2456  // The seed value for a simple multiplicative congruential pseudo-random
2457  // number sequence.
2458  optional uint32 seed = 3;
2459
2460  // The size of each message in bytes. Should be greater than or equal 5 to
2461  // account for the number of bytes needed to encode the random number and a
2462  // null byte for the string.
2463  optional uint32 message_size = 4;
2464
2465  // Whether the producer should send a event batch when the data source is
2466  // is initially registered.
2467  optional bool send_batch_on_register = 5;
2468
2469  optional DummyFields dummy_fields = 6;
2470}
2471
2472// End of protos/perfetto/config/test_config.proto
2473
2474// Begin of protos/perfetto/config/track_event/track_event_config.proto
2475
2476message TrackEventConfig {
2477  // The following fields define the set of enabled trace categories. Each list
2478  // item is a glob.
2479  //
2480  // To determine if category is enabled, it is checked against the filters in
2481  // the following order:
2482  //
2483  //   1. Exact matches in enabled categories.
2484  //   2. Exact matches in enabled tags.
2485  //   3. Exact matches in disabled categories.
2486  //   4. Exact matches in disabled tags.
2487  //   5. Pattern matches in enabled categories.
2488  //   6. Pattern matches in enabled tags.
2489  //   7. Pattern matches in disabled categories.
2490  //   8. Pattern matches in disabled tags.
2491  //
2492  // If none of the steps produced a match, the category is enabled by default.
2493  //
2494  // Examples:
2495  //
2496  //  - To enable all non-slow/debug categories:
2497  //
2498  //       No configuration needed, happens by default.
2499  //
2500  //  - To enable a specific category:
2501  //
2502  //       disabled_categories = ["*"]
2503  //       enabled_categories = ["my_category"]
2504  //
2505  //  - To enable only categories with a specific tag:
2506  //
2507  //       disabled_tags = ["*"]
2508  //       enabled_tags = ["my_tag"]
2509  //
2510
2511  // Default: []
2512  repeated string disabled_categories = 1;
2513
2514  // Default: []
2515  repeated string enabled_categories = 2;
2516
2517  // Default: ["slow", "debug"]
2518  repeated string disabled_tags = 3;
2519
2520  // Default: []
2521  repeated string enabled_tags = 4;
2522
2523  // Default: false (i.e. enabled by default)
2524  optional bool disable_incremental_timestamps = 5;
2525
2526  // Allows to specify a custom unit different than the default (ns).
2527  // Also affects thread timestamps if enable_thread_time_sampling = true.
2528  // A multiplier of 1000 means that a timestamp = 3 should be interpreted as
2529  // 3000 ns = 3 us.
2530  // Default: 1 (if unset, it should be read as 1).
2531  optional uint64 timestamp_unit_multiplier = 6;
2532
2533  // Default: false (i.e. debug_annotations is NOT filtered out by default)
2534  // When true, any debug annotations provided as arguments to the
2535  // TRACE_EVENT macros are not written into the trace. Typed arguments will
2536  // still be emitted even if set to true.
2537  optional bool filter_debug_annotations = 7;
2538
2539  // Default : false (i.e. disabled)
2540  // When true, the SDK samples and emits the current thread time counter value
2541  // for each event on the current thread's track. This value represents the
2542  // total CPU time consumed by that thread since its creation. Note that if a
2543  // thread is not scheduled by OS for some duration, that time won't be
2544  // included in thread_time.
2545  // Learn more : "CLOCK_THREAD_CPUTIME_ID" flag at
2546  // https://linux.die.net/man/3/clock_gettime
2547  optional bool enable_thread_time_sampling = 8;
2548
2549  // Default: false (i.e. dynamic event names are NOT filtered out by default)
2550  // When true, event_names wrapped in perfetto::DynamicString will be filtered
2551  // out.
2552  optional bool filter_dynamic_event_names = 9;
2553}
2554
2555// End of protos/perfetto/config/track_event/track_event_config.proto
2556
2557// Begin of protos/perfetto/config/data_source_config.proto
2558
2559// The configuration that is passed to each data source when starting tracing.
2560// Next id: 123
2561message DataSourceConfig {
2562  enum SessionInitiator {
2563    SESSION_INITIATOR_UNSPECIFIED = 0;
2564    // This trace was initiated from a trusted system app has DUMP and
2565    // USAGE_STATS permission. This system app is expected to not expose the
2566    // trace to the user of the device.
2567    // This is determined by checking the UID initiating the trace.
2568    SESSION_INITIATOR_TRUSTED_SYSTEM = 1;
2569  };
2570  // Data source unique name, e.g., "linux.ftrace". This must match
2571  // the name passed by the data source when it registers (see
2572  // RegisterDataSource()).
2573  optional string name = 1;
2574
2575  // The index of the logging buffer where TracePacket(s) will be stored.
2576  // This field doesn't make a major difference for the Producer(s). The final
2577  // logging buffers, in fact, are completely owned by the Service. We just ask
2578  // the Producer to copy this number into the chunk headers it emits, so that
2579  // the Service can quickly identify the buffer where to move the chunks into
2580  // without expensive lookups on its fastpath.
2581  optional uint32 target_buffer = 2;
2582
2583  // Set by the service to indicate the duration of the trace.
2584  // DO NOT SET in consumer as this will be overridden by the service.
2585  optional uint32 trace_duration_ms = 3;
2586
2587  // If true, |trace_duration_ms| should count also time in suspend. This
2588  // is propagated from TraceConfig.prefer_suspend_clock_for_duration.
2589  optional bool prefer_suspend_clock_for_duration = 122;
2590
2591  // Set by the service to indicate how long it waits after StopDataSource.
2592  // DO NOT SET in consumer as this will be overridden by the service.
2593  optional uint32 stop_timeout_ms = 7;
2594
2595  // Set by the service to indicate whether this tracing session has extra
2596  // guardrails.
2597  // DO NOT SET in consumer as this will be overridden by the service.
2598  optional bool enable_extra_guardrails = 6;
2599
2600  // Set by the service to indicate which user initiated this trace.
2601  // DO NOT SET in consumer as this will be overridden by the service.
2602  optional SessionInitiator session_initiator = 8;
2603
2604  // Set by the service to indicate which tracing session the data source
2605  // belongs to. The intended use case for this is checking if two data sources,
2606  // one of which produces metadata for the other one, belong to the same trace
2607  // session and hence should be linked together.
2608  // This field was introduced in Aug 2018 after Android P.
2609  // DO NOT SET in consumer as this will be overridden by the service.
2610  optional uint64 tracing_session_id = 4;
2611
2612  // Keeep the lower IDs (up to 99) for fields that are *not* specific to
2613  // data-sources and needs to be processed by the traced daemon.
2614
2615  // All data source config fields must be marked as [lazy=true]. This prevents
2616  // the proto-to-cpp generator from recursing into those when generating the
2617  // cpp classes and polluting tracing/core with data-source-specific classes.
2618  // Instead they are treated as opaque strings containing raw proto bytes.
2619
2620  // Data source name: linux.ftrace
2621  optional FtraceConfig ftrace_config = 100 [lazy = true];
2622  // Data source name: linux.inode_file_map
2623  optional InodeFileConfig inode_file_config = 102 [lazy = true];
2624  // Data source name: linux.process_stats
2625  optional ProcessStatsConfig process_stats_config = 103 [lazy = true];
2626  // Data source name: linux.sys_stats
2627  optional SysStatsConfig sys_stats_config = 104 [lazy = true];
2628  // Data source name: android.heapprofd
2629  // Introduced in Android 10.
2630  optional HeapprofdConfig heapprofd_config = 105 [lazy = true];
2631  // Data source name: android.java_hprof
2632  // Introduced in Android 11.
2633  optional JavaHprofConfig java_hprof_config = 110 [lazy = true];
2634  // Data source name: android.power
2635  optional AndroidPowerConfig android_power_config = 106 [lazy = true];
2636  // Data source name: android.log
2637  optional AndroidLogConfig android_log_config = 107 [lazy = true];
2638  // TODO(fmayer): Add data source name for this.
2639  optional GpuCounterConfig gpu_counter_config = 108 [lazy = true];
2640  // Data source name: android.game_interventions
2641  optional AndroidGameInterventionListConfig
2642      android_game_intervention_list_config = 116 [lazy = true];
2643  // Data source name: android.packages_list
2644  optional PackagesListConfig packages_list_config = 109 [lazy = true];
2645  // Data source name: linux.perf
2646  optional PerfEventConfig perf_event_config = 111 [lazy = true];
2647  // Data source name: vulkan.memory_tracker
2648  optional VulkanMemoryConfig vulkan_memory_config = 112 [lazy = true];
2649  // Data source name: track_event
2650  optional TrackEventConfig track_event_config = 113 [lazy = true];
2651  // Data source name: android.polled_state
2652  optional AndroidPolledStateConfig android_polled_state_config = 114
2653      [lazy = true];
2654  // Data source name: android.system_property
2655  optional AndroidSystemPropertyConfig android_system_property_config = 118
2656      [lazy = true];
2657  // Data source name: android.statsd
2658  optional StatsdTracingConfig statsd_tracing_config = 117 [lazy = true];
2659  // Data source name: linux.system_info
2660  optional SystemInfoConfig system_info_config = 119;
2661
2662  // Chrome is special as it doesn't use the perfetto IPC layer. We want to
2663  // avoid proto serialization and de-serialization there because that would
2664  // just add extra hops on top of the Mojo ser/des. Instead we auto-generate a
2665  // C++ class for it so it can pass around plain C++ objets.
2666  optional ChromeConfig chrome_config = 101;
2667
2668  // If an interceptor is specified here, packets for this data source will be
2669  // rerouted to the interceptor instead of the main trace buffer. This can be
2670  // used, for example, to write trace data into ETW or for logging trace points
2671  // to the console.
2672  //
2673  // Note that interceptors are only supported by data sources registered
2674  // through the Perfetto SDK API. Data sources that don't use that API (e.g.,
2675  // traced_probes) may not support interception.
2676  optional InterceptorConfig interceptor_config = 115;
2677
2678  // Data source name: android.network_packets.
2679  // Introduced in Android 14 (U).
2680  optional NetworkPacketTraceConfig network_packet_trace_config = 120
2681      [lazy = true];
2682
2683  // This is a fallback mechanism to send a free-form text config to the
2684  // producer. In theory this should never be needed. All the code that
2685  // is part of the platform (i.e. traced service) is supposed to *not* truncate
2686  // the trace config proto and propagate unknown fields. However, if anything
2687  // in the pipeline (client or backend) ends up breaking this forward compat
2688  // plan, this field will become the escape hatch to allow future data sources
2689  // to get some meaningful configuration.
2690  optional string legacy_config = 1000;
2691
2692  // This field is only used for testing.
2693  optional TestConfig for_testing = 1001;
2694
2695  // Was |for_testing|. Caused more problems then found.
2696  reserved 268435455;
2697}
2698
2699// End of protos/perfetto/config/data_source_config.proto
2700
2701// Begin of protos/perfetto/config/trace_config.proto
2702
2703// The overall config that is used when starting a new tracing session through
2704// ProducerPort::StartTracing().
2705// It contains the general config for the logging buffer(s) and the configs for
2706// all the data source being enabled.
2707//
2708// Next id: 38.
2709message TraceConfig {
2710  message BufferConfig {
2711    optional uint32 size_kb = 1;
2712
2713    // |page_size|, now deprecated.
2714    reserved 2;
2715
2716    // |optimize_for|, now deprecated.
2717    reserved 3;
2718
2719    enum FillPolicy {
2720      UNSPECIFIED = 0;
2721
2722      // Default behavior. The buffer operates as a conventional ring buffer.
2723      // If the writer is faster than the reader (or if the reader reads only
2724      // after tracing is stopped) newly written packets will overwrite old
2725      // packets.
2726      RING_BUFFER = 1;
2727
2728      // Behaves like RING_BUFFER as long as there is space in the buffer or
2729      // the reader catches up with the writer. As soon as the writer hits
2730      // an unread chunk, it stops accepting new data in the buffer.
2731      DISCARD = 2;
2732    }
2733    optional FillPolicy fill_policy = 4;
2734  }
2735  repeated BufferConfig buffers = 1;
2736
2737  message DataSource {
2738    // Filters and data-source specific config. It contains also the unique name
2739    // of the data source, the one passed in the  DataSourceDescriptor when they
2740    // register on the service.
2741    optional protos.DataSourceConfig config = 1;
2742
2743    // Optional. If multiple producers (~processes) expose the same data source
2744    // and either |producer_name_filter| or |producer_name_regex_filter| is set,
2745    // the data source is enabled only for producers whose names match any of
2746    // the filters.
2747    // |producer_name_filter| has to be an exact match, while
2748    // |producer_name_regex_filter| is a regular expression.
2749    // This allows to enable a data source only for specific processes.
2750    // The "repeated" fields have OR semantics: specifying a filter ["foo",
2751    // "bar"] will enable data sources on both "foo" and "bar" (if they exist).
2752    repeated string producer_name_filter = 2;
2753    repeated string producer_name_regex_filter = 3;
2754  }
2755  repeated DataSource data_sources = 2;
2756
2757  // Config for disabling builtin data sources in the tracing service.
2758  message BuiltinDataSource {
2759    // Disable emitting clock timestamps into the trace.
2760    optional bool disable_clock_snapshotting = 1;
2761
2762    // Disable echoing the original trace config in the trace.
2763    optional bool disable_trace_config = 2;
2764
2765    // Disable emitting system info (build fingerprint, cpuinfo, etc).
2766    optional bool disable_system_info = 3;
2767
2768    // Disable emitting events for data-source state changes (e.g. the marker
2769    // for all data sources having ACKed the start of the trace).
2770    optional bool disable_service_events = 4;
2771
2772    // The authoritative clock domain for the trace. Defaults to BOOTTIME. See
2773    // also ClockSnapshot's primary_trace_clock. The configured value is written
2774    // into the trace as part of the ClockSnapshots emitted by the service.
2775    // Trace processor will attempt to translate packet/event timestamps from
2776    // various data sources (and their chosen clock domains) to this domain
2777    // during import. Added in Android R.
2778    optional BuiltinClock primary_trace_clock = 5;
2779
2780    // Time interval in between snapshotting of sync markers, clock snapshots,
2781    // stats, and other periodic service-emitted events. Note that the service
2782    // only keeps track of the first and the most recent snapshot until
2783    // ReadBuffers() is called.
2784    optional uint32 snapshot_interval_ms = 6;
2785
2786    // Hints to the service that a suspend-aware (i.e. counting time in suspend)
2787    // clock should be used for periodic snapshots of service-emitted events.
2788    // This means, if a snapshot *should* have happened during suspend, it will
2789    // happen immediately after the device resumes.
2790    //
2791    // Choosing a clock like this is done on best-effort basis; not all
2792    // platforms (e.g. Windows) expose a clock which can be used for periodic
2793    // tasks counting suspend. If such a clock is not available, the service
2794    // falls back to the best-available alternative.
2795    //
2796    // Introduced in Android S.
2797    // TODO(lalitm): deprecate this in T and make this the default if nothing
2798    // crashes in S.
2799    optional bool prefer_suspend_clock_for_snapshot = 7;
2800
2801    // Disables the reporting of per-trace-writer histograms in TraceStats.
2802    optional bool disable_chunk_usage_histograms = 8;
2803  }
2804  optional BuiltinDataSource builtin_data_sources = 20;
2805
2806  // If specified, the trace will be stopped |duration_ms| after starting.
2807  // This does *not* count the time the system is suspended, so we will run
2808  // for duration_ms of system activity, not wall time.
2809  //
2810  // However in case of traces with triggers, see
2811  // TriggerConfig.trigger_timeout_ms instead.
2812  optional uint32 duration_ms = 3;
2813
2814  // If true, tries to use CLOCK_BOOTTIME for duration_ms rather than
2815  // CLOCK_MONOTONIC (which doesn't count time in suspend). Supported only on
2816  // Linux/Android, no-op on other platforms. This is used when dealing with
2817  // long (e.g. 24h) traces, where suspend can inflate them to weeks of
2818  // wall-time, making them more likely to hit device reboots (and hence loss).
2819  // This option also changes consistently the semantic of
2820  // TrigerConfig.stop_delay_ms.
2821  optional bool prefer_suspend_clock_for_duration = 36;
2822
2823  // This is set when --dropbox is passed to the Perfetto command line client
2824  // and enables guardrails that limit resource usage for traces requested
2825  // by statsd.
2826  optional bool enable_extra_guardrails = 4;
2827
2828  enum LockdownModeOperation {
2829    LOCKDOWN_UNCHANGED = 0;
2830    LOCKDOWN_CLEAR = 1;
2831    LOCKDOWN_SET = 2;
2832  }
2833  // Reject producers that are not running under the same UID as the tracing
2834  // service.
2835  optional LockdownModeOperation lockdown_mode = 5;
2836
2837  message ProducerConfig {
2838    // Identifies the producer for which this config is for.
2839    optional string producer_name = 1;
2840
2841    // Specifies the preferred size of the shared memory buffer. If the size is
2842    // larger than the max size, the max will be used. If it is smaller than
2843    // the page size or doesn't fit pages evenly into it, it will fall back to
2844    // the size specified by the producer or finally the default shared memory
2845    // size.
2846    optional uint32 shm_size_kb = 2;
2847
2848    // Specifies the preferred size of each page in the shared memory buffer.
2849    // Must be an integer multiple of 4K.
2850    optional uint32 page_size_kb = 3;
2851  }
2852
2853  repeated ProducerConfig producers = 6;
2854
2855  // Contains statsd-specific metadata about an alert associated with the trace.
2856  message StatsdMetadata {
2857    // The identifier of the alert which triggered this trace.
2858    optional int64 triggering_alert_id = 1;
2859    // The uid which registered the triggering configuration with statsd.
2860    optional int32 triggering_config_uid = 2;
2861    // The identifier of the config which triggered the alert.
2862    optional int64 triggering_config_id = 3;
2863    // The identifier of the subscription which triggered this trace.
2864    optional int64 triggering_subscription_id = 4;
2865  }
2866
2867  // Statsd-specific metadata.
2868  optional StatsdMetadata statsd_metadata = 7;
2869
2870  // When true && |output_path| is empty, the EnableTracing() request must
2871  // provide a file descriptor. The service will then periodically read packets
2872  // out of the trace buffer and store it into the passed file.
2873  // If |output_path| is not empty no fd should be passed, the service
2874  // will create a new file and write into that (see comment below).
2875  optional bool write_into_file = 8;
2876
2877  // This must point to a non-existing file. If the file exists the service
2878  // will NOT overwrite and will fail instead as a security precaution.
2879  // On Android, when this is used with the system traced, the path must be
2880  // within /data/misc/perfetto-traces/ or the trace will fail.
2881  // This option has been introduced in Android R. Before R write_into_file
2882  // can be used only with the "pass a file descriptor over IPC" mode.
2883  optional string output_path = 29;
2884
2885  // Optional. If non-zero tunes the write period. A min value of 100ms is
2886  // enforced (i.e. smaller values are ignored).
2887  optional uint32 file_write_period_ms = 9;
2888
2889  // Optional. When non zero the periodic write stops once at most X bytes
2890  // have been written into the file. Tracing is disabled when this limit is
2891  // reached, even if |duration_ms| has not been reached yet.
2892  optional uint64 max_file_size_bytes = 10;
2893
2894  // Contains flags which override the default values of the guardrails inside
2895  // Perfetto.
2896  message GuardrailOverrides {
2897    // Override the default limit (in bytes) for uploading data to server within
2898    // a 24 hour period.
2899    // On R-, this override only affected userdebug builds. Since S, it also
2900    // affects user builds.
2901    optional uint64 max_upload_per_day_bytes = 1;
2902
2903    // Overrides the guardrail for maximum trace buffer size.
2904    // Available on U+
2905    optional uint32 max_tracing_buffer_size_kb = 2;
2906  }
2907  optional GuardrailOverrides guardrail_overrides = 11;
2908
2909  // When true, data sources are not started until an explicit call to
2910  // StartTracing() on the consumer port. This is to support early
2911  // initialization and fast trace triggering. This can be used only when the
2912  // Consumer explicitly triggers the StartTracing() method.
2913  // This should not be used in a remote trace config via statsd, doing so will
2914  // result in a hung trace session.
2915  optional bool deferred_start = 12;
2916
2917  // When set, it periodically issues a Flush() to all data source, forcing them
2918  // to commit their data into the tracing service. This can be used for
2919  // quasi-real-time streaming mode and to guarantee some partial ordering of
2920  // events in the trace in windows of X ms.
2921  optional uint32 flush_period_ms = 13;
2922
2923  // Wait for this long for producers to acknowledge flush requests.
2924  // Default 5s.
2925  optional uint32 flush_timeout_ms = 14;
2926
2927  // Wait for this long for producers to acknowledge stop requests.
2928  // Default 5s.
2929  optional uint32 data_source_stop_timeout_ms = 23;
2930
2931  // |disable_clock_snapshotting| moved.
2932  reserved 15;
2933
2934  // Android-only. If set, sends an intent to the Traceur system app when the
2935  // trace ends to notify it about the trace readiness.
2936  optional bool notify_traceur = 16;
2937
2938  // This field was introduced in Android S.
2939  // Android-only. If set to a value > 0, marks the trace session as a candidate
2940  // for being attached to a bugreport. This field effectively acts as a z-index
2941  // for bugreports. When Android's dumpstate runs perfetto
2942  // --save-for-bugreport, traced will pick the tracing session with the highest
2943  // score (score <= 0 is ignored) and:
2944  // On Android S, T:  will steal its contents, save the trace into
2945  //     a known path and stop prematurely.
2946  // On Android U+: will create a read-only snapshot and save that into a known
2947  //     path, without stoppin the original tracing session.
2948  // When this field is set the tracing session becomes eligible to be cloned
2949  // by other UIDs.
2950  optional int32 bugreport_score = 30;
2951
2952  // Triggers allow producers to start or stop the tracing session when an event
2953  // occurs.
2954  //
2955  // For example if we are tracing probabilistically, most traces will be
2956  // uninteresting. Triggers allow us to keep only the interesting ones such as
2957  // those traces during which the device temperature reached a certain
2958  // threshold. In this case the producer can activate a trigger to keep
2959  // (STOP_TRACING) the trace, otherwise it can also begin a trace
2960  // (START_TRACING) because it knows something is about to happen.
2961  message TriggerConfig {
2962    enum TriggerMode {
2963      UNSPECIFIED = 0;
2964
2965      // When this mode is chosen, data sources are not started until one of the
2966      // |triggers| are received. This supports early initialization and fast
2967      // starting of the tracing system. On triggering, the session will then
2968      // record for |stop_delay_ms|. However if no trigger is seen
2969      // after |trigger_timeout_ms| the session will be stopped and no data will
2970      // be returned.
2971      START_TRACING = 1;
2972
2973      // When this mode is chosen, the session will be started via the normal
2974      // EnableTracing() & StartTracing(). If no trigger is ever seen
2975      // the session will be stopped after |trigger_timeout_ms| and no data will
2976      // be returned. However if triggered the trace will stop after
2977      // |stop_delay_ms| and any data in the buffer will be returned to the
2978      // consumer.
2979      STOP_TRACING = 2;
2980
2981      // 3 was taken by CLONE_SNAPSHOT but that has been moved to 4.
2982      // The early implementation of CLONE_SNAPSHOT had various bugs
2983      // (b/290798988, b/290799105) and made it into Android U. The number
2984      // change is to make sure nobody rolls out a config that hits the broken
2985      // behaviour.
2986      reserved 3;
2987
2988      // When this mode is chosen, this causes a snapshot of the current tracing
2989      // session to be created after |stop_delay_ms| while the current tracing
2990      // session continues undisturbed (% an extra flush). This mode can be
2991      // used only when the tracing session is handled by the "perfetto" cmdline
2992      // client (which is true in 90% of cases). Part of the business logic
2993      // necessary for this behavior, and ensuing file handling, lives in
2994      // perfetto_cmd.cc . On other consumers, this causes only a notification
2995      // of the trigger through a CloneTriggerHit ObservableEvent. The custom
2996      // consumer is supposed to call CloneSession() itself after the event.
2997      // Use use_clone_snapshot_if_available=true when targeting older versions
2998      // of perfetto.
2999      CLONE_SNAPSHOT = 4;
3000
3001      // NOTE: CLONE_SNAPSHOT should be used only when we targeting Android V+
3002      // (15+) / Perfetto v38+. A bug in older versions of the tracing service
3003      // might cause indefinitely long tracing sessions (see b/274931668).
3004    }
3005    optional TriggerMode trigger_mode = 1;
3006
3007    // This flag is really a workaround for b/274931668. This is needed only
3008    // when deploying configs to different versions of the tracing service.
3009    // When this is set to true this has the same effect of setting trigger_mode
3010    // to CLONE_SNAPSHOT on newer versions of the service. This boolean has been
3011    // introduced to allow to have configs that use CLONE_SNAPSHOT on newer
3012    // versions of Android and fall back to STOP_TRACING on older versions where
3013    // CLONE_SNAPSHOT did not exist.
3014    // When using this flag, trigger_mode must be set to STOP_TRACING.
3015    optional bool use_clone_snapshot_if_available = 5;
3016
3017    // DEPRECATED, was use_clone_snapshot_if_available in U. See the comment
3018    // around CLONE_SNAPSHOT.
3019    reserved 4;
3020
3021    message Trigger {
3022      // The producer must specify this name to activate the trigger.
3023      optional string name = 1;
3024
3025      // An std::regex that will match the producer that can activate this
3026      // trigger. This is optional. If unset any producers can activate this
3027      // trigger.
3028      optional string producer_name_regex = 2;
3029
3030      // After a trigger is received either in START_TRACING or STOP_TRACING
3031      // mode then the trace will end |stop_delay_ms| after triggering.
3032      // In CLONE_SNAPSHOT mode, this is the delay between the trigger and the
3033      // snapshot.
3034      // If |prefer_suspend_clock_for_duration| is set, the duration will be
3035      // based on wall-clock, counting also time in suspend.
3036      optional uint32 stop_delay_ms = 3;
3037
3038      // Limits the number of traces this trigger can start/stop in a rolling
3039      // 24 hour window. If this field is unset or zero, no limit is applied and
3040      // activiation of this trigger *always* starts/stops the trace.
3041      optional uint32 max_per_24_h = 4;
3042
3043      // A value between 0 and 1 which encodes the probability of skipping a
3044      // trigger with this name. This is useful for reducing the probability
3045      // of high-frequency triggers from dominating trace finaization. If this
3046      // field is unset or zero, the trigger will *never* be skipped. If this
3047      // field is greater than or equal to 1, this trigger will *always* be
3048      // skipped i.e. it will be as if this trigger was never included in the
3049      // first place.
3050      // This probability check is applied *before* any other limits. For
3051      // example, if |max_per_24_h| is also set, first we will check if the
3052      // probability bar is met and only then will we check the |max_per_24_h|
3053      // limit.
3054      optional double skip_probability = 5;
3055    }
3056    // A list of triggers which are related to this configuration. If ANY
3057    // trigger is seen then an action will be performed based on |trigger_mode|.
3058    repeated Trigger triggers = 2;
3059
3060    // Required and must be positive if a TriggerConfig is specified. This is
3061    // how long this TraceConfig should wait for a trigger to arrive. After this
3062    // period of time if no trigger is seen the TracingSession will be cleaned
3063    // up.
3064    optional uint32 trigger_timeout_ms = 3;
3065  }
3066  optional TriggerConfig trigger_config = 17;
3067
3068  // When this is non-empty the perfetto command line tool will ignore the rest
3069  // of this TraceConfig and instead connect to the perfetto service as a
3070  // producer and send these triggers, potentially stopping or starting traces
3071  // that were previous configured to use a TriggerConfig.
3072  repeated string activate_triggers = 18;
3073
3074  // Configuration for trace contents that reference earlier trace data. For
3075  // example, a data source might intern strings, and emit packets containing
3076  // {interned id : string} pairs. Future packets from that data source can then
3077  // use the interned ids instead of duplicating the raw string contents. The
3078  // trace parser will then need to use that interning table to fully interpret
3079  // the rest of the trace.
3080  message IncrementalStateConfig {
3081    // If nonzero, notify eligible data sources to clear their incremental state
3082    // periodically, with the given period. The notification is sent only to
3083    // data sources that have |handles_incremental_state_clear| set in their
3084    // DataSourceDescriptor. The notification requests that the data source
3085    // stops referring to past trace contents. This is particularly useful when
3086    // tracing in ring buffer mode, where it is not exceptional to overwrite old
3087    // trace data.
3088    //
3089    // Warning: this time-based global clearing is likely to be removed in the
3090    // future, to be replaced with a smarter way of sending the notifications
3091    // only when necessary.
3092    optional uint32 clear_period_ms = 1;
3093  }
3094  optional IncrementalStateConfig incremental_state_config = 21;
3095
3096  // Additional guardrail used by the Perfetto command line client.
3097  // On user builds when --dropbox is set perfetto will refuse to trace unless
3098  // this is also set.
3099  // Added in Q.
3100  optional bool allow_user_build_tracing = 19;
3101
3102  // If set the tracing service will ensure there is at most one tracing session
3103  // with this key.
3104  optional string unique_session_name = 22;
3105
3106  // Compress trace with the given method. Best effort.
3107  enum CompressionType {
3108    COMPRESSION_TYPE_UNSPECIFIED = 0;
3109    COMPRESSION_TYPE_DEFLATE = 1;
3110  }
3111  optional CompressionType compression_type = 24;
3112
3113  // Use the legacy codepath that compresses from perfetto_cmd.cc instead of
3114  // using the new codepath that compresses from tracing_service_impl.cc. This
3115  // will be removed in the future.
3116  optional bool compress_from_cli = 37;
3117
3118  // Android-only. Not for general use. If set, saves the trace into an
3119  // incident. This field is read by perfetto_cmd, rather than the tracing
3120  // service. This field must be set when passing the --upload flag to
3121  // perfetto_cmd.
3122  message IncidentReportConfig {
3123    // In this message, either:
3124    //  * all of |destination_package|, |destination_class| and |privacy_level|
3125    //    must be set.
3126    //  * |skip_incidentd| must be explicitly set to true.
3127
3128    optional string destination_package = 1;
3129    optional string destination_class = 2;
3130    // Level of filtering in the requested incident. See |Destination| in
3131    // frameworks/base/core/proto/android/privacy.proto.
3132    optional int32 privacy_level = 3;
3133
3134    // If true, then skips saving the trace to incidentd.
3135    //
3136    // This flag is useful in testing (e.g. Perfetto-statsd integration tests)
3137    // or when we explicitly don't want traces to go to incidentd even when they
3138    // usually would (e.g. configs deployed using statsd but only used for
3139    // inclusion in bugreports using |bugreport_score|).
3140    //
3141    // The motivation for having this flag, instead of just not setting
3142    // |incident_report_config|, is prevent accidents where
3143    // |incident_report_config| is omitted by mistake.
3144    optional bool skip_incidentd = 5;
3145
3146    // If true, do not write the trace into dropbox (i.e. incident only).
3147    // Otherwise, write to both dropbox and incident.
3148    // TODO(lalitm): remove this field as we no longer use Dropbox.
3149    optional bool skip_dropbox = 4 [deprecated = true];
3150  }
3151  optional IncidentReportConfig incident_report_config = 25;
3152
3153  enum StatsdLogging {
3154    STATSD_LOGGING_UNSPECIFIED = 0;
3155    STATSD_LOGGING_ENABLED = 1;
3156    STATSD_LOGGING_DISABLED = 2;
3157  }
3158
3159  // Android-only. Not for general use. If specified, sets the logging to statsd
3160  // of guardrails and checkpoints in the tracing service. perfetto_cmd sets
3161  // this to enabled (if not explicitly set in the config) when specifying
3162  // --upload.
3163  optional StatsdLogging statsd_logging = 31;
3164
3165  // DEPRECATED. Was trace_uuid, use trace_uuid_msb and trace_uuid_lsb instead.
3166  reserved 26;
3167
3168  // An identifier clients can use to tie this trace to other logging.
3169  // DEPRECATED as per v32. See TracePacket.trace_uuid for the authoritative
3170  // Trace UUID. If this field is set, the tracing service will respect the
3171  // requested UUID (i.e. TracePacket.trace_uuid == this field) but only if
3172  // gap-less snapshotting is not used.
3173  optional int64 trace_uuid_msb = 27 [deprecated = true];
3174  optional int64 trace_uuid_lsb = 28 [deprecated = true];
3175
3176  // When set applies a post-filter to the trace contents using the filter
3177  // provided. The filter is applied at ReadBuffers() time and works both in the
3178  // case of IPC readback and write_into_file. This filter can be generated
3179  // using `tools/proto_filter -s schema.proto -F filter_out.bytes` or
3180  // `-T filter_out.escaped_string` (for .pbtx). See go/trace-filtering for
3181  // design.
3182  //
3183  // Introduced in Android S, but it was broken (b/195065199). Reintroduced in
3184  // Android T with a different field number. Updated in Android U with a new
3185  // bytecode version which supports string filtering.
3186  message TraceFilter {
3187    // =========================
3188    // Filter bytecode.
3189    // =========================
3190
3191    // The bytecode as implemented in Android T.
3192    optional bytes bytecode = 1;
3193
3194    // The bytecode as implemented in Android U. Adds support for string
3195    // filtering.
3196    optional bytes bytecode_v2 = 2;
3197
3198    // =========================
3199    // String filtering
3200    // =========================
3201
3202    // The principles and terminology of string filtering is heavily inspired by
3203    // iptables. A "rule" decide how strings should be filtered. Each rule
3204    // contains a "policy" which indicates the algorithm to use for filtering.
3205    // A "chain" is a list of rules which will be sequentially checked against
3206    // each string.
3207    //
3208    // The first rule which applies to the string terminates filtering for that
3209    // string. If no rules apply, the string is left unchanged.
3210
3211    // A policy specifies which algorithm should be used for filtering the
3212    // string.
3213    enum StringFilterPolicy {
3214      SFP_UNSPECIFIED = 0;
3215
3216      // Tries to match the string field against |regex_pattern|. If it
3217      // matches, all matching groups are "redacted" (i.e. replaced with a
3218      // constant string) and filtering is terminated (i.e. no further rules are
3219      // checked). If it doesn't match, the string is left unchanged and the
3220      // next rule in chain is considered.
3221      SFP_MATCH_REDACT_GROUPS = 1;
3222
3223      // Like |SFP_MATCH_REDACT_GROUPS| but tries to do some pre-work before
3224      // checking the regex. Specifically, it tries to parse the string field as
3225      // an atrace tracepoint and checks if the post-tgid field starts with
3226      // |atrace_post_tgid_starts_with|. The regex matching is only performed if
3227      // this check succeeds.
3228      SFP_ATRACE_MATCH_REDACT_GROUPS = 2;
3229
3230      // Tries to match the string field against |regex_pattern|. If it
3231      // matches, filtering is terminated (i.e. no further rules are checked).
3232      // If it doesn't match, the string is left unchanged and the next rule in
3233      // chain is considered.
3234      SFP_MATCH_BREAK = 3;
3235
3236      // Like |SFP_MATCH_BREAK| but tries to do some pre-work before checking
3237      // the regex. Specifically, it tries to parse the string field as an
3238      // atrace tracepoint and checks if the post-tgid field starts with
3239      // |atrace_post_tgid_starts_with|. The regex matching is only performed if
3240      // this check succeeds.
3241      SFP_ATRACE_MATCH_BREAK = 4;
3242    }
3243
3244    // A rule specifies how strings should be filtered.
3245    message StringFilterRule {
3246      // The policy (i.e. algorithm) dictating how strings matching this rule
3247      // should be handled.
3248      optional StringFilterPolicy policy = 1;
3249
3250      // The regex pattern used to match against each string.
3251      optional string regex_pattern = 2;
3252
3253      // The string which should appear after the tgid in atrace tracepoint
3254      // strings.
3255      optional string atrace_payload_starts_with = 3;
3256    }
3257
3258    // A chain is a list of rules which string will be sequentially checked
3259    // against.
3260    message StringFilterChain {
3261      repeated StringFilterRule rules = 1;
3262    }
3263    optional StringFilterChain string_filter_chain = 3;
3264  }
3265  // old field number for trace_filter
3266  reserved 32;
3267  optional TraceFilter trace_filter = 33;
3268
3269  // Android-only. Not for general use. If set, reports the trace to the
3270  // Android framework. This field is read by perfetto_cmd, rather than the
3271  // tracing service. This field must be set when passing the --upload flag to
3272  // perfetto_cmd.
3273  message AndroidReportConfig {
3274    // In this message, either:
3275    //  * |reporter_service_package| and |reporter_service_class| must be set.
3276    //  * |skip_reporting| must be explicitly set to true.
3277
3278    optional string reporter_service_package = 1;
3279    optional string reporter_service_class = 2;
3280
3281    // If true, then skips reporting the trace to Android framework.
3282    //
3283    // This flag is useful in testing (e.g. Perfetto-statsd integration tests)
3284    // or when we explicitly don't want to report traces to the framework even
3285    // when they usually would (e.g. configs deployed using statsd but only
3286    // used for inclusion in bugreports using |bugreport_score|).
3287    //
3288    // The motivation for having this flag, instead of just not setting
3289    // |framework_report_config|, is prevent accidents where
3290    // |framework_report_config| is omitted by mistake.
3291    optional bool skip_report = 3;
3292
3293    // If true, will direct the Android framework to read the data in trace
3294    // file and pass it to the reporter class over a pipe instead of passing
3295    // the file descriptor directly.
3296    //
3297    // This flag is needed because the Android test framework does not
3298    // currently support priv-app helper apps (in terms of SELinux) and we
3299    // really don't want to add an allow rule for untrusted_app to receive
3300    // trace fds.
3301    //
3302    // Because of this, we instead will direct the framework to create a new
3303    // pipe and pass this to the reporter process instead. As the pipe is
3304    // created by the framework, we won't have any problems with SELinux
3305    // (system_server is already allowed to pass pipe fds, even
3306    // to untrusted apps).
3307    //
3308    // As the name suggests this option *MUST* only be used for testing.
3309    // Note that the framework will reject (and drop) files which are too
3310    // large both for simplicity and to be minimize the amount of data we
3311    // pass to a non-priv app (note that the framework will still check
3312    // manifest permissions even though SELinux permissions are worked around).
3313    optional bool use_pipe_in_framework_for_testing = 4;
3314  }
3315  optional AndroidReportConfig android_report_config = 34;
3316
3317  // If set, delays the start of tracing by a random duration. The duration is
3318  // chosen from a uniform distribution between the specified minimum and
3319  // maximum.
3320  // Note: this delay is implemented by perfetto_cmd *not* by traced so will
3321  // not work if you communicate with traced directly over the consumer API.
3322  // Introduced in Android T.
3323  message CmdTraceStartDelay {
3324    optional uint32 min_delay_ms = 1;
3325    optional uint32 max_delay_ms = 2;
3326  }
3327  optional CmdTraceStartDelay cmd_trace_start_delay = 35;
3328}
3329
3330// End of protos/perfetto/config/trace_config.proto
3331
3332// Begin of protos/perfetto/common/trace_stats.proto
3333
3334// Statistics for the internals of the tracing service.
3335//
3336// Next id: 17.
3337message TraceStats {
3338  // From TraceBuffer::Stats.
3339  //
3340  // Next id: 20.
3341  message BufferStats {
3342    // Size of the circular buffer in bytes.
3343    optional uint64 buffer_size = 12;
3344
3345    // Num. bytes written into the circular buffer, including chunk headers.
3346    optional uint64 bytes_written = 1;
3347
3348    // Num. bytes overwritten before they have been read (i.e. loss of data).
3349    optional uint64 bytes_overwritten = 13;
3350
3351    // Total size of chunks that were fully read from the circular buffer by the
3352    // consumer. This may not be equal to |bytes_written| either in the middle
3353    // of tracing, or if |chunks_overwritten| is non-zero. Note that this is the
3354    // size of the chunks read from the buffer, including chunk headers, which
3355    // will be different from the total size of packets returned to the
3356    // consumer.
3357    //
3358    // The current utilization of the trace buffer (mid-tracing) can be obtained
3359    // by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|,
3360    // adding the difference of |padding_bytes_written| and
3361    // |padding_bytes_cleared|, and comparing this sum to the |buffer_size|.
3362    // Note that this represents the total size of buffered data in the buffer,
3363    // yet this data may be spread non-contiguously through the buffer and may
3364    // be overridden before the utilization reaches 100%.
3365    optional uint64 bytes_read = 14;
3366
3367    // Num. bytes that were allocated as padding between chunks in the circular
3368    // buffer.
3369    optional uint64 padding_bytes_written = 15;
3370
3371    // Num. of padding bytes that were removed from the circular buffer when
3372    // they were overwritten.
3373    //
3374    // The difference between |padding_bytes_written| and
3375    // |padding_bytes_cleared| denotes the total size of padding currently
3376    // present in the buffer.
3377    optional uint64 padding_bytes_cleared = 16;
3378
3379    // Num. chunks (!= packets) written into the buffer.
3380    optional uint64 chunks_written = 2;
3381
3382    // Num. chunks (!= packets) rewritten into the buffer. This means we rewrote
3383    // the same chunk with additional packets appended to the end.
3384    optional uint64 chunks_rewritten = 10;
3385
3386    // Num. chunks overwritten before they have been read (i.e. loss of data).
3387    optional uint64 chunks_overwritten = 3;
3388
3389    // Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer
3390    // is configured with FillPolicy == DISCARD.
3391    optional uint64 chunks_discarded = 18;
3392
3393    // Num. chunks (!= packets) that were fully read from the circular buffer by
3394    // the consumer. This may not be equal to |chunks_written| either in the
3395    // middle of tracing, or if |chunks_overwritten| is non-zero.
3396    optional uint64 chunks_read = 17;
3397
3398    // Num. chunks that were committed out of order.
3399    optional uint64 chunks_committed_out_of_order = 11;
3400
3401    // Num. times the ring buffer wrapped around.
3402    optional uint64 write_wrap_count = 4;
3403
3404    // Num. out-of-band (OOB) patches that succeeded.
3405    optional uint64 patches_succeeded = 5;
3406
3407    // Num. OOB patches that failed (e.g., the chunk to patch was gone).
3408    optional uint64 patches_failed = 6;
3409
3410    // Num. readaheads (for large multi-chunk packet reads) that ended up in a
3411    // successful packet read.
3412    optional uint64 readaheads_succeeded = 7;
3413
3414    // Num. readaheads aborted because of missing chunks in the sequence stream.
3415    // Note that a small number > 0 is totally expected: occasionally, when
3416    // issuing a read, the very last packet in a sequence might be incomplete
3417    // (because the producer is still writing it while we read). The read will
3418    // stop at that point, for that sequence, increasing this counter.
3419    optional uint64 readaheads_failed = 8;
3420
3421    // Num. of violations of the SharedMemoryABI found while writing or reading
3422    // the buffer. This is an indication of either a bug in the producer(s) or
3423    // malicious producer(s).
3424    optional uint64 abi_violations = 9;
3425
3426    // The fields below have been introduced in Android R.
3427
3428    // Num. of times the service detected packet loss on a trace writer
3429    // sequence. This is usually caused by exhaustion of available chunks in the
3430    // writer process's SMB. Note that this relies on the client's TraceWriter
3431    // indicating this loss to the service -- packets lost for other reasons are
3432    // not reflected in this stat.
3433    optional uint64 trace_writer_packet_loss = 19;
3434  }
3435
3436  // Stats for the TraceBuffer(s) of the current trace session.
3437  repeated BufferStats buffer_stats = 1;
3438
3439  // Per TraceWriter stat. Each {producer, trace writer} tuple is publicly
3440  // visible as a unique sequence ID in the trace.
3441  message WriterStats {
3442    // This matches the TracePacket.trusted_packet_sequence_id and is used to
3443    // correlate the stats with the actual packet types.
3444    optional uint64 sequence_id = 1;
3445
3446    // These two arrays have the same cardinality and match the cardinality of
3447    // chunk_payload_histogram_def + 1 (for the overflow bucket, see below).
3448    // `sum` contains the SUM(entries) and `counts` contains the COUNT(entries)
3449    // for each bucket.
3450    repeated uint64 chunk_payload_histogram_counts = 2 [packed = true];
3451    repeated int64 chunk_payload_histogram_sum = 3 [packed = true];
3452  }
3453
3454  // The thresholds of each the `writer_stats` histogram buckets. This is
3455  // emitted only once as all WriterStats share the same bucket layout.
3456  // This field has the same cardinality of the
3457  // `writer_stats.chunk_payload_histogram_{counts,sum}` - 1.
3458  // (The -1 is because the last overflow bucket is not reported in the _def).
3459  // An array of values [10, 100, 1000] in the _def array means that there are
3460  // four buckets (3 + the implicit overflow bucket):
3461  // [0]: x <= 10; [1]: 100 < x <= 1000; [2]: 1000 < x <= 1000; [3]: x > 1000.
3462  repeated int64 chunk_payload_histogram_def = 17;
3463  repeated WriterStats writer_stats = 18;
3464
3465  // Num. producers connected (whether they are involved in the current tracing
3466  // session or not).
3467  optional uint32 producers_connected = 2;
3468
3469  // Num. producers ever seen for all trace sessions since startup (it's a good
3470  // proxy for inferring num. producers crashed / killed).
3471  optional uint64 producers_seen = 3;
3472
3473  // Num. data sources registered for all trace sessions.
3474  optional uint32 data_sources_registered = 4;
3475
3476  // Num. data sources ever seen for all trace sessions since startup.
3477  optional uint64 data_sources_seen = 5;
3478
3479  // Num. concurrently active tracing sessions.
3480  optional uint32 tracing_sessions = 6;
3481
3482  // Num. buffers for all tracing session (not just the current one). This will
3483  // be >= buffer_stats.size(), because the latter is only about the current
3484  // session.
3485  optional uint32 total_buffers = 7;
3486
3487  // The fields below have been introduced in Android Q.
3488
3489  // Num. chunks that were discarded by the service before attempting to commit
3490  // them to a buffer, e.g. because the producer specified an invalid buffer ID.
3491  optional uint64 chunks_discarded = 8;
3492
3493  // Num. patches that were discarded by the service before attempting to apply
3494  // them to a buffer, e.g. because the producer specified an invalid buffer ID.
3495  optional uint64 patches_discarded = 9;
3496
3497  // Packets that failed validation of the TrustedPacket. If this is > 0, there
3498  // is a bug in the producer.
3499  optional uint64 invalid_packets = 10;
3500
3501  // This is set only when the TraceConfig specifies a TraceFilter.
3502  message FilterStats {
3503    optional uint64 input_packets = 1;
3504    optional uint64 input_bytes = 2;
3505    optional uint64 output_bytes = 3;
3506    optional uint64 errors = 4;
3507    optional uint64 time_taken_ns = 5;
3508  }
3509  optional FilterStats filter_stats = 11;
3510
3511  // Count of Flush() requests (either from the Consumer, or self-induced
3512  // periodic flushes). The final Flush() is also included in the count.
3513  optional uint64 flushes_requested = 12;
3514
3515  // The count of the Flush() requests that were completed successfully.
3516  // In a well behaving trace this should always be == `flush_requests`.
3517  optional uint64 flushes_succeeded = 13;
3518
3519  // The count of the Flush() requests that failed (in most timed out).
3520  // In a well behaving trace this should always be == 0.
3521  optional uint64 flushes_failed = 14;
3522
3523  enum FinalFlushOutcome {
3524    FINAL_FLUSH_UNSPECIFIED = 0;
3525    FINAL_FLUSH_SUCCEEDED = 1;
3526    FINAL_FLUSH_FAILED = 2;
3527  }
3528  optional FinalFlushOutcome final_flush_outcome = 15;
3529}
3530
3531// End of protos/perfetto/common/trace_stats.proto
3532
3533// Begin of protos/perfetto/trace/android/android_game_intervention_list.proto
3534
3535message AndroidGameInterventionList {
3536  message GameModeInfo {
3537    optional uint32 mode = 1;
3538    optional bool use_angle = 2;
3539    optional float resolution_downscale = 3;
3540    optional float fps = 4;
3541  }
3542  message GamePackageInfo {
3543    optional string name = 1;
3544    optional uint64 uid = 2;
3545    optional uint32 current_mode = 3;
3546    repeated GameModeInfo game_mode_info = 4;
3547  }
3548
3549  repeated GamePackageInfo game_packages = 1;
3550
3551  // True when at least one error occured when parsing
3552  // game_mode_intervention.list
3553  optional bool parse_error = 2;
3554
3555  // Failed to open / read game_mode_intervention.list
3556  optional bool read_error = 3;
3557}
3558
3559// End of protos/perfetto/trace/android/android_game_intervention_list.proto
3560
3561// Begin of protos/perfetto/trace/android/android_log.proto
3562
3563message AndroidLogPacket {
3564  message LogEvent {
3565    // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
3566    optional AndroidLogId log_id = 1;
3567
3568    // PID (TGID), TID and UID of the task that emitted the event.
3569    optional int32 pid = 2;
3570    optional int32 tid = 3;
3571    optional int32 uid = 4;
3572
3573    // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
3574    // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
3575    // processor will take care of realigning clocks using the ClockSnapshot(s).
3576    optional uint64 timestamp = 5;
3577
3578    // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
3579    // the second column of /system/etc/event-log-tags. For all other events,
3580    // |tag| is the app-specified argument passed to __android_log_write().
3581    optional string tag = 6;
3582
3583    // Empty when log_id == LID_EVENTS.
3584    optional AndroidLogPriority prio = 7;
3585
3586    // Empty when log_id == LID_EVENTS.
3587    optional string message = 8;
3588
3589    message Arg {
3590      optional string name = 1;
3591      oneof value {
3592        int64 int_value = 2;
3593        float float_value = 3;
3594        string string_value = 4;
3595      }
3596    }
3597    // Only populated when log_id == LID_EVENTS.
3598    repeated Arg args = 9;
3599  }
3600
3601  repeated LogEvent events = 1;
3602
3603  // Stats are emitted only upon Flush() and are monotonic (i.e. they are
3604  // absolute counters since the beginning of the lifetime of the tracing
3605  // session and NOT relative to the previous Stats snapshot).
3606  message Stats {
3607    // Total number of log events seen, including errors and skipped entries
3608    // (num of events stored in the trace = total - failed - skipped).
3609    optional uint64 num_total = 1;
3610
3611    // Parser failures.
3612    optional uint64 num_failed = 2;
3613
3614    // Messages skipped due to filters.
3615    optional uint64 num_skipped = 3;
3616  }
3617  optional Stats stats = 2;
3618}
3619
3620// End of protos/perfetto/trace/android/android_log.proto
3621
3622// Begin of protos/perfetto/trace/android/android_system_property.proto
3623
3624message AndroidSystemProperty {
3625  message PropertyValue {
3626    optional string name = 1;
3627    optional string value = 2;
3628  }
3629
3630  repeated PropertyValue values = 1;
3631}
3632
3633// End of protos/perfetto/trace/android/android_system_property.proto
3634
3635// Begin of protos/perfetto/trace/android/camera_event.proto
3636
3637// A profiling event corresponding to a single camera frame. This message
3638// collects important details and timestamps involved in producing a single
3639// camera frame.
3640// Next ID: 17
3641message AndroidCameraFrameEvent {
3642  // Identifier for the CameraCaptureSession this frame originates from. See:
3643  // https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession
3644  optional uint64 session_id = 1;
3645  // Identifier for the camera sensor that is the source of this frame. This may
3646  // be either a physical or logical camera (up to vendor interpretation).
3647  optional uint32 camera_id = 2;
3648  // The frame number identifying this frame on this camera.
3649  optional int64 frame_number = 3;
3650  // Identifier for the CaptureRequest. See:
3651  // https://developer.android.com/reference/android/hardware/camera2/CaptureRequest
3652  //
3653  // If multiple cameras are streaming simultaneously, the request_id may be
3654  // used to identify which frames were captured in service of the same request.
3655  optional int64 request_id = 4;
3656
3657  // The CLOCK_BOOTTIME timestamp at which the camera framework request is
3658  // received by the camera HAL pipeline. Note that this request may wait for
3659  // some time before processing actually begins. See also
3660  // request_processing_started_ns.
3661  optional int64 request_received_ns = 5;
3662  // The CLOCK_BOOTTIME timestamp at which the framework request is accepted for
3663  // processing by the camera HAL pipeline. This is the time at which the
3664  // pipeline actually begins to work on the request.
3665  optional int64 request_processing_started_ns = 6;
3666
3667  // The CLOCK_BOOTTIME timestamp at which the sensor begins its exposure.
3668  optional int64 start_of_exposure_ns = 7;
3669  // The CLOCK_BOOTTIME timestamp corresponding to the sensor start of frame
3670  // event.
3671  optional int64 start_of_frame_ns = 8;
3672  // The CLOCK_BOOTTIME timestamp at which the camera HAL has sent all responses
3673  // for the frame.
3674  optional int64 responses_all_sent_ns = 9;
3675
3676  // The error status, if any, reported to the camera framework. Any status
3677  // other than STATUS_OK indicates a dropped frame.
3678  // Next Enum: 6
3679  enum CaptureResultStatus {
3680    STATUS_UNSPECIFIED = 0;
3681    STATUS_OK = 1;
3682    // Early metadata was returned to the camera framework with an error.
3683    STATUS_EARLY_METADATA_ERROR = 2;
3684    // Final metadata was returned to the camera framework with an error.
3685    STATUS_FINAL_METADATA_ERROR = 3;
3686    // One or more buffers were returned to the camera framework with an error.
3687    STATUS_BUFFER_ERROR = 4;
3688    // The frame was dropped as a result of a flush operation.
3689    STATUS_FLUSH_ERROR = 5;
3690  }
3691  optional CaptureResultStatus capture_result_status = 10;
3692
3693  // The number of sensor frames that were skipped between this frame and the
3694  // previous frame. Under normal operation, this should be zero. Any number
3695  // greater than zero indicates dropped sensor frames.
3696  optional int32 skipped_sensor_frames = 11;
3697
3698  // The value of CONTROL_CAPTURE_INTENT. See:
3699  // https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_CAPTURE_INTENT
3700  optional int32 capture_intent = 12;
3701  // The number of streams in the capture request.
3702  optional int32 num_streams = 13;
3703
3704  // A profiling event corresponding to a single node processing within the camera
3705  // pipeline. Intuitively this corresponds to a single stage of processing to
3706  // produce a camera frame.
3707  // Next ID: 6
3708  message CameraNodeProcessingDetails {
3709    optional int64 node_id = 1;
3710    // The timestamp at which node processing begins to run.
3711    optional int64 start_processing_ns = 2;
3712    // The timestamp at which node processing finishes running.
3713    optional int64 end_processing_ns = 3;
3714    // The delay between inputs becoming ready and the node actually beginning to
3715    // run.
3716    optional int64 scheduling_latency_ns = 4;
3717  }
3718  repeated CameraNodeProcessingDetails node_processing_details = 14;
3719
3720  // These fields capture vendor-specific additions to this proto message. In
3721  // practice `vendor_data` typically contains a serialized message of the
3722  // vendor's design, and `vendor_data_version` is incremented each time there
3723  // is a backwards incompatible change made to the message.
3724  optional int32 vendor_data_version = 15;
3725  optional bytes vendor_data = 16;
3726}
3727
3728// A profiling event that may be emitted periodically (i.e., at a slower rate
3729// than `AndroidCameraFrameEvent`s) to record fixed and aggregated camera
3730// session-specific values.
3731message AndroidCameraSessionStats {
3732  // Identifier for the CameraCaptureSession this frame originates from. See:
3733  // https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession
3734  optional uint64 session_id = 1;
3735
3736  // Although vendor implementations may vary, camera pipeline processing is
3737  // typically arranged into a directed graph-like structure. This message is
3738  // used to record that graph.
3739  message CameraGraph {
3740    message CameraNode {
3741      optional int64 node_id = 1;
3742      // A list of inputs consumed by this node.
3743      repeated int64 input_ids = 2;
3744      // A list of outputs produced by this node.
3745      repeated int64 output_ids = 3;
3746
3747      // These fields capture vendor-specific additions to this proto message. In
3748      // practice `vendor_data` typically contains a serialized message of the
3749      // vendor's design, and `vendor_data_version` is incremented each time there
3750      // is a backwards incompatible change made to the message.
3751      optional int32 vendor_data_version = 4;
3752      optional bytes vendor_data = 5;
3753    }
3754    repeated CameraNode nodes = 1;
3755
3756    // An adjacency list describing connections between CameraNodes, mapping
3757    // nodes and their outputs to other nodes that consume them as inputs.
3758    message CameraEdge {
3759      // The pair of IDs identifying the node and output connected by this edge.
3760      optional int64 output_node_id = 1;
3761      optional int64 output_id = 2;
3762
3763      // The pair of IDs identifying the node and input connected by this edge.
3764      optional int64 input_node_id = 3;
3765      optional int64 input_id = 4;
3766
3767      // These fields capture vendor-specific additions to this proto message. In
3768      // practice `vendor_data` typically contains a serialized message of the
3769      // vendor's design, and `vendor_data_version` is incremented each time there
3770      // is a backwards incompatible change made to the message.
3771      optional int32 vendor_data_version = 5;
3772      optional bytes vendor_data = 6;
3773    }
3774    repeated CameraEdge edges = 2;
3775  }
3776  optional CameraGraph graph = 2;
3777}
3778
3779// End of protos/perfetto/trace/android/camera_event.proto
3780
3781// Begin of protos/perfetto/trace/android/frame_timeline_event.proto
3782
3783// Generated by SurfaceFlinger's FrameTimeline (go/adaptive-scheduling-fr).
3784// Used in comparing the expected timeline of a frame to the actual timeline.
3785// Key terms:
3786//    1) DisplayFrame - represents SurfaceFlinger's work on a frame(composited)
3787//    2) SurfaceFrame - represents App's work on its frame
3788//    3) Timeline = start to end of a component's(app/SF) work on a frame.
3789// SurfaceFlinger composites frames from many apps together, so
3790//    One DisplayFrame can map to N SurfaceFrame(s)
3791// This relationship can be reconstructed by using
3792//    DisplayFrame.token = SurfaceFrame.display_frame_token
3793message FrameTimelineEvent {
3794  // Specifies the reason(s) most likely to have caused the jank.
3795  // Used as a bitmask.
3796  enum JankType {
3797    JANK_UNSPECIFIED = 0;
3798    JANK_NONE = 1;
3799    JANK_SF_SCHEDULING = 2;
3800    JANK_PREDICTION_ERROR = 4;
3801    JANK_DISPLAY_HAL = 8;
3802    JANK_SF_CPU_DEADLINE_MISSED = 16;
3803    JANK_SF_GPU_DEADLINE_MISSED = 32;
3804    JANK_APP_DEADLINE_MISSED = 64;
3805    JANK_BUFFER_STUFFING = 128;
3806    JANK_UNKNOWN = 256;
3807    JANK_SF_STUFFING = 512;
3808    JANK_DROPPED = 1024;
3809  };
3810
3811  // Specifies how a frame was presented on screen w.r.t. timing.
3812  // Can be different for SurfaceFrame and DisplayFrame.
3813  enum PresentType {
3814    PRESENT_UNSPECIFIED = 0;
3815    PRESENT_ON_TIME = 1;
3816    PRESENT_LATE = 2;
3817    PRESENT_EARLY = 3;
3818    PRESENT_DROPPED = 4;
3819    PRESENT_UNKNOWN = 5;
3820  };
3821
3822  // Specifies if the predictions for the frame are still valid, expired or
3823  // unknown.
3824  enum PredictionType {
3825    PREDICTION_UNSPECIFIED = 0;
3826    PREDICTION_VALID = 1;
3827    PREDICTION_EXPIRED = 2;
3828    PREDICTION_UNKNOWN = 3;
3829  };
3830
3831  // Indicates the start of expected timeline slice for SurfaceFrames.
3832  message ExpectedSurfaceFrameStart {
3833    // Cookie used to correlate between the start and end messages of the same
3834    // frame. Since all values except the ts are same for start and end, cookie
3835    // helps in preventing redundant data transmission.
3836    // The same cookie is used only by start and end messages of a single frame
3837    // and is otherwise unique.
3838    optional int64 cookie = 1;
3839
3840    // Token received by the app for its work. Can be shared between multiple
3841    // layers of the same app (example: pip mode).
3842    optional int64 token = 2;
3843    // The corresponding DisplayFrame token is required to link the App's work
3844    // with SurfaceFlinger's work. Many SurfaceFrames can be mapped to a single
3845    // DisplayFrame.
3846    // this.display_frame_token = DisplayFrame.token
3847    optional int64 display_frame_token = 3;
3848
3849    // Pid of the app. Used in creating the timeline tracks (and slices) inside
3850    // the respective process track group.
3851    optional int32 pid = 4;
3852    optional string layer_name = 5;
3853  };
3854
3855  // Indicates the start of actual timeline slice for SurfaceFrames. Also
3856  // includes the jank information.
3857  message ActualSurfaceFrameStart {
3858    // Cookie used to correlate between the start and end messages of the same
3859    // frame. Since all values except the ts are same for start and end, cookie
3860    // helps in preventing redundant data transmission.
3861    // The same cookie is used only by start and end messages of a single frame
3862    // and is otherwise unique.
3863    optional int64 cookie = 1;
3864
3865    // Token received by the app for its work. Can be shared between multiple
3866    // layers of the same app (example: pip mode).
3867    optional int64 token = 2;
3868    // The corresponding DisplayFrame token is required to link the App's work
3869    // with SurfaceFlinger's work. Many SurfaceFrames can be mapped to a single
3870    // DisplayFrame.
3871    // this.display_frame_token = DisplayFrame.token
3872    optional int64 display_frame_token = 3;
3873
3874    // Pid of the app. Used in creating the timeline tracks (and slices) inside
3875    // the respective process track group.
3876    optional int32 pid = 4;
3877    optional string layer_name = 5;
3878
3879    optional PresentType present_type = 6;
3880    optional bool on_time_finish = 7;
3881    optional bool gpu_composition = 8;
3882    // A bitmask of JankType. More than one reason can be attributed to a janky
3883    // frame.
3884    optional int32 jank_type = 9;
3885    optional PredictionType prediction_type = 10;
3886    optional bool is_buffer = 11;
3887  };
3888
3889  // Indicates the start of expected timeline slice for DisplayFrames.
3890  message ExpectedDisplayFrameStart {
3891    // Cookie used to correlate between the start and end messages of the same
3892    // frame. Since all values except the ts are same for start and end, cookie
3893    // helps in preventing redundant data transmission.
3894    // The same cookie is used only by start and end messages of a single frame
3895    // and is otherwise unique.
3896    optional int64 cookie = 1;
3897
3898    // Token received by SurfaceFlinger for its work
3899    // this.token = SurfaceFrame.display_frame_token
3900    optional int64 token = 2;
3901
3902    // Pid of SurfaceFlinger. Used in creating the timeline tracks (and slices)
3903    // inside the SurfaceFlinger process group.
3904    optional int32 pid = 3;
3905  };
3906
3907  // Indicates the start of actual timeline slice for DisplayFrames. Also
3908  // includes the jank information.
3909  message ActualDisplayFrameStart {
3910    // Cookie used to correlate between the start and end messages of the same
3911    // frame. Since all values except the ts are same for start and end, cookie
3912    // helps in preventing redundant data transmission.
3913    // The same cookie is used only by start and end messages of a single frame
3914    // and is otherwise unique.
3915    optional int64 cookie = 1;
3916
3917    // Token received by SurfaceFlinger for its work
3918    // this.token = SurfaceFrame.display_frame_token
3919    optional int64 token = 2;
3920
3921    // Pid of SurfaceFlinger. Used in creating the timeline tracks (and slices)
3922    // inside the SurfaceFlinger process group.
3923    optional int32 pid = 3;
3924
3925    optional PresentType present_type = 4;
3926    optional bool on_time_finish = 5;
3927    optional bool gpu_composition = 6;
3928    // A bitmask of JankType. More than one reason can be attributed to a janky
3929    // frame.
3930    optional int32 jank_type = 7;
3931    optional PredictionType prediction_type = 8;
3932  };
3933
3934  // FrameEnd just sends the cookie to indicate that the corresponding
3935  // <display/surface>frame slice's end.
3936  message FrameEnd { optional int64 cookie = 1; };
3937
3938  oneof event {
3939    ExpectedDisplayFrameStart expected_display_frame_start = 1;
3940    ActualDisplayFrameStart actual_display_frame_start = 2;
3941
3942    ExpectedSurfaceFrameStart expected_surface_frame_start = 3;
3943    ActualSurfaceFrameStart actual_surface_frame_start = 4;
3944
3945    FrameEnd frame_end = 5;
3946  }
3947}
3948
3949// End of protos/perfetto/trace/android/frame_timeline_event.proto
3950
3951// Begin of protos/perfetto/trace/android/gpu_mem_event.proto
3952
3953// Generated by Android's GpuService.
3954message GpuMemTotalEvent {
3955  optional uint32 gpu_id = 1;
3956  optional uint32 pid = 2;
3957  optional uint64 size = 3;
3958}
3959
3960// End of protos/perfetto/trace/android/gpu_mem_event.proto
3961
3962// Begin of protos/perfetto/trace/android/graphics_frame_event.proto
3963
3964// Generated by Android's SurfaceFlinger.
3965message GraphicsFrameEvent {
3966  enum BufferEventType {
3967    UNSPECIFIED = 0;
3968    DEQUEUE = 1;
3969    QUEUE = 2;
3970    POST = 3;
3971    ACQUIRE_FENCE = 4;
3972    LATCH = 5;
3973    // HWC will compose this buffer
3974    HWC_COMPOSITION_QUEUED = 6;
3975    // renderEngine composition
3976    FALLBACK_COMPOSITION = 7;
3977    PRESENT_FENCE = 8;
3978    RELEASE_FENCE = 9;
3979    MODIFY = 10;
3980    DETACH = 11;
3981    ATTACH = 12;
3982    CANCEL = 13;
3983  }
3984
3985  message BufferEvent {
3986    optional uint32 frame_number = 1;
3987    optional BufferEventType type = 2;
3988    optional string layer_name = 3;
3989    // If no duration is set, the event is an instant event.
3990    optional uint64 duration_ns = 4;
3991    // Unique buffer identifier.
3992    optional uint32 buffer_id = 5;
3993  }
3994
3995  optional BufferEvent buffer_event = 1;
3996}
3997
3998// End of protos/perfetto/trace/android/graphics_frame_event.proto
3999
4000// Begin of protos/perfetto/trace/android/initial_display_state.proto
4001
4002message InitialDisplayState {
4003  // Same values as android.view.Display.STATE_*
4004  optional int32 display_state = 1;
4005  optional double brightness = 2;
4006}
4007
4008// End of protos/perfetto/trace/android/initial_display_state.proto
4009
4010// Begin of protos/perfetto/trace/android/network_trace.proto
4011
4012enum TrafficDirection {
4013  DIR_UNSPECIFIED = 0;
4014  DIR_INGRESS = 1;
4015  DIR_EGRESS = 2;
4016}
4017
4018// NetworkPacketEvent records the details of a single packet sent or received
4019// on the network (in Linux kernel terminology, one sk_buff struct).
4020message NetworkPacketEvent {
4021  // The direction traffic is flowing for this event.
4022  optional TrafficDirection direction = 1;
4023
4024  // The name of the interface if available (e.g. 'rmnet0').
4025  optional string interface = 2;
4026
4027  // The length of the packet in bytes (wire_size - L2_header_size). Ignored
4028  // when using NetworkPacketEvent as the ctx in either NetworkPacketBundle or
4029  // NetworkPacketContext.
4030  optional uint32 length = 3;
4031
4032  // The Linux user id associated with the packet's socket.
4033  optional uint32 uid = 4;
4034
4035  // The Android network tag associated with the packet's socket.
4036  optional uint32 tag = 5;
4037
4038  // The packet's IP protocol (TCP=6, UDP=17, etc).
4039  optional uint32 ip_proto = 6;
4040
4041  // The packet's TCP flags as a bitmask (FIN=0x1, SYN=0x2, RST=0x4, etc).
4042  optional uint32 tcp_flags = 7;
4043
4044  // The local udp/tcp port of the packet.
4045  optional uint32 local_port = 8;
4046
4047  // The remote udp/tcp port of the packet.
4048  optional uint32 remote_port = 9;
4049}
4050
4051// NetworkPacketBundle bundles one or more packets sharing the same attributes.
4052message NetworkPacketBundle {
4053  oneof packet_context {
4054    // The intern id for looking up the associated packet context.
4055    uint64 iid = 1;
4056
4057    // The inlined context for events in this bundle.
4058    NetworkPacketEvent ctx = 2;
4059  }
4060
4061  // The timestamp of the i-th packet encoded as the nanoseconds since the
4062  // enclosing TracePacket's timestamp.
4063  repeated uint64 packet_timestamps = 3 [packed = true];
4064
4065  // The length of the i-th packet in bytes (wire_size - L2_header_size).
4066  repeated uint32 packet_lengths = 4 [packed = true];
4067
4068  // Total number of packets in the bundle (when above aggregation_threshold).
4069  optional uint32 total_packets = 5;
4070
4071  // Duration between first and last packet (when above aggregation_threshold).
4072  optional uint64 total_duration = 6;
4073
4074  // Total packet length in bytes (when above aggregation_threshold).
4075  optional uint64 total_length = 7;
4076}
4077
4078// An internable packet context.
4079message NetworkPacketContext {
4080  optional uint64 iid = 1;
4081  optional NetworkPacketEvent ctx = 2;
4082}
4083
4084// End of protos/perfetto/trace/android/network_trace.proto
4085
4086// Begin of protos/perfetto/trace/android/packages_list.proto
4087
4088message PackagesList {
4089  message PackageInfo {
4090    optional string name = 1;
4091    optional uint64 uid = 2;
4092    optional bool debuggable = 3;
4093    optional bool profileable_from_shell = 4;
4094    optional int64 version_code = 5;
4095  }
4096
4097  repeated PackageInfo packages = 1;
4098
4099  // At least one error occurred parsing the packages.list.
4100  optional bool parse_error = 2;
4101
4102  // Failed to open / read packages.list.
4103  optional bool read_error = 3;
4104}
4105
4106// End of protos/perfetto/trace/android/packages_list.proto
4107
4108// Begin of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
4109
4110// This message is not intended to be written by the chrome on the device.
4111// It's emitted on the host by the telemetry benchmark infrastructure (it's a
4112// part of the trace that's written by the telemetry tracing agent).
4113message ChromeBenchmarkMetadata {
4114  // Time when the benchmark execution started (host unixtime in microseconds).
4115  optional int64 benchmark_start_time_us = 1;
4116
4117  // Time when this particular story was run (host unixtime in microseconds).
4118  optional int64 story_run_time_us = 2;
4119
4120  // Name of benchmark.
4121  optional string benchmark_name = 3;
4122
4123  // Description of benchmark.
4124  optional string benchmark_description = 4;
4125
4126  // Optional label.
4127  optional string label = 5;
4128
4129  // Name of story.
4130  optional string story_name = 6;
4131
4132  // List of story tags.
4133  repeated string story_tags = 7;
4134
4135  // Index of the story run (>0 if the same story was run several times).
4136  optional int32 story_run_index = 8;
4137
4138  // Whether this run failed.
4139  optional bool had_failures = 9;
4140}
4141
4142// End of protos/perfetto/trace/chrome/chrome_benchmark_metadata.proto
4143
4144// Begin of protos/perfetto/trace/chrome/chrome_metadata.proto
4145
4146// Metadata for chrome traces.
4147message ChromeMetadataPacket {
4148  optional BackgroundTracingMetadata background_tracing_metadata = 1;
4149
4150  // Version code of Chrome used by Android's Play Store. This field is only set
4151  // on Android.
4152  optional int32 chrome_version_code = 2;
4153
4154  // Comma separated list of enabled categories for tracing. The list of
4155  // possible category strings are listed in code
4156  // base/trace_event/builtin_categories.h.
4157  optional string enabled_categories = 3;
4158}
4159
4160// Metadata related to background tracing scenarios, states and triggers.
4161message BackgroundTracingMetadata {
4162  // Information about a trigger rule defined in the experiment config.
4163  message TriggerRule {
4164    enum TriggerType {
4165      TRIGGER_UNSPECIFIED = 0;
4166
4167      // Traces are triggered by specific range of values of an UMA histogram.
4168      MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1;
4169
4170      // Traces are triggered by specific named events in chromium codebase,
4171      // like "second-update-failure".
4172      MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2;
4173    }
4174    optional TriggerType trigger_type = 1;
4175
4176    // Configuration of histogram trigger.
4177    message HistogramRule {
4178      // UMA histogram name hash, same as HistogramEventProto.name_hash.
4179      optional fixed64 histogram_name_hash = 1;
4180
4181      // Range of values of the histogram that activates trigger.
4182      optional int64 histogram_min_trigger = 2;
4183      optional int64 histogram_max_trigger = 3;
4184    }
4185    optional HistogramRule histogram_rule = 2;
4186
4187    // Configuration of named trigger.
4188    message NamedRule {
4189      enum EventType {
4190        UNSPECIFIED = 0;
4191        SESSION_RESTORE = 1;
4192        NAVIGATION = 2;
4193        STARTUP = 3;
4194        REACHED_CODE = 4;
4195        CONTENT_TRIGGER = 5;
4196
4197        TEST_RULE = 1000;
4198      }
4199      optional EventType event_type = 1;
4200
4201      // If |event_type| is CONTENT_TRIGGER, then this stores the hash of the
4202      // content-trigger that actually fired.
4203      optional fixed64 content_trigger_name_hash = 2;
4204    }
4205    optional NamedRule named_rule = 3;
4206
4207    // Hash of the rule name.
4208    optional fixed32 name_hash = 4;
4209  }
4210
4211  // Specifies the rule that caused the trace to be uploaded.
4212  optional TriggerRule triggered_rule = 1;
4213
4214  // List of all active triggers in current session, when trace was triggered.
4215  repeated TriggerRule active_rules = 2;
4216
4217  // Hash of the scenario name.
4218  optional fixed32 scenario_name_hash = 3;
4219}
4220
4221// End of protos/perfetto/trace/chrome/chrome_metadata.proto
4222
4223// Begin of protos/perfetto/trace/chrome/chrome_trace_event.proto
4224
4225message ChromeTracedValue {
4226  enum NestedType {
4227    DICT = 0;
4228    ARRAY = 1;
4229  }
4230  optional NestedType nested_type = 1;
4231
4232  repeated string dict_keys = 2;
4233  repeated ChromeTracedValue dict_values = 3;
4234  repeated ChromeTracedValue array_values = 4;
4235  optional int32 int_value = 5;
4236  optional double double_value = 6;
4237  optional bool bool_value = 7;
4238  optional string string_value = 8;
4239}
4240
4241message ChromeStringTableEntry {
4242  optional string value = 1;
4243  optional int32 index = 2;
4244}
4245
4246// Deprecated, use TrackEvent protos instead.
4247message ChromeTraceEvent {
4248  message Arg {
4249    optional string name = 1;
4250
4251    oneof value {
4252      bool bool_value = 2;
4253      uint64 uint_value = 3;
4254      int64 int_value = 4;
4255      double double_value = 5;
4256      string string_value = 6;
4257      // Pointers are stored in a separate type as the JSON output treats them
4258      // differently from other uint64 values.
4259      uint64 pointer_value = 7;
4260      string json_value = 8;
4261      ChromeTracedValue traced_value = 10;
4262    }
4263
4264    // Takes precedence over |name| if set,
4265    // and is an index into |string_table|.
4266    optional uint32 name_index = 9;
4267  }
4268
4269  optional string name = 1;
4270  optional int64 timestamp = 2;
4271  optional int32 phase = 3;
4272  optional int32 thread_id = 4;
4273  optional int64 duration = 5;
4274  optional int64 thread_duration = 6;
4275  optional string scope = 7;
4276  optional uint64 id = 8;
4277  optional uint32 flags = 9;
4278  optional string category_group_name = 10;
4279  optional int32 process_id = 11;
4280  optional int64 thread_timestamp = 12;
4281  optional uint64 bind_id = 13;
4282
4283  repeated Arg args = 14;
4284
4285  // Takes precedence over respectively |name| and
4286  // |category_group_name_index| if set,
4287  // and are indices into |string_table|.
4288  optional uint32 name_index = 15;
4289  optional uint32 category_group_name_index = 16;
4290}
4291
4292message ChromeMetadata {
4293  optional string name = 1;
4294
4295  oneof value {
4296    string string_value = 2;
4297    bool bool_value = 3;
4298    int64 int_value = 4;
4299    string json_value = 5;
4300  }
4301}
4302
4303// Subtraces produced in legacy json format by Chrome tracing agents not yet
4304// updated to support the new binary format, e.g. ETW and CrOS ARC.
4305// TODO(eseckler): Update these agents to become perfetto producers.
4306message ChromeLegacyJsonTrace {
4307  enum TraceType {
4308    USER_TRACE = 0;
4309
4310    // Deprecated.
4311    SYSTEM_TRACE = 1;
4312  }
4313  optional TraceType type = 1;
4314  optional string data = 2;
4315}
4316
4317message ChromeEventBundle {
4318  // Deprecated, use TrackEvent protos instead.
4319  repeated ChromeTraceEvent trace_events = 1 [deprecated = true];
4320  // TODO(ssid): This should be deprecated in favor of ChromeMetadataPacket
4321  // which contains typed fields.
4322  repeated ChromeMetadata metadata = 2;
4323  // ftrace output from CrOS and Cast system tracing agents.
4324  // TODO(eseckler): Replace system traces with native perfetto service.
4325  repeated string legacy_ftrace_output = 4;
4326  repeated ChromeLegacyJsonTrace legacy_json_trace = 5;
4327
4328  // Contents of a string table that's valid for
4329  // the whole ChromeEventBundle entry.
4330  repeated ChromeStringTableEntry string_table = 3 [deprecated = true];
4331}
4332
4333// End of protos/perfetto/trace/chrome/chrome_trace_event.proto
4334
4335// Begin of protos/perfetto/trace/clock_snapshot.proto
4336
4337// A snapshot of clock readings to allow for trace alignment.
4338message ClockSnapshot {
4339  message Clock {
4340    // DEPRECATED. This enum has moved to ../common/builtin_clock.proto.
4341    enum BuiltinClocks {
4342      UNKNOWN = 0;
4343      REALTIME = 1;
4344      REALTIME_COARSE = 2;
4345      MONOTONIC = 3;
4346      MONOTONIC_COARSE = 4;
4347      MONOTONIC_RAW = 5;
4348      BOOTTIME = 6;
4349      BUILTIN_CLOCK_MAX_ID = 63;
4350
4351      reserved 7, 8;
4352    }
4353
4354    // Clock IDs have the following semantic:
4355    // [1, 63]:    Builtin types, see BuiltinClock from
4356    //             ../common/builtin_clock.proto.
4357    // [64, 127]:  User-defined clocks. These clocks are sequence-scoped. They
4358    //             are only valid within the same |trusted_packet_sequence_id|
4359    //             (i.e. only for TracePacket(s) emitted by the same TraceWriter
4360    //             that emitted the clock snapshot).
4361    // [128, MAX]: Reserved for future use. The idea is to allow global clock
4362    //             IDs and setting this ID to hash(full_clock_name) & ~127.
4363    optional uint32 clock_id = 1;
4364
4365    // Absolute timestamp. Unit is ns unless specified otherwise by the
4366    // unit_multiplier_ns field below.
4367    optional uint64 timestamp = 2;
4368
4369    // When true each TracePacket's timestamp should be interpreted as a delta
4370    // from the last TracePacket's timestamp (referencing this clock) emitted by
4371    // the same packet_sequence_id. Should only be used for user-defined
4372    // sequence-local clocks. The first packet timestamp after each
4373    // ClockSnapshot that contains this clock is relative to the |timestamp| in
4374    // the ClockSnapshot.
4375    optional bool is_incremental = 3;
4376
4377    // Allows to specify a custom unit different than the default (ns) for this
4378    // clock domain. A multiplier of 1000 means that a timestamp = 3 should be
4379    // interpreted as 3000 ns = 3 us. All snapshots for the same clock within a
4380    // trace need to use the same unit.
4381    optional uint64 unit_multiplier_ns = 4;
4382  }
4383  repeated Clock clocks = 1;
4384
4385  // The authoritative clock domain for the trace. Defaults to BOOTTIME, but can
4386  // be overridden in TraceConfig's builtin_data_sources. Trace processor will
4387  // attempt to translate packet/event timestamps from various data sources (and
4388  // their chosen clock domains) to this domain during import.
4389  optional BuiltinClock primary_trace_clock = 2;
4390}
4391
4392// End of protos/perfetto/trace/clock_snapshot.proto
4393
4394// Begin of protos/perfetto/common/descriptor.proto
4395
4396// The protocol compiler can output a FileDescriptorSet containing the .proto
4397// files it parses.
4398message FileDescriptorSet {
4399  repeated FileDescriptorProto file = 1;
4400}
4401
4402// Describes a complete .proto file.
4403message FileDescriptorProto {
4404  // file name, relative to root of source tree
4405  optional string name = 1;
4406  // e.g. "foo", "foo.bar", etc.
4407  optional string package = 2;
4408
4409  // Names of files imported by this file.
4410  repeated string dependency = 3;
4411  // Indexes of the public imported files in the dependency list above.
4412  repeated int32 public_dependency = 10;
4413  // Indexes of the weak imported files in the dependency list.
4414  // For Google-internal migration only. Do not use.
4415  repeated int32 weak_dependency = 11;
4416
4417  // All top-level definitions in this file.
4418  repeated DescriptorProto message_type = 4;
4419  repeated EnumDescriptorProto enum_type = 5;
4420  repeated FieldDescriptorProto extension = 7;
4421
4422  reserved 6;
4423  reserved 8;
4424  reserved 9;
4425  reserved 12;
4426}
4427
4428// Describes a message type.
4429message DescriptorProto {
4430  optional string name = 1;
4431
4432  repeated FieldDescriptorProto field = 2;
4433  repeated FieldDescriptorProto extension = 6;
4434
4435  repeated DescriptorProto nested_type = 3;
4436  repeated EnumDescriptorProto enum_type = 4;
4437
4438  reserved 5;
4439
4440  repeated OneofDescriptorProto oneof_decl = 8;
4441
4442  reserved 7;
4443
4444  // Range of reserved tag numbers. Reserved tag numbers may not be used by
4445  // fields or extension ranges in the same message. Reserved ranges may
4446  // not overlap.
4447  message ReservedRange {
4448    // Inclusive.
4449    optional int32 start = 1;
4450    // Exclusive.
4451    optional int32 end = 2;
4452  }
4453  repeated ReservedRange reserved_range = 9;
4454  // Reserved field names, which may not be used by fields in the same message.
4455  // A given name may only be reserved once.
4456  repeated string reserved_name = 10;
4457}
4458
4459message FieldOptions {
4460  // The packed option can be enabled for repeated primitive fields to enable
4461  // a more efficient representation on the wire. Rather than repeatedly
4462  // writing the tag and type for each element, the entire array is encoded as
4463  // a single length-delimited blob. In proto3, only explicit setting it to
4464  // false will avoid using packed encoding.
4465  optional bool packed = 2;
4466}
4467
4468// Describes a field within a message.
4469message FieldDescriptorProto {
4470  enum Type {
4471    // 0 is reserved for errors.
4472    // Order is weird for historical reasons.
4473    TYPE_DOUBLE = 1;
4474    TYPE_FLOAT = 2;
4475    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
4476    // negative values are likely.
4477    TYPE_INT64 = 3;
4478    TYPE_UINT64 = 4;
4479    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
4480    // negative values are likely.
4481    TYPE_INT32 = 5;
4482    TYPE_FIXED64 = 6;
4483    TYPE_FIXED32 = 7;
4484    TYPE_BOOL = 8;
4485    TYPE_STRING = 9;
4486    // Tag-delimited aggregate.
4487    // Group type is deprecated and not supported in proto3. However, Proto3
4488    // implementations should still be able to parse the group wire format and
4489    // treat group fields as unknown fields.
4490    TYPE_GROUP = 10;
4491    // Length-delimited aggregate.
4492    TYPE_MESSAGE = 11;
4493
4494    // New in version 2.
4495    TYPE_BYTES = 12;
4496    TYPE_UINT32 = 13;
4497    TYPE_ENUM = 14;
4498    TYPE_SFIXED32 = 15;
4499    TYPE_SFIXED64 = 16;
4500    // Uses ZigZag encoding.
4501    TYPE_SINT32 = 17;
4502    // Uses ZigZag encoding.
4503    TYPE_SINT64 = 18;
4504  };
4505
4506  enum Label {
4507    // 0 is reserved for errors
4508    LABEL_OPTIONAL = 1;
4509    LABEL_REQUIRED = 2;
4510    LABEL_REPEATED = 3;
4511  };
4512
4513  optional string name = 1;
4514  optional int32 number = 3;
4515  optional Label label = 4;
4516
4517  // If type_name is set, this need not be set.  If both this and type_name
4518  // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
4519  optional Type type = 5;
4520
4521  // For message and enum types, this is the name of the type.  If the name
4522  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
4523  // rules are used to find the type (i.e. first the nested types within this
4524  // message are searched, then within the parent, on up to the root
4525  // namespace).
4526  optional string type_name = 6;
4527
4528  // For extensions, this is the name of the type being extended.  It is
4529  // resolved in the same manner as type_name.
4530  optional string extendee = 2;
4531
4532  // For numeric types, contains the original text representation of the value.
4533  // For booleans, "true" or "false".
4534  // For strings, contains the default text contents (not escaped in any way).
4535  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
4536  // TODO(kenton):  Base-64 encode?
4537  optional string default_value = 7;
4538
4539  optional FieldOptions options = 8;
4540
4541  // If set, gives the index of a oneof in the containing type's oneof_decl
4542  // list.  This field is a member of that oneof.
4543  optional int32 oneof_index = 9;
4544
4545  reserved 10;
4546}
4547
4548// Describes a oneof.
4549message OneofDescriptorProto {
4550  optional string name = 1;
4551  optional OneofOptions options = 2;
4552}
4553
4554// Describes an enum type.
4555message EnumDescriptorProto {
4556  optional string name = 1;
4557
4558  repeated EnumValueDescriptorProto value = 2;
4559
4560  reserved 3;
4561  reserved 4;
4562
4563  // Reserved enum value names, which may not be reused. A given name may only
4564  // be reserved once.
4565  repeated string reserved_name = 5;
4566}
4567
4568// Describes a value within an enum.
4569message EnumValueDescriptorProto {
4570  optional string name = 1;
4571  optional int32 number = 2;
4572
4573  reserved 3;
4574}
4575
4576message OneofOptions {
4577  reserved 999;
4578
4579  // Clients can define custom options in extensions of this message. See above.
4580  extensions 1000 to max;
4581}
4582
4583// End of protos/perfetto/common/descriptor.proto
4584
4585// Begin of protos/perfetto/trace/extension_descriptor.proto
4586
4587// This message contains descriptors used to parse extension fields of
4588// TrackEvent.
4589//
4590// See docs/design-docs/extensions.md for more details.
4591message ExtensionDescriptor {
4592  optional FileDescriptorSet extension_set = 1;
4593}
4594
4595// End of protos/perfetto/trace/extension_descriptor.proto
4596
4597// Begin of protos/perfetto/trace/filesystem/inode_file_map.proto
4598
4599// Represents the mapping between inode numbers in a block device and their path
4600// on the filesystem
4601message InodeFileMap {
4602  // Representation of Entry
4603  message Entry {
4604    optional uint64 inode_number = 1;
4605
4606    // The path to the file, e.g. "etc/file.xml"
4607    // List of strings for multiple hardlinks
4608    repeated string paths = 2;
4609
4610    // The file type
4611    enum Type {
4612      UNKNOWN = 0;
4613      FILE = 1;
4614      DIRECTORY = 2;
4615    }
4616    optional Type type = 3;
4617  }
4618
4619  optional uint64 block_device_id = 1;
4620
4621  // The mount points of the block device, e.g. ["system"].
4622  repeated string mount_points = 2;
4623
4624  // The list of all the entries from the block device
4625  repeated Entry entries = 3;
4626}
4627
4628// End of protos/perfetto/trace/filesystem/inode_file_map.proto
4629
4630// Begin of protos/perfetto/trace/ftrace/android_fs.proto
4631
4632message AndroidFsDatareadEndFtraceEvent {
4633  optional int32 bytes = 1;
4634  optional uint64 ino = 2;
4635  optional int64 offset = 3;
4636}
4637message AndroidFsDatareadStartFtraceEvent {
4638  optional int32 bytes = 1;
4639  optional string cmdline = 2;
4640  optional int64 i_size = 3;
4641  optional uint64 ino = 4;
4642  optional int64 offset = 5;
4643  optional string pathbuf = 6;
4644  optional int32 pid = 7;
4645}
4646message AndroidFsDatawriteEndFtraceEvent {
4647  optional int32 bytes = 1;
4648  optional uint64 ino = 2;
4649  optional int64 offset = 3;
4650}
4651message AndroidFsDatawriteStartFtraceEvent {
4652  optional int32 bytes = 1;
4653  optional string cmdline = 2;
4654  optional int64 i_size = 3;
4655  optional uint64 ino = 4;
4656  optional int64 offset = 5;
4657  optional string pathbuf = 6;
4658  optional int32 pid = 7;
4659}
4660message AndroidFsFsyncEndFtraceEvent {
4661  optional int32 bytes = 1;
4662  optional uint64 ino = 2;
4663  optional int64 offset = 3;
4664}
4665message AndroidFsFsyncStartFtraceEvent {
4666  optional string cmdline = 1;
4667  optional int64 i_size = 2;
4668  optional uint64 ino = 3;
4669  optional string pathbuf = 4;
4670  optional int32 pid = 5;
4671}
4672
4673// End of protos/perfetto/trace/ftrace/android_fs.proto
4674
4675// Begin of protos/perfetto/trace/ftrace/binder.proto
4676
4677message BinderTransactionFtraceEvent {
4678  optional int32 debug_id = 1;
4679  optional int32 target_node = 2;
4680  optional int32 to_proc = 3;
4681  optional int32 to_thread = 4;
4682  optional int32 reply = 5;
4683  optional uint32 code = 6;
4684  optional uint32 flags = 7;
4685}
4686message BinderTransactionReceivedFtraceEvent {
4687  optional int32 debug_id = 1;
4688}
4689message BinderSetPriorityFtraceEvent {
4690  optional int32 proc = 1;
4691  optional int32 thread = 2;
4692  optional uint32 old_prio = 3;
4693  optional uint32 new_prio = 4;
4694  optional uint32 desired_prio = 5;
4695}
4696message BinderLockFtraceEvent {
4697  optional string tag = 1;
4698}
4699message BinderLockedFtraceEvent {
4700  optional string tag = 1;
4701}
4702message BinderUnlockFtraceEvent {
4703  optional string tag = 1;
4704}
4705message BinderTransactionAllocBufFtraceEvent {
4706  optional uint64 data_size = 1;
4707  optional int32 debug_id = 2;
4708  optional uint64 offsets_size = 3;
4709  optional uint64 extra_buffers_size = 4;
4710}
4711
4712// End of protos/perfetto/trace/ftrace/binder.proto
4713
4714// Begin of protos/perfetto/trace/ftrace/block.proto
4715
4716message BlockRqIssueFtraceEvent {
4717  optional uint64 dev = 1;
4718  optional uint64 sector = 2;
4719  optional uint32 nr_sector = 3;
4720  optional uint32 bytes = 4;
4721  optional string rwbs = 5;
4722  optional string comm = 6;
4723  optional string cmd = 7;
4724}
4725message BlockBioBackmergeFtraceEvent {
4726  optional uint64 dev = 1;
4727  optional uint64 sector = 2;
4728  optional uint32 nr_sector = 3;
4729  optional string rwbs = 4;
4730  optional string comm = 5;
4731}
4732message BlockBioBounceFtraceEvent {
4733  optional uint64 dev = 1;
4734  optional uint64 sector = 2;
4735  optional uint32 nr_sector = 3;
4736  optional string rwbs = 4;
4737  optional string comm = 5;
4738}
4739message BlockBioCompleteFtraceEvent {
4740  optional uint64 dev = 1;
4741  optional uint64 sector = 2;
4742  optional uint32 nr_sector = 3;
4743  optional int32 error = 4;
4744  optional string rwbs = 5;
4745}
4746message BlockBioFrontmergeFtraceEvent {
4747  optional uint64 dev = 1;
4748  optional uint64 sector = 2;
4749  optional uint32 nr_sector = 3;
4750  optional string rwbs = 4;
4751  optional string comm = 5;
4752}
4753message BlockBioQueueFtraceEvent {
4754  optional uint64 dev = 1;
4755  optional uint64 sector = 2;
4756  optional uint32 nr_sector = 3;
4757  optional string rwbs = 4;
4758  optional string comm = 5;
4759}
4760message BlockBioRemapFtraceEvent {
4761  optional uint64 dev = 1;
4762  optional uint64 sector = 2;
4763  optional uint32 nr_sector = 3;
4764  optional uint64 old_dev = 4;
4765  optional uint64 old_sector = 5;
4766  optional string rwbs = 6;
4767}
4768message BlockDirtyBufferFtraceEvent {
4769  optional uint64 dev = 1;
4770  optional uint64 sector = 2;
4771  optional uint64 size = 3;
4772}
4773message BlockGetrqFtraceEvent {
4774  optional uint64 dev = 1;
4775  optional uint64 sector = 2;
4776  optional uint32 nr_sector = 3;
4777  optional string rwbs = 4;
4778  optional string comm = 5;
4779}
4780message BlockPlugFtraceEvent {
4781  optional string comm = 1;
4782}
4783message BlockRqAbortFtraceEvent {
4784  optional uint64 dev = 1;
4785  optional uint64 sector = 2;
4786  optional uint32 nr_sector = 3;
4787  optional int32 errors = 4;
4788  optional string rwbs = 5;
4789  optional string cmd = 6;
4790}
4791message BlockRqCompleteFtraceEvent {
4792  optional uint64 dev = 1;
4793  optional uint64 sector = 2;
4794  optional uint32 nr_sector = 3;
4795  optional int32 errors = 4;
4796  optional string rwbs = 5;
4797  optional string cmd = 6;
4798  optional int32 error = 7;
4799}
4800message BlockRqInsertFtraceEvent {
4801  optional uint64 dev = 1;
4802  optional uint64 sector = 2;
4803  optional uint32 nr_sector = 3;
4804  optional uint32 bytes = 4;
4805  optional string rwbs = 5;
4806  optional string comm = 6;
4807  optional string cmd = 7;
4808}
4809message BlockRqRemapFtraceEvent {
4810  optional uint64 dev = 1;
4811  optional uint64 sector = 2;
4812  optional uint32 nr_sector = 3;
4813  optional uint64 old_dev = 4;
4814  optional uint64 old_sector = 5;
4815  optional uint32 nr_bios = 6;
4816  optional string rwbs = 7;
4817}
4818message BlockRqRequeueFtraceEvent {
4819  optional uint64 dev = 1;
4820  optional uint64 sector = 2;
4821  optional uint32 nr_sector = 3;
4822  optional int32 errors = 4;
4823  optional string rwbs = 5;
4824  optional string cmd = 6;
4825}
4826message BlockSleeprqFtraceEvent {
4827  optional uint64 dev = 1;
4828  optional uint64 sector = 2;
4829  optional uint32 nr_sector = 3;
4830  optional string rwbs = 4;
4831  optional string comm = 5;
4832}
4833message BlockSplitFtraceEvent {
4834  optional uint64 dev = 1;
4835  optional uint64 sector = 2;
4836  optional uint64 new_sector = 3;
4837  optional string rwbs = 4;
4838  optional string comm = 5;
4839}
4840message BlockTouchBufferFtraceEvent {
4841  optional uint64 dev = 1;
4842  optional uint64 sector = 2;
4843  optional uint64 size = 3;
4844}
4845message BlockUnplugFtraceEvent {
4846  optional int32 nr_rq = 1;
4847  optional string comm = 2;
4848}
4849
4850// End of protos/perfetto/trace/ftrace/block.proto
4851
4852// Begin of protos/perfetto/trace/ftrace/cgroup.proto
4853
4854message CgroupAttachTaskFtraceEvent {
4855  optional int32 dst_root = 1;
4856  optional int32 dst_id = 2;
4857  optional int32 pid = 3;
4858  optional string comm = 4;
4859  optional string cname = 5;
4860  optional int32 dst_level = 6;
4861  optional string dst_path = 7;
4862}
4863message CgroupMkdirFtraceEvent {
4864  optional int32 root = 1;
4865  optional int32 id = 2;
4866  optional string cname = 3;
4867  optional int32 level = 4;
4868  optional string path = 5;
4869}
4870message CgroupRemountFtraceEvent {
4871  optional int32 root = 1;
4872  optional uint32 ss_mask = 2;
4873  optional string name = 3;
4874}
4875message CgroupRmdirFtraceEvent {
4876  optional int32 root = 1;
4877  optional int32 id = 2;
4878  optional string cname = 3;
4879  optional int32 level = 4;
4880  optional string path = 5;
4881}
4882message CgroupTransferTasksFtraceEvent {
4883  optional int32 dst_root = 1;
4884  optional int32 dst_id = 2;
4885  optional int32 pid = 3;
4886  optional string comm = 4;
4887  optional string cname = 5;
4888  optional int32 dst_level = 6;
4889  optional string dst_path = 7;
4890}
4891message CgroupDestroyRootFtraceEvent {
4892  optional int32 root = 1;
4893  optional uint32 ss_mask = 2;
4894  optional string name = 3;
4895}
4896message CgroupReleaseFtraceEvent {
4897  optional int32 root = 1;
4898  optional int32 id = 2;
4899  optional string cname = 3;
4900  optional int32 level = 4;
4901  optional string path = 5;
4902}
4903message CgroupRenameFtraceEvent {
4904  optional int32 root = 1;
4905  optional int32 id = 2;
4906  optional string cname = 3;
4907  optional int32 level = 4;
4908  optional string path = 5;
4909}
4910message CgroupSetupRootFtraceEvent {
4911  optional int32 root = 1;
4912  optional uint32 ss_mask = 2;
4913  optional string name = 3;
4914}
4915
4916// End of protos/perfetto/trace/ftrace/cgroup.proto
4917
4918// Begin of protos/perfetto/trace/ftrace/clk.proto
4919
4920message ClkEnableFtraceEvent {
4921  optional string name = 1;
4922}
4923message ClkDisableFtraceEvent {
4924  optional string name = 1;
4925}
4926message ClkSetRateFtraceEvent {
4927  optional string name = 1;
4928  optional uint64 rate = 2;
4929}
4930
4931// End of protos/perfetto/trace/ftrace/clk.proto
4932
4933// Begin of protos/perfetto/trace/ftrace/cma.proto
4934
4935message CmaAllocStartFtraceEvent {
4936  optional uint32 align = 1;
4937  optional uint32 count = 2;
4938  optional string name = 3;
4939}
4940message CmaAllocInfoFtraceEvent {
4941  optional uint32 align = 1;
4942  optional uint32 count = 2;
4943  optional uint32 err_iso = 3;
4944  optional uint32 err_mig = 4;
4945  optional uint32 err_test = 5;
4946  optional string name = 6;
4947  optional uint64 nr_mapped = 7;
4948  optional uint64 nr_migrated = 8;
4949  optional uint64 nr_reclaimed = 9;
4950  optional uint64 pfn = 10;
4951}
4952
4953// End of protos/perfetto/trace/ftrace/cma.proto
4954
4955// Begin of protos/perfetto/trace/ftrace/compaction.proto
4956
4957message MmCompactionBeginFtraceEvent {
4958  optional uint64 zone_start = 1;
4959  optional uint64 migrate_pfn = 2;
4960  optional uint64 free_pfn = 3;
4961  optional uint64 zone_end = 4;
4962  optional uint32 sync = 5;
4963}
4964message MmCompactionDeferCompactionFtraceEvent {
4965  optional int32 nid = 1;
4966  optional uint32 idx = 2;
4967  optional int32 order = 3;
4968  optional uint32 considered = 4;
4969  optional uint32 defer_shift = 5;
4970  optional int32 order_failed = 6;
4971}
4972message MmCompactionDeferredFtraceEvent {
4973  optional int32 nid = 1;
4974  optional uint32 idx = 2;
4975  optional int32 order = 3;
4976  optional uint32 considered = 4;
4977  optional uint32 defer_shift = 5;
4978  optional int32 order_failed = 6;
4979}
4980message MmCompactionDeferResetFtraceEvent {
4981  optional int32 nid = 1;
4982  optional uint32 idx = 2;
4983  optional int32 order = 3;
4984  optional uint32 considered = 4;
4985  optional uint32 defer_shift = 5;
4986  optional int32 order_failed = 6;
4987}
4988message MmCompactionEndFtraceEvent {
4989  optional uint64 zone_start = 1;
4990  optional uint64 migrate_pfn = 2;
4991  optional uint64 free_pfn = 3;
4992  optional uint64 zone_end = 4;
4993  optional uint32 sync = 5;
4994  optional int32 status = 6;
4995}
4996message MmCompactionFinishedFtraceEvent {
4997  optional int32 nid = 1;
4998  optional uint32 idx = 2;
4999  optional int32 order = 3;
5000  optional int32 ret = 4;
5001}
5002message MmCompactionIsolateFreepagesFtraceEvent {
5003  optional uint64 start_pfn = 1;
5004  optional uint64 end_pfn = 2;
5005  optional uint64 nr_scanned = 3;
5006  optional uint64 nr_taken = 4;
5007}
5008message MmCompactionIsolateMigratepagesFtraceEvent {
5009  optional uint64 start_pfn = 1;
5010  optional uint64 end_pfn = 2;
5011  optional uint64 nr_scanned = 3;
5012  optional uint64 nr_taken = 4;
5013}
5014message MmCompactionKcompactdSleepFtraceEvent {
5015  optional int32 nid = 1;
5016}
5017message MmCompactionKcompactdWakeFtraceEvent {
5018  optional int32 nid = 1;
5019  optional int32 order = 2;
5020  optional uint32 classzone_idx = 3;
5021  optional uint32 highest_zoneidx = 4;
5022}
5023message MmCompactionMigratepagesFtraceEvent {
5024  optional uint64 nr_migrated = 1;
5025  optional uint64 nr_failed = 2;
5026}
5027message MmCompactionSuitableFtraceEvent {
5028  optional int32 nid = 1;
5029  optional uint32 idx = 2;
5030  optional int32 order = 3;
5031  optional int32 ret = 4;
5032}
5033message MmCompactionTryToCompactPagesFtraceEvent {
5034  optional int32 order = 1;
5035  optional uint32 gfp_mask = 2;
5036  optional uint32 mode = 3;
5037  optional int32 prio = 4;
5038}
5039message MmCompactionWakeupKcompactdFtraceEvent {
5040  optional int32 nid = 1;
5041  optional int32 order = 2;
5042  optional uint32 classzone_idx = 3;
5043  optional uint32 highest_zoneidx = 4;
5044}
5045
5046// End of protos/perfetto/trace/ftrace/compaction.proto
5047
5048// Begin of protos/perfetto/trace/ftrace/cpuhp.proto
5049
5050message CpuhpExitFtraceEvent {
5051  optional uint32 cpu = 1;
5052  optional int32 idx = 2;
5053  optional int32 ret = 3;
5054  optional int32 state = 4;
5055}
5056message CpuhpMultiEnterFtraceEvent {
5057  optional uint32 cpu = 1;
5058  optional uint64 fun = 2;
5059  optional int32 idx = 3;
5060  optional int32 target = 4;
5061}
5062message CpuhpEnterFtraceEvent {
5063  optional uint32 cpu = 1;
5064  optional uint64 fun = 2;
5065  optional int32 idx = 3;
5066  optional int32 target = 4;
5067}
5068message CpuhpLatencyFtraceEvent {
5069  optional uint32 cpu = 1;
5070  optional int32 ret = 2;
5071  optional uint32 state = 3;
5072  optional uint64 time = 4;
5073}
5074message CpuhpPauseFtraceEvent {
5075  optional uint32 active_cpus = 1;
5076  optional uint32 cpus = 2;
5077  optional uint32 pause = 3;
5078  optional uint32 time = 4;
5079}
5080
5081// End of protos/perfetto/trace/ftrace/cpuhp.proto
5082
5083// Begin of protos/perfetto/trace/ftrace/cros_ec.proto
5084
5085message CrosEcSensorhubDataFtraceEvent {
5086  optional int64 current_time = 1;
5087  optional int64 current_timestamp = 2;
5088  optional int64 delta = 3;
5089  optional uint32 ec_fifo_timestamp = 4;
5090  optional uint32 ec_sensor_num = 5;
5091  optional int64 fifo_timestamp = 6;
5092}
5093
5094// End of protos/perfetto/trace/ftrace/cros_ec.proto
5095
5096// Begin of protos/perfetto/trace/ftrace/dma_fence.proto
5097
5098message DmaFenceInitFtraceEvent {
5099  optional uint32 context = 1;
5100  optional string driver = 2;
5101  optional uint32 seqno = 3;
5102  optional string timeline = 4;
5103}
5104message DmaFenceEmitFtraceEvent {
5105  optional uint32 context = 1;
5106  optional string driver = 2;
5107  optional uint32 seqno = 3;
5108  optional string timeline = 4;
5109}
5110message DmaFenceSignaledFtraceEvent {
5111  optional uint32 context = 1;
5112  optional string driver = 2;
5113  optional uint32 seqno = 3;
5114  optional string timeline = 4;
5115}
5116message DmaFenceWaitStartFtraceEvent {
5117  optional uint32 context = 1;
5118  optional string driver = 2;
5119  optional uint32 seqno = 3;
5120  optional string timeline = 4;
5121}
5122message DmaFenceWaitEndFtraceEvent {
5123  optional uint32 context = 1;
5124  optional string driver = 2;
5125  optional uint32 seqno = 3;
5126  optional string timeline = 4;
5127}
5128
5129// End of protos/perfetto/trace/ftrace/dma_fence.proto
5130
5131// Begin of protos/perfetto/trace/ftrace/dmabuf_heap.proto
5132
5133message DmaHeapStatFtraceEvent {
5134  optional uint64 inode = 1;
5135  optional int64 len = 2;
5136  optional uint64 total_allocated = 3;
5137}
5138
5139// End of protos/perfetto/trace/ftrace/dmabuf_heap.proto
5140
5141// Begin of protos/perfetto/trace/ftrace/dpu.proto
5142
5143message DpuTracingMarkWriteFtraceEvent {
5144  optional int32 pid = 1;
5145  optional string trace_name = 2;
5146  optional uint32 trace_begin = 3;
5147  optional string name = 4;
5148  optional uint32 type = 5;
5149  optional int32 value = 6;
5150}
5151
5152// End of protos/perfetto/trace/ftrace/dpu.proto
5153
5154// Begin of protos/perfetto/trace/ftrace/drm.proto
5155
5156message DrmVblankEventFtraceEvent {
5157  optional int32 crtc = 1;
5158  optional uint32 high_prec = 2;
5159  optional uint32 seq = 3;
5160  optional int64 time = 4;
5161}
5162message DrmVblankEventDeliveredFtraceEvent {
5163  optional int32 crtc = 1;
5164  optional uint64 file = 2;
5165  optional uint32 seq = 3;
5166}
5167
5168// End of protos/perfetto/trace/ftrace/drm.proto
5169
5170// Begin of protos/perfetto/trace/ftrace/ext4.proto
5171
5172message Ext4DaWriteBeginFtraceEvent {
5173  optional uint64 dev = 1;
5174  optional uint64 ino = 2;
5175  optional int64 pos = 3;
5176  optional uint32 len = 4;
5177  optional uint32 flags = 5;
5178}
5179message Ext4DaWriteEndFtraceEvent {
5180  optional uint64 dev = 1;
5181  optional uint64 ino = 2;
5182  optional int64 pos = 3;
5183  optional uint32 len = 4;
5184  optional uint32 copied = 5;
5185}
5186message Ext4SyncFileEnterFtraceEvent {
5187  optional uint64 dev = 1;
5188  optional uint64 ino = 2;
5189  optional uint64 parent = 3;
5190  optional int32 datasync = 4;
5191}
5192message Ext4SyncFileExitFtraceEvent {
5193  optional uint64 dev = 1;
5194  optional uint64 ino = 2;
5195  optional int32 ret = 3;
5196}
5197message Ext4AllocDaBlocksFtraceEvent {
5198  optional uint64 dev = 1;
5199  optional uint64 ino = 2;
5200  optional uint32 data_blocks = 3;
5201  optional uint32 meta_blocks = 4;
5202}
5203message Ext4AllocateBlocksFtraceEvent {
5204  optional uint64 dev = 1;
5205  optional uint64 ino = 2;
5206  optional uint64 block = 3;
5207  optional uint32 len = 4;
5208  optional uint32 logical = 5;
5209  optional uint32 lleft = 6;
5210  optional uint32 lright = 7;
5211  optional uint64 goal = 8;
5212  optional uint64 pleft = 9;
5213  optional uint64 pright = 10;
5214  optional uint32 flags = 11;
5215}
5216message Ext4AllocateInodeFtraceEvent {
5217  optional uint64 dev = 1;
5218  optional uint64 ino = 2;
5219  optional uint64 dir = 3;
5220  optional uint32 mode = 4;
5221}
5222message Ext4BeginOrderedTruncateFtraceEvent {
5223  optional uint64 dev = 1;
5224  optional uint64 ino = 2;
5225  optional int64 new_size = 3;
5226}
5227message Ext4CollapseRangeFtraceEvent {
5228  optional uint64 dev = 1;
5229  optional uint64 ino = 2;
5230  optional int64 offset = 3;
5231  optional int64 len = 4;
5232}
5233message Ext4DaReleaseSpaceFtraceEvent {
5234  optional uint64 dev = 1;
5235  optional uint64 ino = 2;
5236  optional uint64 i_blocks = 3;
5237  optional int32 freed_blocks = 4;
5238  optional int32 reserved_data_blocks = 5;
5239  optional int32 reserved_meta_blocks = 6;
5240  optional int32 allocated_meta_blocks = 7;
5241  optional uint32 mode = 8;
5242}
5243message Ext4DaReserveSpaceFtraceEvent {
5244  optional uint64 dev = 1;
5245  optional uint64 ino = 2;
5246  optional uint64 i_blocks = 3;
5247  optional int32 reserved_data_blocks = 4;
5248  optional int32 reserved_meta_blocks = 5;
5249  optional uint32 mode = 6;
5250  optional int32 md_needed = 7;
5251}
5252message Ext4DaUpdateReserveSpaceFtraceEvent {
5253  optional uint64 dev = 1;
5254  optional uint64 ino = 2;
5255  optional uint64 i_blocks = 3;
5256  optional int32 used_blocks = 4;
5257  optional int32 reserved_data_blocks = 5;
5258  optional int32 reserved_meta_blocks = 6;
5259  optional int32 allocated_meta_blocks = 7;
5260  optional int32 quota_claim = 8;
5261  optional uint32 mode = 9;
5262}
5263message Ext4DaWritePagesFtraceEvent {
5264  optional uint64 dev = 1;
5265  optional uint64 ino = 2;
5266  optional uint64 first_page = 3;
5267  optional int64 nr_to_write = 4;
5268  optional int32 sync_mode = 5;
5269  optional uint64 b_blocknr = 6;
5270  optional uint32 b_size = 7;
5271  optional uint32 b_state = 8;
5272  optional int32 io_done = 9;
5273  optional int32 pages_written = 10;
5274}
5275message Ext4DaWritePagesExtentFtraceEvent {
5276  optional uint64 dev = 1;
5277  optional uint64 ino = 2;
5278  optional uint64 lblk = 3;
5279  optional uint32 len = 4;
5280  optional uint32 flags = 5;
5281}
5282message Ext4DirectIOEnterFtraceEvent {
5283  optional uint64 dev = 1;
5284  optional uint64 ino = 2;
5285  optional int64 pos = 3;
5286  optional uint64 len = 4;
5287  optional int32 rw = 5;
5288}
5289message Ext4DirectIOExitFtraceEvent {
5290  optional uint64 dev = 1;
5291  optional uint64 ino = 2;
5292  optional int64 pos = 3;
5293  optional uint64 len = 4;
5294  optional int32 rw = 5;
5295  optional int32 ret = 6;
5296}
5297message Ext4DiscardBlocksFtraceEvent {
5298  optional uint64 dev = 1;
5299  optional uint64 blk = 2;
5300  optional uint64 count = 3;
5301}
5302message Ext4DiscardPreallocationsFtraceEvent {
5303  optional uint64 dev = 1;
5304  optional uint64 ino = 2;
5305  optional uint32 len = 3;
5306  optional uint32 needed = 4;
5307}
5308message Ext4DropInodeFtraceEvent {
5309  optional uint64 dev = 1;
5310  optional uint64 ino = 2;
5311  optional int32 drop = 3;
5312}
5313message Ext4EsCacheExtentFtraceEvent {
5314  optional uint64 dev = 1;
5315  optional uint64 ino = 2;
5316  optional uint32 lblk = 3;
5317  optional uint32 len = 4;
5318  optional uint64 pblk = 5;
5319  optional uint32 status = 6;
5320}
5321message Ext4EsFindDelayedExtentRangeEnterFtraceEvent {
5322  optional uint64 dev = 1;
5323  optional uint64 ino = 2;
5324  optional uint32 lblk = 3;
5325}
5326message Ext4EsFindDelayedExtentRangeExitFtraceEvent {
5327  optional uint64 dev = 1;
5328  optional uint64 ino = 2;
5329  optional uint32 lblk = 3;
5330  optional uint32 len = 4;
5331  optional uint64 pblk = 5;
5332  optional uint64 status = 6;
5333}
5334message Ext4EsInsertExtentFtraceEvent {
5335  optional uint64 dev = 1;
5336  optional uint64 ino = 2;
5337  optional uint32 lblk = 3;
5338  optional uint32 len = 4;
5339  optional uint64 pblk = 5;
5340  optional uint64 status = 6;
5341}
5342message Ext4EsLookupExtentEnterFtraceEvent {
5343  optional uint64 dev = 1;
5344  optional uint64 ino = 2;
5345  optional uint32 lblk = 3;
5346}
5347message Ext4EsLookupExtentExitFtraceEvent {
5348  optional uint64 dev = 1;
5349  optional uint64 ino = 2;
5350  optional uint32 lblk = 3;
5351  optional uint32 len = 4;
5352  optional uint64 pblk = 5;
5353  optional uint64 status = 6;
5354  optional int32 found = 7;
5355}
5356message Ext4EsRemoveExtentFtraceEvent {
5357  optional uint64 dev = 1;
5358  optional uint64 ino = 2;
5359  optional int64 lblk = 3;
5360  optional int64 len = 4;
5361}
5362message Ext4EsShrinkFtraceEvent {
5363  optional uint64 dev = 1;
5364  optional int32 nr_shrunk = 2;
5365  optional uint64 scan_time = 3;
5366  optional int32 nr_skipped = 4;
5367  optional int32 retried = 5;
5368}
5369message Ext4EsShrinkCountFtraceEvent {
5370  optional uint64 dev = 1;
5371  optional int32 nr_to_scan = 2;
5372  optional int32 cache_cnt = 3;
5373}
5374message Ext4EsShrinkScanEnterFtraceEvent {
5375  optional uint64 dev = 1;
5376  optional int32 nr_to_scan = 2;
5377  optional int32 cache_cnt = 3;
5378}
5379message Ext4EsShrinkScanExitFtraceEvent {
5380  optional uint64 dev = 1;
5381  optional int32 nr_shrunk = 2;
5382  optional int32 cache_cnt = 3;
5383}
5384message Ext4EvictInodeFtraceEvent {
5385  optional uint64 dev = 1;
5386  optional uint64 ino = 2;
5387  optional int32 nlink = 3;
5388}
5389message Ext4ExtConvertToInitializedEnterFtraceEvent {
5390  optional uint64 dev = 1;
5391  optional uint64 ino = 2;
5392  optional uint32 m_lblk = 3;
5393  optional uint32 m_len = 4;
5394  optional uint32 u_lblk = 5;
5395  optional uint32 u_len = 6;
5396  optional uint64 u_pblk = 7;
5397}
5398message Ext4ExtConvertToInitializedFastpathFtraceEvent {
5399  optional uint64 dev = 1;
5400  optional uint64 ino = 2;
5401  optional uint32 m_lblk = 3;
5402  optional uint32 m_len = 4;
5403  optional uint32 u_lblk = 5;
5404  optional uint32 u_len = 6;
5405  optional uint64 u_pblk = 7;
5406  optional uint32 i_lblk = 8;
5407  optional uint32 i_len = 9;
5408  optional uint64 i_pblk = 10;
5409}
5410message Ext4ExtHandleUnwrittenExtentsFtraceEvent {
5411  optional uint64 dev = 1;
5412  optional uint64 ino = 2;
5413  optional int32 flags = 3;
5414  optional uint32 lblk = 4;
5415  optional uint64 pblk = 5;
5416  optional uint32 len = 6;
5417  optional uint32 allocated = 7;
5418  optional uint64 newblk = 8;
5419}
5420message Ext4ExtInCacheFtraceEvent {
5421  optional uint64 dev = 1;
5422  optional uint64 ino = 2;
5423  optional uint32 lblk = 3;
5424  optional int32 ret = 4;
5425}
5426message Ext4ExtLoadExtentFtraceEvent {
5427  optional uint64 dev = 1;
5428  optional uint64 ino = 2;
5429  optional uint64 pblk = 3;
5430  optional uint32 lblk = 4;
5431}
5432message Ext4ExtMapBlocksEnterFtraceEvent {
5433  optional uint64 dev = 1;
5434  optional uint64 ino = 2;
5435  optional uint32 lblk = 3;
5436  optional uint32 len = 4;
5437  optional uint32 flags = 5;
5438}
5439message Ext4ExtMapBlocksExitFtraceEvent {
5440  optional uint64 dev = 1;
5441  optional uint64 ino = 2;
5442  optional uint32 flags = 3;
5443  optional uint64 pblk = 4;
5444  optional uint32 lblk = 5;
5445  optional uint32 len = 6;
5446  optional uint32 mflags = 7;
5447  optional int32 ret = 8;
5448}
5449message Ext4ExtPutInCacheFtraceEvent {
5450  optional uint64 dev = 1;
5451  optional uint64 ino = 2;
5452  optional uint32 lblk = 3;
5453  optional uint32 len = 4;
5454  optional uint64 start = 5;
5455}
5456message Ext4ExtRemoveSpaceFtraceEvent {
5457  optional uint64 dev = 1;
5458  optional uint64 ino = 2;
5459  optional uint32 start = 3;
5460  optional uint32 end = 4;
5461  optional int32 depth = 5;
5462}
5463message Ext4ExtRemoveSpaceDoneFtraceEvent {
5464  optional uint64 dev = 1;
5465  optional uint64 ino = 2;
5466  optional uint32 start = 3;
5467  optional uint32 end = 4;
5468  optional int32 depth = 5;
5469  optional int64 partial = 6;
5470  optional uint32 eh_entries = 7;
5471  optional uint32 pc_lblk = 8;
5472  optional uint64 pc_pclu = 9;
5473  optional int32 pc_state = 10;
5474}
5475message Ext4ExtRmIdxFtraceEvent {
5476  optional uint64 dev = 1;
5477  optional uint64 ino = 2;
5478  optional uint64 pblk = 3;
5479}
5480message Ext4ExtRmLeafFtraceEvent {
5481  optional uint64 dev = 1;
5482  optional uint64 ino = 2;
5483  optional int64 partial = 3;
5484  optional uint32 start = 4;
5485  optional uint32 ee_lblk = 5;
5486  optional uint64 ee_pblk = 6;
5487  optional int32 ee_len = 7;
5488  optional uint32 pc_lblk = 8;
5489  optional uint64 pc_pclu = 9;
5490  optional int32 pc_state = 10;
5491}
5492message Ext4ExtShowExtentFtraceEvent {
5493  optional uint64 dev = 1;
5494  optional uint64 ino = 2;
5495  optional uint64 pblk = 3;
5496  optional uint32 lblk = 4;
5497  optional uint32 len = 5;
5498}
5499message Ext4FallocateEnterFtraceEvent {
5500  optional uint64 dev = 1;
5501  optional uint64 ino = 2;
5502  optional int64 offset = 3;
5503  optional int64 len = 4;
5504  optional int32 mode = 5;
5505  optional int64 pos = 6;
5506}
5507message Ext4FallocateExitFtraceEvent {
5508  optional uint64 dev = 1;
5509  optional uint64 ino = 2;
5510  optional int64 pos = 3;
5511  optional uint32 blocks = 4;
5512  optional int32 ret = 5;
5513}
5514message Ext4FindDelallocRangeFtraceEvent {
5515  optional uint64 dev = 1;
5516  optional uint64 ino = 2;
5517  optional uint32 from = 3;
5518  optional uint32 to = 4;
5519  optional int32 reverse = 5;
5520  optional int32 found = 6;
5521  optional uint32 found_blk = 7;
5522}
5523message Ext4ForgetFtraceEvent {
5524  optional uint64 dev = 1;
5525  optional uint64 ino = 2;
5526  optional uint64 block = 3;
5527  optional int32 is_metadata = 4;
5528  optional uint32 mode = 5;
5529}
5530message Ext4FreeBlocksFtraceEvent {
5531  optional uint64 dev = 1;
5532  optional uint64 ino = 2;
5533  optional uint64 block = 3;
5534  optional uint64 count = 4;
5535  optional int32 flags = 5;
5536  optional uint32 mode = 6;
5537}
5538message Ext4FreeInodeFtraceEvent {
5539  optional uint64 dev = 1;
5540  optional uint64 ino = 2;
5541  optional uint32 uid = 3;
5542  optional uint32 gid = 4;
5543  optional uint64 blocks = 5;
5544  optional uint32 mode = 6;
5545}
5546message Ext4GetImpliedClusterAllocExitFtraceEvent {
5547  optional uint64 dev = 1;
5548  optional uint32 flags = 2;
5549  optional uint32 lblk = 3;
5550  optional uint64 pblk = 4;
5551  optional uint32 len = 5;
5552  optional int32 ret = 6;
5553}
5554message Ext4GetReservedClusterAllocFtraceEvent {
5555  optional uint64 dev = 1;
5556  optional uint64 ino = 2;
5557  optional uint32 lblk = 3;
5558  optional uint32 len = 4;
5559}
5560message Ext4IndMapBlocksEnterFtraceEvent {
5561  optional uint64 dev = 1;
5562  optional uint64 ino = 2;
5563  optional uint32 lblk = 3;
5564  optional uint32 len = 4;
5565  optional uint32 flags = 5;
5566}
5567message Ext4IndMapBlocksExitFtraceEvent {
5568  optional uint64 dev = 1;
5569  optional uint64 ino = 2;
5570  optional uint32 flags = 3;
5571  optional uint64 pblk = 4;
5572  optional uint32 lblk = 5;
5573  optional uint32 len = 6;
5574  optional uint32 mflags = 7;
5575  optional int32 ret = 8;
5576}
5577message Ext4InsertRangeFtraceEvent {
5578  optional uint64 dev = 1;
5579  optional uint64 ino = 2;
5580  optional int64 offset = 3;
5581  optional int64 len = 4;
5582}
5583message Ext4InvalidatepageFtraceEvent {
5584  optional uint64 dev = 1;
5585  optional uint64 ino = 2;
5586  optional uint64 index = 3;
5587  optional uint64 offset = 4;
5588  optional uint32 length = 5;
5589}
5590message Ext4JournalStartFtraceEvent {
5591  optional uint64 dev = 1;
5592  optional uint64 ip = 2;
5593  optional int32 blocks = 3;
5594  optional int32 rsv_blocks = 4;
5595  optional int32 nblocks = 5;
5596  optional int32 revoke_creds = 6;
5597}
5598message Ext4JournalStartReservedFtraceEvent {
5599  optional uint64 dev = 1;
5600  optional uint64 ip = 2;
5601  optional int32 blocks = 3;
5602}
5603message Ext4JournalledInvalidatepageFtraceEvent {
5604  optional uint64 dev = 1;
5605  optional uint64 ino = 2;
5606  optional uint64 index = 3;
5607  optional uint64 offset = 4;
5608  optional uint32 length = 5;
5609}
5610message Ext4JournalledWriteEndFtraceEvent {
5611  optional uint64 dev = 1;
5612  optional uint64 ino = 2;
5613  optional int64 pos = 3;
5614  optional uint32 len = 4;
5615  optional uint32 copied = 5;
5616}
5617message Ext4LoadInodeFtraceEvent {
5618  optional uint64 dev = 1;
5619  optional uint64 ino = 2;
5620}
5621message Ext4LoadInodeBitmapFtraceEvent {
5622  optional uint64 dev = 1;
5623  optional uint32 group = 2;
5624}
5625message Ext4MarkInodeDirtyFtraceEvent {
5626  optional uint64 dev = 1;
5627  optional uint64 ino = 2;
5628  optional uint64 ip = 3;
5629}
5630message Ext4MbBitmapLoadFtraceEvent {
5631  optional uint64 dev = 1;
5632  optional uint32 group = 2;
5633}
5634message Ext4MbBuddyBitmapLoadFtraceEvent {
5635  optional uint64 dev = 1;
5636  optional uint32 group = 2;
5637}
5638message Ext4MbDiscardPreallocationsFtraceEvent {
5639  optional uint64 dev = 1;
5640  optional int32 needed = 2;
5641}
5642message Ext4MbNewGroupPaFtraceEvent {
5643  optional uint64 dev = 1;
5644  optional uint64 ino = 2;
5645  optional uint64 pa_pstart = 3;
5646  optional uint64 pa_lstart = 4;
5647  optional uint32 pa_len = 5;
5648}
5649message Ext4MbNewInodePaFtraceEvent {
5650  optional uint64 dev = 1;
5651  optional uint64 ino = 2;
5652  optional uint64 pa_pstart = 3;
5653  optional uint64 pa_lstart = 4;
5654  optional uint32 pa_len = 5;
5655}
5656message Ext4MbReleaseGroupPaFtraceEvent {
5657  optional uint64 dev = 1;
5658  optional uint64 pa_pstart = 2;
5659  optional uint32 pa_len = 3;
5660}
5661message Ext4MbReleaseInodePaFtraceEvent {
5662  optional uint64 dev = 1;
5663  optional uint64 ino = 2;
5664  optional uint64 block = 3;
5665  optional uint32 count = 4;
5666}
5667message Ext4MballocAllocFtraceEvent {
5668  optional uint64 dev = 1;
5669  optional uint64 ino = 2;
5670  optional uint32 orig_logical = 3;
5671  optional int32 orig_start = 4;
5672  optional uint32 orig_group = 5;
5673  optional int32 orig_len = 6;
5674  optional uint32 goal_logical = 7;
5675  optional int32 goal_start = 8;
5676  optional uint32 goal_group = 9;
5677  optional int32 goal_len = 10;
5678  optional uint32 result_logical = 11;
5679  optional int32 result_start = 12;
5680  optional uint32 result_group = 13;
5681  optional int32 result_len = 14;
5682  optional uint32 found = 15;
5683  optional uint32 groups = 16;
5684  optional uint32 buddy = 17;
5685  optional uint32 flags = 18;
5686  optional uint32 tail = 19;
5687  optional uint32 cr = 20;
5688}
5689message Ext4MballocDiscardFtraceEvent {
5690  optional uint64 dev = 1;
5691  optional uint64 ino = 2;
5692  optional int32 result_start = 3;
5693  optional uint32 result_group = 4;
5694  optional int32 result_len = 5;
5695}
5696message Ext4MballocFreeFtraceEvent {
5697  optional uint64 dev = 1;
5698  optional uint64 ino = 2;
5699  optional int32 result_start = 3;
5700  optional uint32 result_group = 4;
5701  optional int32 result_len = 5;
5702}
5703message Ext4MballocPreallocFtraceEvent {
5704  optional uint64 dev = 1;
5705  optional uint64 ino = 2;
5706  optional uint32 orig_logical = 3;
5707  optional int32 orig_start = 4;
5708  optional uint32 orig_group = 5;
5709  optional int32 orig_len = 6;
5710  optional uint32 result_logical = 7;
5711  optional int32 result_start = 8;
5712  optional uint32 result_group = 9;
5713  optional int32 result_len = 10;
5714}
5715message Ext4OtherInodeUpdateTimeFtraceEvent {
5716  optional uint64 dev = 1;
5717  optional uint64 ino = 2;
5718  optional uint64 orig_ino = 3;
5719  optional uint32 uid = 4;
5720  optional uint32 gid = 5;
5721  optional uint32 mode = 6;
5722}
5723message Ext4PunchHoleFtraceEvent {
5724  optional uint64 dev = 1;
5725  optional uint64 ino = 2;
5726  optional int64 offset = 3;
5727  optional int64 len = 4;
5728  optional int32 mode = 5;
5729}
5730message Ext4ReadBlockBitmapLoadFtraceEvent {
5731  optional uint64 dev = 1;
5732  optional uint32 group = 2;
5733  optional uint32 prefetch = 3;
5734}
5735message Ext4ReadpageFtraceEvent {
5736  optional uint64 dev = 1;
5737  optional uint64 ino = 2;
5738  optional uint64 index = 3;
5739}
5740message Ext4ReleasepageFtraceEvent {
5741  optional uint64 dev = 1;
5742  optional uint64 ino = 2;
5743  optional uint64 index = 3;
5744}
5745message Ext4RemoveBlocksFtraceEvent {
5746  optional uint64 dev = 1;
5747  optional uint64 ino = 2;
5748  optional uint32 from = 3;
5749  optional uint32 to = 4;
5750  optional int64 partial = 5;
5751  optional uint64 ee_pblk = 6;
5752  optional uint32 ee_lblk = 7;
5753  optional uint32 ee_len = 8;
5754  optional uint32 pc_lblk = 9;
5755  optional uint64 pc_pclu = 10;
5756  optional int32 pc_state = 11;
5757}
5758message Ext4RequestBlocksFtraceEvent {
5759  optional uint64 dev = 1;
5760  optional uint64 ino = 2;
5761  optional uint32 len = 3;
5762  optional uint32 logical = 4;
5763  optional uint32 lleft = 5;
5764  optional uint32 lright = 6;
5765  optional uint64 goal = 7;
5766  optional uint64 pleft = 8;
5767  optional uint64 pright = 9;
5768  optional uint32 flags = 10;
5769}
5770message Ext4RequestInodeFtraceEvent {
5771  optional uint64 dev = 1;
5772  optional uint64 dir = 2;
5773  optional uint32 mode = 3;
5774}
5775message Ext4SyncFsFtraceEvent {
5776  optional uint64 dev = 1;
5777  optional int32 wait = 2;
5778}
5779message Ext4TrimAllFreeFtraceEvent {
5780  optional int32 dev_major = 1;
5781  optional int32 dev_minor = 2;
5782  optional uint32 group = 3;
5783  optional int32 start = 4;
5784  optional int32 len = 5;
5785}
5786message Ext4TrimExtentFtraceEvent {
5787  optional int32 dev_major = 1;
5788  optional int32 dev_minor = 2;
5789  optional uint32 group = 3;
5790  optional int32 start = 4;
5791  optional int32 len = 5;
5792}
5793message Ext4TruncateEnterFtraceEvent {
5794  optional uint64 dev = 1;
5795  optional uint64 ino = 2;
5796  optional uint64 blocks = 3;
5797}
5798message Ext4TruncateExitFtraceEvent {
5799  optional uint64 dev = 1;
5800  optional uint64 ino = 2;
5801  optional uint64 blocks = 3;
5802}
5803message Ext4UnlinkEnterFtraceEvent {
5804  optional uint64 dev = 1;
5805  optional uint64 ino = 2;
5806  optional uint64 parent = 3;
5807  optional int64 size = 4;
5808}
5809message Ext4UnlinkExitFtraceEvent {
5810  optional uint64 dev = 1;
5811  optional uint64 ino = 2;
5812  optional int32 ret = 3;
5813}
5814message Ext4WriteBeginFtraceEvent {
5815  optional uint64 dev = 1;
5816  optional uint64 ino = 2;
5817  optional int64 pos = 3;
5818  optional uint32 len = 4;
5819  optional uint32 flags = 5;
5820}
5821message Ext4WriteEndFtraceEvent {
5822  optional uint64 dev = 1;
5823  optional uint64 ino = 2;
5824  optional int64 pos = 3;
5825  optional uint32 len = 4;
5826  optional uint32 copied = 5;
5827}
5828message Ext4WritepageFtraceEvent {
5829  optional uint64 dev = 1;
5830  optional uint64 ino = 2;
5831  optional uint64 index = 3;
5832}
5833message Ext4WritepagesFtraceEvent {
5834  optional uint64 dev = 1;
5835  optional uint64 ino = 2;
5836  optional int64 nr_to_write = 3;
5837  optional int64 pages_skipped = 4;
5838  optional int64 range_start = 5;
5839  optional int64 range_end = 6;
5840  optional uint64 writeback_index = 7;
5841  optional int32 sync_mode = 8;
5842  optional uint32 for_kupdate = 9;
5843  optional uint32 range_cyclic = 10;
5844}
5845message Ext4WritepagesResultFtraceEvent {
5846  optional uint64 dev = 1;
5847  optional uint64 ino = 2;
5848  optional int32 ret = 3;
5849  optional int32 pages_written = 4;
5850  optional int64 pages_skipped = 5;
5851  optional uint64 writeback_index = 6;
5852  optional int32 sync_mode = 7;
5853}
5854message Ext4ZeroRangeFtraceEvent {
5855  optional uint64 dev = 1;
5856  optional uint64 ino = 2;
5857  optional int64 offset = 3;
5858  optional int64 len = 4;
5859  optional int32 mode = 5;
5860}
5861
5862// End of protos/perfetto/trace/ftrace/ext4.proto
5863
5864// Begin of protos/perfetto/trace/ftrace/f2fs.proto
5865
5866message F2fsDoSubmitBioFtraceEvent {
5867  optional uint64 dev = 1;
5868  optional int32 btype = 2;
5869  optional uint32 sync = 3;
5870  optional uint64 sector = 4;
5871  optional uint32 size = 5;
5872}
5873message F2fsEvictInodeFtraceEvent {
5874  optional uint64 dev = 1;
5875  optional uint64 ino = 2;
5876  optional uint64 pino = 3;
5877  optional uint32 mode = 4;
5878  optional int64 size = 5;
5879  optional uint32 nlink = 6;
5880  optional uint64 blocks = 7;
5881  optional uint32 advise = 8;
5882}
5883message F2fsFallocateFtraceEvent {
5884  optional uint64 dev = 1;
5885  optional uint64 ino = 2;
5886  optional int32 mode = 3;
5887  optional int64 offset = 4;
5888  optional int64 len = 5;
5889  optional int64 size = 6;
5890  optional uint64 blocks = 7;
5891  optional int32 ret = 8;
5892}
5893message F2fsGetDataBlockFtraceEvent {
5894  optional uint64 dev = 1;
5895  optional uint64 ino = 2;
5896  optional uint64 iblock = 3;
5897  optional uint64 bh_start = 4;
5898  optional uint64 bh_size = 5;
5899  optional int32 ret = 6;
5900}
5901message F2fsGetVictimFtraceEvent {
5902  optional uint64 dev = 1;
5903  optional int32 type = 2;
5904  optional int32 gc_type = 3;
5905  optional int32 alloc_mode = 4;
5906  optional int32 gc_mode = 5;
5907  optional uint32 victim = 6;
5908  optional uint32 ofs_unit = 7;
5909  optional uint32 pre_victim = 8;
5910  optional uint32 prefree = 9;
5911  optional uint32 free = 10;
5912  optional uint32 cost = 11;
5913}
5914message F2fsIgetFtraceEvent {
5915  optional uint64 dev = 1;
5916  optional uint64 ino = 2;
5917  optional uint64 pino = 3;
5918  optional uint32 mode = 4;
5919  optional int64 size = 5;
5920  optional uint32 nlink = 6;
5921  optional uint64 blocks = 7;
5922  optional uint32 advise = 8;
5923}
5924message F2fsIgetExitFtraceEvent {
5925  optional uint64 dev = 1;
5926  optional uint64 ino = 2;
5927  optional int32 ret = 3;
5928}
5929message F2fsNewInodeFtraceEvent {
5930  optional uint64 dev = 1;
5931  optional uint64 ino = 2;
5932  optional int32 ret = 3;
5933}
5934message F2fsReadpageFtraceEvent {
5935  optional uint64 dev = 1;
5936  optional uint64 ino = 2;
5937  optional uint64 index = 3;
5938  optional uint64 blkaddr = 4;
5939  optional int32 type = 5;
5940  optional int32 dir = 6;
5941  optional int32 dirty = 7;
5942  optional int32 uptodate = 8;
5943}
5944message F2fsReserveNewBlockFtraceEvent {
5945  optional uint64 dev = 1;
5946  optional uint32 nid = 2;
5947  optional uint32 ofs_in_node = 3;
5948}
5949message F2fsSetPageDirtyFtraceEvent {
5950  optional uint64 dev = 1;
5951  optional uint64 ino = 2;
5952  optional int32 type = 3;
5953  optional int32 dir = 4;
5954  optional uint64 index = 5;
5955  optional int32 dirty = 6;
5956  optional int32 uptodate = 7;
5957}
5958message F2fsSubmitWritePageFtraceEvent {
5959  optional uint64 dev = 1;
5960  optional uint64 ino = 2;
5961  optional int32 type = 3;
5962  optional uint64 index = 4;
5963  optional uint32 block = 5;
5964}
5965message F2fsSyncFileEnterFtraceEvent {
5966  optional uint64 dev = 1;
5967  optional uint64 ino = 2;
5968  optional uint64 pino = 3;
5969  optional uint32 mode = 4;
5970  optional int64 size = 5;
5971  optional uint32 nlink = 6;
5972  optional uint64 blocks = 7;
5973  optional uint32 advise = 8;
5974}
5975message F2fsSyncFileExitFtraceEvent {
5976  optional uint64 dev = 1;
5977  optional uint64 ino = 2;
5978  optional uint32 need_cp = 3;
5979  optional int32 datasync = 4;
5980  optional int32 ret = 5;
5981  optional int32 cp_reason = 6;
5982}
5983message F2fsSyncFsFtraceEvent {
5984  optional uint64 dev = 1;
5985  optional int32 dirty = 2;
5986  optional int32 wait = 3;
5987}
5988message F2fsTruncateFtraceEvent {
5989  optional uint64 dev = 1;
5990  optional uint64 ino = 2;
5991  optional uint64 pino = 3;
5992  optional uint32 mode = 4;
5993  optional int64 size = 5;
5994  optional uint32 nlink = 6;
5995  optional uint64 blocks = 7;
5996  optional uint32 advise = 8;
5997}
5998message F2fsTruncateBlocksEnterFtraceEvent {
5999  optional uint64 dev = 1;
6000  optional uint64 ino = 2;
6001  optional int64 size = 3;
6002  optional uint64 blocks = 4;
6003  optional uint64 from = 5;
6004}
6005message F2fsTruncateBlocksExitFtraceEvent {
6006  optional uint64 dev = 1;
6007  optional uint64 ino = 2;
6008  optional int32 ret = 3;
6009}
6010message F2fsTruncateDataBlocksRangeFtraceEvent {
6011  optional uint64 dev = 1;
6012  optional uint64 ino = 2;
6013  optional uint32 nid = 3;
6014  optional uint32 ofs = 4;
6015  optional int32 free = 5;
6016}
6017message F2fsTruncateInodeBlocksEnterFtraceEvent {
6018  optional uint64 dev = 1;
6019  optional uint64 ino = 2;
6020  optional int64 size = 3;
6021  optional uint64 blocks = 4;
6022  optional uint64 from = 5;
6023}
6024message F2fsTruncateInodeBlocksExitFtraceEvent {
6025  optional uint64 dev = 1;
6026  optional uint64 ino = 2;
6027  optional int32 ret = 3;
6028}
6029message F2fsTruncateNodeFtraceEvent {
6030  optional uint64 dev = 1;
6031  optional uint64 ino = 2;
6032  optional uint32 nid = 3;
6033  optional uint32 blk_addr = 4;
6034}
6035message F2fsTruncateNodesEnterFtraceEvent {
6036  optional uint64 dev = 1;
6037  optional uint64 ino = 2;
6038  optional uint32 nid = 3;
6039  optional uint32 blk_addr = 4;
6040}
6041message F2fsTruncateNodesExitFtraceEvent {
6042  optional uint64 dev = 1;
6043  optional uint64 ino = 2;
6044  optional int32 ret = 3;
6045}
6046message F2fsTruncatePartialNodesFtraceEvent {
6047  optional uint64 dev = 1;
6048  optional uint64 ino = 2;
6049  optional uint32 nid = 3;
6050  optional int32 depth = 4;
6051  optional int32 err = 5;
6052}
6053message F2fsUnlinkEnterFtraceEvent {
6054  optional uint64 dev = 1;
6055  optional uint64 ino = 2;
6056  optional int64 size = 3;
6057  optional uint64 blocks = 4;
6058  optional string name = 5;
6059}
6060message F2fsUnlinkExitFtraceEvent {
6061  optional uint64 dev = 1;
6062  optional uint64 ino = 2;
6063  optional int32 ret = 3;
6064}
6065message F2fsVmPageMkwriteFtraceEvent {
6066  optional uint64 dev = 1;
6067  optional uint64 ino = 2;
6068  optional int32 type = 3;
6069  optional int32 dir = 4;
6070  optional uint64 index = 5;
6071  optional int32 dirty = 6;
6072  optional int32 uptodate = 7;
6073}
6074message F2fsWriteBeginFtraceEvent {
6075  optional uint64 dev = 1;
6076  optional uint64 ino = 2;
6077  optional int64 pos = 3;
6078  optional uint32 len = 4;
6079  optional uint32 flags = 5;
6080}
6081message F2fsWriteCheckpointFtraceEvent {
6082  optional uint64 dev = 1;
6083  optional uint32 is_umount = 2;
6084  optional string msg = 3;
6085  optional int32 reason = 4;
6086}
6087message F2fsWriteEndFtraceEvent {
6088  optional uint64 dev = 1;
6089  optional uint64 ino = 2;
6090  optional int64 pos = 3;
6091  optional uint32 len = 4;
6092  optional uint32 copied = 5;
6093}
6094message F2fsIostatFtraceEvent {
6095  optional uint64 app_bio = 1;
6096  optional uint64 app_brio = 2;
6097  optional uint64 app_dio = 3;
6098  optional uint64 app_drio = 4;
6099  optional uint64 app_mio = 5;
6100  optional uint64 app_mrio = 6;
6101  optional uint64 app_rio = 7;
6102  optional uint64 app_wio = 8;
6103  optional uint64 dev = 9;
6104  optional uint64 fs_cdrio = 10;
6105  optional uint64 fs_cp_dio = 11;
6106  optional uint64 fs_cp_mio = 12;
6107  optional uint64 fs_cp_nio = 13;
6108  optional uint64 fs_dio = 14;
6109  optional uint64 fs_discard = 15;
6110  optional uint64 fs_drio = 16;
6111  optional uint64 fs_gc_dio = 17;
6112  optional uint64 fs_gc_nio = 18;
6113  optional uint64 fs_gdrio = 19;
6114  optional uint64 fs_mio = 20;
6115  optional uint64 fs_mrio = 21;
6116  optional uint64 fs_nio = 22;
6117  optional uint64 fs_nrio = 23;
6118}
6119message F2fsIostatLatencyFtraceEvent {
6120  optional uint32 d_rd_avg = 1;
6121  optional uint32 d_rd_cnt = 2;
6122  optional uint32 d_rd_peak = 3;
6123  optional uint32 d_wr_as_avg = 4;
6124  optional uint32 d_wr_as_cnt = 5;
6125  optional uint32 d_wr_as_peak = 6;
6126  optional uint32 d_wr_s_avg = 7;
6127  optional uint32 d_wr_s_cnt = 8;
6128  optional uint32 d_wr_s_peak = 9;
6129  optional uint64 dev = 10;
6130  optional uint32 m_rd_avg = 11;
6131  optional uint32 m_rd_cnt = 12;
6132  optional uint32 m_rd_peak = 13;
6133  optional uint32 m_wr_as_avg = 14;
6134  optional uint32 m_wr_as_cnt = 15;
6135  optional uint32 m_wr_as_peak = 16;
6136  optional uint32 m_wr_s_avg = 17;
6137  optional uint32 m_wr_s_cnt = 18;
6138  optional uint32 m_wr_s_peak = 19;
6139  optional uint32 n_rd_avg = 20;
6140  optional uint32 n_rd_cnt = 21;
6141  optional uint32 n_rd_peak = 22;
6142  optional uint32 n_wr_as_avg = 23;
6143  optional uint32 n_wr_as_cnt = 24;
6144  optional uint32 n_wr_as_peak = 25;
6145  optional uint32 n_wr_s_avg = 26;
6146  optional uint32 n_wr_s_cnt = 27;
6147  optional uint32 n_wr_s_peak = 28;
6148}
6149
6150// End of protos/perfetto/trace/ftrace/f2fs.proto
6151
6152// Begin of protos/perfetto/trace/ftrace/fastrpc.proto
6153
6154message FastrpcDmaStatFtraceEvent {
6155  optional int32 cid = 1;
6156  optional int64 len = 2;
6157  optional uint64 total_allocated = 3;
6158}
6159
6160// End of protos/perfetto/trace/ftrace/fastrpc.proto
6161
6162// Begin of protos/perfetto/trace/ftrace/fence.proto
6163
6164message FenceInitFtraceEvent {
6165  optional uint32 context = 1;
6166  optional string driver = 2;
6167  optional uint32 seqno = 3;
6168  optional string timeline = 4;
6169}
6170message FenceDestroyFtraceEvent {
6171  optional uint32 context = 1;
6172  optional string driver = 2;
6173  optional uint32 seqno = 3;
6174  optional string timeline = 4;
6175}
6176message FenceEnableSignalFtraceEvent {
6177  optional uint32 context = 1;
6178  optional string driver = 2;
6179  optional uint32 seqno = 3;
6180  optional string timeline = 4;
6181}
6182message FenceSignaledFtraceEvent {
6183  optional uint32 context = 1;
6184  optional string driver = 2;
6185  optional uint32 seqno = 3;
6186  optional string timeline = 4;
6187}
6188
6189// End of protos/perfetto/trace/ftrace/fence.proto
6190
6191// Begin of protos/perfetto/trace/ftrace/filemap.proto
6192
6193message MmFilemapAddToPageCacheFtraceEvent {
6194  optional uint64 pfn = 1;
6195  optional uint64 i_ino = 2;
6196  optional uint64 index = 3;
6197  optional uint64 s_dev = 4;
6198  optional uint64 page = 5;
6199}
6200message MmFilemapDeleteFromPageCacheFtraceEvent {
6201  optional uint64 pfn = 1;
6202  optional uint64 i_ino = 2;
6203  optional uint64 index = 3;
6204  optional uint64 s_dev = 4;
6205  optional uint64 page = 5;
6206}
6207
6208// End of protos/perfetto/trace/ftrace/filemap.proto
6209
6210// Begin of protos/perfetto/trace/ftrace/ftrace.proto
6211
6212message PrintFtraceEvent {
6213  optional uint64 ip = 1;
6214  optional string buf = 2;
6215}
6216message FuncgraphEntryFtraceEvent {
6217  optional int32 depth = 1;
6218  optional uint64 func = 2;
6219}
6220message FuncgraphExitFtraceEvent {
6221  optional uint64 calltime = 1;
6222  optional int32 depth = 2;
6223  optional uint64 func = 3;
6224  optional uint64 overrun = 4;
6225  optional uint64 rettime = 5;
6226}
6227
6228// End of protos/perfetto/trace/ftrace/ftrace.proto
6229
6230// Begin of protos/perfetto/trace/ftrace/g2d.proto
6231
6232message G2dTracingMarkWriteFtraceEvent {
6233  optional int32 pid = 1;
6234  optional string name = 4;
6235  optional uint32 type = 5;
6236  optional int32 value = 6;
6237}
6238
6239// End of protos/perfetto/trace/ftrace/g2d.proto
6240
6241// Begin of protos/perfetto/trace/ftrace/generic.proto
6242
6243// This generic proto is used to output events in the trace
6244// when a specific proto for that event does not exist.
6245message GenericFtraceEvent {
6246  message Field {
6247    optional string name = 1;
6248    oneof value {
6249      string str_value = 3;
6250      int64 int_value = 4;
6251      uint64 uint_value = 5;
6252    }
6253  }
6254
6255  optional string event_name = 1;
6256  repeated Field field = 2;
6257}
6258
6259// End of protos/perfetto/trace/ftrace/generic.proto
6260
6261// Begin of protos/perfetto/trace/ftrace/gpu_mem.proto
6262
6263message GpuMemTotalFtraceEvent {
6264  optional uint32 gpu_id = 1;
6265  optional uint32 pid = 2;
6266  optional uint64 size = 3;
6267}
6268
6269// End of protos/perfetto/trace/ftrace/gpu_mem.proto
6270
6271// Begin of protos/perfetto/trace/ftrace/gpu_scheduler.proto
6272
6273message DrmSchedJobFtraceEvent {
6274  optional uint64 entity = 1;
6275  optional uint64 fence = 2;
6276  optional int32 hw_job_count = 3;
6277  optional uint64 id = 4;
6278  optional uint32 job_count = 5;
6279  optional string name = 6;
6280}
6281message DrmRunJobFtraceEvent {
6282  optional uint64 entity = 1;
6283  optional uint64 fence = 2;
6284  optional int32 hw_job_count = 3;
6285  optional uint64 id = 4;
6286  optional uint32 job_count = 5;
6287  optional string name = 6;
6288}
6289message DrmSchedProcessJobFtraceEvent {
6290  optional uint64 fence = 1;
6291}
6292
6293// End of protos/perfetto/trace/ftrace/gpu_scheduler.proto
6294
6295// Begin of protos/perfetto/trace/ftrace/hyp.proto
6296
6297message HypEnterFtraceEvent {}
6298message HypExitFtraceEvent {}
6299message HostHcallFtraceEvent {
6300  optional uint32 id = 1;
6301  optional uint32 invalid = 2;
6302}
6303message HostSmcFtraceEvent {
6304  optional uint64 id = 1;
6305  optional uint32 forwarded = 2;
6306}
6307message HostMemAbortFtraceEvent {
6308  optional uint64 esr = 1;
6309  optional uint64 addr = 2;
6310}
6311
6312// End of protos/perfetto/trace/ftrace/hyp.proto
6313
6314// Begin of protos/perfetto/trace/ftrace/i2c.proto
6315
6316message I2cReadFtraceEvent {
6317  optional int32 adapter_nr = 1;
6318  optional uint32 msg_nr = 2;
6319  optional uint32 addr = 3;
6320  optional uint32 flags = 4;
6321  optional uint32 len = 5;
6322}
6323message I2cWriteFtraceEvent {
6324  optional int32 adapter_nr = 1;
6325  optional uint32 msg_nr = 2;
6326  optional uint32 addr = 3;
6327  optional uint32 flags = 4;
6328  optional uint32 len = 5;
6329  optional uint32 buf = 6;
6330}
6331message I2cResultFtraceEvent {
6332  optional int32 adapter_nr = 1;
6333  optional uint32 nr_msgs = 2;
6334  optional int32 ret = 3;
6335}
6336message I2cReplyFtraceEvent {
6337  optional int32 adapter_nr = 1;
6338  optional uint32 msg_nr = 2;
6339  optional uint32 addr = 3;
6340  optional uint32 flags = 4;
6341  optional uint32 len = 5;
6342  optional uint32 buf = 6;
6343}
6344message SmbusReadFtraceEvent {
6345  optional int32 adapter_nr = 1;
6346  optional uint32 flags = 2;
6347  optional uint32 addr = 3;
6348  optional uint32 command = 4;
6349  optional uint32 protocol = 5;
6350}
6351message SmbusWriteFtraceEvent {
6352  optional int32 adapter_nr = 1;
6353  optional uint32 addr = 2;
6354  optional uint32 flags = 3;
6355  optional uint32 command = 4;
6356  optional uint32 len = 5;
6357  optional uint32 protocol = 6;
6358}
6359message SmbusResultFtraceEvent {
6360  optional int32 adapter_nr = 1;
6361  optional uint32 addr = 2;
6362  optional uint32 flags = 3;
6363  optional uint32 read_write = 4;
6364  optional uint32 command = 5;
6365  optional int32 res = 6;
6366  optional uint32 protocol = 7;
6367}
6368message SmbusReplyFtraceEvent {
6369  optional int32 adapter_nr = 1;
6370  optional uint32 addr = 2;
6371  optional uint32 flags = 3;
6372  optional uint32 command = 4;
6373  optional uint32 len = 5;
6374  optional uint32 protocol = 6;
6375}
6376
6377// End of protos/perfetto/trace/ftrace/i2c.proto
6378
6379// Begin of protos/perfetto/trace/ftrace/ion.proto
6380
6381message IonStatFtraceEvent {
6382  optional uint32 buffer_id = 1;
6383  optional int64 len = 2;
6384  optional uint64 total_allocated = 3;
6385}
6386
6387// End of protos/perfetto/trace/ftrace/ion.proto
6388
6389// Begin of protos/perfetto/trace/ftrace/ipi.proto
6390
6391message IpiEntryFtraceEvent {
6392  optional string reason = 1;
6393}
6394message IpiExitFtraceEvent {
6395  optional string reason = 1;
6396}
6397message IpiRaiseFtraceEvent {
6398  optional uint32 target_cpus = 1;
6399  optional string reason = 2;
6400}
6401
6402// End of protos/perfetto/trace/ftrace/ipi.proto
6403
6404// Begin of protos/perfetto/trace/ftrace/irq.proto
6405
6406message SoftirqEntryFtraceEvent {
6407  optional uint32 vec = 1;
6408}
6409message SoftirqExitFtraceEvent {
6410  optional uint32 vec = 1;
6411}
6412message SoftirqRaiseFtraceEvent {
6413  optional uint32 vec = 1;
6414}
6415message IrqHandlerEntryFtraceEvent {
6416  optional int32 irq = 1;
6417  optional string name = 2;
6418  optional uint32 handler = 3;
6419}
6420message IrqHandlerExitFtraceEvent {
6421  optional int32 irq = 1;
6422  optional int32 ret = 2;
6423}
6424
6425// End of protos/perfetto/trace/ftrace/irq.proto
6426
6427// Begin of protos/perfetto/trace/ftrace/kmem.proto
6428
6429message AllocPagesIommuEndFtraceEvent {
6430  optional uint32 gfp_flags = 1;
6431  optional uint32 order = 2;
6432}
6433message AllocPagesIommuFailFtraceEvent {
6434  optional uint32 gfp_flags = 1;
6435  optional uint32 order = 2;
6436}
6437message AllocPagesIommuStartFtraceEvent {
6438  optional uint32 gfp_flags = 1;
6439  optional uint32 order = 2;
6440}
6441message AllocPagesSysEndFtraceEvent {
6442  optional uint32 gfp_flags = 1;
6443  optional uint32 order = 2;
6444}
6445message AllocPagesSysFailFtraceEvent {
6446  optional uint32 gfp_flags = 1;
6447  optional uint32 order = 2;
6448}
6449message AllocPagesSysStartFtraceEvent {
6450  optional uint32 gfp_flags = 1;
6451  optional uint32 order = 2;
6452}
6453message DmaAllocContiguousRetryFtraceEvent {
6454  optional int32 tries = 1;
6455}
6456message IommuMapRangeFtraceEvent {
6457  optional uint64 chunk_size = 1;
6458  optional uint64 len = 2;
6459  optional uint64 pa = 3;
6460  optional uint64 va = 4;
6461}
6462message IommuSecPtblMapRangeEndFtraceEvent {
6463  optional uint64 len = 1;
6464  optional int32 num = 2;
6465  optional uint32 pa = 3;
6466  optional int32 sec_id = 4;
6467  optional uint64 va = 5;
6468}
6469message IommuSecPtblMapRangeStartFtraceEvent {
6470  optional uint64 len = 1;
6471  optional int32 num = 2;
6472  optional uint32 pa = 3;
6473  optional int32 sec_id = 4;
6474  optional uint64 va = 5;
6475}
6476message IonAllocBufferEndFtraceEvent {
6477  optional string client_name = 1;
6478  optional uint32 flags = 2;
6479  optional string heap_name = 3;
6480  optional uint64 len = 4;
6481  optional uint32 mask = 5;
6482}
6483message IonAllocBufferFailFtraceEvent {
6484  optional string client_name = 1;
6485  optional int64 error = 2;
6486  optional uint32 flags = 3;
6487  optional string heap_name = 4;
6488  optional uint64 len = 5;
6489  optional uint32 mask = 6;
6490}
6491message IonAllocBufferFallbackFtraceEvent {
6492  optional string client_name = 1;
6493  optional int64 error = 2;
6494  optional uint32 flags = 3;
6495  optional string heap_name = 4;
6496  optional uint64 len = 5;
6497  optional uint32 mask = 6;
6498}
6499message IonAllocBufferStartFtraceEvent {
6500  optional string client_name = 1;
6501  optional uint32 flags = 2;
6502  optional string heap_name = 3;
6503  optional uint64 len = 4;
6504  optional uint32 mask = 5;
6505}
6506message IonCpAllocRetryFtraceEvent {
6507  optional int32 tries = 1;
6508}
6509message IonCpSecureBufferEndFtraceEvent {
6510  optional uint64 align = 1;
6511  optional uint64 flags = 2;
6512  optional string heap_name = 3;
6513  optional uint64 len = 4;
6514}
6515message IonCpSecureBufferStartFtraceEvent {
6516  optional uint64 align = 1;
6517  optional uint64 flags = 2;
6518  optional string heap_name = 3;
6519  optional uint64 len = 4;
6520}
6521message IonPrefetchingFtraceEvent {
6522  optional uint64 len = 1;
6523}
6524message IonSecureCmaAddToPoolEndFtraceEvent {
6525  optional uint32 is_prefetch = 1;
6526  optional uint64 len = 2;
6527  optional int32 pool_total = 3;
6528}
6529message IonSecureCmaAddToPoolStartFtraceEvent {
6530  optional uint32 is_prefetch = 1;
6531  optional uint64 len = 2;
6532  optional int32 pool_total = 3;
6533}
6534message IonSecureCmaAllocateEndFtraceEvent {
6535  optional uint64 align = 1;
6536  optional uint64 flags = 2;
6537  optional string heap_name = 3;
6538  optional uint64 len = 4;
6539}
6540message IonSecureCmaAllocateStartFtraceEvent {
6541  optional uint64 align = 1;
6542  optional uint64 flags = 2;
6543  optional string heap_name = 3;
6544  optional uint64 len = 4;
6545}
6546message IonSecureCmaShrinkPoolEndFtraceEvent {
6547  optional uint64 drained_size = 1;
6548  optional uint64 skipped_size = 2;
6549}
6550message IonSecureCmaShrinkPoolStartFtraceEvent {
6551  optional uint64 drained_size = 1;
6552  optional uint64 skipped_size = 2;
6553}
6554message KfreeFtraceEvent {
6555  optional uint64 call_site = 1;
6556  optional uint64 ptr = 2;
6557}
6558message KmallocFtraceEvent {
6559  optional uint64 bytes_alloc = 1;
6560  optional uint64 bytes_req = 2;
6561  optional uint64 call_site = 3;
6562  optional uint32 gfp_flags = 4;
6563  optional uint64 ptr = 5;
6564}
6565message KmallocNodeFtraceEvent {
6566  optional uint64 bytes_alloc = 1;
6567  optional uint64 bytes_req = 2;
6568  optional uint64 call_site = 3;
6569  optional uint32 gfp_flags = 4;
6570  optional int32 node = 5;
6571  optional uint64 ptr = 6;
6572}
6573message KmemCacheAllocFtraceEvent {
6574  optional uint64 bytes_alloc = 1;
6575  optional uint64 bytes_req = 2;
6576  optional uint64 call_site = 3;
6577  optional uint32 gfp_flags = 4;
6578  optional uint64 ptr = 5;
6579}
6580message KmemCacheAllocNodeFtraceEvent {
6581  optional uint64 bytes_alloc = 1;
6582  optional uint64 bytes_req = 2;
6583  optional uint64 call_site = 3;
6584  optional uint32 gfp_flags = 4;
6585  optional int32 node = 5;
6586  optional uint64 ptr = 6;
6587}
6588message KmemCacheFreeFtraceEvent {
6589  optional uint64 call_site = 1;
6590  optional uint64 ptr = 2;
6591}
6592message MigratePagesEndFtraceEvent {
6593  optional int32 mode = 1;
6594}
6595message MigratePagesStartFtraceEvent {
6596  optional int32 mode = 1;
6597}
6598message MigrateRetryFtraceEvent {
6599  optional int32 tries = 1;
6600}
6601message MmPageAllocFtraceEvent {
6602  optional uint32 gfp_flags = 1;
6603  optional int32 migratetype = 2;
6604  optional uint32 order = 3;
6605  optional uint64 page = 4;
6606  optional uint64 pfn = 5;
6607}
6608message MmPageAllocExtfragFtraceEvent {
6609  optional int32 alloc_migratetype = 1;
6610  optional int32 alloc_order = 2;
6611  optional int32 fallback_migratetype = 3;
6612  optional int32 fallback_order = 4;
6613  optional uint64 page = 5;
6614  optional int32 change_ownership = 6;
6615  optional uint64 pfn = 7;
6616}
6617message MmPageAllocZoneLockedFtraceEvent {
6618  optional int32 migratetype = 1;
6619  optional uint32 order = 2;
6620  optional uint64 page = 3;
6621  optional uint64 pfn = 4;
6622}
6623message MmPageFreeFtraceEvent {
6624  optional uint32 order = 1;
6625  optional uint64 page = 2;
6626  optional uint64 pfn = 3;
6627}
6628message MmPageFreeBatchedFtraceEvent {
6629  optional int32 cold = 1;
6630  optional uint64 page = 2;
6631  optional uint64 pfn = 3;
6632}
6633message MmPagePcpuDrainFtraceEvent {
6634  optional int32 migratetype = 1;
6635  optional uint32 order = 2;
6636  optional uint64 page = 3;
6637  optional uint64 pfn = 4;
6638}
6639message RssStatFtraceEvent {
6640  optional int32 member = 1;
6641  optional int64 size = 2;
6642  optional uint32 curr = 3;
6643  optional uint32 mm_id = 4;
6644}
6645message IonHeapShrinkFtraceEvent {
6646  optional string heap_name = 1;
6647  optional uint64 len = 2;
6648  optional int64 total_allocated = 3;
6649}
6650message IonHeapGrowFtraceEvent {
6651  optional string heap_name = 1;
6652  optional uint64 len = 2;
6653  optional int64 total_allocated = 3;
6654}
6655message IonBufferCreateFtraceEvent {
6656  optional uint64 addr = 1;
6657  optional uint64 len = 2;
6658}
6659message IonBufferDestroyFtraceEvent {
6660  optional uint64 addr = 1;
6661  optional uint64 len = 2;
6662}
6663
6664// End of protos/perfetto/trace/ftrace/kmem.proto
6665
6666// Begin of protos/perfetto/trace/ftrace/kvm.proto
6667
6668message KvmAccessFaultFtraceEvent {
6669  optional uint64 ipa = 1;
6670}
6671message KvmAckIrqFtraceEvent {
6672  optional uint32 irqchip = 1;
6673  optional uint32 pin = 2;
6674}
6675message KvmAgeHvaFtraceEvent {
6676  optional uint64 end = 1;
6677  optional uint64 start = 2;
6678}
6679message KvmAgePageFtraceEvent {
6680  optional uint64 gfn = 1;
6681  optional uint64 hva = 2;
6682  optional uint32 level = 3;
6683  optional uint32 referenced = 4;
6684}
6685message KvmArmClearDebugFtraceEvent {
6686  optional uint32 guest_debug = 1;
6687}
6688message KvmArmSetDreg32FtraceEvent {
6689  optional string name = 1;
6690  optional uint32 value = 2;
6691}
6692message KvmArmSetRegsetFtraceEvent {
6693  optional int32 len = 1;
6694  optional string name = 2;
6695}
6696message KvmArmSetupDebugFtraceEvent {
6697  optional uint32 guest_debug = 1;
6698  optional uint64 vcpu = 2;
6699}
6700message KvmEntryFtraceEvent {
6701  optional uint64 vcpu_pc = 1;
6702}
6703message KvmExitFtraceEvent {
6704  optional uint32 esr_ec = 1;
6705  optional int32 ret = 2;
6706  optional uint64 vcpu_pc = 3;
6707}
6708message KvmFpuFtraceEvent {
6709  optional uint32 load = 1;
6710}
6711message KvmGetTimerMapFtraceEvent {
6712  optional int32 direct_ptimer = 1;
6713  optional int32 direct_vtimer = 2;
6714  optional int32 emul_ptimer = 3;
6715  optional uint64 vcpu_id = 4;
6716}
6717message KvmGuestFaultFtraceEvent {
6718  optional uint64 hsr = 1;
6719  optional uint64 hxfar = 2;
6720  optional uint64 ipa = 3;
6721  optional uint64 vcpu_pc = 4;
6722}
6723message KvmHandleSysRegFtraceEvent {
6724  optional uint64 hsr = 1;
6725}
6726message KvmHvcArm64FtraceEvent {
6727  optional uint64 imm = 1;
6728  optional uint64 r0 = 2;
6729  optional uint64 vcpu_pc = 3;
6730}
6731message KvmIrqLineFtraceEvent {
6732  optional int32 irq_num = 1;
6733  optional int32 level = 2;
6734  optional uint32 type = 3;
6735  optional int32 vcpu_idx = 4;
6736}
6737message KvmMmioFtraceEvent {
6738  optional uint64 gpa = 1;
6739  optional uint32 len = 2;
6740  optional uint32 type = 3;
6741  optional uint64 val = 4;
6742}
6743message KvmMmioEmulateFtraceEvent {
6744  optional uint64 cpsr = 1;
6745  optional uint64 instr = 2;
6746  optional uint64 vcpu_pc = 3;
6747}
6748message KvmSetGuestDebugFtraceEvent {
6749  optional uint32 guest_debug = 1;
6750  optional uint64 vcpu = 2;
6751}
6752message KvmSetIrqFtraceEvent {
6753  optional uint32 gsi = 1;
6754  optional int32 irq_source_id = 2;
6755  optional int32 level = 3;
6756}
6757message KvmSetSpteHvaFtraceEvent {
6758  optional uint64 hva = 1;
6759}
6760message KvmSetWayFlushFtraceEvent {
6761  optional uint32 cache = 1;
6762  optional uint64 vcpu_pc = 2;
6763}
6764message KvmSysAccessFtraceEvent {
6765  optional uint32 CRm = 1;
6766  optional uint32 CRn = 2;
6767  optional uint32 Op0 = 3;
6768  optional uint32 Op1 = 4;
6769  optional uint32 Op2 = 5;
6770  optional uint32 is_write = 6;
6771  optional string name = 7;
6772  optional uint64 vcpu_pc = 8;
6773}
6774message KvmTestAgeHvaFtraceEvent {
6775  optional uint64 hva = 1;
6776}
6777message KvmTimerEmulateFtraceEvent {
6778  optional uint32 should_fire = 1;
6779  optional int32 timer_idx = 2;
6780}
6781message KvmTimerHrtimerExpireFtraceEvent {
6782  optional int32 timer_idx = 1;
6783}
6784message KvmTimerRestoreStateFtraceEvent {
6785  optional uint64 ctl = 1;
6786  optional uint64 cval = 2;
6787  optional int32 timer_idx = 3;
6788}
6789message KvmTimerSaveStateFtraceEvent {
6790  optional uint64 ctl = 1;
6791  optional uint64 cval = 2;
6792  optional int32 timer_idx = 3;
6793}
6794message KvmTimerUpdateIrqFtraceEvent {
6795  optional uint32 irq = 1;
6796  optional int32 level = 2;
6797  optional uint64 vcpu_id = 3;
6798}
6799message KvmToggleCacheFtraceEvent {
6800  optional uint32 now = 1;
6801  optional uint64 vcpu_pc = 2;
6802  optional uint32 was = 3;
6803}
6804message KvmUnmapHvaRangeFtraceEvent {
6805  optional uint64 end = 1;
6806  optional uint64 start = 2;
6807}
6808message KvmUserspaceExitFtraceEvent {
6809  optional uint32 reason = 1;
6810}
6811message KvmVcpuWakeupFtraceEvent {
6812  optional uint64 ns = 1;
6813  optional uint32 valid = 2;
6814  optional uint32 waited = 3;
6815}
6816message KvmWfxArm64FtraceEvent {
6817  optional uint32 is_wfe = 1;
6818  optional uint64 vcpu_pc = 2;
6819}
6820message TrapRegFtraceEvent {
6821  optional string fn = 1;
6822  optional uint32 is_write = 2;
6823  optional int32 reg = 3;
6824  optional uint64 write_value = 4;
6825}
6826message VgicUpdateIrqPendingFtraceEvent {
6827  optional uint32 irq = 1;
6828  optional uint32 level = 2;
6829  optional uint64 vcpu_id = 3;
6830}
6831
6832// End of protos/perfetto/trace/ftrace/kvm.proto
6833
6834// Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto
6835
6836message LowmemoryKillFtraceEvent {
6837  optional string comm = 1;
6838  optional int32 pid = 2;
6839  optional int64 pagecache_size = 3;
6840  optional int64 pagecache_limit = 4;
6841  optional int64 free = 5;
6842}
6843
6844// End of protos/perfetto/trace/ftrace/lowmemorykiller.proto
6845
6846// Begin of protos/perfetto/trace/ftrace/lwis.proto
6847
6848message LwisTracingMarkWriteFtraceEvent {
6849  optional string lwis_name = 1;
6850  optional uint32 type = 2;
6851  optional int32 pid = 3;
6852  optional string func_name = 4;
6853  optional int64 value = 5;
6854}
6855
6856// End of protos/perfetto/trace/ftrace/lwis.proto
6857
6858// Begin of protos/perfetto/trace/ftrace/mali.proto
6859
6860message MaliTracingMarkWriteFtraceEvent {
6861  optional string name = 1;
6862  optional int32 pid = 2;
6863  optional uint32 type = 3;
6864  optional int32 value = 4;
6865}
6866message MaliMaliKCPUCQSSETFtraceEvent {
6867  optional uint32 id = 1;
6868  optional uint64 info_val1 = 2;
6869  optional uint64 info_val2 = 3;
6870  optional uint32 kctx_id = 4;
6871  optional int32 kctx_tgid = 5;
6872}
6873message MaliMaliKCPUCQSWAITSTARTFtraceEvent {
6874  optional uint32 id = 1;
6875  optional uint64 info_val1 = 2;
6876  optional uint64 info_val2 = 3;
6877  optional uint32 kctx_id = 4;
6878  optional int32 kctx_tgid = 5;
6879}
6880message MaliMaliKCPUCQSWAITENDFtraceEvent {
6881  optional uint32 id = 1;
6882  optional uint64 info_val1 = 2;
6883  optional uint64 info_val2 = 3;
6884  optional uint32 kctx_id = 4;
6885  optional int32 kctx_tgid = 5;
6886}
6887message MaliMaliKCPUFENCESIGNALFtraceEvent {
6888  optional uint64 info_val1 = 1;
6889  optional uint64 info_val2 = 2;
6890  optional int32 kctx_tgid = 3;
6891  optional uint32 kctx_id = 4;
6892  optional uint32 id = 5;
6893}
6894message MaliMaliKCPUFENCEWAITSTARTFtraceEvent {
6895  optional uint64 info_val1 = 1;
6896  optional uint64 info_val2 = 2;
6897  optional int32 kctx_tgid = 3;
6898  optional uint32 kctx_id = 4;
6899  optional uint32 id = 5;
6900}
6901message MaliMaliKCPUFENCEWAITENDFtraceEvent {
6902  optional uint64 info_val1 = 1;
6903  optional uint64 info_val2 = 2;
6904  optional int32 kctx_tgid = 3;
6905  optional uint32 kctx_id = 4;
6906  optional uint32 id = 5;
6907}
6908message MaliMaliCSFINTERRUPTSTARTFtraceEvent {
6909  optional int32 kctx_tgid = 1;
6910  optional uint32 kctx_id = 2;
6911  optional uint64 info_val = 3;
6912}
6913message MaliMaliCSFINTERRUPTENDFtraceEvent {
6914  optional int32 kctx_tgid = 1;
6915  optional uint32 kctx_id = 2;
6916  optional uint64 info_val = 3;
6917}
6918
6919// End of protos/perfetto/trace/ftrace/mali.proto
6920
6921// Begin of protos/perfetto/trace/ftrace/mdss.proto
6922
6923message MdpCmdKickoffFtraceEvent {
6924  optional uint32 ctl_num = 1;
6925  optional int32 kickoff_cnt = 2;
6926}
6927message MdpCommitFtraceEvent {
6928  optional uint32 num = 1;
6929  optional uint32 play_cnt = 2;
6930  optional uint32 clk_rate = 3;
6931  optional uint64 bandwidth = 4;
6932}
6933message MdpPerfSetOtFtraceEvent {
6934  optional uint32 pnum = 1;
6935  optional uint32 xin_id = 2;
6936  optional uint32 rd_lim = 3;
6937  optional uint32 is_vbif_rt = 4;
6938}
6939message MdpSsppChangeFtraceEvent {
6940  optional uint32 num = 1;
6941  optional uint32 play_cnt = 2;
6942  optional uint32 mixer = 3;
6943  optional uint32 stage = 4;
6944  optional uint32 flags = 5;
6945  optional uint32 format = 6;
6946  optional uint32 img_w = 7;
6947  optional uint32 img_h = 8;
6948  optional uint32 src_x = 9;
6949  optional uint32 src_y = 10;
6950  optional uint32 src_w = 11;
6951  optional uint32 src_h = 12;
6952  optional uint32 dst_x = 13;
6953  optional uint32 dst_y = 14;
6954  optional uint32 dst_w = 15;
6955  optional uint32 dst_h = 16;
6956}
6957message TracingMarkWriteFtraceEvent {
6958  optional int32 pid = 1;
6959  optional string trace_name = 2;
6960  optional uint32 trace_begin = 3;
6961}
6962message MdpCmdPingpongDoneFtraceEvent {
6963  optional uint32 ctl_num = 1;
6964  optional uint32 intf_num = 2;
6965  optional uint32 pp_num = 3;
6966  optional int32 koff_cnt = 4;
6967}
6968message MdpCompareBwFtraceEvent {
6969  optional uint64 new_ab = 1;
6970  optional uint64 new_ib = 2;
6971  optional uint64 new_wb = 3;
6972  optional uint64 old_ab = 4;
6973  optional uint64 old_ib = 5;
6974  optional uint64 old_wb = 6;
6975  optional uint32 params_changed = 7;
6976  optional uint32 update_bw = 8;
6977}
6978message MdpPerfSetPanicLutsFtraceEvent {
6979  optional uint32 pnum = 1;
6980  optional uint32 fmt = 2;
6981  optional uint32 mode = 3;
6982  optional uint32 panic_lut = 4;
6983  optional uint32 robust_lut = 5;
6984}
6985message MdpSsppSetFtraceEvent {
6986  optional uint32 num = 1;
6987  optional uint32 play_cnt = 2;
6988  optional uint32 mixer = 3;
6989  optional uint32 stage = 4;
6990  optional uint32 flags = 5;
6991  optional uint32 format = 6;
6992  optional uint32 img_w = 7;
6993  optional uint32 img_h = 8;
6994  optional uint32 src_x = 9;
6995  optional uint32 src_y = 10;
6996  optional uint32 src_w = 11;
6997  optional uint32 src_h = 12;
6998  optional uint32 dst_x = 13;
6999  optional uint32 dst_y = 14;
7000  optional uint32 dst_w = 15;
7001  optional uint32 dst_h = 16;
7002}
7003message MdpCmdReadptrDoneFtraceEvent {
7004  optional uint32 ctl_num = 1;
7005  optional int32 koff_cnt = 2;
7006}
7007message MdpMisrCrcFtraceEvent {
7008  optional uint32 block_id = 1;
7009  optional uint32 vsync_cnt = 2;
7010  optional uint32 crc = 3;
7011}
7012message MdpPerfSetQosLutsFtraceEvent {
7013  optional uint32 pnum = 1;
7014  optional uint32 fmt = 2;
7015  optional uint32 intf = 3;
7016  optional uint32 rot = 4;
7017  optional uint32 fl = 5;
7018  optional uint32 lut = 6;
7019  optional uint32 linear = 7;
7020}
7021message MdpTraceCounterFtraceEvent {
7022  optional int32 pid = 1;
7023  optional string counter_name = 2;
7024  optional int32 value = 3;
7025}
7026message MdpCmdReleaseBwFtraceEvent {
7027  optional uint32 ctl_num = 1;
7028}
7029message MdpMixerUpdateFtraceEvent {
7030  optional uint32 mixer_num = 1;
7031}
7032message MdpPerfSetWmLevelsFtraceEvent {
7033  optional uint32 pnum = 1;
7034  optional uint32 use_space = 2;
7035  optional uint32 priority_bytes = 3;
7036  optional uint32 wm0 = 4;
7037  optional uint32 wm1 = 5;
7038  optional uint32 wm2 = 6;
7039  optional uint32 mb_cnt = 7;
7040  optional uint32 mb_size = 8;
7041}
7042message MdpVideoUnderrunDoneFtraceEvent {
7043  optional uint32 ctl_num = 1;
7044  optional uint32 underrun_cnt = 2;
7045}
7046message MdpCmdWaitPingpongFtraceEvent {
7047  optional uint32 ctl_num = 1;
7048  optional int32 kickoff_cnt = 2;
7049}
7050message MdpPerfPrefillCalcFtraceEvent {
7051  optional uint32 pnum = 1;
7052  optional uint32 latency_buf = 2;
7053  optional uint32 ot = 3;
7054  optional uint32 y_buf = 4;
7055  optional uint32 y_scaler = 5;
7056  optional uint32 pp_lines = 6;
7057  optional uint32 pp_bytes = 7;
7058  optional uint32 post_sc = 8;
7059  optional uint32 fbc_bytes = 9;
7060  optional uint32 prefill_bytes = 10;
7061}
7062message MdpPerfUpdateBusFtraceEvent {
7063  optional int32 client = 1;
7064  optional uint64 ab_quota = 2;
7065  optional uint64 ib_quota = 3;
7066}
7067message RotatorBwAoAsContextFtraceEvent {
7068  optional uint32 state = 1;
7069}
7070
7071// End of protos/perfetto/trace/ftrace/mdss.proto
7072
7073// Begin of protos/perfetto/trace/ftrace/mm_event.proto
7074
7075message MmEventRecordFtraceEvent {
7076  optional uint32 avg_lat = 1;
7077  optional uint32 count = 2;
7078  optional uint32 max_lat = 3;
7079  optional uint32 type = 4;
7080}
7081
7082// End of protos/perfetto/trace/ftrace/mm_event.proto
7083
7084// Begin of protos/perfetto/trace/ftrace/net.proto
7085
7086message NetifReceiveSkbFtraceEvent {
7087  optional uint32 len = 1;
7088  optional string name = 2;
7089  optional uint64 skbaddr = 3;
7090}
7091message NetDevXmitFtraceEvent {
7092  optional uint32 len = 1;
7093  optional string name = 2;
7094  optional int32 rc = 3;
7095  optional uint64 skbaddr = 4;
7096}
7097message NapiGroReceiveEntryFtraceEvent {
7098  optional uint32 data_len = 1;
7099  optional uint32 gso_size = 2;
7100  optional uint32 gso_type = 3;
7101  optional uint32 hash = 4;
7102  optional uint32 ip_summed = 5;
7103  optional uint32 l4_hash = 6;
7104  optional uint32 len = 7;
7105  optional int32 mac_header = 8;
7106  optional uint32 mac_header_valid = 9;
7107  optional string name = 10;
7108  optional uint32 napi_id = 11;
7109  optional uint32 nr_frags = 12;
7110  optional uint32 protocol = 13;
7111  optional uint32 queue_mapping = 14;
7112  optional uint64 skbaddr = 15;
7113  optional uint32 truesize = 16;
7114  optional uint32 vlan_proto = 17;
7115  optional uint32 vlan_tagged = 18;
7116  optional uint32 vlan_tci = 19;
7117}
7118message NapiGroReceiveExitFtraceEvent {
7119  optional int32 ret = 1;
7120}
7121
7122// End of protos/perfetto/trace/ftrace/net.proto
7123
7124// Begin of protos/perfetto/trace/ftrace/oom.proto
7125
7126message OomScoreAdjUpdateFtraceEvent {
7127  optional string comm = 1;
7128  optional int32 oom_score_adj = 2;
7129  optional int32 pid = 3;
7130}
7131message MarkVictimFtraceEvent {
7132  optional int32 pid = 1;
7133}
7134
7135// End of protos/perfetto/trace/ftrace/oom.proto
7136
7137// Begin of protos/perfetto/trace/ftrace/panel.proto
7138
7139message DsiCmdFifoStatusFtraceEvent {
7140  optional uint32 header = 1;
7141  optional uint32 payload = 2;
7142}
7143message DsiRxFtraceEvent {
7144  optional uint32 cmd = 1;
7145  optional uint32 rx_buf = 2;
7146}
7147message DsiTxFtraceEvent {
7148  optional uint32 last = 1;
7149  optional uint32 tx_buf = 2;
7150  optional uint32 type = 3;
7151}
7152
7153// End of protos/perfetto/trace/ftrace/panel.proto
7154
7155// Begin of protos/perfetto/trace/ftrace/power.proto
7156
7157message CpuFrequencyFtraceEvent {
7158  optional uint32 state = 1;
7159  optional uint32 cpu_id = 2;
7160}
7161message CpuFrequencyLimitsFtraceEvent {
7162  optional uint32 min_freq = 1;
7163  optional uint32 max_freq = 2;
7164  optional uint32 cpu_id = 3;
7165}
7166message CpuIdleFtraceEvent {
7167  optional uint32 state = 1;
7168  optional uint32 cpu_id = 2;
7169}
7170message ClockEnableFtraceEvent {
7171  optional string name = 1;
7172  optional uint64 state = 2;
7173  optional uint64 cpu_id = 3;
7174}
7175message ClockDisableFtraceEvent {
7176  optional string name = 1;
7177  optional uint64 state = 2;
7178  optional uint64 cpu_id = 3;
7179}
7180message ClockSetRateFtraceEvent {
7181  optional string name = 1;
7182  optional uint64 state = 2;
7183  optional uint64 cpu_id = 3;
7184}
7185message SuspendResumeFtraceEvent {
7186  optional string action = 1;
7187  optional int32 val = 2;
7188  optional uint32 start = 3;
7189}
7190message GpuFrequencyFtraceEvent {
7191  optional uint32 gpu_id = 1;
7192  optional uint32 state = 2;
7193}
7194message WakeupSourceActivateFtraceEvent {
7195  optional string name = 1;
7196  optional uint64 state = 2;
7197}
7198message WakeupSourceDeactivateFtraceEvent {
7199  optional string name = 1;
7200  optional uint64 state = 2;
7201}
7202
7203// End of protos/perfetto/trace/ftrace/power.proto
7204
7205// Begin of protos/perfetto/trace/ftrace/printk.proto
7206
7207message ConsoleFtraceEvent {
7208  optional string msg = 1;
7209}
7210
7211// End of protos/perfetto/trace/ftrace/printk.proto
7212
7213// Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto
7214
7215message SysEnterFtraceEvent {
7216  optional int64 id = 1;
7217  repeated uint64 args = 2;
7218}
7219message SysExitFtraceEvent {
7220  optional int64 id = 1;
7221  optional int64 ret = 2;
7222}
7223
7224// End of protos/perfetto/trace/ftrace/raw_syscalls.proto
7225
7226// Begin of protos/perfetto/trace/ftrace/regulator.proto
7227
7228message RegulatorDisableFtraceEvent {
7229  optional string name = 1;
7230}
7231message RegulatorDisableCompleteFtraceEvent {
7232  optional string name = 1;
7233}
7234message RegulatorEnableFtraceEvent {
7235  optional string name = 1;
7236}
7237message RegulatorEnableCompleteFtraceEvent {
7238  optional string name = 1;
7239}
7240message RegulatorEnableDelayFtraceEvent {
7241  optional string name = 1;
7242}
7243message RegulatorSetVoltageFtraceEvent {
7244  optional string name = 1;
7245  optional int32 min = 2;
7246  optional int32 max = 3;
7247}
7248message RegulatorSetVoltageCompleteFtraceEvent {
7249  optional string name = 1;
7250  optional uint32 val = 2;
7251}
7252
7253// End of protos/perfetto/trace/ftrace/regulator.proto
7254
7255// Begin of protos/perfetto/trace/ftrace/sched.proto
7256
7257message SchedSwitchFtraceEvent {
7258  optional string prev_comm = 1;
7259  optional int32 prev_pid = 2;
7260  optional int32 prev_prio = 3;
7261  optional int64 prev_state = 4;
7262  optional string next_comm = 5;
7263  optional int32 next_pid = 6;
7264  optional int32 next_prio = 7;
7265}
7266message SchedWakeupFtraceEvent {
7267  optional string comm = 1;
7268  optional int32 pid = 2;
7269  optional int32 prio = 3;
7270  optional int32 success = 4;
7271  optional int32 target_cpu = 5;
7272}
7273message SchedBlockedReasonFtraceEvent {
7274  optional int32 pid = 1;
7275  optional uint64 caller = 2;
7276  optional uint32 io_wait = 3;
7277}
7278message SchedCpuHotplugFtraceEvent {
7279  optional int32 affected_cpu = 1;
7280  optional int32 error = 2;
7281  optional int32 status = 3;
7282}
7283message SchedWakingFtraceEvent {
7284  optional string comm = 1;
7285  optional int32 pid = 2;
7286  optional int32 prio = 3;
7287  optional int32 success = 4;
7288  optional int32 target_cpu = 5;
7289}
7290message SchedWakeupNewFtraceEvent {
7291  optional string comm = 1;
7292  optional int32 pid = 2;
7293  optional int32 prio = 3;
7294  optional int32 success = 4;
7295  optional int32 target_cpu = 5;
7296}
7297message SchedProcessExecFtraceEvent {
7298  optional string filename = 1;
7299  optional int32 pid = 2;
7300  optional int32 old_pid = 3;
7301}
7302message SchedProcessExitFtraceEvent {
7303  optional string comm = 1;
7304  optional int32 pid = 2;
7305  optional int32 tgid = 3;
7306  optional int32 prio = 4;
7307}
7308message SchedProcessForkFtraceEvent {
7309  optional string parent_comm = 1;
7310  optional int32 parent_pid = 2;
7311  optional string child_comm = 3;
7312  optional int32 child_pid = 4;
7313}
7314message SchedProcessFreeFtraceEvent {
7315  optional string comm = 1;
7316  optional int32 pid = 2;
7317  optional int32 prio = 3;
7318}
7319message SchedProcessHangFtraceEvent {
7320  optional string comm = 1;
7321  optional int32 pid = 2;
7322}
7323message SchedProcessWaitFtraceEvent {
7324  optional string comm = 1;
7325  optional int32 pid = 2;
7326  optional int32 prio = 3;
7327}
7328message SchedPiSetprioFtraceEvent {
7329  optional string comm = 1;
7330  optional int32 newprio = 2;
7331  optional int32 oldprio = 3;
7332  optional int32 pid = 4;
7333}
7334message SchedCpuUtilCfsFtraceEvent {
7335  optional int32 active = 1;
7336  optional uint64 capacity = 2;
7337  optional uint64 capacity_orig = 3;
7338  optional uint32 cpu = 4;
7339  optional uint64 cpu_importance = 5;
7340  optional uint64 cpu_util = 6;
7341  optional uint32 exit_lat = 7;
7342  optional uint64 group_capacity = 8;
7343  optional uint32 grp_overutilized = 9;
7344  optional uint32 idle_cpu = 10;
7345  optional uint32 nr_running = 11;
7346  optional int64 spare_cap = 12;
7347  optional uint32 task_fits = 13;
7348  optional uint64 wake_group_util = 14;
7349  optional uint64 wake_util = 15;
7350}
7351
7352// End of protos/perfetto/trace/ftrace/sched.proto
7353
7354// Begin of protos/perfetto/trace/ftrace/scm.proto
7355
7356message ScmCallStartFtraceEvent {
7357  optional uint32 arginfo = 1;
7358  optional uint64 x0 = 2;
7359  optional uint64 x5 = 3;
7360}
7361message ScmCallEndFtraceEvent {
7362}
7363
7364// End of protos/perfetto/trace/ftrace/scm.proto
7365
7366// Begin of protos/perfetto/trace/ftrace/sde.proto
7367
7368message SdeTracingMarkWriteFtraceEvent {
7369  optional int32 pid = 1;
7370  optional string trace_name = 2;
7371  optional uint32 trace_type = 3;
7372  optional int32 value = 4;
7373  optional uint32 trace_begin = 5;
7374}
7375message SdeSdeEvtlogFtraceEvent {
7376  optional string evtlog_tag = 1;
7377  optional int32 pid = 2;
7378  optional uint32 tag_id = 3;
7379}
7380message SdeSdePerfCalcCrtcFtraceEvent {
7381  optional uint64 bw_ctl_ebi = 1;
7382  optional uint64 bw_ctl_llcc = 2;
7383  optional uint64 bw_ctl_mnoc = 3;
7384  optional uint32 core_clk_rate = 4;
7385  optional uint32 crtc = 5;
7386  optional uint64 ib_ebi = 6;
7387  optional uint64 ib_llcc = 7;
7388  optional uint64 ib_mnoc = 8;
7389}
7390message SdeSdePerfCrtcUpdateFtraceEvent {
7391  optional uint64 bw_ctl_ebi = 1;
7392  optional uint64 bw_ctl_llcc = 2;
7393  optional uint64 bw_ctl_mnoc = 3;
7394  optional uint32 core_clk_rate = 4;
7395  optional uint32 crtc = 5;
7396  optional int32 params = 6;
7397  optional uint64 per_pipe_ib_ebi = 7;
7398  optional uint64 per_pipe_ib_llcc = 8;
7399  optional uint64 per_pipe_ib_mnoc = 9;
7400  optional uint32 stop_req = 10;
7401  optional uint32 update_bus = 11;
7402  optional uint32 update_clk = 12;
7403}
7404message SdeSdePerfSetQosLutsFtraceEvent {
7405  optional uint32 fl = 1;
7406  optional uint32 fmt = 2;
7407  optional uint64 lut = 3;
7408  optional uint32 lut_usage = 4;
7409  optional uint32 pnum = 5;
7410  optional uint32 rt = 6;
7411}
7412message SdeSdePerfUpdateBusFtraceEvent {
7413  optional uint64 ab_quota = 1;
7414  optional uint32 bus_id = 2;
7415  optional int32 client = 3;
7416  optional uint64 ib_quota = 4;
7417}
7418
7419// End of protos/perfetto/trace/ftrace/sde.proto
7420
7421// Begin of protos/perfetto/trace/ftrace/signal.proto
7422
7423message SignalDeliverFtraceEvent {
7424  optional int32 code = 1;
7425  optional uint64 sa_flags = 2;
7426  optional int32 sig = 3;
7427}
7428message SignalGenerateFtraceEvent {
7429  optional int32 code = 1;
7430  optional string comm = 2;
7431  optional int32 group = 3;
7432  optional int32 pid = 4;
7433  optional int32 result = 5;
7434  optional int32 sig = 6;
7435}
7436
7437// End of protos/perfetto/trace/ftrace/signal.proto
7438
7439// Begin of protos/perfetto/trace/ftrace/skb.proto
7440
7441message KfreeSkbFtraceEvent {
7442  optional uint64 location = 1;
7443  optional uint32 protocol = 2;
7444  optional uint64 skbaddr = 3;
7445}
7446
7447// End of protos/perfetto/trace/ftrace/skb.proto
7448
7449// Begin of protos/perfetto/trace/ftrace/sock.proto
7450
7451message InetSockSetStateFtraceEvent {
7452  optional uint32 daddr = 1;
7453  optional uint32 dport = 2;
7454  optional uint32 family = 3;
7455  optional int32 newstate = 4;
7456  optional int32 oldstate = 5;
7457  optional uint32 protocol = 6;
7458  optional uint32 saddr = 7;
7459  optional uint64 skaddr = 8;
7460  optional uint32 sport = 9;
7461}
7462
7463// End of protos/perfetto/trace/ftrace/sock.proto
7464
7465// Begin of protos/perfetto/trace/ftrace/sync.proto
7466
7467message SyncPtFtraceEvent {
7468  optional string timeline = 1;
7469  optional string value = 2;
7470}
7471message SyncTimelineFtraceEvent {
7472  optional string name = 1;
7473  optional string value = 2;
7474}
7475message SyncWaitFtraceEvent {
7476  optional string name = 1;
7477  optional int32 status = 2;
7478  optional uint32 begin = 3;
7479}
7480
7481// End of protos/perfetto/trace/ftrace/sync.proto
7482
7483// Begin of protos/perfetto/trace/ftrace/synthetic.proto
7484
7485message RssStatThrottledFtraceEvent {
7486  optional uint32 curr = 1;
7487  optional int32 member = 2;
7488  optional uint32 mm_id = 3;
7489  optional int64 size = 4;
7490}
7491message SuspendResumeMinimalFtraceEvent {
7492  optional uint32 start = 1;
7493}
7494
7495// End of protos/perfetto/trace/ftrace/synthetic.proto
7496
7497// Begin of protos/perfetto/trace/ftrace/systrace.proto
7498
7499message ZeroFtraceEvent {
7500  optional int32 flag = 1;
7501  optional string name = 2;
7502  optional int32 pid = 3;
7503  optional int64 value = 4;
7504}
7505
7506// End of protos/perfetto/trace/ftrace/systrace.proto
7507
7508// Begin of protos/perfetto/trace/ftrace/task.proto
7509
7510message TaskNewtaskFtraceEvent {
7511  optional int32 pid = 1;
7512  optional string comm = 2;
7513  optional uint64 clone_flags = 3;
7514  optional int32 oom_score_adj = 4;
7515}
7516message TaskRenameFtraceEvent {
7517  optional int32 pid = 1;
7518  optional string oldcomm = 2;
7519  optional string newcomm = 3;
7520  optional int32 oom_score_adj = 4;
7521}
7522
7523// End of protos/perfetto/trace/ftrace/task.proto
7524
7525// Begin of protos/perfetto/trace/ftrace/tcp.proto
7526
7527message TcpRetransmitSkbFtraceEvent {
7528  optional uint32 daddr = 1;
7529  optional uint32 dport = 2;
7530  optional uint32 saddr = 3;
7531  optional uint64 skaddr = 4;
7532  optional uint64 skbaddr = 5;
7533  optional uint32 sport = 6;
7534  optional int32 state = 7;
7535}
7536
7537// End of protos/perfetto/trace/ftrace/tcp.proto
7538
7539// Begin of protos/perfetto/trace/ftrace/thermal.proto
7540
7541message ThermalTemperatureFtraceEvent {
7542  optional int32 id = 1;
7543  optional int32 temp = 2;
7544  optional int32 temp_prev = 3;
7545  optional string thermal_zone = 4;
7546}
7547message CdevUpdateFtraceEvent {
7548  optional uint64 target = 1;
7549  optional string type = 2;
7550}
7551
7552// End of protos/perfetto/trace/ftrace/thermal.proto
7553
7554// Begin of protos/perfetto/trace/ftrace/trusty.proto
7555
7556message TrustySmcFtraceEvent {
7557  optional uint64 r0 = 1;
7558  optional uint64 r1 = 2;
7559  optional uint64 r2 = 3;
7560  optional uint64 r3 = 4;
7561}
7562message TrustySmcDoneFtraceEvent {
7563  optional uint64 ret = 1;
7564}
7565message TrustyStdCall32FtraceEvent {
7566  optional uint64 r0 = 1;
7567  optional uint64 r1 = 2;
7568  optional uint64 r2 = 3;
7569  optional uint64 r3 = 4;
7570}
7571message TrustyStdCall32DoneFtraceEvent {
7572  optional int64 ret = 1;
7573}
7574message TrustyShareMemoryFtraceEvent {
7575  optional uint64 len = 1;
7576  optional uint32 lend = 2;
7577  optional uint32 nents = 3;
7578}
7579message TrustyShareMemoryDoneFtraceEvent {
7580  optional uint64 handle = 1;
7581  optional uint64 len = 2;
7582  optional uint32 lend = 3;
7583  optional uint32 nents = 4;
7584  optional int32 ret = 5;
7585}
7586message TrustyReclaimMemoryFtraceEvent {
7587  optional uint64 id = 1;
7588}
7589message TrustyReclaimMemoryDoneFtraceEvent {
7590  optional uint64 id = 1;
7591  optional int32 ret = 2;
7592}
7593message TrustyIrqFtraceEvent {
7594  optional int32 irq = 1;
7595}
7596message TrustyIpcHandleEventFtraceEvent {
7597  optional uint32 chan = 1;
7598  optional uint32 event_id = 2;
7599  optional string srv_name = 3;
7600}
7601message TrustyIpcConnectFtraceEvent {
7602  optional uint32 chan = 1;
7603  optional string port = 2;
7604  optional int32 state = 3;
7605}
7606message TrustyIpcConnectEndFtraceEvent {
7607  optional uint32 chan = 1;
7608  optional int32 err = 2;
7609  optional int32 state = 3;
7610}
7611message TrustyIpcWriteFtraceEvent {
7612  optional uint64 buf_id = 1;
7613  optional uint32 chan = 2;
7614  optional int32 kind_shm = 3;
7615  optional int32 len_or_err = 4;
7616  optional uint64 shm_cnt = 5;
7617  optional string srv_name = 6;
7618}
7619message TrustyIpcPollFtraceEvent {
7620  optional uint32 chan = 1;
7621  optional uint32 poll_mask = 2;
7622  optional string srv_name = 3;
7623}
7624message TrustyIpcReadFtraceEvent {
7625  optional uint32 chan = 1;
7626  optional string srv_name = 2;
7627}
7628message TrustyIpcReadEndFtraceEvent {
7629  optional uint64 buf_id = 1;
7630  optional uint32 chan = 2;
7631  optional int32 len_or_err = 3;
7632  optional uint64 shm_cnt = 4;
7633  optional string srv_name = 5;
7634}
7635message TrustyIpcRxFtraceEvent {
7636  optional uint64 buf_id = 1;
7637  optional uint32 chan = 2;
7638  optional string srv_name = 3;
7639}
7640message TrustyEnqueueNopFtraceEvent {
7641  optional uint32 arg1 = 1;
7642  optional uint32 arg2 = 2;
7643  optional uint32 arg3 = 3;
7644}
7645
7646// End of protos/perfetto/trace/ftrace/trusty.proto
7647
7648// Begin of protos/perfetto/trace/ftrace/ufs.proto
7649
7650message UfshcdCommandFtraceEvent {
7651  optional string dev_name = 1;
7652  optional uint32 doorbell = 2;
7653  optional uint32 intr = 3;
7654  optional uint64 lba = 4;
7655  optional uint32 opcode = 5;
7656  optional string str = 6;
7657  optional uint32 tag = 7;
7658  optional int32 transfer_len = 8;
7659  optional uint32 group_id = 9;
7660  optional uint32 str_t = 10;
7661}
7662message UfshcdClkGatingFtraceEvent {
7663  optional string dev_name = 1;
7664  optional int32 state = 2;
7665}
7666
7667// End of protos/perfetto/trace/ftrace/ufs.proto
7668
7669// Begin of protos/perfetto/trace/ftrace/v4l2.proto
7670
7671message V4l2QbufFtraceEvent {
7672  optional uint32 bytesused = 1;
7673  optional uint32 field = 2;
7674  optional uint32 flags = 3;
7675  optional uint32 index = 4;
7676  optional int32 minor = 5;
7677  optional uint32 sequence = 6;
7678  optional uint32 timecode_flags = 7;
7679  optional uint32 timecode_frames = 8;
7680  optional uint32 timecode_hours = 9;
7681  optional uint32 timecode_minutes = 10;
7682  optional uint32 timecode_seconds = 11;
7683  optional uint32 timecode_type = 12;
7684  optional uint32 timecode_userbits0 = 13;
7685  optional uint32 timecode_userbits1 = 14;
7686  optional uint32 timecode_userbits2 = 15;
7687  optional uint32 timecode_userbits3 = 16;
7688  optional int64 timestamp = 17;
7689  optional uint32 type = 18;
7690}
7691message V4l2DqbufFtraceEvent {
7692  optional uint32 bytesused = 1;
7693  optional uint32 field = 2;
7694  optional uint32 flags = 3;
7695  optional uint32 index = 4;
7696  optional int32 minor = 5;
7697  optional uint32 sequence = 6;
7698  optional uint32 timecode_flags = 7;
7699  optional uint32 timecode_frames = 8;
7700  optional uint32 timecode_hours = 9;
7701  optional uint32 timecode_minutes = 10;
7702  optional uint32 timecode_seconds = 11;
7703  optional uint32 timecode_type = 12;
7704  optional uint32 timecode_userbits0 = 13;
7705  optional uint32 timecode_userbits1 = 14;
7706  optional uint32 timecode_userbits2 = 15;
7707  optional uint32 timecode_userbits3 = 16;
7708  optional int64 timestamp = 17;
7709  optional uint32 type = 18;
7710}
7711message Vb2V4l2BufQueueFtraceEvent {
7712  optional uint32 field = 1;
7713  optional uint32 flags = 2;
7714  optional int32 minor = 3;
7715  optional uint32 sequence = 4;
7716  optional uint32 timecode_flags = 5;
7717  optional uint32 timecode_frames = 6;
7718  optional uint32 timecode_hours = 7;
7719  optional uint32 timecode_minutes = 8;
7720  optional uint32 timecode_seconds = 9;
7721  optional uint32 timecode_type = 10;
7722  optional uint32 timecode_userbits0 = 11;
7723  optional uint32 timecode_userbits1 = 12;
7724  optional uint32 timecode_userbits2 = 13;
7725  optional uint32 timecode_userbits3 = 14;
7726  optional int64 timestamp = 15;
7727}
7728message Vb2V4l2BufDoneFtraceEvent {
7729  optional uint32 field = 1;
7730  optional uint32 flags = 2;
7731  optional int32 minor = 3;
7732  optional uint32 sequence = 4;
7733  optional uint32 timecode_flags = 5;
7734  optional uint32 timecode_frames = 6;
7735  optional uint32 timecode_hours = 7;
7736  optional uint32 timecode_minutes = 8;
7737  optional uint32 timecode_seconds = 9;
7738  optional uint32 timecode_type = 10;
7739  optional uint32 timecode_userbits0 = 11;
7740  optional uint32 timecode_userbits1 = 12;
7741  optional uint32 timecode_userbits2 = 13;
7742  optional uint32 timecode_userbits3 = 14;
7743  optional int64 timestamp = 15;
7744}
7745message Vb2V4l2QbufFtraceEvent {
7746  optional uint32 field = 1;
7747  optional uint32 flags = 2;
7748  optional int32 minor = 3;
7749  optional uint32 sequence = 4;
7750  optional uint32 timecode_flags = 5;
7751  optional uint32 timecode_frames = 6;
7752  optional uint32 timecode_hours = 7;
7753  optional uint32 timecode_minutes = 8;
7754  optional uint32 timecode_seconds = 9;
7755  optional uint32 timecode_type = 10;
7756  optional uint32 timecode_userbits0 = 11;
7757  optional uint32 timecode_userbits1 = 12;
7758  optional uint32 timecode_userbits2 = 13;
7759  optional uint32 timecode_userbits3 = 14;
7760  optional int64 timestamp = 15;
7761}
7762message Vb2V4l2DqbufFtraceEvent {
7763  optional uint32 field = 1;
7764  optional uint32 flags = 2;
7765  optional int32 minor = 3;
7766  optional uint32 sequence = 4;
7767  optional uint32 timecode_flags = 5;
7768  optional uint32 timecode_frames = 6;
7769  optional uint32 timecode_hours = 7;
7770  optional uint32 timecode_minutes = 8;
7771  optional uint32 timecode_seconds = 9;
7772  optional uint32 timecode_type = 10;
7773  optional uint32 timecode_userbits0 = 11;
7774  optional uint32 timecode_userbits1 = 12;
7775  optional uint32 timecode_userbits2 = 13;
7776  optional uint32 timecode_userbits3 = 14;
7777  optional int64 timestamp = 15;
7778}
7779
7780// End of protos/perfetto/trace/ftrace/v4l2.proto
7781
7782// Begin of protos/perfetto/trace/ftrace/virtio_gpu.proto
7783
7784message VirtioGpuCmdQueueFtraceEvent {
7785  optional uint32 ctx_id = 1;
7786  optional int32 dev = 2;
7787  optional uint64 fence_id = 3;
7788  optional uint32 flags = 4;
7789  optional string name = 5;
7790  optional uint32 num_free = 6;
7791  optional uint32 seqno = 7;
7792  optional uint32 type = 8;
7793  optional uint32 vq = 9;
7794}
7795message VirtioGpuCmdResponseFtraceEvent {
7796  optional uint32 ctx_id = 1;
7797  optional int32 dev = 2;
7798  optional uint64 fence_id = 3;
7799  optional uint32 flags = 4;
7800  optional string name = 5;
7801  optional uint32 num_free = 6;
7802  optional uint32 seqno = 7;
7803  optional uint32 type = 8;
7804  optional uint32 vq = 9;
7805}
7806
7807// End of protos/perfetto/trace/ftrace/virtio_gpu.proto
7808
7809// Begin of protos/perfetto/trace/ftrace/virtio_video.proto
7810
7811message VirtioVideoCmdFtraceEvent {
7812  optional uint32 stream_id = 1;
7813  optional uint32 type = 2;
7814}
7815message VirtioVideoCmdDoneFtraceEvent {
7816  optional uint32 stream_id = 1;
7817  optional uint32 type = 2;
7818}
7819message VirtioVideoResourceQueueFtraceEvent {
7820  optional uint32 data_size0 = 1;
7821  optional uint32 data_size1 = 2;
7822  optional uint32 data_size2 = 3;
7823  optional uint32 data_size3 = 4;
7824  optional uint32 queue_type = 5;
7825  optional int32 resource_id = 6;
7826  optional int32 stream_id = 7;
7827  optional uint64 timestamp = 8;
7828}
7829message VirtioVideoResourceQueueDoneFtraceEvent {
7830  optional uint32 data_size0 = 1;
7831  optional uint32 data_size1 = 2;
7832  optional uint32 data_size2 = 3;
7833  optional uint32 data_size3 = 4;
7834  optional uint32 queue_type = 5;
7835  optional int32 resource_id = 6;
7836  optional int32 stream_id = 7;
7837  optional uint64 timestamp = 8;
7838}
7839
7840// End of protos/perfetto/trace/ftrace/virtio_video.proto
7841
7842// Begin of protos/perfetto/trace/ftrace/vmscan.proto
7843
7844message MmVmscanDirectReclaimBeginFtraceEvent {
7845  optional int32 order = 1;
7846  optional int32 may_writepage = 2;
7847  optional uint32 gfp_flags = 3;
7848}
7849message MmVmscanDirectReclaimEndFtraceEvent {
7850  optional uint64 nr_reclaimed = 1;
7851}
7852message MmVmscanKswapdWakeFtraceEvent {
7853  optional int32 nid = 1;
7854  optional int32 order = 2;
7855  optional int32 zid = 3;
7856}
7857message MmVmscanKswapdSleepFtraceEvent {
7858  optional int32 nid = 1;
7859}
7860message MmShrinkSlabStartFtraceEvent {
7861  optional uint64 cache_items = 1;
7862  optional uint64 delta = 2;
7863  optional uint32 gfp_flags = 3;
7864  optional uint64 lru_pgs = 4;
7865  optional int64 nr_objects_to_shrink = 5;
7866  optional uint64 pgs_scanned = 6;
7867  optional uint64 shr = 7;
7868  optional uint64 shrink = 8;
7869  optional uint64 total_scan = 9;
7870  optional int32 nid = 10;
7871  optional int32 priority = 11;
7872}
7873message MmShrinkSlabEndFtraceEvent {
7874  optional int64 new_scan = 1;
7875  optional int32 retval = 2;
7876  optional uint64 shr = 3;
7877  optional uint64 shrink = 4;
7878  optional int64 total_scan = 5;
7879  optional int64 unused_scan = 6;
7880  optional int32 nid = 7;
7881}
7882
7883// End of protos/perfetto/trace/ftrace/vmscan.proto
7884
7885// Begin of protos/perfetto/trace/ftrace/workqueue.proto
7886
7887message WorkqueueActivateWorkFtraceEvent {
7888  optional uint64 work = 1;
7889}
7890message WorkqueueExecuteEndFtraceEvent {
7891  optional uint64 work = 1;
7892  optional uint64 function = 2;
7893}
7894message WorkqueueExecuteStartFtraceEvent {
7895  optional uint64 work = 1;
7896  optional uint64 function = 2;
7897}
7898message WorkqueueQueueWorkFtraceEvent {
7899  optional uint64 work = 1;
7900  optional uint64 function = 2;
7901  optional uint64 workqueue = 3;
7902  optional uint32 req_cpu = 4;
7903  optional uint32 cpu = 5;
7904}
7905
7906// End of protos/perfetto/trace/ftrace/workqueue.proto
7907
7908// Begin of protos/perfetto/trace/ftrace/ftrace_event.proto
7909
7910message FtraceEvent {
7911  // Timestamp in nanoseconds using .../tracing/trace_clock.
7912  optional uint64 timestamp = 1;
7913
7914  // Kernel pid (do not confuse with userspace pid aka tgid).
7915  optional uint32 pid = 2;
7916
7917  // Not populated in actual traces. Wire format might change.
7918  // Placeholder declaration so that the ftrace parsing code accepts the
7919  // existence of this common field. If this becomes needed for all events:
7920  // consider merging with common_preempt_count to avoid extra proto tags.
7921  optional uint32 common_flags = 5;
7922
7923  oneof event {
7924    PrintFtraceEvent print = 3;
7925    SchedSwitchFtraceEvent sched_switch = 4;
7926    // removed field with id 5;
7927    // removed field with id 6;
7928    // removed field with id 7;
7929    // removed field with id 8;
7930    // removed field with id 9;
7931    // removed field with id 10;
7932    CpuFrequencyFtraceEvent cpu_frequency = 11;
7933    CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12;
7934    CpuIdleFtraceEvent cpu_idle = 13;
7935    ClockEnableFtraceEvent clock_enable = 14;
7936    ClockDisableFtraceEvent clock_disable = 15;
7937    ClockSetRateFtraceEvent clock_set_rate = 16;
7938    SchedWakeupFtraceEvent sched_wakeup = 17;
7939    SchedBlockedReasonFtraceEvent sched_blocked_reason = 18;
7940    SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19;
7941    SchedWakingFtraceEvent sched_waking = 20;
7942    IpiEntryFtraceEvent ipi_entry = 21;
7943    IpiExitFtraceEvent ipi_exit = 22;
7944    IpiRaiseFtraceEvent ipi_raise = 23;
7945    SoftirqEntryFtraceEvent softirq_entry = 24;
7946    SoftirqExitFtraceEvent softirq_exit = 25;
7947    SoftirqRaiseFtraceEvent softirq_raise = 26;
7948    I2cReadFtraceEvent i2c_read = 27;
7949    I2cWriteFtraceEvent i2c_write = 28;
7950    I2cResultFtraceEvent i2c_result = 29;
7951    I2cReplyFtraceEvent i2c_reply = 30;
7952    SmbusReadFtraceEvent smbus_read = 31;
7953    SmbusWriteFtraceEvent smbus_write = 32;
7954    SmbusResultFtraceEvent smbus_result = 33;
7955    SmbusReplyFtraceEvent smbus_reply = 34;
7956    LowmemoryKillFtraceEvent lowmemory_kill = 35;
7957    IrqHandlerEntryFtraceEvent irq_handler_entry = 36;
7958    IrqHandlerExitFtraceEvent irq_handler_exit = 37;
7959    SyncPtFtraceEvent sync_pt = 38;
7960    SyncTimelineFtraceEvent sync_timeline = 39;
7961    SyncWaitFtraceEvent sync_wait = 40;
7962    Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41;
7963    Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42;
7964    Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43;
7965    Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44;
7966    BlockRqIssueFtraceEvent block_rq_issue = 45;
7967    MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46;
7968    MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47;
7969    MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48;
7970    MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49;
7971    BinderTransactionFtraceEvent binder_transaction = 50;
7972    BinderTransactionReceivedFtraceEvent binder_transaction_received = 51;
7973    BinderSetPriorityFtraceEvent binder_set_priority = 52;
7974    BinderLockFtraceEvent binder_lock = 53;
7975    BinderLockedFtraceEvent binder_locked = 54;
7976    BinderUnlockFtraceEvent binder_unlock = 55;
7977    WorkqueueActivateWorkFtraceEvent workqueue_activate_work = 56;
7978    WorkqueueExecuteEndFtraceEvent workqueue_execute_end = 57;
7979    WorkqueueExecuteStartFtraceEvent workqueue_execute_start = 58;
7980    WorkqueueQueueWorkFtraceEvent workqueue_queue_work = 59;
7981    RegulatorDisableFtraceEvent regulator_disable = 60;
7982    RegulatorDisableCompleteFtraceEvent regulator_disable_complete = 61;
7983    RegulatorEnableFtraceEvent regulator_enable = 62;
7984    RegulatorEnableCompleteFtraceEvent regulator_enable_complete = 63;
7985    RegulatorEnableDelayFtraceEvent regulator_enable_delay = 64;
7986    RegulatorSetVoltageFtraceEvent regulator_set_voltage = 65;
7987    RegulatorSetVoltageCompleteFtraceEvent regulator_set_voltage_complete = 66;
7988    CgroupAttachTaskFtraceEvent cgroup_attach_task = 67;
7989    CgroupMkdirFtraceEvent cgroup_mkdir = 68;
7990    CgroupRemountFtraceEvent cgroup_remount = 69;
7991    CgroupRmdirFtraceEvent cgroup_rmdir = 70;
7992    CgroupTransferTasksFtraceEvent cgroup_transfer_tasks = 71;
7993    CgroupDestroyRootFtraceEvent cgroup_destroy_root = 72;
7994    CgroupReleaseFtraceEvent cgroup_release = 73;
7995    CgroupRenameFtraceEvent cgroup_rename = 74;
7996    CgroupSetupRootFtraceEvent cgroup_setup_root = 75;
7997    MdpCmdKickoffFtraceEvent mdp_cmd_kickoff = 76;
7998    MdpCommitFtraceEvent mdp_commit = 77;
7999    MdpPerfSetOtFtraceEvent mdp_perf_set_ot = 78;
8000    MdpSsppChangeFtraceEvent mdp_sspp_change = 79;
8001    TracingMarkWriteFtraceEvent tracing_mark_write = 80;
8002    MdpCmdPingpongDoneFtraceEvent mdp_cmd_pingpong_done = 81;
8003    MdpCompareBwFtraceEvent mdp_compare_bw = 82;
8004    MdpPerfSetPanicLutsFtraceEvent mdp_perf_set_panic_luts = 83;
8005    MdpSsppSetFtraceEvent mdp_sspp_set = 84;
8006    MdpCmdReadptrDoneFtraceEvent mdp_cmd_readptr_done = 85;
8007    MdpMisrCrcFtraceEvent mdp_misr_crc = 86;
8008    MdpPerfSetQosLutsFtraceEvent mdp_perf_set_qos_luts = 87;
8009    MdpTraceCounterFtraceEvent mdp_trace_counter = 88;
8010    MdpCmdReleaseBwFtraceEvent mdp_cmd_release_bw = 89;
8011    MdpMixerUpdateFtraceEvent mdp_mixer_update = 90;
8012    MdpPerfSetWmLevelsFtraceEvent mdp_perf_set_wm_levels = 91;
8013    MdpVideoUnderrunDoneFtraceEvent mdp_video_underrun_done = 92;
8014    MdpCmdWaitPingpongFtraceEvent mdp_cmd_wait_pingpong = 93;
8015    MdpPerfPrefillCalcFtraceEvent mdp_perf_prefill_calc = 94;
8016    MdpPerfUpdateBusFtraceEvent mdp_perf_update_bus = 95;
8017    RotatorBwAoAsContextFtraceEvent rotator_bw_ao_as_context = 96;
8018    MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97;
8019    MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache =
8020        98;
8021    MmCompactionBeginFtraceEvent mm_compaction_begin = 99;
8022    MmCompactionDeferCompactionFtraceEvent mm_compaction_defer_compaction = 100;
8023    MmCompactionDeferredFtraceEvent mm_compaction_deferred = 101;
8024    MmCompactionDeferResetFtraceEvent mm_compaction_defer_reset = 102;
8025    MmCompactionEndFtraceEvent mm_compaction_end = 103;
8026    MmCompactionFinishedFtraceEvent mm_compaction_finished = 104;
8027    MmCompactionIsolateFreepagesFtraceEvent mm_compaction_isolate_freepages =
8028        105;
8029    MmCompactionIsolateMigratepagesFtraceEvent
8030        mm_compaction_isolate_migratepages = 106;
8031    MmCompactionKcompactdSleepFtraceEvent mm_compaction_kcompactd_sleep = 107;
8032    MmCompactionKcompactdWakeFtraceEvent mm_compaction_kcompactd_wake = 108;
8033    MmCompactionMigratepagesFtraceEvent mm_compaction_migratepages = 109;
8034    MmCompactionSuitableFtraceEvent mm_compaction_suitable = 110;
8035    MmCompactionTryToCompactPagesFtraceEvent
8036        mm_compaction_try_to_compact_pages = 111;
8037    MmCompactionWakeupKcompactdFtraceEvent mm_compaction_wakeup_kcompactd = 112;
8038    SuspendResumeFtraceEvent suspend_resume = 113;
8039    SchedWakeupNewFtraceEvent sched_wakeup_new = 114;
8040    BlockBioBackmergeFtraceEvent block_bio_backmerge = 115;
8041    BlockBioBounceFtraceEvent block_bio_bounce = 116;
8042    BlockBioCompleteFtraceEvent block_bio_complete = 117;
8043    BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118;
8044    BlockBioQueueFtraceEvent block_bio_queue = 119;
8045    BlockBioRemapFtraceEvent block_bio_remap = 120;
8046    BlockDirtyBufferFtraceEvent block_dirty_buffer = 121;
8047    BlockGetrqFtraceEvent block_getrq = 122;
8048    BlockPlugFtraceEvent block_plug = 123;
8049    BlockRqAbortFtraceEvent block_rq_abort = 124;
8050    BlockRqCompleteFtraceEvent block_rq_complete = 125;
8051    BlockRqInsertFtraceEvent block_rq_insert = 126;
8052    // removed field with id 127;
8053    BlockRqRemapFtraceEvent block_rq_remap = 128;
8054    BlockRqRequeueFtraceEvent block_rq_requeue = 129;
8055    BlockSleeprqFtraceEvent block_sleeprq = 130;
8056    BlockSplitFtraceEvent block_split = 131;
8057    BlockTouchBufferFtraceEvent block_touch_buffer = 132;
8058    BlockUnplugFtraceEvent block_unplug = 133;
8059    Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134;
8060    Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135;
8061    Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136;
8062    Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137;
8063    Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138;
8064    Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139;
8065    Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140;
8066    Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141;
8067    Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142;
8068    Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143;
8069    Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144;
8070    Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145;
8071    Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146;
8072    Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147;
8073    Ext4DropInodeFtraceEvent ext4_drop_inode = 148;
8074    Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149;
8075    Ext4EsFindDelayedExtentRangeEnterFtraceEvent
8076        ext4_es_find_delayed_extent_range_enter = 150;
8077    Ext4EsFindDelayedExtentRangeExitFtraceEvent
8078        ext4_es_find_delayed_extent_range_exit = 151;
8079    Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152;
8080    Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153;
8081    Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154;
8082    Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155;
8083    Ext4EsShrinkFtraceEvent ext4_es_shrink = 156;
8084    Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157;
8085    Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158;
8086    Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159;
8087    Ext4EvictInodeFtraceEvent ext4_evict_inode = 160;
8088    Ext4ExtConvertToInitializedEnterFtraceEvent
8089        ext4_ext_convert_to_initialized_enter = 161;
8090    Ext4ExtConvertToInitializedFastpathFtraceEvent
8091        ext4_ext_convert_to_initialized_fastpath = 162;
8092    Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents =
8093        163;
8094    Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164;
8095    Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165;
8096    Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166;
8097    Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167;
8098    Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168;
8099    Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169;
8100    Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170;
8101    Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171;
8102    Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172;
8103    Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173;
8104    Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174;
8105    Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175;
8106    Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176;
8107    Ext4ForgetFtraceEvent ext4_forget = 177;
8108    Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178;
8109    Ext4FreeInodeFtraceEvent ext4_free_inode = 179;
8110    Ext4GetImpliedClusterAllocExitFtraceEvent
8111        ext4_get_implied_cluster_alloc_exit = 180;
8112    Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc =
8113        181;
8114    Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182;
8115    Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183;
8116    Ext4InsertRangeFtraceEvent ext4_insert_range = 184;
8117    Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185;
8118    Ext4JournalStartFtraceEvent ext4_journal_start = 186;
8119    Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187;
8120    Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage =
8121        188;
8122    Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189;
8123    Ext4LoadInodeFtraceEvent ext4_load_inode = 190;
8124    Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191;
8125    Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192;
8126    Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193;
8127    Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194;
8128    Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195;
8129    Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196;
8130    Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197;
8131    Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198;
8132    Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199;
8133    Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200;
8134    Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201;
8135    Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202;
8136    Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203;
8137    Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204;
8138    Ext4PunchHoleFtraceEvent ext4_punch_hole = 205;
8139    Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206;
8140    Ext4ReadpageFtraceEvent ext4_readpage = 207;
8141    Ext4ReleasepageFtraceEvent ext4_releasepage = 208;
8142    Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209;
8143    Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210;
8144    Ext4RequestInodeFtraceEvent ext4_request_inode = 211;
8145    Ext4SyncFsFtraceEvent ext4_sync_fs = 212;
8146    Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213;
8147    Ext4TrimExtentFtraceEvent ext4_trim_extent = 214;
8148    Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215;
8149    Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216;
8150    Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217;
8151    Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218;
8152    Ext4WriteBeginFtraceEvent ext4_write_begin = 219;
8153    // removed field with id 220;
8154    // removed field with id 221;
8155    // removed field with id 222;
8156    // removed field with id 223;
8157    // removed field with id 224;
8158    // removed field with id 225;
8159    // removed field with id 226;
8160    // removed field with id 227;
8161    // removed field with id 228;
8162    // removed field with id 229;
8163    Ext4WriteEndFtraceEvent ext4_write_end = 230;
8164    Ext4WritepageFtraceEvent ext4_writepage = 231;
8165    Ext4WritepagesFtraceEvent ext4_writepages = 232;
8166    Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233;
8167    Ext4ZeroRangeFtraceEvent ext4_zero_range = 234;
8168    TaskNewtaskFtraceEvent task_newtask = 235;
8169    TaskRenameFtraceEvent task_rename = 236;
8170    SchedProcessExecFtraceEvent sched_process_exec = 237;
8171    SchedProcessExitFtraceEvent sched_process_exit = 238;
8172    SchedProcessForkFtraceEvent sched_process_fork = 239;
8173    SchedProcessFreeFtraceEvent sched_process_free = 240;
8174    SchedProcessHangFtraceEvent sched_process_hang = 241;
8175    SchedProcessWaitFtraceEvent sched_process_wait = 242;
8176    F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243;
8177    F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244;
8178    F2fsFallocateFtraceEvent f2fs_fallocate = 245;
8179    F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246;
8180    F2fsGetVictimFtraceEvent f2fs_get_victim = 247;
8181    F2fsIgetFtraceEvent f2fs_iget = 248;
8182    F2fsIgetExitFtraceEvent f2fs_iget_exit = 249;
8183    F2fsNewInodeFtraceEvent f2fs_new_inode = 250;
8184    F2fsReadpageFtraceEvent f2fs_readpage = 251;
8185    F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252;
8186    F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253;
8187    F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254;
8188    F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255;
8189    F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256;
8190    F2fsSyncFsFtraceEvent f2fs_sync_fs = 257;
8191    F2fsTruncateFtraceEvent f2fs_truncate = 258;
8192    F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259;
8193    F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260;
8194    F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range =
8195        261;
8196    F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter =
8197        262;
8198    F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit =
8199        263;
8200    F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264;
8201    F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265;
8202    F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266;
8203    F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267;
8204    F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268;
8205    F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269;
8206    F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270;
8207    F2fsWriteBeginFtraceEvent f2fs_write_begin = 271;
8208    F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272;
8209    F2fsWriteEndFtraceEvent f2fs_write_end = 273;
8210    AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274;
8211    AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275;
8212    AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276;
8213    AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277;
8214    AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278;
8215    AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279;
8216    DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280;
8217    IommuMapRangeFtraceEvent iommu_map_range = 281;
8218    IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282;
8219    IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283;
8220    IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284;
8221    IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285;
8222    IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286;
8223    IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287;
8224    IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288;
8225    IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289;
8226    IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290;
8227    IonPrefetchingFtraceEvent ion_prefetching = 291;
8228    IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292;
8229    IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start =
8230        293;
8231    IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294;
8232    IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295;
8233    IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296;
8234    IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start =
8235        297;
8236    KfreeFtraceEvent kfree = 298;
8237    KmallocFtraceEvent kmalloc = 299;
8238    KmallocNodeFtraceEvent kmalloc_node = 300;
8239    KmemCacheAllocFtraceEvent kmem_cache_alloc = 301;
8240    KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302;
8241    KmemCacheFreeFtraceEvent kmem_cache_free = 303;
8242    MigratePagesEndFtraceEvent migrate_pages_end = 304;
8243    MigratePagesStartFtraceEvent migrate_pages_start = 305;
8244    MigrateRetryFtraceEvent migrate_retry = 306;
8245    MmPageAllocFtraceEvent mm_page_alloc = 307;
8246    MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308;
8247    MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309;
8248    MmPageFreeFtraceEvent mm_page_free = 310;
8249    MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311;
8250    MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312;
8251    RssStatFtraceEvent rss_stat = 313;
8252    IonHeapShrinkFtraceEvent ion_heap_shrink = 314;
8253    IonHeapGrowFtraceEvent ion_heap_grow = 315;
8254    FenceInitFtraceEvent fence_init = 316;
8255    FenceDestroyFtraceEvent fence_destroy = 317;
8256    FenceEnableSignalFtraceEvent fence_enable_signal = 318;
8257    FenceSignaledFtraceEvent fence_signaled = 319;
8258    ClkEnableFtraceEvent clk_enable = 320;
8259    ClkDisableFtraceEvent clk_disable = 321;
8260    ClkSetRateFtraceEvent clk_set_rate = 322;
8261    BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323;
8262    SignalDeliverFtraceEvent signal_deliver = 324;
8263    SignalGenerateFtraceEvent signal_generate = 325;
8264    OomScoreAdjUpdateFtraceEvent oom_score_adj_update = 326;
8265    GenericFtraceEvent generic = 327;
8266    MmEventRecordFtraceEvent mm_event_record = 328;
8267    SysEnterFtraceEvent sys_enter = 329;
8268    SysExitFtraceEvent sys_exit = 330;
8269    ZeroFtraceEvent zero = 331;
8270    GpuFrequencyFtraceEvent gpu_frequency = 332;
8271    SdeTracingMarkWriteFtraceEvent sde_tracing_mark_write = 333;
8272    MarkVictimFtraceEvent mark_victim = 334;
8273    IonStatFtraceEvent ion_stat = 335;
8274    IonBufferCreateFtraceEvent ion_buffer_create = 336;
8275    IonBufferDestroyFtraceEvent ion_buffer_destroy = 337;
8276    ScmCallStartFtraceEvent scm_call_start = 338;
8277    ScmCallEndFtraceEvent scm_call_end = 339;
8278    GpuMemTotalFtraceEvent gpu_mem_total = 340;
8279    ThermalTemperatureFtraceEvent thermal_temperature = 341;
8280    CdevUpdateFtraceEvent cdev_update = 342;
8281    CpuhpExitFtraceEvent cpuhp_exit = 343;
8282    CpuhpMultiEnterFtraceEvent cpuhp_multi_enter = 344;
8283    CpuhpEnterFtraceEvent cpuhp_enter = 345;
8284    CpuhpLatencyFtraceEvent cpuhp_latency = 346;
8285    FastrpcDmaStatFtraceEvent fastrpc_dma_stat = 347;
8286    DpuTracingMarkWriteFtraceEvent dpu_tracing_mark_write = 348;
8287    G2dTracingMarkWriteFtraceEvent g2d_tracing_mark_write = 349;
8288    MaliTracingMarkWriteFtraceEvent mali_tracing_mark_write = 350;
8289    DmaHeapStatFtraceEvent dma_heap_stat = 351;
8290    CpuhpPauseFtraceEvent cpuhp_pause = 352;
8291    SchedPiSetprioFtraceEvent sched_pi_setprio = 353;
8292    SdeSdeEvtlogFtraceEvent sde_sde_evtlog = 354;
8293    SdeSdePerfCalcCrtcFtraceEvent sde_sde_perf_calc_crtc = 355;
8294    SdeSdePerfCrtcUpdateFtraceEvent sde_sde_perf_crtc_update = 356;
8295    SdeSdePerfSetQosLutsFtraceEvent sde_sde_perf_set_qos_luts = 357;
8296    SdeSdePerfUpdateBusFtraceEvent sde_sde_perf_update_bus = 358;
8297    RssStatThrottledFtraceEvent rss_stat_throttled = 359;
8298    NetifReceiveSkbFtraceEvent netif_receive_skb = 360;
8299    NetDevXmitFtraceEvent net_dev_xmit = 361;
8300    InetSockSetStateFtraceEvent inet_sock_set_state = 362;
8301    TcpRetransmitSkbFtraceEvent tcp_retransmit_skb = 363;
8302    CrosEcSensorhubDataFtraceEvent cros_ec_sensorhub_data = 364;
8303    NapiGroReceiveEntryFtraceEvent napi_gro_receive_entry = 365;
8304    NapiGroReceiveExitFtraceEvent napi_gro_receive_exit = 366;
8305    KfreeSkbFtraceEvent kfree_skb = 367;
8306    KvmAccessFaultFtraceEvent kvm_access_fault = 368;
8307    KvmAckIrqFtraceEvent kvm_ack_irq = 369;
8308    KvmAgeHvaFtraceEvent kvm_age_hva = 370;
8309    KvmAgePageFtraceEvent kvm_age_page = 371;
8310    KvmArmClearDebugFtraceEvent kvm_arm_clear_debug = 372;
8311    KvmArmSetDreg32FtraceEvent kvm_arm_set_dreg32 = 373;
8312    KvmArmSetRegsetFtraceEvent kvm_arm_set_regset = 374;
8313    KvmArmSetupDebugFtraceEvent kvm_arm_setup_debug = 375;
8314    KvmEntryFtraceEvent kvm_entry = 376;
8315    KvmExitFtraceEvent kvm_exit = 377;
8316    KvmFpuFtraceEvent kvm_fpu = 378;
8317    KvmGetTimerMapFtraceEvent kvm_get_timer_map = 379;
8318    KvmGuestFaultFtraceEvent kvm_guest_fault = 380;
8319    KvmHandleSysRegFtraceEvent kvm_handle_sys_reg = 381;
8320    KvmHvcArm64FtraceEvent kvm_hvc_arm64 = 382;
8321    KvmIrqLineFtraceEvent kvm_irq_line = 383;
8322    KvmMmioFtraceEvent kvm_mmio = 384;
8323    KvmMmioEmulateFtraceEvent kvm_mmio_emulate = 385;
8324    KvmSetGuestDebugFtraceEvent kvm_set_guest_debug = 386;
8325    KvmSetIrqFtraceEvent kvm_set_irq = 387;
8326    KvmSetSpteHvaFtraceEvent kvm_set_spte_hva = 388;
8327    KvmSetWayFlushFtraceEvent kvm_set_way_flush = 389;
8328    KvmSysAccessFtraceEvent kvm_sys_access = 390;
8329    KvmTestAgeHvaFtraceEvent kvm_test_age_hva = 391;
8330    KvmTimerEmulateFtraceEvent kvm_timer_emulate = 392;
8331    KvmTimerHrtimerExpireFtraceEvent kvm_timer_hrtimer_expire = 393;
8332    KvmTimerRestoreStateFtraceEvent kvm_timer_restore_state = 394;
8333    KvmTimerSaveStateFtraceEvent kvm_timer_save_state = 395;
8334    KvmTimerUpdateIrqFtraceEvent kvm_timer_update_irq = 396;
8335    KvmToggleCacheFtraceEvent kvm_toggle_cache = 397;
8336    KvmUnmapHvaRangeFtraceEvent kvm_unmap_hva_range = 398;
8337    KvmUserspaceExitFtraceEvent kvm_userspace_exit = 399;
8338    KvmVcpuWakeupFtraceEvent kvm_vcpu_wakeup = 400;
8339    KvmWfxArm64FtraceEvent kvm_wfx_arm64 = 401;
8340    TrapRegFtraceEvent trap_reg = 402;
8341    VgicUpdateIrqPendingFtraceEvent vgic_update_irq_pending = 403;
8342    WakeupSourceActivateFtraceEvent wakeup_source_activate = 404;
8343    WakeupSourceDeactivateFtraceEvent wakeup_source_deactivate = 405;
8344    UfshcdCommandFtraceEvent ufshcd_command = 406;
8345    UfshcdClkGatingFtraceEvent ufshcd_clk_gating = 407;
8346    ConsoleFtraceEvent console = 408;
8347    DrmVblankEventFtraceEvent drm_vblank_event = 409;
8348    DrmVblankEventDeliveredFtraceEvent drm_vblank_event_delivered = 410;
8349    DrmSchedJobFtraceEvent drm_sched_job = 411;
8350    DrmRunJobFtraceEvent drm_run_job = 412;
8351    DrmSchedProcessJobFtraceEvent drm_sched_process_job = 413;
8352    DmaFenceInitFtraceEvent dma_fence_init = 414;
8353    DmaFenceEmitFtraceEvent dma_fence_emit = 415;
8354    DmaFenceSignaledFtraceEvent dma_fence_signaled = 416;
8355    DmaFenceWaitStartFtraceEvent dma_fence_wait_start = 417;
8356    DmaFenceWaitEndFtraceEvent dma_fence_wait_end = 418;
8357    F2fsIostatFtraceEvent f2fs_iostat = 419;
8358    F2fsIostatLatencyFtraceEvent f2fs_iostat_latency = 420;
8359    SchedCpuUtilCfsFtraceEvent sched_cpu_util_cfs = 421;
8360    V4l2QbufFtraceEvent v4l2_qbuf = 422;
8361    V4l2DqbufFtraceEvent v4l2_dqbuf = 423;
8362    Vb2V4l2BufQueueFtraceEvent vb2_v4l2_buf_queue = 424;
8363    Vb2V4l2BufDoneFtraceEvent vb2_v4l2_buf_done = 425;
8364    Vb2V4l2QbufFtraceEvent vb2_v4l2_qbuf = 426;
8365    Vb2V4l2DqbufFtraceEvent vb2_v4l2_dqbuf = 427;
8366    DsiCmdFifoStatusFtraceEvent dsi_cmd_fifo_status = 428;
8367    DsiRxFtraceEvent dsi_rx = 429;
8368    DsiTxFtraceEvent dsi_tx = 430;
8369    AndroidFsDatareadEndFtraceEvent android_fs_dataread_end = 431;
8370    AndroidFsDatareadStartFtraceEvent android_fs_dataread_start = 432;
8371    AndroidFsDatawriteEndFtraceEvent android_fs_datawrite_end = 433;
8372    AndroidFsDatawriteStartFtraceEvent android_fs_datawrite_start = 434;
8373    AndroidFsFsyncEndFtraceEvent android_fs_fsync_end = 435;
8374    AndroidFsFsyncStartFtraceEvent android_fs_fsync_start = 436;
8375    FuncgraphEntryFtraceEvent funcgraph_entry = 437;
8376    FuncgraphExitFtraceEvent funcgraph_exit = 438;
8377    VirtioVideoCmdFtraceEvent virtio_video_cmd = 439;
8378    VirtioVideoCmdDoneFtraceEvent virtio_video_cmd_done = 440;
8379    VirtioVideoResourceQueueFtraceEvent virtio_video_resource_queue = 441;
8380    VirtioVideoResourceQueueDoneFtraceEvent virtio_video_resource_queue_done =
8381        442;
8382    MmShrinkSlabStartFtraceEvent mm_shrink_slab_start = 443;
8383    MmShrinkSlabEndFtraceEvent mm_shrink_slab_end = 444;
8384    TrustySmcFtraceEvent trusty_smc = 445;
8385    TrustySmcDoneFtraceEvent trusty_smc_done = 446;
8386    TrustyStdCall32FtraceEvent trusty_std_call32 = 447;
8387    TrustyStdCall32DoneFtraceEvent trusty_std_call32_done = 448;
8388    TrustyShareMemoryFtraceEvent trusty_share_memory = 449;
8389    TrustyShareMemoryDoneFtraceEvent trusty_share_memory_done = 450;
8390    TrustyReclaimMemoryFtraceEvent trusty_reclaim_memory = 451;
8391    TrustyReclaimMemoryDoneFtraceEvent trusty_reclaim_memory_done = 452;
8392    TrustyIrqFtraceEvent trusty_irq = 453;
8393    TrustyIpcHandleEventFtraceEvent trusty_ipc_handle_event = 454;
8394    TrustyIpcConnectFtraceEvent trusty_ipc_connect = 455;
8395    TrustyIpcConnectEndFtraceEvent trusty_ipc_connect_end = 456;
8396    TrustyIpcWriteFtraceEvent trusty_ipc_write = 457;
8397    TrustyIpcPollFtraceEvent trusty_ipc_poll = 458;
8398    // removed field with id 459;
8399    TrustyIpcReadFtraceEvent trusty_ipc_read = 460;
8400    TrustyIpcReadEndFtraceEvent trusty_ipc_read_end = 461;
8401    TrustyIpcRxFtraceEvent trusty_ipc_rx = 462;
8402    // removed field with id 463;
8403    TrustyEnqueueNopFtraceEvent trusty_enqueue_nop = 464;
8404    CmaAllocStartFtraceEvent cma_alloc_start = 465;
8405    CmaAllocInfoFtraceEvent cma_alloc_info = 466;
8406    LwisTracingMarkWriteFtraceEvent lwis_tracing_mark_write = 467;
8407    VirtioGpuCmdQueueFtraceEvent virtio_gpu_cmd_queue = 468;
8408    VirtioGpuCmdResponseFtraceEvent virtio_gpu_cmd_response = 469;
8409    MaliMaliKCPUCQSSETFtraceEvent mali_mali_KCPU_CQS_SET = 470;
8410    MaliMaliKCPUCQSWAITSTARTFtraceEvent mali_mali_KCPU_CQS_WAIT_START = 471;
8411    MaliMaliKCPUCQSWAITENDFtraceEvent mali_mali_KCPU_CQS_WAIT_END = 472;
8412    MaliMaliKCPUFENCESIGNALFtraceEvent mali_mali_KCPU_FENCE_SIGNAL = 473;
8413    MaliMaliKCPUFENCEWAITSTARTFtraceEvent mali_mali_KCPU_FENCE_WAIT_START = 474;
8414    MaliMaliKCPUFENCEWAITENDFtraceEvent mali_mali_KCPU_FENCE_WAIT_END = 475;
8415    HypEnterFtraceEvent hyp_enter = 476;
8416    HypExitFtraceEvent hyp_exit = 477;
8417    HostHcallFtraceEvent host_hcall = 478;
8418    HostSmcFtraceEvent host_smc = 479;
8419    HostMemAbortFtraceEvent host_mem_abort = 480;
8420    SuspendResumeMinimalFtraceEvent suspend_resume_minimal = 481;
8421    MaliMaliCSFINTERRUPTSTARTFtraceEvent mali_mali_CSF_INTERRUPT_START = 482;
8422    MaliMaliCSFINTERRUPTENDFtraceEvent mali_mali_CSF_INTERRUPT_END = 483;
8423  }
8424}
8425
8426// End of protos/perfetto/trace/ftrace/ftrace_event.proto
8427
8428// Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
8429
8430// The result of tracing one or more ftrace data pages from a single per-cpu
8431// kernel ring buffer. If collating multiple pages' worth of events, all of
8432// them come from contiguous pages, with no kernel data loss in between.
8433message FtraceEventBundle {
8434  optional uint32 cpu = 1;
8435  repeated FtraceEvent event = 2;
8436
8437  // Set to true if there was data loss between the last time we've read from
8438  // the corresponding per-cpu kernel buffer, and the earliest event recorded
8439  // in this bundle.
8440  optional bool lost_events = 3;
8441
8442  // Optionally-enabled compact encoding of a batch of scheduling events. Only
8443  // a subset of events & their fields is recorded.
8444  // All fields (except comms) are stored in a structure-of-arrays form, one
8445  // entry in each repeated field per event.
8446  message CompactSched {
8447    // Interned table of unique strings for this bundle.
8448    repeated string intern_table = 5;
8449
8450    // Delta-encoded timestamps across all sched_switch events within this
8451    // bundle. The first is absolute, each next one is relative to its
8452    // predecessor.
8453    repeated uint64 switch_timestamp = 1 [packed = true];
8454    repeated int64 switch_prev_state = 2 [packed = true];
8455    repeated int32 switch_next_pid = 3 [packed = true];
8456    repeated int32 switch_next_prio = 4 [packed = true];
8457    // One per event, index into |intern_table| corresponding to the
8458    // next_comm field of the event.
8459    repeated uint32 switch_next_comm_index = 6 [packed = true];
8460
8461    // Delta-encoded timestamps across all sched_waking events within this
8462    // bundle. The first is absolute, each next one is relative to its
8463    // predecessor.
8464    repeated uint64 waking_timestamp = 7 [packed = true];
8465    repeated int32 waking_pid = 8 [packed = true];
8466    repeated int32 waking_target_cpu = 9 [packed = true];
8467    repeated int32 waking_prio = 10 [packed = true];
8468    // One per event, index into |intern_table| corresponding to the
8469    // comm field of the event.
8470    repeated uint32 waking_comm_index = 11 [packed = true];
8471    repeated uint32 waking_common_flags = 12 [packed = true];
8472  }
8473  optional CompactSched compact_sched = 4;
8474
8475  // traced_probes always sets the ftrace_clock to "boot". That is not available
8476  // in older kernels (v3.x). In that case we fallback on "global" or "local".
8477  // When we do that, we report the fallback clock in each bundle so we can do
8478  // proper clock syncing at parsing time in TraceProcessor. We cannot use the
8479  // TracePacket timestamp_clock_id because: (1) there is no per-packet
8480  // timestamp for ftrace bundles; (2) "global" does not match CLOCK_MONOTONIC.
8481  // Having a dedicated and explicit flag allows us to correct further misakes
8482  // in future by looking at the kernel version.
8483  // This field has been introduced in perfetto v19 / Android T (13).
8484  // This field is omitted when the ftrace clock is just "boot", as that is the
8485  // default assumption (and for consistency with the past).
8486  optional FtraceClock ftrace_clock = 5;
8487
8488  // The timestamp according to the ftrace clock, taken at the same instant
8489  // as |boot_timestamp|. This is used to sync ftrace events when a non-boot
8490  // clock is used as the ftrace clock. We don't use the ClockSnapshot packet
8491  // because the ftrace global/local clocks don't match any of the clock_gettime
8492  // domains and can be only read by traced_probes.
8493  //
8494  // Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
8495  //
8496  // Implementation note: Populated by reading the 'now ts:' field in
8497  // tracefs/per_cpu/cpuX/stat.
8498  optional int64 ftrace_timestamp = 6;
8499
8500  // The timestamp according to CLOCK_BOOTTIME, taken at the same instant as
8501  // |ftrace_timestamp|. See documentation of |ftrace_timestamp| for
8502  // more info.
8503  //
8504  // Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
8505  optional int64 boot_timestamp = 7;
8506}
8507
8508enum FtraceClock {
8509  // There is no FTRACE_CLOCK_BOOT entry as that's the default assumption. When
8510  // the ftrace clock is "boot", it's just omitted (so UNSPECIFIED == BOOT).
8511  FTRACE_CLOCK_UNSPECIFIED = 0;
8512  FTRACE_CLOCK_UNKNOWN = 1;
8513  FTRACE_CLOCK_GLOBAL = 2;
8514  FTRACE_CLOCK_LOCAL = 3;
8515  FTRACE_CLOCK_MONO_RAW = 4;
8516}
8517
8518// End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto
8519
8520// Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto
8521
8522// Per-CPU stats for the ftrace data source gathered from the kernel from
8523// /sys/kernel/debug/tracing/per_cpu/cpuX/stats.
8524message FtraceCpuStats {
8525  // CPU index.
8526  optional uint64 cpu = 1;
8527
8528  // Number of entries still in the kernel buffer. Ideally this should be close
8529  // to zero, as events are consumed regularly and moved into the userspace
8530  // buffers (or file).
8531  optional uint64 entries = 2;
8532
8533  // Number of events lost in kernel buffers due to overwriting of old events
8534  // before userspace had a chance to drain them.
8535  optional uint64 overrun = 3;
8536
8537  // This should always be zero. If not the buffer size is way too small or
8538  // something went wrong with the tracer.
8539  optional uint64 commit_overrun = 4;
8540
8541  // Bytes actually read (not overwritten).
8542  optional uint64 bytes_read = 5;
8543
8544  // The timestamp for the oldest event still in the ring buffer.
8545  optional double oldest_event_ts = 6;
8546
8547  // The current timestamp.
8548  optional double now_ts = 7;
8549
8550  // If the kernel buffer has overwrite mode disabled, this will show the number
8551  // of new events that were lost because the buffer was full. This is similar
8552  // to |overrun| but only for the overwrite=false case.
8553  optional uint64 dropped_events = 8;
8554
8555  // The number of events read.
8556  optional uint64 read_events = 9;
8557}
8558
8559// Ftrace stats for all CPUs.
8560message FtraceStats {
8561  enum Phase {
8562    UNSPECIFIED = 0;
8563    START_OF_TRACE = 1;
8564    END_OF_TRACE = 2;
8565  }
8566
8567  // Tells when stats were sampled. There should be one sample at the beginning
8568  // of the trace and one sample at the end.
8569  optional Phase phase = 1;
8570
8571  // Per-CPU stats (one entry for each CPU).
8572  repeated FtraceCpuStats cpu_stats = 2;
8573
8574  // When FtraceConfig.symbolize_ksyms = true, this records the number of
8575  // symbols parsed from /proc/kallsyms, whether they have been seen in the
8576  // trace or not. It can be used to debug kptr_restrict or security-related
8577  // errors.
8578  // Note: this will be valid only when phase = END_OF_TRACE. The symbolizer is
8579  // initialized. When START_OF_TRACE is emitted it is not ready yet.
8580  optional uint32 kernel_symbols_parsed = 3;
8581
8582  // The memory used by the kernel symbolizer (KernelSymbolMap.size_bytes()).
8583  optional uint32 kernel_symbols_mem_kb = 4;
8584
8585  // Atrace errors (even non-fatal ones) are reported here. A typical example is
8586  // one or more atrace categories not available on the device.
8587  optional string atrace_errors = 5;
8588
8589  // Ftrace events requested by the config but not present on device.
8590  repeated string unknown_ftrace_events = 6;
8591
8592  // Ftrace events requested by the config and present on device, but which we
8593  // failed to enable due to permissions, or due to a conflicting option
8594  // (currently FtraceConfig.disable_generic_events).
8595  repeated string failed_ftrace_events = 7;
8596
8597  // The data source was configured to preserve existing events in the ftrace
8598  // buffer before the start of the trace.
8599  optional bool preserve_ftrace_buffer = 8;
8600}
8601
8602// End of protos/perfetto/trace/ftrace/ftrace_stats.proto
8603
8604// Begin of protos/perfetto/trace/gpu/gpu_counter_event.proto
8605
8606message GpuCounterEvent {
8607  // The first trace packet of each session should include counter_spec.
8608  optional GpuCounterDescriptor counter_descriptor = 1;
8609
8610  message GpuCounter {
8611    // required. Identifier for counter.
8612    optional uint32 counter_id = 1;
8613    // required. Value of the counter.
8614    oneof value {
8615      int64 int_value = 2;
8616      double double_value = 3;
8617    }
8618  }
8619  repeated GpuCounter counters = 2;
8620
8621  // optional. Identifier for GPU in a multi-gpu device.
8622  optional int32 gpu_id = 3;
8623}
8624
8625// End of protos/perfetto/trace/gpu/gpu_counter_event.proto
8626
8627// Begin of protos/perfetto/trace/gpu/gpu_log.proto
8628
8629// Message for logging events GPU data producer.
8630message GpuLog {
8631  enum Severity {
8632    LOG_SEVERITY_UNSPECIFIED = 0;
8633    LOG_SEVERITY_VERBOSE = 1;
8634    LOG_SEVERITY_DEBUG = 2;
8635    LOG_SEVERITY_INFO = 3;
8636    LOG_SEVERITY_WARNING = 4;
8637    LOG_SEVERITY_ERROR = 5;
8638  };
8639  optional Severity severity = 1;
8640
8641  optional string tag = 2;
8642
8643  optional string log_message = 3;
8644}
8645
8646// End of protos/perfetto/trace/gpu/gpu_log.proto
8647
8648// Begin of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
8649
8650// next id: 15
8651message GpuRenderStageEvent {
8652  // required. Unique ID for the event.
8653  optional uint64 event_id = 1;
8654
8655  // optional. Duration of the event in nanoseconds. If unset, this is a
8656  // single time point event.
8657  optional uint64 duration = 2;
8658
8659  // required. ID to a hardware queue description in the specifications.
8660  // InternedGpuRenderStageSpecification
8661  optional uint64 hw_queue_iid = 13;
8662
8663  // required. ID to a render stage description in the specifications.
8664  // InternedGpuRenderStageSpecification
8665  optional uint64 stage_iid = 14;
8666
8667  // optional. Identifier for GPU in a multi-gpu device.
8668  optional int32 gpu_id = 11;
8669
8670  // required. Graphics context for the event.
8671  // For OpenGL, this is the GL context.
8672  // For Vulkan, this is the VkDevice.
8673  optional uint64 context = 5;
8674
8675  // optional. The render target for this event.
8676  // For OpenGL, this is the GL frame buffer handle.
8677  // For Vulkan, this is the VkFrameBuffer handle.
8678  optional uint64 render_target_handle = 8;
8679
8680  // optional. Submission ID generated by the UMD.
8681  // For OpenGL, the ID should map to an API submission (e.g., glFlush,
8682  // glFinish, eglSwapBufffers) event.  The set of submissions to the HW due
8683  // to a single API submission should share the same ID.
8684  // For Vulkan, it should map 1:1 with a vkQueueSubmit.
8685  optional uint32 submission_id = 10;
8686
8687  // optional. Additional data for the user. This may include attributes for
8688  // the event like resource ids, shaders, etc.
8689  message ExtraData {
8690    optional string name = 1;
8691    optional string value = 2;
8692  }
8693  repeated ExtraData extra_data = 6;
8694
8695  // VULKAN SPECIFICS
8696
8697  // optional. The Vulkan render pass handle.
8698  optional uint64 render_pass_handle = 9;
8699
8700  // optional. A bit mask representing which render subpasses contributed to
8701  // this render stage event.  Subpass index 0 is represented by setting the
8702  // LSB of the mask.  Additional mask can be added for subpass index greater
8703  // than 63.
8704  repeated uint64 render_subpass_index_mask = 15;
8705
8706  // optional. The Vulkan command buffer handle.
8707  optional uint64 command_buffer_handle = 12;
8708
8709  // DEPRECATED
8710
8711  // Deprecated.  Use InternedGpuRenderStageSpecification instead.
8712  // The first trace packet of each session should include a Specifications
8713  // to enumerate *all* IDs that will be used. The timestamp of this packet
8714  // must be earlier than all other packets. Only one packet with Specifications
8715  // is expected.
8716  message Specifications {
8717    message ContextSpec {
8718      optional uint64 context = 1;
8719      optional int32 pid = 2;
8720    }
8721    optional ContextSpec context_spec = 1;
8722
8723    message Description {
8724      optional string name = 1;
8725      optional string description = 2;
8726    }
8727
8728    // Labels to categorize the hw Queue this event goes on.
8729    repeated Description hw_queue = 2;
8730
8731    // Labels to categorize render stage(binning, render, compute etc).
8732    repeated Description stage = 3;
8733  }
8734  // Deprecated.  Use hw_queue_iid and stage_iid to refer to
8735  // InternedGpuRenderStageSpecification instead.
8736  optional Specifications specifications = 7 [deprecated = true];
8737
8738  // Deprecated. Use hw_queue_iid instead;
8739  optional int32 hw_queue_id = 3 [deprecated = true];
8740
8741  // Deprecated. Use stage_iid instead;
8742  optional int32 stage_id = 4 [deprecated = true];
8743
8744  // Extension for vendor's custom proto.
8745  extensions 100;
8746}
8747
8748// Interned data.
8749
8750// The iid is the numeric value of either the GL Context or the VkDevice
8751// handle.
8752message InternedGraphicsContext {
8753  optional uint64 iid = 1;
8754  optional int32 pid = 2;
8755  enum Api {
8756    UNDEFINED = 0;
8757    OPEN_GL = 1;
8758    VULKAN = 2;
8759    OPEN_CL = 3;
8760  }
8761  optional Api api = 3;
8762}
8763
8764message InternedGpuRenderStageSpecification {
8765  optional uint64 iid = 1;
8766  optional string name = 2;
8767  optional string description = 3;
8768
8769  enum RenderStageCategory {
8770    OTHER = 0;
8771    GRAPHICS = 1;
8772    COMPUTE = 2;
8773  }
8774  optional RenderStageCategory category = 4;
8775}
8776
8777// End of protos/perfetto/trace/gpu/gpu_render_stage_event.proto
8778
8779// Begin of protos/perfetto/trace/gpu/vulkan_api_event.proto
8780
8781// Message for recording the Vulkan call.
8782message VulkanApiEvent {
8783  oneof event {
8784    VkDebugUtilsObjectName vk_debug_utils_object_name = 1;
8785    VkQueueSubmit vk_queue_submit = 2;
8786  }
8787
8788  // For recording vkSetDebugUtilsObjectNameEXT and
8789  // vkDebugMarkerSetObjectNameEXT
8790  message VkDebugUtilsObjectName {
8791    optional uint32 pid = 1;
8792    optional uint64 vk_device = 2;
8793    // VkObjectType.  Value must match
8794    // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkObjectType.html.
8795    optional int32 object_type = 3;
8796    optional uint64 object = 4;
8797    optional string object_name = 5;
8798  }
8799
8800  // For recording vkQueueSubmit call.
8801  message VkQueueSubmit {
8802    optional uint64 duration_ns = 1;
8803    optional uint32 pid = 2;
8804    optional uint32 tid = 3;
8805    optional uint64 vk_queue = 4;
8806    repeated uint64 vk_command_buffers = 5;
8807    // Submission ID.  An identifier unique to each vkQueueSubmit call.  This
8808    // submission_id must match GpuRenderStageEvent.submission_id if the
8809    // GpuRenderStageEvent is created due to this vkQueueSubmit.
8810    optional uint32 submission_id = 6;
8811  }
8812}
8813
8814// End of protos/perfetto/trace/gpu/vulkan_api_event.proto
8815
8816// Begin of protos/perfetto/trace/gpu/vulkan_memory_event.proto
8817
8818// All the information that cannot be sent within a VulkanMemoryEvent message,
8819// are sent as annotations to the main memory event. One example is the
8820// properties of the object that consumes the allocated memory, for example, a
8821// buffer or an image.
8822// key_iid and string_iid are both interned strings. Original string value is
8823// stored in vulkan_memory_keys from
8824// protos/perfetto/trace/interned_data/interned_data.proto.
8825message VulkanMemoryEventAnnotation {
8826  optional uint64 key_iid = 1;
8827  oneof value {
8828    int64 int_value = 2;
8829    double double_value = 3;
8830    uint64 string_iid = 4;
8831  }
8832}
8833
8834// Each VulkanMemoryEvent encompasses information regarding one single function
8835// call that results in reserving, binding or freeing host or GPU memory. There
8836// is a special message type, ANNOTATIONS, which is used to communicate
8837// information that are not directly related to a memory event, nonetheless are
8838// essential to understand the memory usage. An example is the size and memory
8839// types of the memory heaps.
8840//
8841// Next reserved id: 10 (up to 15).
8842// Next id: 21.
8843message VulkanMemoryEvent {
8844  enum Source {
8845    SOURCE_UNSPECIFIED = 0;
8846    SOURCE_DRIVER = 1;
8847    SOURCE_DEVICE = 2;
8848    SOURCE_DEVICE_MEMORY = 3;
8849    SOURCE_BUFFER = 4;
8850    SOURCE_IMAGE = 5;
8851  }
8852
8853  enum Operation {
8854    OP_UNSPECIFIED = 0;
8855
8856    // alloc, create
8857    OP_CREATE = 1;
8858
8859    // free, destroy(non-bound)
8860    OP_DESTROY = 2;
8861
8862    // bind buffer and image
8863    OP_BIND = 3;
8864
8865    // destroy (bound)
8866    OP_DESTROY_BOUND = 4;
8867
8868    // only annotations
8869    OP_ANNOTATIONS = 5;
8870  }
8871
8872  enum AllocationScope {
8873    SCOPE_UNSPECIFIED = 0;
8874    SCOPE_COMMAND = 1;
8875    SCOPE_OBJECT = 2;
8876    SCOPE_CACHE = 3;
8877    SCOPE_DEVICE = 4;
8878    SCOPE_INSTANCE = 5;
8879  }
8880
8881  optional Source source = 1;
8882  optional Operation operation = 2;
8883  optional int64 timestamp = 3;
8884  optional uint32 pid = 4;
8885  optional fixed64 memory_address = 5;
8886  optional uint64 memory_size = 6;
8887  // Interned string. Original string value is stored in function_names from
8888  // protos/perfetto/trace/interned_data/interned_data.proto.
8889  optional uint64 caller_iid = 7;
8890  optional AllocationScope allocation_scope = 8;
8891  // Extra related information, e.g., create configs, etc.
8892  repeated VulkanMemoryEventAnnotation annotations = 9;
8893
8894  // Field IDs used for device memory (low sampling rate)
8895  optional fixed64 device = 16;
8896  optional fixed64 device_memory = 17;
8897  optional uint32 memory_type = 18;
8898  optional uint32 heap = 19;
8899  optional fixed64 object_handle = 20;
8900}
8901
8902// End of protos/perfetto/trace/gpu/vulkan_memory_event.proto
8903
8904// Begin of protos/perfetto/trace/profiling/profile_common.proto
8905
8906// TODO(fmayer): Figure out naming thoroughout this file to get a
8907// nomenclature that works between Windows and Linux.
8908
8909// The interning fields in this file can refer to 2 different intern tables,
8910// depending on the message they are used in. If the interned fields are present
8911// in ProfilePacket proto, then the intern tables included in the ProfilePacket
8912// should be used. If the intered fields are present in the
8913// StreamingProfilePacket proto, then the intern tables included in all of the
8914// previous InternedData message with same sequence ID should be used.
8915// TODO(fmayer): Move to the intern tables to a common location.
8916message InternedString {
8917  optional uint64 iid = 1;
8918  optional bytes str = 2;
8919}
8920
8921// A symbol field that is emitted after the trace is written. These tables would
8922// be appended as the last packets in the trace that the profiler will use, so
8923// that the actual trace need not be rewritten to symbolize the profiles.
8924message ProfiledFrameSymbols {
8925  // Use the frame id as the interning key for the symbols.
8926  optional uint64 frame_iid = 1;
8927
8928  // These are repeated because when inlining happens, multiple functions'
8929  // frames can be at a single address. Imagine function Foo calling the
8930  // std::vector<int> constructor, which gets inlined at 0xf00. We then get
8931  // both Foo and the std::vector<int> constructor when we symbolize the
8932  // address.
8933
8934  // key to InternedString
8935  repeated uint64 function_name_id = 2;
8936
8937  // key to InternedString
8938  repeated uint64 file_name_id = 3;
8939
8940  repeated uint32 line_number = 4;
8941}
8942
8943message Line {
8944  optional string function_name = 1;
8945  optional string source_file_name = 2;
8946  optional uint32 line_number = 3;
8947}
8948
8949// Symbols for a given address in a module.
8950message AddressSymbols {
8951  optional uint64 address = 1;
8952
8953  // Source lines that correspond to this address.
8954  //
8955  // These are repeated because when inlining happens, multiple functions'
8956  // frames can be at a single address. Imagine function Foo calling the
8957  // std::vector<int> constructor, which gets inlined at 0xf00. We then get
8958  // both Foo and the std::vector<int> constructor when we symbolize the
8959  // address.
8960  repeated Line lines = 2;
8961}
8962
8963// Symbols for addresses seen in a module.
8964message ModuleSymbols {
8965  // Fully qualified path to the mapping.
8966  // E.g. /system/lib64/libc.so.
8967  optional string path = 1;
8968
8969  // .note.gnu.build-id on Linux (not hex encoded).
8970  // uuid on MacOS.
8971  // Module GUID on Windows.
8972  optional string build_id = 2;
8973  repeated AddressSymbols address_symbols = 3;
8974}
8975
8976message Mapping {
8977  // Interning key.
8978  optional uint64 iid = 1;
8979
8980  // Interning key.
8981  optional uint64 build_id = 2;
8982
8983  // The linker may create multiple memory mappings for the same shared
8984  // library.
8985  // This is so that the ELF header is mapped as read only, while the
8986  // executable memory is mapped as executable only.
8987  // The details of this depend on the linker, a possible mapping of an ELF
8988  // file is this:
8989  //         +----------------------+
8990  // ELF     |xxxxxxxxxyyyyyyyyyyyyy|
8991  //         +---------+------------+
8992  //         |         |
8993  //         | read    | executable
8994  //         v mapping v mapping
8995  //         +----------------------+
8996  // Memory  |xxxxxxxxx|yyyyyyyyyyyy|
8997  //         +------------------+---+
8998  //         ^         ^        ^
8999  //         +         +        +
9000  //       start     exact    relpc
9001  //       offset   offset    0x1800
9002  //       0x0000   0x1000
9003  //
9004  // exact_offset is the offset into the library file of this mapping.
9005  // start_offset is the offset into the library file of the first mapping
9006  // for that library. For native libraries (.so files) this should be 0.
9007
9008  // This is not set on Android 10.
9009  optional uint64 exact_offset = 8;
9010
9011  optional uint64 start_offset = 3;
9012  optional uint64 start = 4;
9013  optional uint64 end = 5;
9014  optional uint64 load_bias = 6;
9015
9016  // E.g. ["system", "lib64", "libc.so"]
9017  // id of string.
9018  repeated uint64 path_string_ids = 7;
9019}
9020
9021message Frame {
9022  // Interning key
9023  optional uint64 iid = 1;
9024
9025  // E.g. "fopen"
9026  // id of string.
9027  optional uint64 function_name_id = 2;
9028
9029  optional uint64 mapping_id = 3;
9030  optional uint64 rel_pc = 4;
9031}
9032
9033message Callstack {
9034  optional uint64 iid = 1;
9035  // Frames of this callstack. Bottom frame first.
9036  repeated uint64 frame_ids = 2;
9037}
9038
9039// End of protos/perfetto/trace/profiling/profile_common.proto
9040
9041// Begin of protos/perfetto/trace/track_event/chrome_histogram_sample.proto
9042
9043message HistogramName {
9044  optional uint64 iid = 1;
9045  optional string name = 2;
9046}
9047
9048// An individual histogram sample logged via Chrome's UMA metrics system.
9049message ChromeHistogramSample {
9050  // MD5 hash of the metric name. Either |name_hash| or |name|/|name_iid| or
9051  // both must be present.
9052  optional uint64 name_hash = 1;
9053  optional string name = 2;
9054  optional int64 sample = 3;
9055  // Interned HistogramName. Only one of |name|, |name_iid| can be set.
9056  optional uint64 name_iid = 4;
9057}
9058
9059// End of protos/perfetto/trace/track_event/chrome_histogram_sample.proto
9060
9061// Begin of protos/perfetto/trace/track_event/debug_annotation.proto
9062
9063// Proto representation of untyped key/value annotations provided in TRACE_EVENT
9064// macros. Users of the Perfetto SDK should prefer to use the
9065// perfetto::TracedValue API to fill these protos, rather than filling them
9066// manually.
9067//
9068// Debug annotations are intended for debug use and are not considered a stable
9069// API of the trace contents. Trace-based metrics that use debug annotation
9070// values are prone to breakage, so please rely on typed TrackEvent fields for
9071// these instead.
9072//
9073// DebugAnnotations support nested arrays and dictionaries. Each entry is
9074// encoded as a single DebugAnnotation message. Only dictionary entries
9075// set the "name" field. The TrackEvent message forms an implicit root
9076// dictionary.
9077//
9078// Example TrackEvent with nested annotations:
9079//   track_event {
9080//     debug_annotations {
9081//       name: "foo"
9082//       dict_entries {
9083//         name: "a"
9084//         bool_value: true
9085//       }
9086//       dict_entries {
9087//         name: "b"
9088//         int_value: 123
9089//       }
9090//     }
9091//     debug_annotations {
9092//       name: "bar"
9093//       array_values {
9094//         string_value: "hello"
9095//       }
9096//       array_values {
9097//         string_value: "world"
9098//       }
9099//     }
9100//   }
9101//
9102// Next ID: 18.
9103// Reserved ID: 15
9104message DebugAnnotation {
9105  // Name fields are set only for dictionary entries.
9106  oneof name_field {
9107    // interned DebugAnnotationName.
9108    uint64 name_iid = 1;
9109    // non-interned variant.
9110    string name = 10;
9111  }
9112
9113  oneof value {
9114    bool bool_value = 2;
9115    uint64 uint_value = 3;
9116    int64 int_value = 4;
9117    double double_value = 5;
9118    // Pointers are stored in a separate type as the JSON output treats them
9119    // differently from other uint64 values.
9120    uint64 pointer_value = 7;
9121
9122    // Deprecated. Use dict_entries / array_values instead.
9123    NestedValue nested_value = 8;
9124
9125    // Legacy instrumentation may not support conversion of nested data to
9126    // NestedValue yet.
9127    string legacy_json_value = 9;
9128
9129    // interned and non-interned variants of strings.
9130    string string_value = 6;
9131    // Corresponds to |debug_annotation_string_values| field in InternedData.
9132    uint64 string_value_iid = 17;
9133  }
9134
9135  // Used to embed arbitrary proto messages (which are also typically used to
9136  // represent typed TrackEvent arguments). |proto_type_name| or
9137  // |proto_type_name_iid| are storing the full name of the proto messages (e.g.
9138  // .perfetto.protos.DebugAnnotation) and |proto_value| contains the serialised
9139  // proto messages. See |TracedValue::WriteProto| for more details.
9140  oneof proto_type_descriptor {
9141    string proto_type_name = 16;
9142    // interned DebugAnnotationValueTypeName.
9143    uint64 proto_type_name_iid = 13;
9144  }
9145  optional bytes proto_value = 14;
9146
9147  repeated DebugAnnotation dict_entries = 11;
9148  repeated DebugAnnotation array_values = 12;
9149
9150  // Deprecated legacy way to use nested values. Only kept for
9151  // backwards-compatibility in TraceProcessor. May be removed in the future -
9152  // code filling protos should use |dict_entries| and |array_values| instead.
9153  message NestedValue {
9154    enum NestedType {
9155      // leaf value.
9156      UNSPECIFIED = 0;
9157      DICT = 1;
9158      ARRAY = 2;
9159    }
9160    optional NestedType nested_type = 1;
9161
9162    repeated string dict_keys = 2;
9163    repeated NestedValue dict_values = 3;
9164    repeated NestedValue array_values = 4;
9165    optional int64 int_value = 5;
9166    optional double double_value = 6;
9167    optional bool bool_value = 7;
9168    optional string string_value = 8;
9169  }
9170}
9171
9172// --------------------
9173// Interned data types:
9174// --------------------
9175
9176message DebugAnnotationName {
9177  optional uint64 iid = 1;
9178  optional string name = 2;
9179}
9180
9181// See the |proto_type_descriptor| comment.
9182message DebugAnnotationValueTypeName {
9183  optional uint64 iid = 1;
9184  optional string name = 2;
9185}
9186
9187// End of protos/perfetto/trace/track_event/debug_annotation.proto
9188
9189// Begin of protos/perfetto/trace/track_event/log_message.proto
9190
9191message LogMessage {
9192  // interned SourceLocation.
9193  optional uint64 source_location_iid = 1;
9194  // interned LogMessageBody.
9195  optional uint64 body_iid = 2;
9196}
9197
9198// --------------------
9199// Interned data types:
9200// --------------------
9201
9202message LogMessageBody {
9203  optional uint64 iid = 1;
9204  optional string body = 2;
9205}
9206// End of protos/perfetto/trace/track_event/log_message.proto
9207
9208// Begin of protos/perfetto/trace/track_event/source_location.proto
9209
9210// --------------------
9211// Interned data types:
9212// --------------------
9213
9214// A source location, represented as a native symbol.
9215// This is similar to `message Frame` from
9216// protos/perfetto/trace/profiling/profile_common.proto, but for abitrary
9217// source code locations (for example in track event args), not stack frames.
9218message UnsymbolizedSourceLocation {
9219  optional uint64 iid = 1;
9220  optional uint64 mapping_id = 2;
9221  optional uint64 rel_pc = 3;
9222}
9223
9224message SourceLocation {
9225  optional uint64 iid = 1;
9226  optional string file_name = 2;
9227  optional string function_name = 3;
9228  optional uint32 line_number = 4;
9229}
9230
9231// End of protos/perfetto/trace/track_event/source_location.proto
9232
9233// Begin of protos/perfetto/trace/track_event/chrome_active_processes.proto
9234
9235// A list of processes connected to the tracing service.
9236message ChromeActiveProcesses {
9237  repeated int32 pid = 1;
9238}
9239// End of protos/perfetto/trace/track_event/chrome_active_processes.proto
9240
9241// Begin of protos/perfetto/trace/track_event/chrome_application_state_info.proto
9242
9243
9244// Trace event arguments for application state changes.
9245message ChromeApplicationStateInfo {
9246  // Enum definition taken from:
9247  // https://source.chromium.org/chromium/chromium/src/+/master:base/android/application_status_listener.h
9248  enum ChromeApplicationState {
9249    APPLICATION_STATE_UNKNOWN = 0;
9250    APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1;
9251    APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2;
9252    APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3;
9253    APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4;
9254  };
9255  optional ChromeApplicationState application_state = 1;
9256}
9257
9258// End of protos/perfetto/trace/track_event/chrome_application_state_info.proto
9259
9260// Begin of protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.proto
9261
9262// Describes Chrome's Compositor scheduler's current state and associated
9263// variables.
9264//
9265// These protos and enums were adapted from the corresponding original JSON
9266// trace event for the scheduler state. In contrast to the JSON, we use strongly
9267// typed enum values instead of strings for many fields, and
9268// microsecond-granularity timestamps.
9269//
9270// The original format was generated in JSON by the code at
9271// https://cs.chromium.org/chromium/src/cc/scheduler/scheduler.cc?l=870&rcl=5e15eabc9c0eec8daf94fdf78e93f13b6e3b63dd
9272//
9273// And is now generated as protozero:
9274// https://cs.chromium.org/chromium/src/cc/scheduler/scheduler.cc?q=Scheduler::AsPro
9275//
9276// All non-delta-timestamps are absolute CLOCK_MONOTONIC timestamps.
9277
9278enum ChromeCompositorSchedulerAction {
9279  CC_SCHEDULER_ACTION_UNSPECIFIED = 0;
9280  CC_SCHEDULER_ACTION_NONE = 1;
9281  CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2;
9282  CC_SCHEDULER_ACTION_COMMIT = 3;
9283  CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4;
9284  CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5;
9285  CC_SCHEDULER_ACTION_DRAW_FORCED = 6;
9286  CC_SCHEDULER_ACTION_DRAW_ABORT = 7;
9287  CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8;
9288  CC_SCHEDULER_ACTION_PREPARE_TILES = 9;
9289  CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10;
9290  CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11;
9291  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12;
9292  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13;
9293}
9294
9295// Next id: 18
9296message ChromeCompositorSchedulerState {
9297  enum BeginImplFrameDeadlineMode {
9298    DEADLINE_MODE_UNSPECIFIED = 0;
9299    DEADLINE_MODE_NONE = 1;
9300    DEADLINE_MODE_IMMEDIATE = 2;
9301    DEADLINE_MODE_REGULAR = 3;
9302    DEADLINE_MODE_LATE = 4;
9303    DEADLINE_MODE_BLOCKED = 5;
9304  }
9305  optional ChromeCompositorStateMachine state_machine = 1;
9306  optional bool observing_begin_frame_source = 2;
9307  optional bool begin_impl_frame_deadline_task = 3;
9308  optional bool pending_begin_frame_task = 4;
9309  optional bool skipped_last_frame_missed_exceeded_deadline = 5;
9310  optional ChromeCompositorSchedulerAction inside_action = 7;
9311  optional BeginImplFrameDeadlineMode deadline_mode = 8;
9312  optional int64 deadline_us = 9;
9313  optional int64 deadline_scheduled_at_us = 10;
9314  optional int64 now_us = 11;
9315  optional int64 now_to_deadline_delta_us = 12;
9316  optional int64 now_to_deadline_scheduled_at_delta_us = 13;
9317  optional BeginImplFrameArgs begin_impl_frame_args = 14;
9318  optional BeginFrameObserverState begin_frame_observer_state = 15;
9319  optional BeginFrameSourceState begin_frame_source_state = 16;
9320  optional CompositorTimingHistory compositor_timing_history = 17;
9321
9322  reserved 6;
9323}
9324
9325// Describes the current values stored in the Chrome Compositor state machine.
9326// Next id: 3
9327message ChromeCompositorStateMachine {
9328  // Next id: 6
9329  message MajorState {
9330    enum BeginImplFrameState {
9331      BEGIN_IMPL_FRAME_UNSPECIFIED = 0;
9332      BEGIN_IMPL_FRAME_IDLE = 1;
9333      BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2;
9334      BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3;
9335    }
9336    enum BeginMainFrameState {
9337      BEGIN_MAIN_FRAME_UNSPECIFIED = 0;
9338      BEGIN_MAIN_FRAME_IDLE = 1;
9339      BEGIN_MAIN_FRAME_SENT = 2;
9340      BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3;
9341    }
9342    enum LayerTreeFrameSinkState {
9343      LAYER_TREE_FRAME_UNSPECIFIED = 0;
9344      LAYER_TREE_FRAME_NONE = 1;
9345      LAYER_TREE_FRAME_ACTIVE = 2;
9346      LAYER_TREE_FRAME_CREATING = 3;
9347      LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4;
9348      LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5;
9349    }
9350    enum ForcedRedrawOnTimeoutState {
9351      FORCED_REDRAW_UNSPECIFIED = 0;
9352      FORCED_REDRAW_IDLE = 1;
9353      FORCED_REDRAW_WAITING_FOR_COMMIT = 2;
9354      FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3;
9355      FORCED_REDRAW_WAITING_FOR_DRAW = 4;
9356    }
9357    optional ChromeCompositorSchedulerAction next_action = 1;
9358    optional BeginImplFrameState begin_impl_frame_state = 2;
9359    optional BeginMainFrameState begin_main_frame_state = 3;
9360    optional LayerTreeFrameSinkState layer_tree_frame_sink_state = 4;
9361    optional ForcedRedrawOnTimeoutState forced_redraw_state = 5;
9362  }
9363  optional MajorState major_state = 1;
9364
9365  // Next id: 47
9366  message MinorState {
9367    enum TreePriority {
9368      TREE_PRIORITY_UNSPECIFIED = 0;
9369      TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1;
9370      TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2;
9371      TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3;
9372    }
9373    enum ScrollHandlerState {
9374      SCROLL_HANDLER_UNSPECIFIED = 0;
9375      SCROLL_AFFECTS_SCROLL_HANDLER = 1;
9376      SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2;
9377    }
9378    optional int32 commit_count = 1;
9379    optional int32 current_frame_number = 2;
9380    optional int32 last_frame_number_submit_performed = 3;
9381    optional int32 last_frame_number_draw_performed = 4;
9382    optional int32 last_frame_number_begin_main_frame_sent = 5;
9383    optional bool did_draw = 6;
9384    optional bool did_send_begin_main_frame_for_current_frame = 7;
9385    optional bool did_notify_begin_main_frame_not_expected_until = 8;
9386    optional bool did_notify_begin_main_frame_not_expected_soon = 9;
9387    optional bool wants_begin_main_frame_not_expected = 10;
9388    optional bool did_commit_during_frame = 11;
9389    optional bool did_invalidate_layer_tree_frame_sink = 12;
9390    optional bool did_perform_impl_side_invalidaion = 13;
9391    optional bool did_prepare_tiles = 14;
9392    optional int32 consecutive_checkerboard_animations = 15;
9393    optional int32 pending_submit_frames = 16;
9394    optional int32 submit_frames_with_current_layer_tree_frame_sink = 17;
9395    optional bool needs_redraw = 18;
9396    optional bool needs_prepare_tiles = 19;
9397    optional bool needs_begin_main_frame = 20;
9398    optional bool needs_one_begin_impl_frame = 21;
9399    optional bool visible = 22;
9400    optional bool begin_frame_source_paused = 23;
9401    optional bool can_draw = 24;
9402    optional bool resourceless_draw = 25;
9403    optional bool has_pending_tree = 26;
9404    optional bool pending_tree_is_ready_for_activation = 27;
9405    optional bool active_tree_needs_first_draw = 28;
9406    optional bool active_tree_is_ready_to_draw = 29;
9407    optional bool did_create_and_initialize_first_layer_tree_frame_sink = 30;
9408    optional TreePriority tree_priority = 31;
9409    optional ScrollHandlerState scroll_handler_state = 32;
9410    optional bool critical_begin_main_frame_to_activate_is_fast = 33;
9411    optional bool main_thread_missed_last_deadline = 34;
9412    optional bool video_needs_begin_frames = 36;
9413    optional bool defer_begin_main_frame = 37;
9414    optional bool last_commit_had_no_updates = 38;
9415    optional bool did_draw_in_last_frame = 39;
9416    optional bool did_submit_in_last_frame = 40;
9417    optional bool needs_impl_side_invalidation = 41;
9418    optional bool current_pending_tree_is_impl_side = 42;
9419    optional bool previous_pending_tree_was_impl_side = 43;
9420    optional bool processing_animation_worklets_for_active_tree = 44;
9421    optional bool processing_animation_worklets_for_pending_tree = 45;
9422    optional bool processing_paint_worklets_for_pending_tree = 46;
9423
9424    reserved 35;
9425  }
9426  optional MinorState minor_state = 2;
9427}
9428
9429// Next id: 13
9430message BeginFrameArgs {
9431  // JSON format has a "type" field that was always just "BeginFrameArgs" we
9432  // drop this in the proto representation, and instead make the JSON format
9433  // "subtype" field become the type field.
9434  enum BeginFrameArgsType {
9435    BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0;
9436    BEGIN_FRAME_ARGS_TYPE_INVALID = 1;
9437    BEGIN_FRAME_ARGS_TYPE_NORMAL = 2;
9438    BEGIN_FRAME_ARGS_TYPE_MISSED = 3;
9439  }
9440  optional BeginFrameArgsType type = 1;
9441  optional uint64 source_id = 2;
9442  optional uint64 sequence_number = 3;
9443  optional int64 frame_time_us = 4;
9444  optional int64 deadline_us = 5;
9445  optional int64 interval_delta_us = 6;
9446  optional bool on_critical_path = 7;
9447  optional bool animate_only = 8;
9448  oneof created_from {
9449    // The interned SourceLocation.
9450    uint64 source_location_iid = 9;
9451    // The SourceLocation that this args was created from.
9452    // TODO(nuskos): Eventually we will support interning inside of
9453    // TypedArgument TraceEvents and then we shouldn't need this SourceLocation
9454    // since we can emit it as part of the InternedData message. When we can
9455    // remove this |source_location|.
9456    SourceLocation source_location = 10;
9457  }
9458  optional int64 frames_throttled_since_last = 12;
9459}
9460
9461// Next id: 7
9462message BeginImplFrameArgs {
9463  optional int64 updated_at_us = 1;
9464  optional int64 finished_at_us = 2;
9465  enum State {
9466    BEGIN_FRAME_FINISHED = 0;
9467    BEGIN_FRAME_USING = 1;
9468  }
9469  optional State state = 3;
9470  oneof args {
9471    // Only set if |state| is BEGIN_FRAME_FINISHED.
9472    BeginFrameArgs current_args = 4;
9473    // Only set if |state| is BEGIN_FRAME_USING.
9474    BeginFrameArgs last_args = 5;
9475  }
9476  message TimestampsInUs {
9477    optional int64 interval_delta = 1;
9478    optional int64 now_to_deadline_delta = 2;
9479    optional int64 frame_time_to_now_delta = 3;
9480    optional int64 frame_time_to_deadline_delta = 4;
9481    optional int64 now = 5;
9482    optional int64 frame_time = 6;
9483    optional int64 deadline = 7;
9484  }
9485  optional TimestampsInUs timestamps_in_us = 6;
9486}
9487
9488message BeginFrameObserverState {
9489  optional int64 dropped_begin_frame_args = 1;
9490  optional BeginFrameArgs last_begin_frame_args = 2;
9491}
9492
9493message BeginFrameSourceState {
9494  optional uint32 source_id = 1;
9495  optional bool paused = 2;
9496  optional uint32 num_observers = 3;
9497  optional BeginFrameArgs last_begin_frame_args = 4;
9498}
9499
9500message CompositorTimingHistory {
9501  optional int64 begin_main_frame_queue_critical_estimate_delta_us = 1;
9502  optional int64 begin_main_frame_queue_not_critical_estimate_delta_us = 2;
9503  optional int64 begin_main_frame_start_to_ready_to_commit_estimate_delta_us =
9504      3;
9505  optional int64 commit_to_ready_to_activate_estimate_delta_us = 4;
9506  optional int64 prepare_tiles_estimate_delta_us = 5;
9507  optional int64 activate_estimate_delta_us = 6;
9508  optional int64 draw_estimate_delta_us = 7;
9509}
9510
9511// End of protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.proto
9512
9513// Begin of protos/perfetto/trace/track_event/chrome_content_settings_event_info.proto
9514
9515// Details about ContentSettings trace events.
9516message ChromeContentSettingsEventInfo {
9517  // The number of user defined hostname patterns for content settings at
9518  // browser start. Similar to UMA histogram
9519  // 'ContentSettings.NumberOfExceptions'.
9520  optional uint32 number_of_exceptions = 1;
9521}
9522// End of protos/perfetto/trace/track_event/chrome_content_settings_event_info.proto
9523
9524// Begin of protos/perfetto/trace/track_event/chrome_frame_reporter.proto
9525
9526message ChromeFrameReporter {
9527  enum State {
9528    // The frame did not have any updates to present.
9529    STATE_NO_UPDATE_DESIRED = 0;
9530
9531    // The frame presented all the desired updates (i.e. any updates requested
9532    // from both the compositor thread and main-threads were handled).
9533    STATE_PRESENTED_ALL = 1;
9534
9535    // The frame was presented with some updates, but also missed some updates
9536    // (e.g. missed updates from the main-thread, but included updates from the
9537    // compositor thread).
9538    STATE_PRESENTED_PARTIAL = 2;
9539
9540    // The frame was dropped, i.e. some updates were desired for the frame, but
9541    // was not presented.
9542    STATE_DROPPED = 3;
9543  };
9544
9545  optional State state = 1;
9546
9547  enum FrameDropReason {
9548    REASON_UNSPECIFIED = 0;
9549
9550    // Frame was dropped by the display-compositor.
9551    // The display-compositor may drop a frame some times (e.g. the frame missed
9552    // the deadline, or was blocked on surface-sync, etc.)
9553    REASON_DISPLAY_COMPOSITOR = 1;
9554
9555    // Frame was dropped because of the main-thread.
9556    // The main-thread may cause a frame to be dropped, e.g. if the main-thread
9557    // is running expensive javascript, or doing a lot of layout updates, etc.
9558    REASON_MAIN_THREAD = 2;
9559
9560    // Frame was dropped by the client compositor.
9561    // The client compositor can drop some frames too (e.g. attempting to
9562    // recover latency, missing the deadline, etc.).
9563    REASON_CLIENT_COMPOSITOR = 3;
9564  };
9565
9566  // The reason is set only if |state| is not |STATE_UPDATED_ALL|.
9567  optional FrameDropReason reason = 2;
9568
9569  optional uint64 frame_source = 3;
9570  optional uint64 frame_sequence = 4;
9571
9572  // If this is a droped frame (i.e. if |state| is set to |STATE_DROPPED| or
9573  // |STATE_PRESENTED_PARTIAL|), then indicates whether this frame impacts
9574  // smoothness.
9575  optional bool affects_smoothness = 5;
9576
9577  enum ScrollState {
9578    SCROLL_NONE = 0;
9579    SCROLL_MAIN_THREAD = 1;
9580    SCROLL_COMPOSITOR_THREAD = 2;
9581
9582    // Used when it can't be determined whether a scroll is in progress or not.
9583    SCROLL_UNKNOWN = 3;
9584  }
9585
9586  // The type of active scroll.
9587  optional ScrollState scroll_state = 6;
9588
9589  // If any main thread animation is active during this frame.
9590  optional bool has_main_animation = 7;
9591  // If any compositor thread animation is active during this frame.
9592  optional bool has_compositor_animation = 8;
9593  // If any touch-driven UX (not scroll) is active during this frame.
9594  optional bool has_smooth_input_main = 9;
9595
9596  // Whether the frame contained any missing content (i.e. whether there was
9597  // checkerboarding in the frame).
9598  optional bool has_missing_content = 10;
9599
9600  // The id of layer_tree_host that the frame has been produced for.
9601  optional uint64 layer_tree_host_id = 11;
9602
9603  // If total latency of PipelineReporter exceeds a certain limit.
9604  optional bool has_high_latency = 12;
9605
9606  enum FrameType {
9607    FORKED = 0;
9608    BACKFILL = 1;
9609  }
9610
9611  // Indicate if the frame is "FORKED" (i.e. a PipelineReporter event starts at
9612  // the same frame sequence as another PipelineReporter) or "BACKFILL"
9613  // (i.e. dropped frames when there are no partial compositor updates).
9614  optional FrameType frame_type = 13;
9615
9616  // The breakdown stage of PipelineReporter that is most likely accountable for
9617  // high latency.
9618  repeated string high_latency_contribution_stage = 14;
9619}
9620
9621// End of protos/perfetto/trace/track_event/chrome_frame_reporter.proto
9622
9623// Begin of protos/perfetto/trace/track_event/chrome_keyed_service.proto
9624
9625// Details about one of Chrome's keyed services associated with the event.
9626message ChromeKeyedService {
9627  // Name of the service, e.g. "MediaRouter", "PreviewsService", etc. (in
9628  // Chrome, these are static strings known at compile time).
9629  optional string name = 1;
9630}
9631
9632// End of protos/perfetto/trace/track_event/chrome_keyed_service.proto
9633
9634// Begin of protos/perfetto/trace/track_event/chrome_latency_info.proto
9635
9636message ChromeLatencyInfo {
9637  optional int64 trace_id = 1;
9638
9639  // NEXT ID: 12
9640  // All step are optional but the enum is ordered (not by number) below in the
9641  // order we expect them to appear if they are emitted in trace in a blocking
9642  // fashion.
9643  enum Step {
9644    STEP_UNSPECIFIED = 0;
9645    // Emitted on the browser main thread.
9646    STEP_SEND_INPUT_EVENT_UI = 3;
9647    // Happens on the renderer's compositor.
9648    STEP_HANDLE_INPUT_EVENT_IMPL = 5;
9649    STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8;
9650    // Occurs on the Renderer's main thread.
9651    STEP_HANDLE_INPUT_EVENT_MAIN = 4;
9652    STEP_MAIN_THREAD_SCROLL_UPDATE = 2;
9653    STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1;
9654    // Could be emitted on both the renderer's main OR compositor.
9655    STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9;
9656    // Optionally sometimes HANDLED_INPUT_EVENT_MAIN_OR_IMPL will proxy to the
9657    // renderer's compositor and this will be emitted.
9658    STEP_HANDLED_INPUT_EVENT_IMPL = 10;
9659    // Renderer's compositor.
9660    STEP_SWAP_BUFFERS = 6;
9661    // Happens on the VizCompositor in the GPU process.
9662    STEP_DRAW_AND_SWAP = 7;
9663    // Happens on the GPU main thread after the swap has completed.
9664    STEP_FINISHED_SWAP_BUFFERS = 11;
9665    // See above for NEXT ID, enum steps are not ordered by tag number.
9666  };
9667
9668  optional Step step = 2;
9669  optional int32 frame_tree_node_id = 3;
9670
9671  // This enum is a copy of LatencyComponentType enum in Chrome, located in
9672  // ui/latency/latency_info.h, modulo added UNKNOWN value per protobuf
9673  // practices.
9674  enum LatencyComponentType {
9675    COMPONENT_UNSPECIFIED = 0;
9676    COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1;
9677    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2;
9678    COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3;
9679    COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4;
9680    COMPONENT_INPUT_EVENT_LATENCY_UI = 5;
9681    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6;
9682    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7;
9683    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8;
9684    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9;
9685    COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10;
9686    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11;
9687    COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12;
9688    COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13;
9689    COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14;
9690  }
9691
9692  message ComponentInfo {
9693    optional LatencyComponentType component_type = 1;
9694
9695    // Microsecond timestamp in CLOCK_MONOTONIC domain
9696    optional uint64 time_us = 2;
9697  };
9698
9699  repeated ComponentInfo component_info = 4;
9700  optional bool is_coalesced = 5;
9701  optional int64 gesture_scroll_id = 6;
9702  optional int64 touch_id = 7;
9703}
9704
9705// End of protos/perfetto/trace/track_event/chrome_latency_info.proto
9706
9707// Begin of protos/perfetto/trace/track_event/chrome_legacy_ipc.proto
9708
9709// Details about a legacy Chrome IPC message that is either sent by the event.
9710// TODO(eseckler): Also use this message on the receiving side?
9711message ChromeLegacyIpc {
9712  enum MessageClass {
9713    CLASS_UNSPECIFIED = 0;
9714    CLASS_AUTOMATION = 1;
9715    CLASS_FRAME = 2;
9716    CLASS_PAGE = 3;
9717    CLASS_VIEW = 4;
9718    CLASS_WIDGET = 5;
9719    CLASS_INPUT = 6;
9720    CLASS_TEST = 7;
9721    CLASS_WORKER = 8;
9722    CLASS_NACL = 9;
9723    CLASS_GPU_CHANNEL = 10;
9724    CLASS_MEDIA = 11;
9725    CLASS_PPAPI = 12;
9726    CLASS_CHROME = 13;
9727    CLASS_DRAG = 14;
9728    CLASS_PRINT = 15;
9729    CLASS_EXTENSION = 16;
9730    CLASS_TEXT_INPUT_CLIENT = 17;
9731    CLASS_BLINK_TEST = 18;
9732    CLASS_ACCESSIBILITY = 19;
9733    CLASS_PRERENDER = 20;
9734    CLASS_CHROMOTING = 21;
9735    CLASS_BROWSER_PLUGIN = 22;
9736    CLASS_ANDROID_WEB_VIEW = 23;
9737    CLASS_NACL_HOST = 24;
9738    CLASS_ENCRYPTED_MEDIA = 25;
9739    CLASS_CAST = 26;
9740    CLASS_GIN_JAVA_BRIDGE = 27;
9741    CLASS_CHROME_UTILITY_PRINTING = 28;
9742    CLASS_OZONE_GPU = 29;
9743    CLASS_WEB_TEST = 30;
9744    CLASS_NETWORK_HINTS = 31;
9745    CLASS_EXTENSIONS_GUEST_VIEW = 32;
9746    CLASS_GUEST_VIEW = 33;
9747    CLASS_MEDIA_PLAYER_DELEGATE = 34;
9748    CLASS_EXTENSION_WORKER = 35;
9749    CLASS_SUBRESOURCE_FILTER = 36;
9750    CLASS_UNFREEZABLE_FRAME = 37;
9751  }
9752
9753  // Corresponds to the message class type defined in Chrome's IPCMessageStart
9754  // enum, e.g. FrameMsgStart,
9755  optional MessageClass message_class = 1;
9756
9757  // Line number of the message definition. See Chrome's IPC_MESSAGE_ID and
9758  // IPC_MESSAGE_START macros.
9759  optional uint32 message_line = 2;
9760}
9761
9762// End of protos/perfetto/trace/track_event/chrome_legacy_ipc.proto
9763
9764// Begin of protos/perfetto/trace/track_event/chrome_message_pump.proto
9765
9766// Details about Chrome message pump events
9767message ChromeMessagePump {
9768  // True if there are sent messages in the queue.
9769  optional bool sent_messages_in_queue = 1;
9770  // Interned SourceLocation of IO handler that MessagePumpForIO is about to
9771  // invoke.
9772  optional uint64 io_handler_location_iid = 2;
9773}
9774
9775// End of protos/perfetto/trace/track_event/chrome_message_pump.proto
9776
9777// Begin of protos/perfetto/trace/track_event/chrome_mojo_event_info.proto
9778
9779// Contains information to identify mojo handling events. The trace events in
9780// mojo are common for all mojo interfaces and this information is used to
9781// identify who is the caller or callee.
9782message ChromeMojoEventInfo {
9783  // Contains the interface name or the file name of the creator of a mojo
9784  // handle watcher, recorded when an event if notified to the watcher. The code
9785  // that runs within the track event belongs to the interface.
9786  optional string watcher_notify_interface_tag = 1;
9787
9788  // The hash of the IPC message that is being handled.
9789  optional uint32 ipc_hash = 2;
9790
9791  // A static string representing the mojo interface name of the message that is
9792  // being handled.
9793  optional string mojo_interface_tag = 3;
9794
9795  // Refers to an interned UnsymbolizedSourceLocation.
9796  // The UnsymbolizedSourceLocation contains the interface method that's being
9797  // handled, represented as a native symbol.
9798  // The native symbol can be symbolized after the trace is recorded.
9799  // Not using a symbolized source location for official Chromium builds to
9800  // reduce binary size - emitting file/function names as strings into the
9801  // trace requires storing them in the binary, which causes a significant
9802  // binary size bloat for Chromium.
9803  optional uint64 mojo_interface_method_iid = 4;
9804
9805  // Indicate whether this is a message or reply.
9806  optional bool is_reply = 5;
9807
9808  // The payload size of the message being sent through mojo messages.
9809  optional uint64 payload_size = 6;
9810
9811  // Represents the size of the message. Includes all headers and user payload.
9812  optional uint64 data_num_bytes = 7;
9813}
9814
9815// End of protos/perfetto/trace/track_event/chrome_mojo_event_info.proto
9816
9817// Begin of protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.proto
9818
9819// Describes the state of the RendererScheduler for a given Renderer Process.
9820
9821// RAIL Mode is an indication of the kind of work that a Renderer is currently
9822// performing which is in turn used to prioritise work accordingly.
9823// A fuller description of these modes can be found https://web.dev/rail/
9824enum ChromeRAILMode {
9825  RAIL_MODE_NONE = 0;
9826  RAIL_MODE_RESPONSE = 1;
9827  RAIL_MODE_ANIMATION = 2;
9828  RAIL_MODE_IDLE = 3;
9829  RAIL_MODE_LOAD = 4;
9830}
9831
9832// Next id: 2
9833message ChromeRendererSchedulerState {
9834  optional ChromeRAILMode rail_mode = 1;
9835
9836  optional bool is_backgrounded = 2;
9837  optional bool is_hidden = 3;
9838}
9839
9840// End of protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.proto
9841
9842// Begin of protos/perfetto/trace/track_event/chrome_user_event.proto
9843
9844// Details about a UI interaction initiated by the user, such as opening or
9845// closing a tab or a context menu.
9846message ChromeUserEvent {
9847  // Name of the action, e.g. "NewTab", "ShowBookmarkManager", etc. (in
9848  // Chrome, these are usually static strings known at compile time, or
9849  // concatenations of multiple such static strings).
9850  optional string action = 1;
9851
9852  // MD5 hash of the action string.
9853  optional uint64 action_hash = 2;
9854}
9855
9856// End of protos/perfetto/trace/track_event/chrome_user_event.proto
9857
9858// Begin of protos/perfetto/trace/track_event/chrome_window_handle_event_info.proto
9859
9860// Details about HWNDMessageHandler trace events.
9861message ChromeWindowHandleEventInfo {
9862  optional uint32 dpi = 1;
9863  optional uint32 message_id = 2;
9864  optional fixed64 hwnd_ptr = 3;
9865}
9866
9867// End of protos/perfetto/trace/track_event/chrome_window_handle_event_info.proto
9868
9869// Begin of protos/perfetto/trace/track_event/task_execution.proto
9870
9871// TrackEvent arguments describing the execution of a task.
9872message TaskExecution {
9873  // Source location that the task was posted from.
9874  // interned SourceLocation.
9875  optional uint64 posted_from_iid = 1;
9876}
9877// End of protos/perfetto/trace/track_event/task_execution.proto
9878
9879// Begin of protos/perfetto/trace/track_event/track_event.proto
9880
9881// NOTE: Full TrackEvent support in the client lib and chrome is WIP, thus these
9882// protos are still subject to change. Don't depend on them staying as they are.
9883
9884// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
9885// which describe activity on a track, such as a thread or asynchronous event
9886// track. The track is specified using separate TrackDescriptor messages and
9887// referred to via the track's UUID.
9888//
9889// A simple TrackEvent packet specifies a timestamp, category, name and type:
9890// ```protobuf
9891//   trace_packet {
9892//     timestamp: 1000
9893//     track_event {
9894//       categories: ["my_cat"]
9895//       name: "my_event"
9896//       type: TYPE_INSTANT
9897//      }
9898//    }
9899// ```
9900//
9901// To associate an event with a custom track (e.g. a thread), the track is
9902// defined in a separate packet and referred to from the TrackEvent by its UUID:
9903// ```protobuf
9904//   trace_packet {
9905//     track_descriptor {
9906//       track_uuid: 1234
9907//       name: "my_track"
9908//
9909//       // Optionally, associate the track with a thread.
9910//       thread_descriptor {
9911//         pid: 10
9912//         tid: 10
9913//         ..
9914//       }
9915//     }
9916//   }
9917// ```
9918//
9919// A pair of TYPE_SLICE_BEGIN and _END events form a slice on the track:
9920//
9921// ```protobuf
9922//   trace_packet {
9923//     timestamp: 1200
9924//     track_event {
9925//       track_uuid: 1234
9926//       categories: ["my_cat"]
9927//       name: "my_slice"
9928//       type: TYPE_SLICE_BEGIN
9929//     }
9930//   }
9931//   trace_packet {
9932//     timestamp: 1400
9933//     track_event {
9934//       track_uuid: 1234
9935//       type: TYPE_SLICE_END
9936//     }
9937//   }
9938// ```
9939// TrackEvents also support optimizations to reduce data repetition and encoded
9940// data size, e.g. through data interning (names, categories, ...) and delta
9941// encoding of timestamps/counters. For details, see the InternedData message.
9942// Further, default values for attributes of events on the same sequence (e.g.
9943// their default track association) can be emitted as part of a
9944// TrackEventDefaults message.
9945//
9946// Next reserved id: 13 (up to 15). Next id: 50.
9947message TrackEvent {
9948  // Names of categories of the event. In the client library, categories are a
9949  // way to turn groups of individual events on or off.
9950  // interned EventCategoryName.
9951  repeated uint64 category_iids = 3;
9952  // non-interned variant.
9953  repeated string categories = 22;
9954
9955  // Optional name of the event for its display in trace viewer. May be left
9956  // unspecified for events with typed arguments.
9957  //
9958  // Note that metrics should not rely on event names, as they are prone to
9959  // changing. Instead, they should use typed arguments to identify the events
9960  // they are interested in.
9961  oneof name_field {
9962    // interned EventName.
9963    uint64 name_iid = 10;
9964    // non-interned variant.
9965    string name = 23;
9966  }
9967
9968  // TODO(eseckler): Support using binary symbols for category/event names.
9969
9970  // Type of the TrackEvent (required if |phase| in LegacyEvent is not set).
9971  enum Type {
9972    TYPE_UNSPECIFIED = 0;
9973
9974    // Slice events are events that have a begin and end timestamp, i.e. a
9975    // duration. They can be nested similar to a callstack: If, on the same
9976    // track, event B begins after event A, but before A ends, B is a child
9977    // event of A and will be drawn as a nested event underneath A in the UI.
9978    // Note that child events should always end before their parents (e.g. B
9979    // before A).
9980    //
9981    // Each slice event is formed by a pair of BEGIN + END events. The END event
9982    // does not need to repeat any TrackEvent fields it has in common with its
9983    // corresponding BEGIN event. Arguments and debug annotations of the BEGIN +
9984    // END pair will be merged during trace import.
9985    //
9986    // Note that we deliberately chose not to support COMPLETE events (which
9987    // would specify a duration directly) since clients would need to delay
9988    // writing them until the slice is completed, which can result in reordered
9989    // events in the trace and loss of unfinished events at the end of a trace.
9990    TYPE_SLICE_BEGIN = 1;
9991    TYPE_SLICE_END = 2;
9992
9993    // Instant events are nestable events without duration. They can be children
9994    // of slice events on the same track.
9995    TYPE_INSTANT = 3;
9996
9997    // Event that provides a value for a counter track. |track_uuid| should
9998    // refer to a counter track and |counter_value| set to the new value. Note
9999    // that most other TrackEvent fields (e.g. categories, name, ..) are not
10000    // supported for TYPE_COUNTER events. See also CounterDescriptor.
10001    TYPE_COUNTER = 4;
10002  }
10003  optional Type type = 9;
10004
10005  // Identifies the track of the event. The default value may be overridden
10006  // using TrackEventDefaults, e.g., to specify the track of the TraceWriter's
10007  // sequence (in most cases sequence = one thread). If no value is specified
10008  // here or in TrackEventDefaults, the TrackEvent will be associated with an
10009  // implicit trace-global track (uuid 0). See TrackDescriptor::uuid.
10010  optional uint64 track_uuid = 11;
10011
10012  // A new value for a counter track. |track_uuid| should refer to a track with
10013  // a CounterDescriptor, and |type| should be TYPE_COUNTER. For a more
10014  // efficient encoding of counter values that are sampled at the beginning/end
10015  // of a slice, see |extra_counter_values| and |extra_counter_track_uuids|.
10016  // Counter values can optionally be encoded in as delta values (positive or
10017  // negative) on each packet sequence (see CounterIncrementalBase).
10018  oneof counter_value_field {
10019    int64 counter_value = 30;
10020    double double_counter_value = 44;
10021  }
10022
10023  // To encode counter values more efficiently, we support attaching additional
10024  // counter values to a TrackEvent of any type. All values will share the same
10025  // timestamp specified in the TracePacket. The value at
10026  // extra_counter_values[N] is for the counter track referenced by
10027  // extra_counter_track_uuids[N].
10028  //
10029  // |extra_counter_track_uuids| may also be set via TrackEventDefaults. There
10030  // should always be equal or more uuids than values. It is valid to set more
10031  // uuids (e.g. via defaults) than values. If uuids are specified in
10032  // TrackEventDefaults and a TrackEvent, the TrackEvent uuids override the
10033  // default uuid list.
10034  //
10035  // For example, this allows snapshotting the thread time clock at each
10036  // thread-track BEGIN and END event to capture the cpu time delta of a slice.
10037  repeated uint64 extra_counter_track_uuids = 31;
10038  repeated int64 extra_counter_values = 12;
10039
10040  // Counter snapshots using floating point instead of integer values.
10041  repeated uint64 extra_double_counter_track_uuids = 45;
10042  repeated double extra_double_counter_values = 46;
10043
10044  // IDs of flows originating, passing through, or ending at this event.
10045  // Flow IDs are global within a trace.
10046  //
10047  // A flow connects a sequence of TrackEvents within or across tracks, e.g.
10048  // an input event may be handled on one thread but cause another event on
10049  // a different thread - a flow between the two events can associate them.
10050  //
10051  // The direction of the flows between events is inferred from the events'
10052  // timestamps. The earliest event with the same flow ID becomes the source
10053  // of the flow. Any events thereafter are intermediate steps of the flow,
10054  // until the flow terminates at the last event with the flow ID.
10055  //
10056  // Flows can also be explicitly terminated (see |terminating_flow_ids|), so
10057  // that the same ID can later be reused for another flow.
10058  // DEPRECATED. Only kept for backwards compatibility. Use |flow_ids|.
10059  repeated uint64 flow_ids_old = 36 [deprecated = true];
10060  // TODO(b/204341740): replace "flow_ids_old" with "flow_ids" to reduce memory
10061  // consumption.
10062  repeated fixed64 flow_ids = 47;
10063
10064  // List of flow ids which should terminate on this event, otherwise same as
10065  // |flow_ids|.
10066  // Any one flow ID should be either listed as part of |flow_ids| OR
10067  // |terminating_flow_ids|, not both.
10068  // DEPRECATED. Only kept for backwards compatibility.  Use
10069  // |terminating_flow_ids|.
10070  repeated uint64 terminating_flow_ids_old = 42 [deprecated = true];
10071  // TODO(b/204341740): replace "terminating_flow_ids_old" with
10072  // "terminating_flow_ids" to reduce memory consumption.
10073  repeated fixed64 terminating_flow_ids = 48;
10074
10075  // ---------------------------------------------------------------------------
10076  // TrackEvent arguments:
10077  // ---------------------------------------------------------------------------
10078
10079  // Unstable key/value annotations shown in the trace viewer but not intended
10080  // for metrics use.
10081  repeated DebugAnnotation debug_annotations = 4;
10082
10083  // Typed event arguments:
10084  optional TaskExecution task_execution = 5;
10085  optional LogMessage log_message = 21;
10086  optional ChromeCompositorSchedulerState cc_scheduler_state = 24;
10087  optional ChromeUserEvent chrome_user_event = 25;
10088  optional ChromeKeyedService chrome_keyed_service = 26;
10089  optional ChromeLegacyIpc chrome_legacy_ipc = 27;
10090  optional ChromeHistogramSample chrome_histogram_sample = 28;
10091  optional ChromeLatencyInfo chrome_latency_info = 29;
10092  optional ChromeFrameReporter chrome_frame_reporter = 32;
10093  optional ChromeApplicationStateInfo chrome_application_state_info = 39;
10094  optional ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40;
10095  optional ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41;
10096  optional ChromeContentSettingsEventInfo chrome_content_settings_event_info =
10097      43;
10098  optional ChromeActiveProcesses chrome_active_processes = 49;
10099
10100  // This field is used only if the source location represents the function that
10101  // executes during this event.
10102  oneof source_location_field {
10103    // Non-interned field.
10104    SourceLocation source_location = 33;
10105    // Interned field.
10106    uint64 source_location_iid = 34;
10107  }
10108
10109  optional ChromeMessagePump chrome_message_pump = 35;
10110  optional ChromeMojoEventInfo chrome_mojo_event_info = 38;
10111
10112  // New argument types go here :)
10113
10114  // Extension range for typed events defined externally.
10115  // See docs/design-docs/extensions.md for more details.
10116  //
10117  // Extension support is work-in-progress, in the future the way to reserve a
10118  // subrange for a particular project will be described here and in the design
10119  // document linked above.
10120  //
10121  // Contact perfetto-dev@googlegroups.com if you are interested in a subrange
10122  // for your project.
10123
10124  // Extension range for future use.
10125  extensions 1000 to 9899;
10126  // Reserved for Perfetto unit and integration tests.
10127  extensions 9900 to 10000;
10128
10129  // ---------------------------------------------------------------------------
10130  // Deprecated / legacy event fields, which will be removed in the future:
10131  // ---------------------------------------------------------------------------
10132
10133  // Deprecated. Use the |timestamp| and |timestamp_clock_id| fields in
10134  // TracePacket instead.
10135  //
10136  // Timestamp in microseconds (usually CLOCK_MONOTONIC).
10137  oneof timestamp {
10138    // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
10139    // calculate the absolute timestamp value, sum up all delta values of the
10140    // preceding TrackEvents since the last ThreadDescriptor and add the sum to
10141    // the |reference_timestamp| in ThreadDescriptor. This value should always
10142    // be positive.
10143    int64 timestamp_delta_us = 1;
10144    // Absolute value (e.g. a manually specified timestamp in the macro).
10145    // This is a one-off value that does not affect delta timestamp computation
10146    // in subsequent TrackEvents.
10147    int64 timestamp_absolute_us = 16;
10148  }
10149
10150  // Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to
10151  // encode thread time instead.
10152  //
10153  // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
10154  // microseconds.
10155  oneof thread_time {
10156    // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
10157    // calculate the absolute timestamp value, sum up all delta values of the
10158    // preceding TrackEvents since the last ThreadDescriptor and add the sum to
10159    // the |reference_timestamp| in ThreadDescriptor. This value should always
10160    // be positive.
10161    int64 thread_time_delta_us = 2;
10162    // This is a one-off absolute value that does not affect delta timestamp
10163    // computation in subsequent TrackEvents.
10164    int64 thread_time_absolute_us = 17;
10165  }
10166
10167  // Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to
10168  // encode thread instruction count instead.
10169  //
10170  // Value of the instruction counter for the current thread.
10171  oneof thread_instruction_count {
10172    // Same encoding as |thread_time| field above.
10173    int64 thread_instruction_count_delta = 8;
10174    int64 thread_instruction_count_absolute = 20;
10175  }
10176
10177  // Apart from {category, time, thread time, tid, pid}, other legacy trace
10178  // event attributes are initially simply proxied for conversion to a JSON
10179  // trace. We intend to gradually transition these attributes to similar native
10180  // features in TrackEvent (e.g. async + flow events), or deprecate them
10181  // without replacement where transition is unsuitable.
10182  //
10183  // Next reserved id: 16 (up to 16).
10184  // Next id: 20.
10185  message LegacyEvent {
10186    // Deprecated, use TrackEvent::name(_iid) instead.
10187    // interned EventName.
10188    optional uint64 name_iid = 1;
10189    optional int32 phase = 2;
10190    optional int64 duration_us = 3;
10191    optional int64 thread_duration_us = 4;
10192
10193    // Elapsed retired instruction count during the event.
10194    optional int64 thread_instruction_delta = 15;
10195
10196    // used to be |flags|.
10197    reserved 5;
10198
10199    oneof id {
10200      uint64 unscoped_id = 6;
10201      uint64 local_id = 10;
10202      uint64 global_id = 11;
10203    }
10204    // Additional optional scope for |id|.
10205    optional string id_scope = 7;
10206
10207    // Consider the thread timestamps for async BEGIN/END event pairs as valid.
10208    optional bool use_async_tts = 9;
10209
10210    // Idenfifies a flow. Flow events with the same bind_id are connected.
10211    optional uint64 bind_id = 8;
10212    // Use the enclosing slice as binding point for a flow end event instead of
10213    // the next slice. Flow start/step events always bind to the enclosing
10214    // slice.
10215    optional bool bind_to_enclosing = 12;
10216
10217    enum FlowDirection {
10218      FLOW_UNSPECIFIED = 0;
10219      FLOW_IN = 1;
10220      FLOW_OUT = 2;
10221      FLOW_INOUT = 3;
10222    }
10223    optional FlowDirection flow_direction = 13;
10224
10225    enum InstantEventScope {
10226      SCOPE_UNSPECIFIED = 0;
10227      SCOPE_GLOBAL = 1;
10228      SCOPE_PROCESS = 2;
10229      SCOPE_THREAD = 3;
10230    }
10231    optional InstantEventScope instant_event_scope = 14;
10232
10233    // Override the pid/tid if the writer needs to emit events on behalf of
10234    // another process/thread. This should be the exception. Normally, the
10235    // pid+tid from ThreadDescriptor is used.
10236    optional int32 pid_override = 18;
10237    optional int32 tid_override = 19;
10238  }
10239
10240  optional LegacyEvent legacy_event = 6;
10241}
10242
10243// Default values for fields of all TrackEvents on the same packet sequence.
10244// Should be emitted as part of TracePacketDefaults whenever incremental state
10245// is cleared. It's defined here because field IDs should match those of the
10246// corresponding fields in TrackEvent.
10247message TrackEventDefaults {
10248  optional uint64 track_uuid = 11;
10249  repeated uint64 extra_counter_track_uuids = 31;
10250  repeated uint64 extra_double_counter_track_uuids = 45;
10251
10252  // TODO(eseckler): Support default values for more TrackEvent fields.
10253}
10254
10255// --------------------
10256// Interned data types:
10257// --------------------
10258
10259message EventCategory {
10260  optional uint64 iid = 1;
10261  optional string name = 2;
10262}
10263
10264message EventName {
10265  optional uint64 iid = 1;
10266  optional string name = 2;
10267}
10268
10269// End of protos/perfetto/trace/track_event/track_event.proto
10270
10271// Begin of protos/perfetto/trace/interned_data/interned_data.proto
10272
10273// ------------------------------ DATA INTERNING: ------------------------------
10274// Interning indexes are built up gradually by adding the entries contained in
10275// each TracePacket of the same packet sequence (packets emitted by the same
10276// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
10277// can only refer to interned data from other packets in the same sequence.
10278//
10279// The writer will emit new entries when it encounters new internable values
10280// that aren't yet in the index. Data in current and subsequent TracePackets can
10281// then refer to the entry by its position (interning ID, abbreviated "iid") in
10282// its index. An interning ID with value 0 is considered invalid (not set).
10283//
10284// Because of the incremental build-up, the interning index will miss data when
10285// TracePackets are lost, e.g. because a chunk was overridden in the central
10286// ring buffer. To avoid invalidation of the whole trace in such a case, the
10287// index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED).
10288// When packet loss occurs, the reader will only lose interning data up to the
10289// next reset.
10290// -----------------------------------------------------------------------------
10291
10292// Message that contains new entries for the interning indices of a packet
10293// sequence.
10294//
10295// The writer will usually emit new entries in the same TracePacket that first
10296// refers to them (since the last reset of interning state). They may also be
10297// emitted proactively in advance of referring to them in later packets.
10298//
10299// Next reserved id: 8 (up to 15).
10300// Next id: 31.
10301message InternedData {
10302  // TODO(eseckler): Replace iid fields inside interned messages with
10303  // map<iid, message> type fields in InternedData.
10304
10305  // Each field's message type needs to specify an |iid| field, which is the ID
10306  // of the entry in the field's interning index. Each field constructs its own
10307  // index, thus interning IDs are scoped to the tracing session and field
10308  // (usually as a counter for efficient var-int encoding). It is illegal to
10309  // override entries in an index (using the same iid for two different values)
10310  // within the same tracing session, even after a reset of the emitted
10311  // interning state.
10312  repeated EventCategory event_categories = 1;
10313  repeated EventName event_names = 2;
10314  repeated DebugAnnotationName debug_annotation_names = 3;
10315  repeated DebugAnnotationValueTypeName debug_annotation_value_type_names = 27;
10316  repeated SourceLocation source_locations = 4;
10317  repeated UnsymbolizedSourceLocation unsymbolized_source_locations = 28;
10318  repeated LogMessageBody log_message_body = 20;
10319  repeated HistogramName histogram_names = 25;
10320
10321  // Note: field IDs up to 15 should be used for frequent data only.
10322
10323  // Build IDs of exectuable files.
10324  repeated InternedString build_ids = 16;
10325  // Paths to executable files.
10326  repeated InternedString mapping_paths = 17;
10327  // Paths to source files.
10328  repeated InternedString source_paths = 18;
10329  // Names of functions used in frames below.
10330  repeated InternedString function_names = 5;
10331  // Symbols that were added to this trace after the fact.
10332  repeated ProfiledFrameSymbols profiled_frame_symbols = 21;
10333
10334  // Executable files mapped into processes.
10335  repeated Mapping mappings = 19;
10336  // Frames of callstacks of a program.
10337  repeated Frame frames = 6;
10338  // A callstack of a program.
10339  repeated Callstack callstacks = 7;
10340
10341  // Additional Vulkan information sent in a VulkanMemoryEvent message
10342  repeated InternedString vulkan_memory_keys = 22;
10343
10344  // Graphics context of a render stage event.  This represent the GL
10345  // context for an OpenGl app or the VkDevice for a Vulkan app.
10346  repeated InternedGraphicsContext graphics_contexts = 23;
10347
10348  // Description of a GPU hardware queue or render stage.
10349  repeated InternedGpuRenderStageSpecification gpu_specifications = 24;
10350
10351  // This is set when FtraceConfig.symbolize_ksyms = true.
10352  // The id of each symbol the number that will be reported in ftrace events
10353  // like sched_block_reason.caller and is obtained from a monotonic counter.
10354  // The same symbol can have different indexes in different bundles.
10355  // This is is NOT the real address. This is to avoid disclosing KASLR through
10356  // traces.
10357  repeated InternedString kernel_symbols = 26;
10358
10359  // Interned string values in the DebugAnnotation proto.
10360  repeated InternedString debug_annotation_string_values = 29;
10361
10362  // Interned packet context for android.network_packets.
10363  repeated NetworkPacketContext packet_context = 30;
10364}
10365
10366// End of protos/perfetto/trace/interned_data/interned_data.proto
10367
10368// Begin of protos/perfetto/trace/memory_graph.proto
10369
10370// Message definitions for app-reported memory breakdowns. At the moment, this
10371// is a Chrome-only tracing feature, historically known as 'memory-infra'. See
10372// https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/ .
10373// This is unrelated to the native or java heap profilers (those protos live
10374// in //protos/perfetto/trace/profiling/).
10375
10376message MemoryTrackerSnapshot {
10377  // Memory snapshot of a process. The snapshot contains memory data that is
10378  // from 2 different sources, namely system stats and instrumentation stats.
10379  // The system memory usage stats come from the OS based on standard API
10380  // available in the platform to query memory usage. The instrumentation stats
10381  // are added by instrumenting specific piece of code which tracks memory
10382  // allocations and deallocations made by a small sub-system within the
10383  // application.
10384  // The system stats of the global memory snapshot are recorded as part of
10385  // ProcessStats and SmapsPacket fields in trace packet with the same
10386  // timestamp.
10387  message ProcessSnapshot {
10388    // Process ID of the process
10389    optional int32 pid = 1;
10390
10391    // Memory dumps are represented as a graph of memory nodes which contain
10392    // statistics. To avoid double counting the same memory across different
10393    // nodes, edges are used to mark nodes that account for the same memory. See
10394    // this doc for examples of the usage:
10395    // https://docs.google.com/document/d/1WGQRJ1sjJrfVkNcgPVY6frm64UqPc94tsxUOXImZUZI
10396
10397    // A single node in the memory graph.
10398    message MemoryNode {
10399      // Unique ID of the node across all processes involved in the global
10400      // memory dump. The ID is only unique within this particular global dump
10401      // identified by GlobalMemoryDumpPacket.global_dump_id.
10402      optional uint64 id = 1;
10403
10404      // Absolute name is a unique name for the memory node within the process
10405      // with ProcessMemoryDump.pid. The name can contain multiple parts
10406      // separated by '/', which traces the edges of the node from the root
10407      // node.
10408      // Eg: "partition_allocator/array_buffers/buffer1" refers to the child
10409      // node "buffer1" in a graph structure of:
10410      //   root -> partition_allocator -> array_buffers -> buffer1.
10411      optional string absolute_name = 2;
10412
10413      // A weak node means that the instrumentation that added the current node
10414      // is unsure about the existence of the actual memory. Unless a "strong"
10415      // (non-weak is default) node that has an edge to the current node exists
10416      // in the current global dump, the current node will be discarded.
10417      optional bool weak = 3;
10418
10419      // Size of the node in bytes, used to compute the effective size of the
10420      // nodes without double counting.
10421      optional uint64 size_bytes = 4;
10422
10423      // Entries in the memory node that contain statistics and additional
10424      // debuggable information about the memory. The size of the node is
10425      // tracked separately in the |size_bytes| field.
10426      message MemoryNodeEntry {
10427        optional string name = 1;
10428
10429        enum Units {
10430          UNSPECIFIED = 0;
10431          BYTES = 1;
10432          COUNT = 2;
10433        }
10434        optional Units units = 2;
10435
10436        // Contains either one of uint64 or string value.
10437        optional uint64 value_uint64 = 3;
10438        optional string value_string = 4;
10439      }
10440      repeated MemoryNodeEntry entries = 5;
10441    }
10442    repeated MemoryNode allocator_dumps = 2;
10443
10444    // A directed edge that connects any 2 nodes in the graph above. These are
10445    // in addition to the inherent edges added due to the tree structure of the
10446    // node's absolute names.
10447    // Node with id |source_id| owns the node with id |target_id|, and has the
10448    // effect of attributing the memory usage of target to source. |importance|
10449    // is optional and relevant only for the cases of co-ownership, where it
10450    // acts as a z-index: the owner with the highest importance will be
10451    // attributed target's memory.
10452    message MemoryEdge {
10453      optional uint64 source_id = 1;
10454      optional uint64 target_id = 2;
10455      optional uint32 importance = 3;
10456      optional bool overridable = 4;
10457    }
10458    repeated MemoryEdge memory_edges = 3;
10459  }
10460
10461  // Unique ID that represents the global memory dump.
10462  optional uint64 global_dump_id = 1;
10463
10464  enum LevelOfDetail {
10465    DETAIL_FULL = 0;
10466    DETAIL_LIGHT = 1;
10467    DETAIL_BACKGROUND = 2;
10468  }
10469  optional LevelOfDetail level_of_detail = 2;
10470
10471  repeated ProcessSnapshot process_memory_dumps = 3;
10472}
10473
10474// End of protos/perfetto/trace/memory_graph.proto
10475
10476// Begin of protos/perfetto/trace/perfetto/perfetto_metatrace.proto
10477
10478// Used to trace the execution of perfetto itself.
10479message PerfettoMetatrace {
10480  // See base/metatrace_events.h for definitions.
10481  oneof record_type {
10482    uint32 event_id = 1;
10483    uint32 counter_id = 2;
10484
10485    // For trace processor metatracing.
10486    string event_name = 8;
10487    uint64 event_name_iid = 11;
10488
10489    string counter_name = 9;
10490  }
10491  message Arg {
10492    oneof key_or_interned_key {
10493      string key = 1;
10494      uint64 key_iid = 3;
10495    }
10496    oneof value_or_interned_value {
10497      string value = 2;
10498      uint64 value_iid = 4;
10499    }
10500  }
10501
10502  // Only when using |event_id|.
10503  optional uint64 event_duration_ns = 3;
10504
10505  // Only when using |counter_id|.
10506  optional int32 counter_value = 4;
10507
10508  // ID of the thread that emitted the event.
10509  optional uint32 thread_id = 5;
10510
10511  // If true the meta-tracing ring buffer had overruns and hence some data is
10512  // missing from this point.
10513  optional bool has_overruns = 6;
10514
10515  // Args for the event.
10516  repeated Arg args = 7;
10517
10518  // Interned strings corresponding to the |event_name_iid|, |key_iid| and
10519  // |value_iid| above.
10520  message InternedString {
10521    optional uint64 iid = 1;
10522    optional string value = 2;
10523  };
10524  repeated InternedString interned_strings = 10;
10525}
10526
10527// End of protos/perfetto/trace/perfetto/perfetto_metatrace.proto
10528
10529// Begin of protos/perfetto/trace/perfetto/tracing_service_event.proto
10530
10531// Events emitted by the tracing service.
10532message TracingServiceEvent {
10533  oneof event_type {
10534    // When each of the following booleans are set to true, they report the
10535    // point in time (through TracePacket's timestamp) where the condition
10536    // they describe happened.
10537    // The order of the booleans below matches the timestamp ordering
10538    // they would generally be expected to have.
10539
10540    // Emitted when we start tracing and specifically, this will be before any
10541    // producer is notified about the existence of this trace. This is always
10542    // emitted before the all_data_sources_started event. This event is also
10543    // guaranteed to be seen (byte-offset wise) before any data packets from
10544    // producers.
10545    bool tracing_started = 2;
10546
10547    // Emitted after all data sources saw the start event and ACKed it.
10548    // This identifies the point in time when it's safe to assume that all data
10549    // sources have been recording events.
10550    bool all_data_sources_started = 1;
10551
10552    // Emitted when all data sources have been flushed successfully or with an
10553    // error (including timeouts). This can generally happen many times over the
10554    // course of the trace.
10555    bool all_data_sources_flushed = 3;
10556
10557    // Emitted when reading back the central tracing buffers has been completed.
10558    // If |write_into_file| is specified, this can happen many times over the
10559    // course of the trace.
10560    bool read_tracing_buffers_completed = 4;
10561
10562    // Emitted after tracing has been disabled and specifically, this will be
10563    // after all packets from producers have been included in the central
10564    // tracing buffer.
10565    bool tracing_disabled = 5;
10566
10567    // Emitted if perfetto --save-for-bugreport was invoked while the current
10568    // tracing session was running and it had the highest bugreport_score. In
10569    // this case the original consumer will see a nearly empty trace, because
10570    // the contents are routed onto the bugreport file. This event flags the
10571    // situation explicitly. Traces that contain this marker should be discarded
10572    // by test infrastructures / pipelines.
10573    // Deprecated since Android U, where --save-for-bugreport uses
10574    // non-destructive cloning.
10575    bool seized_for_bugreport = 6;
10576  }
10577}
10578
10579// End of protos/perfetto/trace/perfetto/tracing_service_event.proto
10580
10581// Begin of protos/perfetto/common/android_energy_consumer_descriptor.proto
10582
10583// Energy consumer based on aidl class:
10584// android.hardware.power.stats.EnergyConsumer.
10585message AndroidEnergyConsumer {
10586  // Unique ID of this energy consumer.  Matches the ID in a
10587  // AndroidEnergyEstimationBreakdown.
10588  optional int32 energy_consumer_id = 1;
10589
10590  // For a group of energy consumers of the same logical type, sorting by
10591  // ordinal gives their physical order. Ordinals must be consecutive integers
10592  // starting from 0.
10593  optional int32 ordinal = 2;
10594
10595  // Type of this energy consumer.
10596  optional string type = 3;
10597
10598  // Unique name of this energy consumer. Vendor/device specific. Opaque to
10599  // framework.
10600  optional string name = 4;
10601}
10602
10603message AndroidEnergyConsumerDescriptor {
10604  repeated AndroidEnergyConsumer energy_consumers = 1;
10605}
10606
10607// End of protos/perfetto/common/android_energy_consumer_descriptor.proto
10608
10609// Begin of protos/perfetto/trace/power/android_energy_estimation_breakdown.proto
10610
10611// Energy data retrieve using the ODPM(On Device Power Monitor) API.
10612// This proto represents the aidl class:
10613// android.hardware.power.stats.EnergyConsumerResult.
10614message AndroidEnergyEstimationBreakdown {
10615  // The first trace packet of each session should include a energy consumer
10616  // descriptor.
10617  optional AndroidEnergyConsumerDescriptor energy_consumer_descriptor = 1;
10618
10619  // ID of the AndroidEnergyConsumer associated with this result.  Matches
10620  // the energy_consumer_id in the AndroidEnergyConsumerDescriptor that
10621  // should be sent at the beginning of a trace.
10622  optional int32 energy_consumer_id = 2;
10623
10624  // Total accumulated energy since boot in microwatt-seconds (uWs)
10625  optional int64 energy_uws = 3;
10626
10627  message EnergyUidBreakdown {
10628    // Android ID/Linux UID, the accumulated energy is attributed to.
10629    optional int32 uid = 1;
10630
10631    // Accumulated energy since boot in microwatt-seconds (uWs).
10632    optional int64 energy_uws = 2;
10633  }
10634  // Optional attributed energy per Android ID / Linux UID for this
10635  // EnergyConsumer. Sum total of attributed energy must be less than or equal
10636  // to total accumulated energy.
10637  repeated EnergyUidBreakdown per_uid_breakdown = 4;
10638}
10639
10640// End of protos/perfetto/trace/power/android_energy_estimation_breakdown.proto
10641
10642// Begin of protos/perfetto/trace/power/android_entity_state_residency.proto
10643
10644message EntityStateResidency {
10645  message PowerEntityState {
10646    // Index corresponding to the entity
10647    optional int32 entity_index = 1;
10648
10649    // Index corresponding to the state
10650    optional int32 state_index = 2;
10651
10652    // Name of the entity. This is device-specific, determined by the PowerStats
10653    // HAL, and cannot be configured by the user. An example would be
10654    // "Bluetooth".
10655    optional string entity_name = 3;
10656
10657    // Name of the state. This is device-specific, determined by the PowerStats
10658    // HAL, and cannot be configured by the user. An example would be
10659    // "Active".
10660    optional string state_name = 4;
10661  }
10662
10663  // This is only emitted at the beginning of the trace.
10664  repeated PowerEntityState power_entity_state = 1;
10665
10666  message StateResidency {
10667    // Index corresponding to PowerEntityState.entity_index
10668    optional int32 entity_index = 1;
10669
10670    // Index corresponding to PowerEntityState.state_index
10671    optional int32 state_index = 2;
10672
10673    // Time since boot that this entity has been in this state
10674    optional uint64 total_time_in_state_ms = 3;
10675
10676    // Total number of times since boot that the entity has entered this state
10677    optional uint64 total_state_entry_count = 4;
10678
10679    // Timestamp of the last time the entity entered this state
10680    optional uint64 last_entry_timestamp_ms = 5;
10681  }
10682
10683  repeated StateResidency residency = 2;
10684}
10685
10686// End of protos/perfetto/trace/power/android_entity_state_residency.proto
10687
10688// Begin of protos/perfetto/trace/power/battery_counters.proto
10689
10690message BatteryCounters {
10691  // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
10692  optional int64 charge_counter_uah = 1;
10693
10694  // Remaining battery capacity percentage of total capacity
10695  optional float capacity_percent = 2;
10696
10697  // Instantaneous battery current in microamperes(µA).
10698  // Positive values indicate current drained from the battery,
10699  // negative values current feeding the battery from a charge source (USB).
10700  // See https://perfetto.dev/docs/data-sources/battery-counters for more.
10701  optional int64 current_ua = 3;
10702
10703  // Instantaneous battery current in microamperes(µA).
10704  optional int64 current_avg_ua = 4;
10705
10706  // Battery name, emitted only on multiple batteries.
10707  optional string name = 5;
10708
10709  // Battery capacity in microwatt-hours(µWh).
10710  optional int64 energy_counter_uwh = 6;
10711
10712  // Battery voltage in microvolts(µV).
10713  optional int64 voltage_uv = 7;
10714}
10715
10716// End of protos/perfetto/trace/power/battery_counters.proto
10717
10718// Begin of protos/perfetto/trace/power/power_rails.proto
10719
10720message PowerRails {
10721
10722  message RailDescriptor {
10723    // Index corresponding to the rail
10724    optional uint32 index = 1;
10725
10726    // Name of the rail
10727    optional string rail_name = 2;
10728
10729    // Name of the subsystem to which this rail belongs
10730    optional string subsys_name = 3;
10731
10732    // Hardware sampling rate (Hz).
10733    optional uint32 sampling_rate = 4;
10734  }
10735
10736  // This is only emitted at the beginning of the trace.
10737  repeated RailDescriptor rail_descriptor = 1;
10738
10739  message EnergyData {
10740    // Index corresponding to RailDescriptor.index
10741    optional uint32 index = 1;
10742
10743    // Time since device boot(CLOCK_BOOTTIME) in milli-seconds.
10744    optional uint64 timestamp_ms = 2;
10745
10746    // Accumulated energy since device boot in microwatt-seconds (uWs).
10747    optional uint64 energy = 3;
10748  }
10749
10750  repeated EnergyData energy_data = 2;
10751}
10752
10753// End of protos/perfetto/trace/power/power_rails.proto
10754
10755// Begin of protos/perfetto/trace/profiling/deobfuscation.proto
10756
10757message ObfuscatedMember {
10758  // This is the obfuscated field name relative to the class containing the
10759  // ObfuscatedMember.
10760  optional string obfuscated_name = 1;
10761  // If this is fully qualified (i.e. contains a '.') this is the deobfuscated
10762  // field name including its class. Otherwise, this is this the unqualified
10763  // deobfuscated field name relative to the class containing this
10764  // ObfuscatedMember.
10765  optional string deobfuscated_name = 2;
10766}
10767
10768message ObfuscatedClass {
10769  optional string obfuscated_name = 1;
10770  optional string deobfuscated_name = 2;
10771  // fields.
10772  repeated ObfuscatedMember obfuscated_members = 3;
10773  repeated ObfuscatedMember obfuscated_methods = 4;
10774}
10775
10776message DeobfuscationMapping {
10777  optional string package_name = 1;
10778  optional int64 version_code = 2;
10779  repeated ObfuscatedClass obfuscated_classes = 3;
10780}
10781// End of protos/perfetto/trace/profiling/deobfuscation.proto
10782
10783// Begin of protos/perfetto/trace/profiling/heap_graph.proto
10784
10785message HeapGraphRoot {
10786  enum Type {
10787    ROOT_UNKNOWN = 0;
10788    ROOT_JNI_GLOBAL = 1;
10789    ROOT_JNI_LOCAL = 2;
10790    ROOT_JAVA_FRAME = 3;
10791    ROOT_NATIVE_STACK = 4;
10792    ROOT_STICKY_CLASS = 5;
10793    ROOT_THREAD_BLOCK = 6;
10794    ROOT_MONITOR_USED = 7;
10795    ROOT_THREAD_OBJECT = 8;
10796    ROOT_INTERNED_STRING = 9;
10797    ROOT_FINALIZING = 10;
10798    ROOT_DEBUGGER = 11;
10799    ROOT_REFERENCE_CLEANUP = 12;
10800    ROOT_VM_INTERNAL = 13;
10801    ROOT_JNI_MONITOR = 14;
10802  };
10803  // Objects retained by this root.
10804  repeated uint64 object_ids = 1 [packed = true];
10805
10806  optional Type root_type = 2;
10807}
10808
10809message HeapGraphType {
10810  enum Kind {
10811    KIND_UNKNOWN = 0;
10812    KIND_NORMAL = 1;
10813    KIND_NOREFERENCES = 2;
10814    KIND_STRING = 3;
10815    KIND_ARRAY = 4;
10816    KIND_CLASS = 5;
10817    KIND_CLASSLOADER = 6;
10818    KIND_DEXCACHE = 7;
10819    KIND_SOFT_REFERENCE = 8;
10820    KIND_WEAK_REFERENCE = 9;
10821    KIND_FINALIZER_REFERENCE = 10;
10822    KIND_PHANTOM_REFERENCE = 11;
10823  };
10824  // TODO(fmayer): Consider removing this and using the index in the repeaed
10825  // field to save space.
10826  optional uint64 id = 1;
10827  optional uint64 location_id = 2;
10828  optional string class_name = 3;
10829  // Size of objects of this type.
10830  optional uint64 object_size = 4;
10831  optional uint64 superclass_id = 5;
10832  // Indices for InternedData.field_names for the names of the fields of
10833  // instances of this class. This does NOT include the fields from
10834  // superclasses. The consumer of this data needs to walk all super
10835  // classes to get a full lists of fields. Objects always write the
10836  // fields in order of most specific class to the furthest up superclass.
10837  repeated uint64 reference_field_id = 6 [packed = true];
10838  optional Kind kind = 7;
10839  optional uint64 classloader_id = 8;
10840}
10841
10842message HeapGraphObject {
10843  oneof identifier {
10844    uint64 id = 1;
10845    uint64 id_delta = 7;
10846  }
10847
10848  // Index for InternedData.types for the name of the type of this object.
10849  optional uint64 type_id = 2;
10850
10851  // Bytes occupied by this objects.
10852  optional uint64 self_size = 3;
10853
10854  // Add this to all non-zero values in reference_object_id. This is used to
10855  // get more compact varint encoding.
10856  //
10857  // The name is confusing, but this has always been used as a base for
10858  // reference_object_id. The field should be named reference_object_id_base.
10859  optional uint64 reference_field_id_base = 6;
10860
10861  // Indices for InternedData.field_names for the name of the field referring
10862  // to the object. For Android S+ and for instances of normal classes (e.g.
10863  // not instances of java.lang.Class or arrays), this is instead set in the
10864  // corresponding HeapGraphType, and this is left empty.
10865  repeated uint64 reference_field_id = 4 [packed = true];
10866
10867  // Ids of the Object that is referred to.
10868  repeated uint64 reference_object_id = 5 [packed = true];
10869
10870  // If this object is an instance of `libcore.util.NativeAllocationRegistry`,
10871  // the value of the `size` field.
10872  //
10873  // N.B. This is not the native size of this object.
10874  optional int64 native_allocation_registry_size_field = 8;
10875}
10876
10877message HeapGraph {
10878  optional int32 pid = 1;
10879
10880  // This contains all objects at the time this dump was taken. Some of these
10881  // will be live, some of those unreachable (garbage). To find the live
10882  // objects, the client needs to build the transitive closure of objects
10883  // reachable from |roots|.
10884  // All objects not contained within that transitive closure are garbage that
10885  // has not yet been collected.
10886  repeated HeapGraphObject objects = 2;
10887
10888  // Roots at the time this dump was taken.
10889  // All live objects are reachable from the roots. All other objects are
10890  // garbage.
10891  repeated HeapGraphRoot roots = 7;
10892
10893  // Types used in HeapGraphObjects.
10894  repeated HeapGraphType types = 9;
10895
10896  reserved 3;
10897
10898  // Field names for references in managed heap graph.
10899  repeated InternedString field_names = 4;
10900
10901  // Paths of files used in managed heap graph.
10902  repeated InternedString location_names = 8;
10903
10904  optional bool continued = 5;
10905  optional uint64 index = 6;
10906}
10907
10908// End of protos/perfetto/trace/profiling/heap_graph.proto
10909
10910// Begin of protos/perfetto/trace/profiling/profile_packet.proto
10911
10912// This file contains a mixture of messages emitted by various sampling
10913// profilers:
10914//
10915// Memory allocator profiling
10916// ----------------
10917// ProfilePacket:
10918//   The packet emitted by heapprofd, which started off as a native heap
10919//   (malloc/free) profiler, but now supports custom allocators as well. Each
10920//   packet contains a preaggregated state of the heap at snapshot time, which
10921//   report the total allocated/free bytes per callstack (plus other info such
10922//   as the number of samples).
10923// StreamingAllocation/StreamingFree:
10924//   Emitted by heapprofd when configured in streaming mode (i.e. when
10925//   stream_allocations = true). This is only for local testing, and doesn't
10926//   report callstacks (only address time and size of each alloc/free). It can
10927//   lead to enormous traces, as it contains the stream of each alloc/free call.
10928//
10929// Callstack sampling
10930// ------------------
10931// StreamingProfilePacket:
10932//   The packet emitted by the chromium in-process sampling profiler, which is
10933//   based on periodically sending a signal to itself, and unwinding the stack
10934//   in the signal handler. Each packet contains a series of individual stack
10935//   samples for a Chromium thread.
10936//
10937// Callstack and performance counter sampling
10938// ---------------------
10939// PerfSample:
10940//   The packet emitted by traced_perf sampling performance profiler based on
10941//   the perf_event_open syscall. Each packet represents an individual sample
10942//   of a performance counter (which might be a timer), and optionally a
10943//   callstack of the process that was scheduled at the time of the sample.
10944//
10945
10946// The packet emitted by heapprofd for each heap snapshot. A snapshot can
10947// involve more than one ProfilePacket if the snapshot is big (when |continued|
10948// is true). The cardinality and grouping is as follows:
10949// A ProfilePacket contains:
10950//  - 1+ per-process heap snapshots (ProcessHeapSamples). Normally there is only
10951//    one heap per process (the main malloc/free heap), but there can be more if
10952//    the process is using the heapprofd API to profile custom allocators.
10953//  - Globally interned strings, mappings and frames (to allow de-duplicating
10954//    frames/mapping in common between different processes).
10955// A ProcessHeapSamples contains:
10956//  - The process and heap identifier.
10957//  - A number of HeapSample, one for each callsite that had some alloc/frees.
10958//  - Statistics about heapprofd internals (e.g., sampling/unwinding timings).
10959// A HeapSample contains statistics about callsites:
10960//  - Total number of bytes allocated and freed from that callsite.
10961//  - Total number of alloc/free calls sampled.
10962//  - Stats at the local maximum when dump_at_max = true.
10963// See https://perfetto.dev/docs/data-sources/native-heap-profiler for more.
10964message ProfilePacket {
10965  // The following interning tables are only used in Android version Q.
10966  // In newer versions, these tables are in InternedData
10967  // (see protos/perfetto/trace/interned_data) and are shared across
10968  // multiple ProfilePackets.
10969  // For backwards compatibility, consumers need to first look up interned
10970  // data in the tables within the ProfilePacket, and then, if they are empty,
10971  // look up in the InternedData instead.
10972  repeated InternedString strings = 1;
10973  repeated Mapping mappings = 4;
10974  repeated Frame frames = 2;
10975  repeated Callstack callstacks = 3;
10976
10977  // Next ID: 9
10978  message HeapSample {
10979    optional uint64 callstack_id = 1;
10980    // bytes allocated at this callstack.
10981    optional uint64 self_allocated = 2;
10982    // bytes allocated at this callstack that have been freed.
10983    optional uint64 self_freed = 3;
10984    // deprecated self_idle.
10985    reserved 7;
10986    // Bytes allocated by this callstack but not freed at the time the malloc
10987    // heap usage of this process was maximal. This is only set if dump_at_max
10988    // is true in HeapprofdConfig. In that case, self_allocated, self_freed and
10989    // self_idle will not be set.
10990    optional uint64 self_max = 8;
10991    // Number of allocations that were sampled at this callstack but not freed
10992    // at the time the malloc heap usage of this process was maximal. This is
10993    // only set if dump_at_max is true in HeapprofdConfig. In that case,
10994    // self_allocated, self_freed and self_idle will not be set.
10995    optional uint64 self_max_count = 9;
10996    // timestamp [opt]
10997    optional uint64 timestamp = 4;
10998    // Number of allocations that were sampled at this callstack.
10999    optional uint64 alloc_count = 5;
11000    // Number of allocations that were sampled at this callstack that have been
11001    // freed.
11002    optional uint64 free_count = 6;
11003  }
11004
11005  message Histogram {
11006    message Bucket {
11007      // This bucket counts values from the previous bucket's (or -infinity if
11008      // this is the first bucket) upper_limit (inclusive) to this upper_limit
11009      // (exclusive).
11010      optional uint64 upper_limit = 1;
11011      // This is the highest bucket. This is set instead of the upper_limit. Any
11012      // values larger or equal to the previous bucket's upper_limit are counted
11013      // in this bucket.
11014      optional bool max_bucket = 2;
11015      // Number of values that fall into this range.
11016      optional uint64 count = 3;
11017    }
11018    repeated Bucket buckets = 1;
11019  }
11020
11021  message ProcessStats {
11022    optional uint64 unwinding_errors = 1;
11023    optional uint64 heap_samples = 2;
11024    optional uint64 map_reparses = 3;
11025    optional Histogram unwinding_time_us = 4;
11026    optional uint64 total_unwinding_time_us = 5;
11027    optional uint64 client_spinlock_blocked_us = 6;
11028  }
11029
11030  repeated ProcessHeapSamples process_dumps = 5;
11031  message ProcessHeapSamples {
11032    enum ClientError {
11033      CLIENT_ERROR_NONE = 0;
11034      CLIENT_ERROR_HIT_TIMEOUT = 1;
11035      CLIENT_ERROR_INVALID_STACK_BOUNDS = 2;
11036    }
11037    optional uint64 pid = 1;
11038
11039    // This process was profiled from startup.
11040    // If false, this process was already running when profiling started.
11041    optional bool from_startup = 3;
11042
11043    // This process was not profiled because a concurrent session was active.
11044    // If this is true, samples will be empty.
11045    optional bool rejected_concurrent = 4;
11046
11047    // This process disconnected while it was profiled.
11048    // If false, the process outlived the profiling session.
11049    optional bool disconnected = 6;
11050
11051    // If disconnected, this disconnect was caused by the client overrunning
11052    // the buffer.
11053    // Equivalent to client_error == CLIENT_ERROR_HIT_TIMEOUT
11054    // on new S builds.
11055    optional bool buffer_overran = 7;
11056
11057    optional ClientError client_error = 14;
11058
11059    // If disconnected, this disconnected was caused by the shared memory
11060    // buffer being corrupted. THIS IS ALWAYS A BUG IN HEAPPROFD OR CLIENT
11061    // MEMORY CORRUPTION.
11062    optional bool buffer_corrupted = 8;
11063
11064    // If disconnected, this disconnect was caused by heapprofd exceeding
11065    // guardrails during this profiling session.
11066    optional bool hit_guardrail = 10;
11067
11068    optional string heap_name = 11;
11069    optional uint64 sampling_interval_bytes = 12;
11070    optional uint64 orig_sampling_interval_bytes = 13;
11071
11072    // Timestamp of the state of the target process that this dump represents.
11073    // This can be different to the timestamp of the TracePackets for various
11074    // reasons:
11075    // * If disconnected is set above, this is the timestamp of last state
11076    //   heapprofd had of the process before it disconnected.
11077    // * Otherwise, if the rate of events produced by the process is high,
11078    //   heapprofd might be behind.
11079    //
11080    // TODO(fmayer): This is MONOTONIC_COARSE. Refactor ClockSnapshot::Clock
11081    //               to have a type enum that we can reuse here.
11082    optional uint64 timestamp = 9;
11083
11084    // Metadata about heapprofd.
11085    optional ProcessStats stats = 5;
11086
11087    repeated HeapSample samples = 2;
11088  }
11089
11090  // If this is true, the next ProfilePacket in this package_sequence_id is a
11091  // continuation of this one.
11092  // To get all samples for a process, accummulate its
11093  // ProcessHeapSamples.samples until you see continued=false.
11094  optional bool continued = 6;
11095
11096  // Index of this ProfilePacket on its package_sequence_id. Can be used
11097  // to detect dropped data.
11098  // Verify these are consecutive.
11099  optional uint64 index = 7;
11100}
11101
11102// Packet emitted by heapprofd when stream_allocations = true. Only for local
11103// testing. Doesn't report the callsite.
11104message StreamingAllocation {
11105  // TODO(fmayer): Add callstack.
11106  repeated uint64 address = 1;
11107  repeated uint64 size = 2;
11108  repeated uint64 sample_size = 3;
11109  repeated uint64 clock_monotonic_coarse_timestamp = 4;
11110  repeated uint32 heap_id = 5;
11111  repeated uint64 sequence_number = 6;
11112};
11113
11114// Packet emitted by heapprofd when stream_allocations = true. Only for local
11115// testing. Doesn't report the callsite.
11116message StreamingFree {
11117  // TODO(fmayer): Add callstack.
11118  repeated uint64 address = 1;
11119  repeated uint32 heap_id = 2;
11120  repeated uint64 sequence_number = 3;
11121};
11122
11123// Packet emitted by the chromium in-process signal-based callstack sampler.
11124// Represents a series of individual stack samples (sampled at discrete points
11125// in time), rather than aggregated over an interval.
11126message StreamingProfilePacket {
11127  // Index into InternedData.callstacks
11128  repeated uint64 callstack_iid = 1;
11129  // TODO(eseckler): ThreadDescriptor-based timestamps are deprecated. Replace
11130  // this with ClockSnapshot-based delta encoding instead.
11131  repeated int64 timestamp_delta_us = 2;
11132  optional int32 process_priority = 3;
11133}
11134
11135// Namespace for the contained enums.
11136message Profiling {
11137  enum CpuMode {
11138    MODE_UNKNOWN = 0;
11139    MODE_KERNEL = 1;
11140    MODE_USER = 2;
11141    // The following values aren't expected, but included for completeness:
11142    MODE_HYPERVISOR = 3;
11143    MODE_GUEST_KERNEL = 4;
11144    MODE_GUEST_USER = 5;
11145  }
11146
11147  // Enumeration of libunwindstack's error codes.
11148  // NB: the integral representations of the two enums are different.
11149  enum StackUnwindError {
11150    UNWIND_ERROR_UNKNOWN = 0;
11151    UNWIND_ERROR_NONE = 1;
11152    UNWIND_ERROR_MEMORY_INVALID = 2;
11153    UNWIND_ERROR_UNWIND_INFO = 3;
11154    UNWIND_ERROR_UNSUPPORTED = 4;
11155    UNWIND_ERROR_INVALID_MAP = 5;
11156    UNWIND_ERROR_MAX_FRAMES_EXCEEDED = 6;
11157    UNWIND_ERROR_REPEATED_FRAME = 7;
11158    UNWIND_ERROR_INVALID_ELF = 8;
11159    UNWIND_ERROR_SYSTEM_CALL = 9;
11160    UNWIND_ERROR_THREAD_TIMEOUT = 10;
11161    UNWIND_ERROR_THREAD_DOES_NOT_EXIST = 11;
11162    UNWIND_ERROR_BAD_ARCH = 12;
11163    UNWIND_ERROR_MAPS_PARSE = 13;
11164    UNWIND_ERROR_INVALID_PARAMETER = 14;
11165    UNWIND_ERROR_PTRACE_CALL = 15;
11166  }
11167}
11168
11169// Packet emitted by the traced_perf sampling performance profiler, which
11170// gathers data via the perf_event_open syscall. Each packet contains an
11171// individual sample with a counter value, and optionally a
11172// callstack.
11173//
11174// Timestamps are within the root packet. The config can specify the clock, or
11175// the implementation will default to CLOCK_MONOTONIC_RAW. Within the Android R
11176// timeframe, the default was CLOCK_BOOTTIME.
11177//
11178// There are several distinct views of this message:
11179// * indication of kernel buffer data loss (kernel_records_lost set)
11180// * indication of skipped samples (sample_skipped_reason set)
11181// * notable event in the sampling implementation (producer_event set)
11182// * normal sample (timebase_count set, typically also callstack_iid)
11183message PerfSample {
11184  optional uint32 cpu = 1;
11185  optional uint32 pid = 2;
11186  optional uint32 tid = 3;
11187
11188  // Execution state that the process was sampled at.
11189  optional Profiling.CpuMode cpu_mode = 5;
11190
11191  // Value of the timebase counter (since the event was configured, no deltas).
11192  optional uint64 timebase_count = 6;
11193
11194  // Unwound callstack. Might be partial, in which case a synthetic "error"
11195  // frame is appended, and |unwind_error| is set accordingly.
11196  optional uint64 callstack_iid = 4;
11197
11198  // If set, stack unwinding was incomplete due to an error.
11199  // Unset values should be treated as UNWIND_ERROR_NONE.
11200  oneof optional_unwind_error { Profiling.StackUnwindError unwind_error = 16; };
11201
11202  // If set, indicates that this message is not a sample, but rather an
11203  // indication of data loss in the ring buffer allocated for |cpu|. Such data
11204  // loss occurs when the kernel has insufficient ring buffer capacity to write
11205  // a record (which gets discarded). A record in this context is an individual
11206  // ring buffer entry, and counts more than just sample records.
11207  //
11208  // The |timestamp| of the packet corresponds to the time that the producer
11209  // wrote the packet for trace-sorting purposes alone, and should not be
11210  // interpreted relative to the sample timestamps. This field is sufficient to
11211  // detect that *some* kernel data loss happened within the trace, but not the
11212  // specific time bounds of that loss (which would require tracking precedessor
11213  // & successor timestamps, which is not deemed necessary at the moment).
11214  optional uint64 kernel_records_lost = 17;
11215
11216  // If set, indicates that the profiler encountered a sample that was relevant,
11217  // but was skipped.
11218  enum SampleSkipReason {
11219    PROFILER_SKIP_UNKNOWN = 0;
11220    PROFILER_SKIP_READ_STAGE = 1;
11221    PROFILER_SKIP_UNWIND_STAGE = 2;
11222    PROFILER_SKIP_UNWIND_ENQUEUE = 3;
11223  }
11224  oneof optional_sample_skipped_reason {
11225    SampleSkipReason sample_skipped_reason = 18;
11226  };
11227
11228  // A notable event within the sampling implementation.
11229  message ProducerEvent {
11230    enum DataSourceStopReason {
11231      PROFILER_STOP_UNKNOWN = 0;
11232      PROFILER_STOP_GUARDRAIL = 1;
11233    }
11234    oneof optional_source_stop_reason {
11235      DataSourceStopReason source_stop_reason = 1;
11236    }
11237  }
11238  optional ProducerEvent producer_event = 19;
11239}
11240
11241// Submessage for TracePacketDefaults.
11242message PerfSampleDefaults {
11243  // The sampling timebase. Might not be identical to the data source config if
11244  // the implementation decided to default/override some parameters.
11245  optional PerfEvents.Timebase timebase = 1;
11246
11247  // If the config requested process sharding, report back the count and which
11248  // of those bins was selected. Never changes for the duration of a trace.
11249  optional uint32 process_shard_count = 2;
11250  optional uint32 chosen_process_shard = 3;
11251}
11252
11253// End of protos/perfetto/trace/profiling/profile_packet.proto
11254
11255// Begin of protos/perfetto/trace/profiling/smaps.proto
11256
11257message SmapsEntry {
11258  optional string path = 1;
11259  optional uint64 size_kb = 2;
11260  optional uint64 private_dirty_kb = 3;
11261  optional uint64 swap_kb = 4;
11262
11263  // for field upload (instead of path).
11264  optional string file_name = 5;
11265
11266  // TODO(crbug.com/1098746): Consider encoding this as incremental values.
11267  optional uint64 start_address = 6;
11268  optional uint64 module_timestamp = 7;
11269  optional string module_debugid = 8;
11270  optional string module_debug_path = 9;
11271  optional uint32 protection_flags = 10;
11272
11273  optional uint64 private_clean_resident_kb = 11;
11274  optional uint64 shared_dirty_resident_kb = 12;
11275  optional uint64 shared_clean_resident_kb = 13;
11276  optional uint64 locked_kb = 14;
11277  optional uint64 proportional_resident_kb = 15;
11278};
11279
11280message SmapsPacket {
11281  optional uint32 pid = 1;
11282  repeated SmapsEntry entries = 2;
11283};
11284
11285// End of protos/perfetto/trace/profiling/smaps.proto
11286
11287// Begin of protos/perfetto/trace/ps/process_stats.proto
11288
11289// Per-process periodically sampled stats. These samples are wrapped in a
11290// dedicated message (as opposite to be fields in process_tree.proto) because
11291// they are dumped at a different rate than cmdline and thread list.
11292// Note: not all of these stats will be present in every ProcessStats message
11293// and sometimes processes may be missing . This is because counters are
11294// cached to reduce emission of counters which do not change.
11295message ProcessStats {
11296  // Per-thread periodically sampled stats.
11297  // Note: not all of these stats will be present in every message. See the note
11298  // for ProcessStats.
11299  message Thread {
11300    optional int32 tid = 1;
11301
11302    // DEPRECATED cpu_freq_indices
11303    reserved 2;
11304
11305    // DEPRECATED cpu_freq_ticks
11306    reserved 3;
11307
11308    // DEPRECATED cpu_freq_full
11309    reserved 4;
11310  }
11311
11312  message FDInfo {
11313    optional uint64 fd = 1;
11314    optional string path = 2;
11315  }
11316
11317  message Process {
11318    optional int32 pid = 1;
11319
11320    // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
11321    optional uint64 vm_size_kb = 2;
11322    optional uint64 vm_rss_kb = 3;
11323    optional uint64 rss_anon_kb = 4;
11324    optional uint64 rss_file_kb = 5;
11325    optional uint64 rss_shmem_kb = 6;
11326    optional uint64 vm_swap_kb = 7;
11327    optional uint64 vm_locked_kb = 8;
11328    optional uint64 vm_hwm_kb = 9;
11329    // When adding a new field remember to update kProcMemCounterSize in
11330    // the trace processor.
11331
11332    optional int64 oom_score_adj = 10;
11333
11334    repeated Thread threads = 11;
11335
11336    // The peak resident set size is resettable in newer Posix kernels.
11337    // This field specifies if reset is supported and if the writer had reset
11338    // the peaks after each process stats recording.
11339    optional bool is_peak_rss_resettable = 12;
11340
11341    // Private, shared and swap footprint of the process as measured by
11342    // Chrome. To know more about these metrics refer to:
11343    // https://docs.google.com/document/d/1_WmgE1F5WUrhwkPqJis3dWyOiUmQKvpXp5cd4w86TvA
11344    optional uint32 chrome_private_footprint_kb = 13;
11345    optional uint32 chrome_peak_resident_set_kb = 14;
11346
11347    repeated FDInfo fds = 15;
11348
11349    // These fields are set only when scan_smaps_rollup=true
11350    optional uint64 smr_rss_kb = 16;
11351    optional uint64 smr_pss_kb = 17;
11352    optional uint64 smr_pss_anon_kb = 18;
11353    optional uint64 smr_pss_file_kb = 19;
11354    optional uint64 smr_pss_shmem_kb = 20;
11355  }
11356  repeated Process processes = 1;
11357
11358  // The time at which we finish collecting this batch of samples;
11359  // the top-level packet timestamp is the time at which
11360  // we begin collection.
11361  optional uint64 collection_end_timestamp = 2;
11362}
11363
11364// End of protos/perfetto/trace/ps/process_stats.proto
11365
11366// Begin of protos/perfetto/trace/ps/process_tree.proto
11367
11368// Metadata about the processes and threads in the trace.
11369// Note: this proto was designed to be filled in by traced_probes and should
11370// only be populated with accurate information coming from the system. Other
11371// trace writers should prefer to fill ThreadDescriptor and ProcessDescriptor
11372// in TrackDescriptor.
11373message ProcessTree {
11374  // Representation of a thread.
11375  message Thread {
11376    // The thread ID (as per gettid()) in the root PID namespace.
11377    optional int32 tid = 1;
11378
11379    // Thread group id (i.e. the PID of the process, == TID of the main thread)
11380    optional int32 tgid = 3;
11381
11382    // The name of the thread.
11383    optional string name = 2;
11384
11385    // The non-root-level thread IDs if the thread runs in a PID namespace. Read
11386    // from the NSpid entry of /proc/<tid>/status, with the first element (root-
11387    // level thread ID) omitted.
11388    repeated int32 nstid = 4;
11389  }
11390
11391  // Representation of a process.
11392  message Process {
11393    // The UNIX process ID, aka thread group ID (as per getpid()) in the root
11394    // PID namespace.
11395    optional int32 pid = 1;
11396
11397    // The parent process ID, as per getppid().
11398    optional int32 ppid = 2;
11399
11400    // The command line for the process, as per /proc/pid/cmdline.
11401    // If it is a kernel thread there will only be one cmdline field
11402    // and it will contain /proc/pid/comm.
11403    repeated string cmdline = 3;
11404
11405    // No longer used as of Apr 2018, when the dedicated |threads| field was
11406    // introduced in ProcessTree.
11407    repeated Thread threads_deprecated = 4 [deprecated = true];
11408
11409    // The uid for the process, as per /proc/pid/status.
11410    optional int32 uid = 5;
11411
11412    // The non-root-level process IDs if the process runs in a PID namespace.
11413    // Read from the NSpid entry of /proc/<pid>/status, with the first element (
11414    // root-level process ID) omitted.
11415    repeated int32 nspid = 6;
11416  }
11417
11418  // List of processes and threads in the client. These lists are incremental
11419  // and not exhaustive. A process and its threads might show up separately in
11420  // different ProcessTree messages. A thread might event not show up at all, if
11421  // no sched_switch activity was detected, for instance:
11422  // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
11423  // #1 { threads: [{pid: 12, tgid: 10}] }
11424  // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
11425  repeated Process processes = 1;
11426  repeated Thread threads = 2;
11427
11428  // The time at which we finish collecting this process tree;
11429  // the top-level packet timestamp is the time at which
11430  // we begin collection.
11431  optional uint64 collection_end_timestamp = 3;
11432}
11433
11434// End of protos/perfetto/trace/ps/process_tree.proto
11435
11436// Begin of protos/perfetto/trace/statsd/statsd_atom.proto
11437
11438// Deliberate empty message. See comment on StatsdAtom#atom below.
11439message Atom {}
11440
11441// One or more statsd atoms. This must continue to match:
11442// perfetto/protos/third_party/statsd/shell_data.proto
11443// So that we can efficiently add data from statsd directly to the
11444// trace.
11445message StatsdAtom {
11446  // Atom should be filled with an Atom proto from:
11447  // https://cs.android.com/android/platform/superproject/+/master:frameworks/proto_logging/stats/atoms.proto?q=f:stats%2Fatoms.proto$%20message%5C%20Atom
11448  // We don't reference Atom directly here since we don't want to import
11449  // Atom.proto and all its transitive dependencies into Perfetto.
11450  // atom and timestamp_nanos have the same cardinality
11451  repeated Atom atom = 1;
11452  repeated int64 timestamp_nanos = 2;
11453}
11454
11455// End of protos/perfetto/trace/statsd/statsd_atom.proto
11456
11457// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto
11458
11459// Various Linux system stat counters from /proc.
11460// The fields in this message can be reported at different rates and with
11461// different granularity. See sys_stats_config.proto.
11462message SysStats {
11463  // Counters from /proc/meminfo. Values are in KB.
11464  message MeminfoValue {
11465    optional MeminfoCounters key = 1;
11466    optional uint64 value = 2;
11467  };
11468  repeated MeminfoValue meminfo = 1;
11469
11470  // Counter from /proc/vmstat. Units are often pages, not KB.
11471  message VmstatValue {
11472    optional VmstatCounters key = 1;
11473    optional uint64 value = 2;
11474  };
11475  repeated VmstatValue vmstat = 2;
11476
11477  // Times in each mode, since boot. Unit: nanoseconds.
11478  message CpuTimes {
11479    optional uint32 cpu_id = 1;
11480
11481    // Time spent in user mode.
11482    optional uint64 user_ns = 2;
11483
11484    // Time spent in user mode (low prio).
11485    optional uint64 user_ice_ns = 3;
11486
11487    // Time spent in system mode.
11488    optional uint64 system_mode_ns = 4;
11489
11490    // Time spent in the idle task.
11491    optional uint64 idle_ns = 5;
11492
11493    // Time spent waiting for I/O.
11494    optional uint64 io_wait_ns = 6;
11495
11496    // Time spent servicing interrupts.
11497    optional uint64 irq_ns = 7;
11498
11499    // Time spent servicing softirqs.
11500    optional uint64 softirq_ns = 8;
11501  }
11502  // One entry per cpu.
11503  repeated CpuTimes cpu_stat = 3;
11504
11505  // Num processes forked since boot.
11506  // Populated only if FORK_COUNT in config.stat_counters.
11507  optional uint64 num_forks = 4;
11508
11509  message InterruptCount {
11510    optional int32 irq = 1;
11511    optional uint64 count = 2;
11512  }
11513
11514  // Number of interrupts, broken by IRQ number.
11515  // Populated only if IRQ_COUNTS in config.stat_counters.
11516
11517  // Total num of irqs serviced since boot.
11518  optional uint64 num_irq_total = 5;
11519  repeated InterruptCount num_irq = 6;
11520
11521  // Number of softirqs, broken by softirq number.
11522  // Populated only if SOFTIRQ_COUNTS in config.stat_counters.
11523
11524  // Total num of softirqs since boot.
11525  optional uint64 num_softirq_total = 7;
11526
11527  // Per-softirq count.
11528  repeated InterruptCount num_softirq = 8;
11529
11530  // The time at which we finish collecting this set of samples;
11531  // the top-level packet timestamp is the time at which
11532  // we begin collection.
11533  optional uint64 collection_end_timestamp = 9;
11534
11535  // Frequencies for /sys/class/devfreq/ entries in kHz.
11536  message DevfreqValue {
11537    optional string key = 1;
11538    optional uint64 value = 2;
11539  };
11540
11541  // One entry per device.
11542  repeated DevfreqValue devfreq = 10;
11543
11544  // Cpu current frequency from
11545  // /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq in kHz.
11546  // One entry per cpu. Report 0 for offline cpu
11547  repeated uint32 cpufreq_khz = 11;
11548
11549  message BuddyInfo {
11550    optional string node = 1;
11551    optional string zone = 2;
11552    repeated uint32 order_pages = 3;
11553  }
11554  // One entry per each node's zones.
11555  repeated BuddyInfo buddy_info = 12;
11556
11557  // Counters from /proc/diskstats.
11558  message DiskStat {
11559    optional string device_name = 1;
11560    optional uint64 read_sectors = 2;
11561    optional uint64 read_time_ms = 3;
11562    optional uint64 write_sectors = 4;
11563    optional uint64 write_time_ms = 5;
11564    optional uint64 discard_sectors = 6;
11565    optional uint64 discard_time_ms = 7;
11566    optional uint64 flush_count = 8;
11567    optional uint64 flush_time_ms = 9;
11568  }
11569  // One entry per disk device.
11570  repeated DiskStat disk_stat = 13;
11571}
11572
11573// End of protos/perfetto/trace/sys_stats/sys_stats.proto
11574
11575// Begin of protos/perfetto/trace/system_info.proto
11576
11577message Utsname {
11578  optional string sysname = 1;
11579  optional string version = 2;
11580  optional string release = 3;
11581  optional string machine = 4;
11582}
11583
11584message SystemInfo {
11585  optional Utsname utsname = 1;
11586  optional string android_build_fingerprint = 2;
11587
11588  // Ticks per second - sysconf(_SC_CLK_TCK).
11589  optional int64 hz = 3;
11590
11591  // The version of traced (the same returned by `traced --version`).
11592  // This is a human readable string with and its format varies depending on
11593  // the build system and the repo (standalone vs AOSP).
11594  // This is intended for human debugging only.
11595  optional string tracing_service_version = 4;
11596
11597  // The Android SDK vesion (e.g. 21 for L, 31 for S etc).
11598  // Introduced in Android T.
11599  optional uint64 android_sdk_version = 5;
11600
11601  // Kernel page size - sysconf(_SC_PAGESIZE).
11602  optional uint32 page_size = 6;
11603}
11604
11605// End of protos/perfetto/trace/system_info.proto
11606
11607// Begin of protos/perfetto/trace/system_info/cpu_info.proto
11608
11609// Information about CPUs from procfs and sysfs.
11610message CpuInfo {
11611  // Information about a single CPU.
11612  message Cpu {
11613    // Value of "Processor" field from /proc/cpuinfo for this CPU.
11614    // Example: "AArch64 Processor rev 12 (aarch64)"
11615    optional string processor = 1;
11616
11617    // Frequencies from
11618    // /sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies
11619    // where X is the index of this CPU.
11620    repeated uint32 frequencies = 2;
11621  }
11622
11623  // Describes available CPUs, one entry per CPU.
11624  repeated Cpu cpus = 1;
11625}
11626
11627// End of protos/perfetto/trace/system_info/cpu_info.proto
11628
11629// Begin of protos/perfetto/trace/test_event.proto
11630
11631// Event used by testing code.
11632message TestEvent {
11633  // Arbitrary string used in tests.
11634  optional string str = 1;
11635
11636  // The current value of the random number sequence used in tests.
11637  optional uint32 seq_value = 2;
11638
11639  // Monotonically increased on each packet.
11640  optional uint64 counter = 3;
11641
11642  // No more packets should follow (from the current sequence).
11643  optional bool is_last = 4;
11644
11645  message TestPayload {
11646    repeated string str = 1;
11647    repeated TestPayload nested = 2;
11648
11649    optional string single_string = 4;
11650
11651    optional int32 single_int = 5;
11652    repeated int32 repeated_ints = 6;
11653
11654    // When 0 this is the bottom-most nested message.
11655    optional uint32 remaining_nesting_depth = 3;
11656
11657    repeated DebugAnnotation debug_annotations = 7;
11658  }
11659  optional TestPayload payload = 5;
11660}
11661
11662// End of protos/perfetto/trace/test_event.proto
11663
11664// Begin of protos/perfetto/trace/trace_packet_defaults.proto
11665
11666// Default values for TracePacket fields that hold for a particular TraceWriter
11667// packet sequence. This message contains a subset of the TracePacket fields
11668// with matching IDs. When provided, these fields define the default values
11669// that should be applied, at import time, to all TracePacket(s) with the same
11670// |trusted_packet_sequence_id|, unless otherwise specified in each packet.
11671//
11672// Should be reemitted whenever incremental state is cleared on the sequence.
11673message TracePacketDefaults {
11674  optional uint32 timestamp_clock_id = 58;
11675
11676  // Default values for TrackEvents (e.g. default track).
11677  optional TrackEventDefaults track_event_defaults = 11;
11678
11679  // Defaults for perf profiler packets (PerfSample).
11680  optional PerfSampleDefaults perf_sample_defaults = 12;
11681}
11682// End of protos/perfetto/trace/trace_packet_defaults.proto
11683
11684// Begin of protos/perfetto/trace/trace_uuid.proto
11685
11686// A random unique ID that identifies the trace.
11687// This message has been introduced in v32. Prior to that, the UUID was
11688// only (optionally) present in the TraceConfig.trace_uuid_msb/lsb fields.
11689// This has been moved to a standalone packet to deal with new use-cases for
11690// go/gapless-aot, where the same tracing session can be serialized several
11691// times, in which case the UUID is changed on each snapshot and does not match
11692// the one in the TraceConfig.
11693message TraceUuid {
11694  optional int64 msb = 1;
11695  optional int64 lsb = 2;
11696}
11697
11698// End of protos/perfetto/trace/trace_uuid.proto
11699
11700// Begin of protos/perfetto/trace/track_event/process_descriptor.proto
11701
11702// Describes a process's attributes. Emitted as part of a TrackDescriptor,
11703// usually by the process's main thread.
11704//
11705// Next id: 9.
11706message ProcessDescriptor {
11707  optional int32 pid = 1;
11708  repeated string cmdline = 2;
11709  optional string process_name = 6;
11710
11711  optional int32 process_priority = 5;
11712  // Process start time in nanoseconds.
11713  // The timestamp refers to the trace clock by default. Other clock IDs
11714  // provided in TracePacket are not supported.
11715  optional int64 start_timestamp_ns = 7;
11716
11717  // ---------------------------------------------------------------------------
11718  // Deprecated / legacy fields, which will be removed in the future:
11719  // ---------------------------------------------------------------------------
11720
11721  // See chromium's content::ProcessType.
11722  enum ChromeProcessType {
11723    PROCESS_UNSPECIFIED = 0;
11724    PROCESS_BROWSER = 1;
11725    PROCESS_RENDERER = 2;
11726    PROCESS_UTILITY = 3;
11727    PROCESS_ZYGOTE = 4;
11728    PROCESS_SANDBOX_HELPER = 5;
11729    PROCESS_GPU = 6;
11730    PROCESS_PPAPI_PLUGIN = 7;
11731    PROCESS_PPAPI_BROKER = 8;
11732  }
11733  optional ChromeProcessType chrome_process_type = 4;
11734
11735  // To support old UI. New UI should determine default sorting by process_type.
11736  optional int32 legacy_sort_index = 3;
11737
11738  // Labels can be used to further describe properties of the work performed by
11739  // the process. For example, these can be used by Chrome renderer process to
11740  // provide titles of frames being rendered.
11741  repeated string process_labels = 8;
11742}
11743
11744// End of protos/perfetto/trace/track_event/process_descriptor.proto
11745
11746// Begin of protos/perfetto/trace/track_event/range_of_interest.proto
11747
11748// This message specifies the "range of interest" for track events. With the
11749// `drop_track_event_data_before` option set to `kTrackEventRangeOfInterest`,
11750// Trace Processor drops track events outside of this range.
11751message TrackEventRangeOfInterest {
11752  optional int64 start_us = 1;
11753}
11754// End of protos/perfetto/trace/track_event/range_of_interest.proto
11755
11756// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
11757
11758// Describes a thread's attributes. Emitted as part of a TrackDescriptor,
11759// usually by the thread's trace writer.
11760//
11761// Next id: 9.
11762message ThreadDescriptor {
11763  optional int32 pid = 1;
11764  optional int32 tid = 2;
11765
11766  optional string thread_name = 5;
11767
11768  // ---------------------------------------------------------------------------
11769  // Deprecated / legacy fields, which will be removed in the future:
11770  // ---------------------------------------------------------------------------
11771
11772  enum ChromeThreadType {
11773    CHROME_THREAD_UNSPECIFIED = 0;
11774
11775    CHROME_THREAD_MAIN = 1;
11776    CHROME_THREAD_IO = 2;
11777
11778    // Scheduler:
11779    CHROME_THREAD_POOL_BG_WORKER = 3;
11780    CHROME_THREAD_POOL_FG_WORKER = 4;
11781    CHROME_THREAD_POOL_FB_BLOCKING = 5;
11782    CHROME_THREAD_POOL_BG_BLOCKING = 6;
11783    CHROME_THREAD_POOL_SERVICE = 7;
11784
11785    // Compositor:
11786    CHROME_THREAD_COMPOSITOR = 8;
11787    CHROME_THREAD_VIZ_COMPOSITOR = 9;
11788    CHROME_THREAD_COMPOSITOR_WORKER = 10;
11789
11790    // Renderer:
11791    CHROME_THREAD_SERVICE_WORKER = 11;
11792
11793    // Tracing related threads:
11794    CHROME_THREAD_MEMORY_INFRA = 50;
11795    CHROME_THREAD_SAMPLING_PROFILER = 51;
11796  };
11797  optional ChromeThreadType chrome_thread_type = 4;
11798
11799  // Deprecated. Use ClockSnapshot in combination with TracePacket's timestamp
11800  // and timestamp_clock_id fields instead.
11801  optional int64 reference_timestamp_us = 6;
11802
11803  // Absolute reference values. Clock values in subsequent TrackEvents can be
11804  // encoded accumulatively and relative to these. This reduces their var-int
11805  // encoding size.
11806  // TODO(eseckler): Deprecated. Replace these with ClockSnapshot encoding.
11807  optional int64 reference_thread_time_us = 7;
11808  optional int64 reference_thread_instruction_count = 8;
11809
11810  // To support old UI. New UI should determine default sorting by thread_type.
11811  optional int32 legacy_sort_index = 3;
11812}
11813
11814// End of protos/perfetto/trace/track_event/thread_descriptor.proto
11815
11816// Begin of protos/perfetto/trace/track_event/chrome_process_descriptor.proto
11817
11818// Describes the attributes for a Chrome process. Must be paired with a
11819// ProcessDescriptor in the same TrackDescriptor.
11820//
11821// Next id: 6.
11822message ChromeProcessDescriptor {
11823  // See chromium's content::ProcessType.
11824  enum ProcessType {
11825    PROCESS_UNSPECIFIED = 0;
11826    PROCESS_BROWSER = 1;
11827    PROCESS_RENDERER = 2;
11828    PROCESS_UTILITY = 3;
11829    PROCESS_ZYGOTE = 4;
11830    PROCESS_SANDBOX_HELPER = 5;
11831    PROCESS_GPU = 6;
11832    PROCESS_PPAPI_PLUGIN = 7;
11833    PROCESS_PPAPI_BROKER = 8;
11834    PROCESS_SERVICE_NETWORK = 9;
11835    PROCESS_SERVICE_TRACING = 10;
11836    PROCESS_SERVICE_STORAGE = 11;
11837    PROCESS_SERVICE_AUDIO = 12;
11838    PROCESS_SERVICE_DATA_DECODER = 13;
11839    PROCESS_SERVICE_UTIL_WIN = 14;
11840    PROCESS_SERVICE_PROXY_RESOLVER = 15;
11841    PROCESS_SERVICE_CDM = 16;
11842    PROCESS_SERVICE_VIDEO_CAPTURE = 17;
11843    PROCESS_SERVICE_UNZIPPER = 18;
11844    PROCESS_SERVICE_MIRRORING = 19;
11845    PROCESS_SERVICE_FILEPATCHER = 20;
11846    PROCESS_SERVICE_TTS = 21;
11847    PROCESS_SERVICE_PRINTING = 22;
11848    PROCESS_SERVICE_QUARANTINE = 23;
11849    PROCESS_SERVICE_CROS_LOCALSEARCH = 24;
11850    PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = 25;
11851    PROCESS_SERVICE_FILEUTIL = 26;
11852    PROCESS_SERVICE_PRINTCOMPOSITOR = 27;
11853    PROCESS_SERVICE_PAINTPREVIEW = 28;
11854    PROCESS_SERVICE_SPEECHRECOGNITION = 29;
11855    PROCESS_SERVICE_XRDEVICE = 30;
11856    PROCESS_SERVICE_READICON = 31;
11857    PROCESS_SERVICE_LANGUAGEDETECTION = 32;
11858    PROCESS_SERVICE_SHARING = 33;
11859    PROCESS_SERVICE_MEDIAPARSER = 34;
11860    PROCESS_SERVICE_QRCODEGENERATOR = 35;
11861    PROCESS_SERVICE_PROFILEIMPORT = 36;
11862    PROCESS_SERVICE_IME = 37;
11863    PROCESS_SERVICE_RECORDING = 38;
11864    PROCESS_SERVICE_SHAPEDETECTION = 39;
11865    PROCESS_RENDERER_EXTENSION = 40;
11866  }
11867  optional ProcessType process_type = 1;
11868  optional int32 process_priority = 2;
11869
11870  // To support old UI. New UI should determine default sorting by process_type.
11871  optional int32 legacy_sort_index = 3;
11872
11873  // Name of the hosting app for WebView. Used to match renderer processes to
11874  // their hosting apps.
11875  optional string host_app_package_name = 4;
11876
11877  // The ID to link crashes to trace.
11878  // Notes:
11879  // * The ID is per process. So, each trace may contain many IDs, and you need
11880  //   to look for the ID from crashed process to find the crash report.
11881  // * Having a "chrome-trace-id" in crash doesn't necessarily mean we can
11882  //   get an uploaded trace, since uploads could have failed.
11883  // * On the other hand, if there was a crash during the session and trace was
11884  //   uploaded, it is very likely to find a crash report with the trace ID.
11885  // * This is not crash ID or trace ID. It is just a random 64-bit number
11886  //   recorded in both traces and crashes. It is possible to have collisions,
11887  //   though very rare.
11888  optional uint64 crash_trace_id = 5;
11889}
11890
11891// End of protos/perfetto/trace/track_event/chrome_process_descriptor.proto
11892
11893// Begin of protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
11894
11895// Describes a Chrome thread's attributes. Emitted as part of a TrackDescriptor,
11896// usually by the thread's trace writer. Must be paired with a ThreadDescriptor
11897// in the same TrackDescriptor.
11898//
11899// Next id: 3.
11900message ChromeThreadDescriptor {
11901  enum ThreadType {
11902    THREAD_UNSPECIFIED = 0;
11903
11904    THREAD_MAIN = 1;
11905    THREAD_IO = 2;
11906
11907    THREAD_POOL_BG_WORKER = 3;
11908    THREAD_POOL_FG_WORKER = 4;
11909    THREAD_POOL_FG_BLOCKING = 5;
11910    THREAD_POOL_BG_BLOCKING = 6;
11911    THREAD_POOL_SERVICE = 7;
11912
11913    THREAD_COMPOSITOR = 8;
11914    THREAD_VIZ_COMPOSITOR = 9;
11915    THREAD_COMPOSITOR_WORKER = 10;
11916
11917    THREAD_SERVICE_WORKER = 11;
11918    THREAD_NETWORK_SERVICE = 12;
11919
11920    THREAD_CHILD_IO = 13;
11921    THREAD_BROWSER_IO = 14;
11922
11923    THREAD_BROWSER_MAIN = 15;
11924    THREAD_RENDERER_MAIN = 16;
11925    THREAD_UTILITY_MAIN = 17;
11926    THREAD_GPU_MAIN = 18;
11927
11928    THREAD_CACHE_BLOCKFILE = 19;
11929    THREAD_MEDIA = 20;
11930    THREAD_AUDIO_OUTPUTDEVICE = 21;
11931    THREAD_AUDIO_INPUTDEVICE = 22;
11932    THREAD_GPU_MEMORY = 23;
11933    THREAD_GPU_VSYNC = 24;
11934    THREAD_DXA_VIDEODECODER = 25;
11935    THREAD_BROWSER_WATCHDOG = 26;
11936    THREAD_WEBRTC_NETWORK = 27;
11937    THREAD_WINDOW_OWNER = 28;
11938    THREAD_WEBRTC_SIGNALING = 29;
11939    THREAD_WEBRTC_WORKER = 30;
11940    THREAD_PPAPI_MAIN = 31;
11941    THREAD_GPU_WATCHDOG = 32;
11942    THREAD_SWAPPER = 33;
11943    THREAD_GAMEPAD_POLLING = 34;
11944    THREAD_WEBCRYPTO = 35;
11945    THREAD_DATABASE = 36;
11946    THREAD_PROXYRESOLVER = 37;
11947    THREAD_DEVTOOLSADB = 38;
11948    THREAD_NETWORKCONFIGWATCHER = 39;
11949    THREAD_WASAPI_RENDER = 40;
11950    THREAD_LOADER_LOCK_SAMPLER = 41;
11951
11952    THREAD_MEMORY_INFRA = 50;
11953    THREAD_SAMPLING_PROFILER = 51;
11954  };
11955
11956  optional ThreadType thread_type = 1;
11957
11958  // To support old UI. New UI should determine default sorting by thread_type.
11959  optional int32 legacy_sort_index = 2;
11960}
11961
11962// End of protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
11963
11964// Begin of protos/perfetto/trace/track_event/counter_descriptor.proto
11965
11966// Defines properties of a counter track, e.g. for built-in counters (thread
11967// time, instruction count, ..) or user-specified counters (e.g. memory usage of
11968// a specific app component).
11969//
11970// Counter tracks only support TYPE_COUNTER track events, which specify new
11971// values for the counter. For counters that require per-slice values, counter
11972// values can instead be provided in a more efficient encoding via TrackEvent's
11973// |extra_counter_track_uuids| and |extra_counter_values| fields. However,
11974// slice-type events cannot be emitted onto a counter track.
11975//
11976// Values for counters that are only emitted on a single packet sequence can
11977// optionally be delta-encoded, see |is_incremental|.
11978//
11979// Next id: 7.
11980message CounterDescriptor {
11981  // Built-in counters, usually with special meaning in the client library,
11982  // trace processor, legacy JSON format, or UI. Trace processor will infer a
11983  // track name from the enum value if none is provided in TrackDescriptor.
11984  enum BuiltinCounterType {
11985    COUNTER_UNSPECIFIED = 0;
11986
11987    // Thread-scoped counters. The thread's track should be specified via
11988    // |parent_uuid| in the TrackDescriptor for such a counter.
11989
11990    // implies UNIT_TIME_NS.
11991    COUNTER_THREAD_TIME_NS = 1;
11992
11993    // implies UNIT_COUNT.
11994    COUNTER_THREAD_INSTRUCTION_COUNT = 2;
11995  }
11996
11997  // Type of the values for the counters - to supply lower granularity units,
11998  // see also |unit_multiplier|.
11999  enum Unit {
12000    UNIT_UNSPECIFIED = 0;
12001    UNIT_TIME_NS = 1;
12002    UNIT_COUNT = 2;
12003    UNIT_SIZE_BYTES = 3;
12004    // TODO(eseckler): Support more units as necessary.
12005  }
12006
12007  // For built-in counters (e.g. thread time). Custom user-specified counters
12008  // (e.g. those emitted by TRACE_COUNTER macros of the client library)
12009  // shouldn't set this, and instead provide a counter name via TrackDescriptor.
12010  optional BuiltinCounterType type = 1;
12011
12012  // Names of categories of the counter (usually for user-specified counters).
12013  // In the client library, categories are a way to turn groups of individual
12014  // counters (or events) on or off.
12015  repeated string categories = 2;
12016
12017  // Type of the counter's values. Built-in counters imply a value for this
12018  // field.
12019  optional Unit unit = 3;
12020
12021  // In order to use a unit not defined as a part of |Unit|, a free-form unit
12022  // name can be used instead.
12023  optional string unit_name = 6;
12024
12025  // Multiplication factor of this counter's values, e.g. to supply
12026  // COUNTER_THREAD_TIME_NS timestamps in microseconds instead.
12027  optional int64 unit_multiplier = 4;
12028
12029  // Whether values for this counter are provided as delta values. Only
12030  // supported for counters that are emitted on a single packet-sequence (e.g.
12031  // thread time). Counter values in subsequent packets on the current packet
12032  // sequence will be interpreted as delta values from the sequence's most
12033  // recent value for the counter. When incremental state is cleared, the
12034  // counter value is considered to be reset to 0. Thus, the first value after
12035  // incremental state is cleared is effectively an absolute value.
12036  optional bool is_incremental = 5;
12037
12038  // TODO(eseckler): Support arguments describing the counter (?).
12039  // repeated DebugAnnotation debug_annotations;
12040}
12041
12042// End of protos/perfetto/trace/track_event/counter_descriptor.proto
12043
12044// Begin of protos/perfetto/trace/track_event/track_descriptor.proto
12045
12046// Defines a track for TrackEvents. Slices and instant events on the same track
12047// will be nested based on their timestamps, see TrackEvent::Type.
12048//
12049// A TrackDescriptor only needs to be emitted by one trace writer / producer and
12050// is valid for the entirety of the trace. To ensure the descriptor isn't lost
12051// when the ring buffer wraps, it should be reemitted whenever incremental state
12052// is cleared.
12053//
12054// As a fallback, TrackEvents emitted without an explicit track association will
12055// be associated with an implicit trace-global track (uuid = 0), see also
12056// |TrackEvent::track_uuid|. It is possible but not necessary to emit a
12057// TrackDescriptor for this implicit track.
12058//
12059// Next id: 10.
12060message TrackDescriptor {
12061  // Unique ID that identifies this track. This ID is global to the whole trace.
12062  // Producers should ensure that it is unlikely to clash with IDs emitted by
12063  // other producers. A value of 0 denotes the implicit trace-global track.
12064  //
12065  // For example, legacy TRACE_EVENT macros may use a hash involving the async
12066  // event id + id_scope, pid, and/or tid to compute this ID.
12067  optional uint64 uuid = 1;
12068
12069  // A parent track reference can be used to describe relationships between
12070  // tracks. For example, to define an asynchronous track which is scoped to a
12071  // specific process, specify the uuid for that process's process track here.
12072  // Similarly, to associate a COUNTER_THREAD_TIME_NS counter track with a
12073  // thread, specify the uuid for that thread's thread track here.
12074  optional uint64 parent_uuid = 5;
12075
12076  // Name of the track. Optional - if unspecified, it may be derived from the
12077  // process/thread name (process/thread tracks), the first event's name (async
12078  // tracks), or counter name (counter tracks).
12079  optional string name = 2;
12080
12081  // Associate the track with a process, making it the process-global track.
12082  // There should only be one such track per process (usually for instant
12083  // events; trace processor uses this fact to detect pid reuse). If you need
12084  // more (e.g. for asynchronous events), create child tracks using parent_uuid.
12085  //
12086  // Trace processor will merge events on a process track with slice-type events
12087  // from other sources (e.g. ftrace) for the same process into a single
12088  // timeline view.
12089  optional ProcessDescriptor process = 3;
12090  optional ChromeProcessDescriptor chrome_process = 6;
12091
12092  // Associate the track with a thread, indicating that the track's events
12093  // describe synchronous code execution on the thread. There should only be one
12094  // such track per thread (trace processor uses this fact to detect tid reuse).
12095  //
12096  // Trace processor will merge events on a thread track with slice-type events
12097  // from other sources (e.g. ftrace) for the same thread into a single timeline
12098  // view.
12099  optional ThreadDescriptor thread = 4;
12100  optional ChromeThreadDescriptor chrome_thread = 7;
12101
12102  // Descriptor for a counter track. If set, the track will only support
12103  // TYPE_COUNTER TrackEvents (and values provided via TrackEvent's
12104  // |extra_counter_values|).
12105  optional CounterDescriptor counter = 8;
12106
12107  // If true, forces Trace Processor to use separate tracks for track events
12108  // and system events for the same thread.
12109  // Track events timestamps in Chrome have microsecond resolution, while
12110  // system events use nanoseconds. It results in broken event nesting when
12111  // track events and system events share a track.
12112  optional bool disallow_merging_with_system_tracks = 9;
12113}
12114
12115// End of protos/perfetto/trace/track_event/track_descriptor.proto
12116
12117// Begin of protos/perfetto/trace/translation/translation_table.proto
12118
12119// Translation rules for the trace processor.
12120// See the comments for each rule type for specific meaning.
12121message TranslationTable {
12122  oneof table {
12123    ChromeHistorgramTranslationTable chrome_histogram = 1;
12124    ChromeUserEventTranslationTable chrome_user_event = 2;
12125    ChromePerformanceMarkTranslationTable chrome_performance_mark = 3;
12126    SliceNameTranslationTable slice_name = 4;
12127  }
12128}
12129
12130// Chrome histogram sample hash -> name translation rules.
12131message ChromeHistorgramTranslationTable {
12132  map<uint64, string> hash_to_name = 1;
12133}
12134
12135// Chrome user event action hash -> name translation rules.
12136message ChromeUserEventTranslationTable {
12137  map<uint64, string> action_hash_to_name = 1;
12138}
12139
12140// Chrome performance mark translation rules.
12141message ChromePerformanceMarkTranslationTable {
12142  map<uint32, string> site_hash_to_name = 1;
12143  map<uint32, string> mark_hash_to_name = 2;
12144};
12145
12146// Raw -> deobfuscated slice name translation rules.
12147message SliceNameTranslationTable {
12148  map<string, string> raw_to_deobfuscated_name = 1;
12149};
12150
12151// End of protos/perfetto/trace/translation/translation_table.proto
12152
12153// Begin of protos/perfetto/trace/trigger.proto
12154
12155// When a TracingSession receives a trigger it records the boot time nanoseconds
12156// in the TracePacket's timestamp field as well as the name of the producer that
12157// triggered it. We emit this data so filtering can be done on triggers received
12158// in the trace.
12159message Trigger {
12160  // Name of the trigger which was received.
12161  optional string trigger_name = 1;
12162  // The actual producer that activated |trigger|.
12163  optional string producer_name = 2;
12164  // The verified UID of the producer.
12165  optional int32 trusted_producer_uid = 3;
12166}
12167
12168// End of protos/perfetto/trace/trigger.proto
12169
12170// Begin of protos/perfetto/trace/ui_state.proto
12171
12172// Common state for UIs visualizing Perfetto traces.
12173// This message can be appended as a TracePacket by UIs to save the
12174// visible state (e.g. scroll position/zoom state) for future opening
12175// of the trace.
12176// Design doc: go/trace-ui-state.
12177message UiState {
12178  // The start and end bounds of the viewport of the UI in nanoseconds.
12179  //
12180  // This is the absolute time associated to slices and other events in
12181  // trace processor tables (i.e. the |ts| column of most tables)
12182  optional int64 timeline_start_ts = 1;
12183  optional int64 timeline_end_ts = 2;
12184
12185  // Indicates that the given process should be highlighted by the UI.
12186  message HighlightProcess {
12187    oneof selector {
12188      // The pid of the process to highlight. This is useful for UIs to focus
12189      // on tracks of a particular process in the trace.
12190      //
12191      // If more than one process in a trace has the same pid, it is UI
12192      // implementation specific how the process to be focused will be
12193      // chosen.
12194      uint32 pid = 1;
12195
12196      // The command line of the process to highlight; for most Android apps,
12197      // this is the package name of the app. This is useful for UIs to focus
12198      // on a particular app in the trace.
12199      //
12200      // If more than one process hasthe same cmdline, it is UI implementation
12201      // specific how the process to be focused will be chosen.
12202      string cmdline = 2;
12203    }
12204  }
12205  optional HighlightProcess highlight_process = 3;
12206}
12207// End of protos/perfetto/trace/ui_state.proto
12208
12209// Begin of protos/perfetto/trace/trace_packet.proto
12210
12211// TracePacket is the root object of a Perfetto trace.
12212// A Perfetto trace is a linear sequence of TracePacket(s).
12213//
12214// The tracing service guarantees that all TracePacket(s) written by a given
12215// TraceWriter are seen in-order, without gaps or duplicates. If, for any
12216// reason, a TraceWriter sequence becomes invalid, no more packets are returned
12217// to the Consumer (or written into the trace file).
12218// TracePacket(s) written by different TraceWriter(s), hence even different
12219// data sources, can be seen in arbitrary order.
12220// The consumer can re-establish a total order, if interested, using the packet
12221// timestamps, after having synchronized the different clocks onto a global
12222// clock.
12223//
12224// The tracing service is agnostic of the content of TracePacket, with the
12225// exception of few fields (e.g.. trusted_*, trace_config) that are written by
12226// the service itself.
12227//
12228// See the [Buffers and Dataflow](/docs/concepts/buffers.md) doc for details.
12229//
12230// Next reserved id: 14 (up to 15).
12231// Next id: 93.
12232message TracePacket {
12233  // The timestamp of the TracePacket.
12234  // By default this timestamps refers to the trace clock (CLOCK_BOOTTIME on
12235  // Android). It can be overridden using a different timestamp_clock_id.
12236  // The clock domain definition in ClockSnapshot can also override:
12237  // - The unit (default: 1ns).
12238  // - The absolute vs delta encoding (default: absolute timestamp).
12239  optional uint64 timestamp = 8;
12240
12241  // Specifies the ID of the clock used for the TracePacket |timestamp|. Can be
12242  // one of the built-in types from ClockSnapshot::BuiltinClocks, or a
12243  // producer-defined clock id.
12244  // If unspecified and if no default per-sequence value has been provided via
12245  // TracePacketDefaults, it defaults to BuiltinClocks::BOOTTIME.
12246  optional uint32 timestamp_clock_id = 58;
12247
12248  oneof data {
12249    ProcessTree process_tree = 2;
12250    ProcessStats process_stats = 9;
12251    InodeFileMap inode_file_map = 4;
12252    ChromeEventBundle chrome_events = 5;
12253    ClockSnapshot clock_snapshot = 6;
12254    SysStats sys_stats = 7;
12255    TrackEvent track_event = 11;
12256
12257    // IDs up to 15 are reserved. They take only one byte to encode their
12258    // preamble so should be used for frequent events.
12259
12260    TraceUuid trace_uuid = 89;
12261    TraceConfig trace_config = 33;
12262    FtraceStats ftrace_stats = 34;
12263    TraceStats trace_stats = 35;
12264    ProfilePacket profile_packet = 37;
12265    StreamingAllocation streaming_allocation = 74;
12266    StreamingFree streaming_free = 75;
12267    BatteryCounters battery = 38;
12268    PowerRails power_rails = 40;
12269    AndroidLogPacket android_log = 39;
12270    SystemInfo system_info = 45;
12271    Trigger trigger = 46;
12272    PackagesList packages_list = 47;
12273    ChromeBenchmarkMetadata chrome_benchmark_metadata = 48;
12274    PerfettoMetatrace perfetto_metatrace = 49;
12275    ChromeMetadataPacket chrome_metadata = 51;
12276    GpuCounterEvent gpu_counter_event = 52;
12277    GpuRenderStageEvent gpu_render_stage_event = 53;
12278    StreamingProfilePacket streaming_profile_packet = 54;
12279    HeapGraph heap_graph = 56;
12280    GraphicsFrameEvent graphics_frame_event = 57;
12281    VulkanMemoryEvent vulkan_memory_event = 62;
12282    GpuLog gpu_log = 63;
12283    VulkanApiEvent vulkan_api_event = 65;
12284    PerfSample perf_sample = 66;
12285    CpuInfo cpu_info = 67;
12286    SmapsPacket smaps_packet = 68;
12287    TracingServiceEvent service_event = 69;
12288    InitialDisplayState initial_display_state = 70;
12289    GpuMemTotalEvent gpu_mem_total_event = 71;
12290    MemoryTrackerSnapshot memory_tracker_snapshot = 73;
12291    FrameTimelineEvent frame_timeline_event = 76;
12292    AndroidEnergyEstimationBreakdown android_energy_estimation_breakdown = 77;
12293    UiState ui_state = 78;
12294    AndroidCameraFrameEvent android_camera_frame_event = 80;
12295    AndroidCameraSessionStats android_camera_session_stats = 81;
12296    TranslationTable translation_table = 82;
12297    AndroidGameInterventionList android_game_intervention_list = 83;
12298    StatsdAtom statsd_atom = 84;
12299    AndroidSystemProperty android_system_property = 86;
12300    EntityStateResidency entity_state_residency = 91;
12301
12302    // Only used in profile packets.
12303    ProfiledFrameSymbols profiled_frame_symbols = 55;
12304    ModuleSymbols module_symbols = 61;
12305    DeobfuscationMapping deobfuscation_mapping = 64;
12306
12307    // Only used by TrackEvent.
12308    TrackDescriptor track_descriptor = 60;
12309
12310    // Deprecated, use TrackDescriptor instead.
12311    ProcessDescriptor process_descriptor = 43;
12312
12313    // Deprecated, use TrackDescriptor instead.
12314    ThreadDescriptor thread_descriptor = 44;
12315
12316    // Events from the Linux kernel ftrace infrastructure.
12317    FtraceEventBundle ftrace_events = 1;
12318
12319    // This field is emitted at periodic intervals (~10s) and
12320    // contains always the binary representation of the UUID
12321    // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
12322    // efficiently partition long traces without having to fully parse them.
12323    bytes synchronization_marker = 36;
12324
12325    // Zero or more proto encoded trace packets compressed using deflate.
12326    // Each compressed_packets TracePacket (including the two field ids and
12327    // sizes) should be less than 512KB.
12328    bytes compressed_packets = 50;
12329
12330    // Data sources can extend the trace proto with custom extension protos (see
12331    // docs/design-docs/extensions.md). When they do that, the descriptor of
12332    // their extension proto descriptor is serialized in this packet. This
12333    // allows trace_processor to deserialize extended messages using reflection
12334    // even if the extension proto is not checked in the Perfetto repo.
12335    ExtensionDescriptor extension_descriptor = 72;
12336
12337    // Represents a single packet sent or received by the network.
12338    NetworkPacketEvent network_packet = 88;
12339
12340    // Represents one or more packets sent or received by the network.
12341    NetworkPacketBundle network_packet_bundle = 92;
12342
12343    // The "range of interest" for track events. See the message definition
12344    // comments for more details.
12345    TrackEventRangeOfInterest track_event_range_of_interest = 90;
12346
12347    // This field is only used for testing.
12348    // In previous versions of this proto this field had the id 268435455
12349    // This caused many problems:
12350    // - protozero decoder does not handle field ids larger than 999.
12351    // - old versions of protoc produce Java bindings with syntax errors when
12352    //   the field id is large enough.
12353    TestEvent for_testing = 900;
12354  }
12355
12356  // Trusted user id of the producer which generated this packet. Keep in sync
12357  // with TrustedPacket.trusted_uid.
12358  //
12359  // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
12360  // instead.
12361  oneof optional_trusted_uid { int32 trusted_uid = 3; };
12362
12363  // Service-assigned identifier of the packet sequence this packet belongs to.
12364  // Uniquely identifies a producer + writer pair within the tracing session. A
12365  // value of zero denotes an invalid ID. Keep in sync with
12366  // TrustedPacket.trusted_packet_sequence_id.
12367  oneof optional_trusted_packet_sequence_id {
12368    uint32 trusted_packet_sequence_id = 10;
12369  }
12370
12371  // Trusted process id of the producer which generated this packet, written by
12372  // the service.
12373  optional int32 trusted_pid = 79;
12374
12375  // Incrementally emitted interned data, valid only on the packet's sequence
12376  // (packets with the same |trusted_packet_sequence_id|). The writer will
12377  // usually emit new interned data in the same TracePacket that first refers to
12378  // it (since the last reset of interning state). It may also be emitted
12379  // proactively in advance of referring to them in later packets.
12380  optional InternedData interned_data = 12;
12381
12382  enum SequenceFlags {
12383    SEQ_UNSPECIFIED = 0;
12384
12385    // Set by the writer to indicate that it will re-emit any incremental data
12386    // for the packet's sequence before referring to it again. This includes
12387    // interned data as well as periodically emitted data like
12388    // Process/ThreadDescriptors. This flag only affects the current packet
12389    // sequence (see |trusted_packet_sequence_id|).
12390    //
12391    // When set, this TracePacket and subsequent TracePackets on the same
12392    // sequence will not refer to any incremental data emitted before this
12393    // TracePacket. For example, previously emitted interned data will be
12394    // re-emitted if it is referred to again.
12395    //
12396    // When the reader detects packet loss (|previous_packet_dropped|), it needs
12397    // to skip packets in the sequence until the next one with this flag set, to
12398    // ensure intact incremental data.
12399    SEQ_INCREMENTAL_STATE_CLEARED = 1;
12400
12401    // This packet requires incremental state, such as TracePacketDefaults or
12402    // InternedData, to be parsed correctly. The trace reader should skip this
12403    // packet if incremental state is not valid on this sequence, i.e. if no
12404    // packet with the SEQ_INCREMENTAL_STATE_CLEARED flag has been seen on the
12405    // current |trusted_packet_sequence_id|.
12406    SEQ_NEEDS_INCREMENTAL_STATE = 2;
12407  };
12408  optional uint32 sequence_flags = 13;
12409
12410  // DEPRECATED. Moved to SequenceFlags::SEQ_INCREMENTAL_STATE_CLEARED.
12411  optional bool incremental_state_cleared = 41;
12412
12413  // Default values for fields of later TracePackets emitted on this packet's
12414  // sequence (TracePackets with the same |trusted_packet_sequence_id|).
12415  // It must be reemitted when incremental state is cleared (see
12416  // |incremental_state_cleared|).
12417  // Requires that any future packet emitted on the same sequence specifies
12418  // the SEQ_NEEDS_INCREMENTAL_STATE flag.
12419  // TracePacketDefaults always override the global defaults for any future
12420  // packet on this sequence (regardless of SEQ_NEEDS_INCREMENTAL_STATE).
12421  optional TracePacketDefaults trace_packet_defaults = 59;
12422
12423  // Flag set by the service if, for the current packet sequence (see
12424  // |trusted_packet_sequence_id|), either:
12425  // * this is the first packet, or
12426  // * one or multiple packets were dropped since the last packet that the
12427  //   consumer read from the sequence. This can happen if chunks in the trace
12428  //   buffer are overridden before the consumer could read them when the trace
12429  //   is configured in ring buffer mode.
12430  //
12431  // When packet loss occurs, incrementally emitted data (including interned
12432  // data) on the sequence should be considered invalid up until the next packet
12433  // with SEQ_INCREMENTAL_STATE_CLEARED set.
12434  optional bool previous_packet_dropped = 42;
12435
12436  // Flag set by a producer (starting from SDK v29) if, for the current packet
12437  // sequence (see |trusted_packet_sequence_id|), this is the first packet.
12438  //
12439  // This flag can be used for distinguishing the two situations when
12440  // processing the trace:
12441  // 1. There are no prior events for the sequence because of data loss, e.g.
12442  //    due to ring buffer wrapping.
12443  // 2. There are no prior events for the sequence because it didn't start
12444  //    before this packet (= there's definitely no preceeding data loss).
12445  //
12446  // Given that older SDK versions do not support this flag, this flag not
12447  // being present for a particular sequence does not necessarily imply data
12448  // loss.
12449  optional bool first_packet_on_sequence = 87;
12450}
12451
12452// End of protos/perfetto/trace/trace_packet.proto
12453
12454// Begin of protos/perfetto/trace/trace.proto
12455
12456message Trace {
12457  repeated TracePacket packet = 1;
12458
12459  // Do NOT add any other field here. This is just a convenience wrapper for
12460  // the use case of a trace being saved to a file. There are other cases
12461  // (streaming) where TracePacket are directly streamed without being wrapped
12462  // in a Trace proto. Nothing should ever rely on the full trace, all the
12463  // logic should be based on TracePacket(s).
12464}
12465
12466// End of protos/perfetto/trace/trace.proto
12467