// copied from: https://github.com/google/perfetto/blob/main/protos/perfetto/trace/perfetto_trace.proto
// AUTOGENERATED - DO NOT EDIT
// ---------------------------
// This file has been generated by
// AOSP://external/perfetto/tools/gen_merged_protos
// merging the perfetto config protos.
// This fused proto is intended to be copied in:
//  - Android tree, for statsd.
//  - Google internal repos.

syntax = "proto2";

package perfetto.protos;

option go_package = "github.com/google/perfetto/perfetto_proto";

// Begin of protos/perfetto/common/ftrace_descriptor.proto

message FtraceDescriptor {
  message AtraceCategory {
    optional string name = 1;
    optional string description = 2;
  }

  // Report the available atrace categories.
  //
  // Used by Traceur via `perfetto --query`.
  repeated AtraceCategory atrace_categories = 1;
}

// End of protos/perfetto/common/ftrace_descriptor.proto

// Begin of protos/perfetto/common/gpu_counter_descriptor.proto

// Description of GPU counters.
// This message is sent by a GPU counter producer to specify the counters
// available in the hardware.
message GpuCounterDescriptor {
  // Logical groups for a counter.  This is used in the UI to present the
  // related counters together.
  enum GpuCounterGroup {
    UNCLASSIFIED = 0;
    SYSTEM = 1;
    VERTICES = 2;
    FRAGMENTS = 3;
    PRIMITIVES = 4;
    // Includes counters relating to caching and bandwidth.
    MEMORY = 5;
    COMPUTE = 6;
  }

  message GpuCounterSpec {
    optional uint32 counter_id = 1;
    optional string name = 2;
    optional string description = 3;
    // MeasureUnit unit (deprecated)
    reserved 4;
    oneof peak_value {
      int64 int_peak_value = 5;
      double double_peak_value = 6;
    }
    repeated MeasureUnit numerator_units = 7;
    repeated MeasureUnit denominator_units = 8;
    optional bool select_by_default = 9;
    repeated GpuCounterGroup groups = 10;
  }
  repeated GpuCounterSpec specs = 1;

  // Allow producer to group counters into block to represent counter islands.
  // A capacity may be specified to indicate the number of counters that can be
  // enable simultaneously in that block.
  message GpuCounterBlock {
    // required. Unique ID for the counter group.
    optional uint32 block_id = 1;
    // optional. Number of counters supported by the block. No limit if unset.
    optional uint32 block_capacity = 2;
    // optional. Name of block.
    optional string name = 3;
    // optional. Description for the block.
    optional string description = 4;
    // list of counters that are part of the block.
    repeated uint32 counter_ids = 5;
  }
  repeated GpuCounterBlock blocks = 2;

  // optional.  Minimum sampling period supported by the producer in
  // nanoseconds.
  optional uint64 min_sampling_period_ns = 3;

  // optional.  Maximum sampling period supported by the producer in
  // nanoseconds.
  optional uint64 max_sampling_period_ns = 4;

  // optional.  The producer supports counter sampling by instrumenting the
  // command buffer.
  optional bool supports_instrumented_sampling = 5;

  // next id: 41
  enum MeasureUnit {
    NONE = 0;

    BIT = 1;
    KILOBIT = 2;
    MEGABIT = 3;
    GIGABIT = 4;
    TERABIT = 5;
    PETABIT = 6;

    BYTE = 7;
    KILOBYTE = 8;
    MEGABYTE = 9;
    GIGABYTE = 10;
    TERABYTE = 11;
    PETABYTE = 12;

    HERTZ = 13;
    KILOHERTZ = 14;
    MEGAHERTZ = 15;
    GIGAHERTZ = 16;
    TERAHERTZ = 17;
    PETAHERTZ = 18;

    NANOSECOND = 19;
    MICROSECOND = 20;
    MILLISECOND = 21;
    SECOND = 22;
    MINUTE = 23;
    HOUR = 24;

    VERTEX = 25;
    PIXEL = 26;
    TRIANGLE = 27;
    PRIMITIVE = 38;
    FRAGMENT = 39;

    MILLIWATT = 28;
    WATT = 29;
    KILOWATT = 30;

    JOULE = 31;
    VOLT = 32;
    AMPERE = 33;

    CELSIUS = 34;
    FAHRENHEIT = 35;
    KELVIN = 36;

    // Values should be out of 100.
    PERCENT = 37;

    INSTRUCTION = 40;
  }
}

// End of protos/perfetto/common/gpu_counter_descriptor.proto

// Begin of protos/perfetto/common/track_event_descriptor.proto

message TrackEventCategory {
  optional string name = 1;
  optional string description = 2;
  repeated string tags = 3;
}

message TrackEventDescriptor {
  repeated TrackEventCategory available_categories = 1;
}

// End of protos/perfetto/common/track_event_descriptor.proto

// Begin of protos/perfetto/common/data_source_descriptor.proto

// This message is sent from Producer(s) to the tracing Service when registering
// to advertise their capabilities. It describes the structure of tracing
// protos that will be produced by the data source and the supported filters.
message DataSourceDescriptor {
  // e.g., "linux.ftrace", "chromium.tracing"
  optional string name = 1;

  // When non-zero, this is a unique ID within the scope of the Producer for
  // this data source (it is NOT globally unique). This is useful to
  // differentiate between data sources with matching names when calling
  // UpdateDataSource(). This field has been introduced in November 2021
  // (v22, Android T) and is not supported on older versions.
  optional uint64 id = 7;

  // When true the data source is expected to ack the stop request through the
  // NotifyDataSourceStopped() IPC. This field has been introduced after
  // Android P in Jul 2018 and is not supported on older versions.
  optional bool will_notify_on_stop = 2;

  // When true the data source is expected to ack the start request through the
  // NotifyDataSourceStarted() IPC. This field has been introduced after
  // Android P in March 2019 and is not supported on older versions.
  optional bool will_notify_on_start = 3;

  // If true, opt into receiving the ClearIncrementalState() IPC. This should be
  // set if the data source writes packets that refer to previous trace
  // contents, and knows how to stop referring to the already-emitted data.
  optional bool handles_incremental_state_clear = 4;

  // If true, indicates that the data source does nothing upon Flush. This
  // allows the service to reduce the flush-related IPC traffic and better deal
  // with frozen producers (see go/perfetto-frozen). This is usually the case
  // for data sources like 'track_event' that don't have access to the various
  // thread task runners to post a flush task and rely purely on server-side
  // scraping.
  // Introduced in v39 / Android V.
  optional bool no_flush = 9;

  // Optional specification about available GPU counters.
  optional GpuCounterDescriptor gpu_counter_descriptor = 5 [lazy = true];

  optional TrackEventDescriptor track_event_descriptor = 6 [lazy = true];

  optional FtraceDescriptor ftrace_descriptor = 8 [lazy = true];
}

// End of protos/perfetto/common/data_source_descriptor.proto

// Begin of protos/perfetto/common/tracing_service_state.proto

// Reports the state of the tracing service. Used to gather details about the
// data sources connected.
// See ConsumerPort::QueryServiceState().
message TracingServiceState {
  // Describes a producer process.
  message Producer {
    // Unique ID of the producer (monotonic counter).
    optional int32 id = 1;

    // Typically matches the process name.
    optional string name = 2;

    // Unix pid of the remote process. Supported only on Linux-based systems.
    // Introduced in v24 / Android T.
    optional int32 pid = 5;

    // Unix uid of the remote process.
    optional int32 uid = 3;

    // The version of the client library used by the producer.
    // This is a human readable string with and its format varies depending on
    // the build system and the repo (standalone vs AOSP).
    // This is intended for human debugging only.
    optional string sdk_version = 4;

    // Returns true if the process appears to be frozen (Android only).
    // Introduced in Perfetto V49 / Android 24Q4.
    optional bool frozen = 6;
  }

  // Describes a data source registered by a producer. Data sources are listed
  // regardless of the fact that they are being used or not.
  message DataSource {
    // Descriptor passed by the data source when calling RegisterDataSource().
    optional DataSourceDescriptor ds_descriptor = 1;

    // ID of the producer, as per Producer.id.
    optional int32 producer_id = 2;
  }

  message TracingSession {
    // The TracingSessionID.
    optional uint64 id = 1;

    // The Unix uid of the consumer that started the session.
    // This is meaningful only if the caller is root. In all other cases only
    // tracing sessions that match the caller UID will be displayed.
    optional int32 consumer_uid = 2;

    // Internal state of the tracing session.
    // These strings are FYI only and subjected to change.
    optional string state = 3;

    // The unique_session_name as set in the trace config (might be empty).
    optional string unique_session_name = 4;

    // The number and size of each buffer.
    repeated uint32 buffer_size_kb = 5;

    // Duration, as specified in the TraceConfig.duration_ms.
    optional uint32 duration_ms = 6;

    // Number of data sources involved in the session.
    optional uint32 num_data_sources = 7;

    // Time when the session was started, in the CLOCK_REALTIME domain.
    // Available only on Linux-based systems.
    optional int64 start_realtime_ns = 8;

    // The fields below have been introduced in v42.

    // The bugreport_score, as set in TraceConfig.bugreport_score.
    optional int32 bugreport_score = 9;

    // As per TraceConfig.bugreport_filename.
    optional string bugreport_filename = 10;

    // If true, the session is in the STARTED state. If false the session is in
    // any other state (see `state` field).
    optional bool is_started = 11;
  }

  // Lists all the producers connected.
  repeated Producer producers = 1;

  // Lists the data sources available.
  repeated DataSource data_sources = 2;

  // Lists the tracing sessions active AND owned by a consumer that has the same
  // UID of the caller (or all of them if the caller is root).
  // Introduced in v24 / Android T.
  repeated TracingSession tracing_sessions = 6;

  // This is always set to true from v24 and beyond. This flag is only used to
  // tell the difference between: (1) talking to a recent service which happens
  // to have no tracing session active; (2) talking to an older version of the
  // service which will never report any tracing session.
  optional bool supports_tracing_sessions = 7;

  // Total number of tracing sessions.
  optional int32 num_sessions = 3;

  // Number of tracing sessions in the started state. Always <= num_sessions.
  optional int32 num_sessions_started = 4;

  // The version of traced (the same returned by `traced --version`).
  // This is a human readable string with and its format varies depending on
  // the build system and the repo (standalone vs AOSP).
  // This is intended for human debugging only.
  optional string tracing_service_version = 5;
}

// End of protos/perfetto/common/tracing_service_state.proto

// Begin of protos/perfetto/common/builtin_clock.proto

enum BuiltinClock {
  BUILTIN_CLOCK_UNKNOWN = 0;
  BUILTIN_CLOCK_REALTIME = 1;
  BUILTIN_CLOCK_REALTIME_COARSE = 2;
  BUILTIN_CLOCK_MONOTONIC = 3;
  BUILTIN_CLOCK_MONOTONIC_COARSE = 4;
  BUILTIN_CLOCK_MONOTONIC_RAW = 5;
  BUILTIN_CLOCK_BOOTTIME = 6;
  BUILTIN_CLOCK_TSC = 9;
  BUILTIN_CLOCK_PERF = 10;
  BUILTIN_CLOCK_MAX_ID = 63;

  reserved 7, 8;
}

// End of protos/perfetto/common/builtin_clock.proto


// Begin of protos/perfetto/config/android/network_trace_config.proto

// Network tracing data source that records details on all packets sent or
// received by the network.
message NetworkPacketTraceConfig {
  // Polling frequency in milliseconds. Network tracing writes to a fixed size
  // ring buffer. The polling interval should be such that the ring buffer is
  // unlikely to fill in that interval (or that filling is an acceptable risk).
  // The minimum polling rate is 100ms (values below this are ignored).
  // Introduced in Android 14 (U).
  optional uint32 poll_ms = 1;

  // The aggregation_threshold is the number of packets at which an event will
  // switch from per-packet details to aggregate details. For example, a value
  // of 50 means that if a particular event (grouped by the unique combinations
  // of metadata fields: {interface, direction, uid, etc}) has fewer than 50
  // packets, the exact timestamp and length are recorded for each packet. If
  // there were 50 or more packets in an event, it would only record the total
  // duration, packets, and length. A value of zero or unspecified will always
  /// record per-packet details. A value of 1 always records aggregate details.
  optional uint32 aggregation_threshold = 2;

  // Specifies the maximum number of packet contexts to intern at a time. This
  // prevents the interning table from growing too large and controls whether
  // interning is enabled or disabled (a value of zero disables interning and
  // is the default). When a data sources interning table reaches this amount,
  // packet contexts will be inlined into NetworkPacketEvents.
  optional uint32 intern_limit = 3;

  // The following fields specify whether certain fields should be dropped from
  // the output. Dropping fields improves normalization results, reduces the
  // size of the interning table, and slightly reduces event size.
  optional bool drop_local_port = 4;
  optional bool drop_remote_port = 5;
  optional bool drop_tcp_flags = 6;
}

// End of protos/perfetto/config/android/network_trace_config.proto


// Begin of protos/perfetto/config/ftrace/ftrace_config.proto

// Next id: 31
message FtraceConfig {
  // Ftrace events to record, example: "sched/sched_switch".
  repeated string ftrace_events = 1;

  message KprobeEvent {
    enum KprobeType {
      KPROBE_TYPE_UNKNOWN = 0;
      KPROBE_TYPE_KPROBE = 1;
      KPROBE_TYPE_KRETPROBE = 2;
      KPROBE_TYPE_BOTH = 3;
    }
    // Kernel function name to attach to, for example "fuse_file_write_iter"
    optional string probe = 1;
    optional KprobeType type = 2;
  }

  // Ftrace events to record, specific for kprobes and kretprobes
  repeated KprobeEvent kprobe_events = 30;

  // Android-specific event categories:
  repeated string atrace_categories = 2;
  repeated string atrace_apps = 3;
  // Some processes can emit data through atrace or through the perfetto SDK via
  // the "track_event" data source. For these categories, the SDK will be
  // preferred, if possible, for this config.
  repeated string atrace_categories_prefer_sdk = 28;

  // Size of each per-cpu kernel ftrace ring buffer.
  // Not guaranteed if there are multiple concurrent tracing sessions, as the
  // buffers cannot be resized without pausing recording in the kernel.
  optional uint32 buffer_size_kb = 10;

  // If set, specifies how often the tracing daemon reads from the kernel ring
  // buffer. Not guaranteed if there are multiple concurrent tracing sessions.
  // Leave unset unless you're fine-tuning a local config.
  optional uint32 drain_period_ms = 11;

  // If set, the tracing daemon will read kernel ring buffers as soon as
  // they're filled past this percentage of occupancy. In other words, a value
  // of 50 means that a read pass is triggered as soon as any per-cpu buffer is
  // half-full. Not guaranteed if there are multiple concurrent tracing
  // sessions.
  // Currently does nothing on Linux kernels below v6.9.
  // Introduced in: perfetto v48.
  optional uint32 drain_buffer_percent = 29;

  // Configuration for compact encoding of scheduler events. When enabled (and
  // recording the relevant ftrace events), specific high-volume events are
  // encoded in a denser format than normal.
  message CompactSchedConfig {
    // If true, and sched_switch or sched_waking ftrace events are enabled,
    // record those events in the compact format.
    //
    // If the field is unset, the default is:
    // * perfetto v42.0+: enabled
    // * before: disabled
    optional bool enabled = 1;
  }
  optional CompactSchedConfig compact_sched = 12;

  // Optional filter for "ftrace/print" events.
  //
  // The filter consists of multiple rules. As soon as a rule matches (the rules
  // are processed in order), its `allow` field will be used as the outcome: if
  // `allow` is true, the event will be included in the trace, otherwise it will
  // be discarded. If an event does not match any rule, it will be allowed by
  // default (a rule with an empty prefix and allow=false, disallows everything
  // by default).
  message PrintFilter {
    message Rule {
      // Matches an atrace message of the form:
      // <type>|pid|<prefix>...
      message AtraceMessage {
        optional string type = 1;
        optional string prefix = 2;
      }
      oneof match {
        // This rule matches if `prefix` matches exactly with the beginning of
        // the "ftrace/print" "buf" field.
        string prefix = 1;
        // This rule matches if the "buf" field contains an atrace-style print
        // message as specified in `atrace_msg`.
        AtraceMessage atrace_msg = 3;
      }
      optional bool allow = 2;
    }
    repeated Rule rules = 1;
  }
  optional PrintFilter print_filter = 22;

  // Enables symbol name resolution against /proc/kallsyms.
  // It requires that either traced_probes is running as root or that
  // kptr_restrict has been manually lowered.
  // It does not disclose KASLR, symbol addresses are mangled.
  optional bool symbolize_ksyms = 13;

  // When symbolize_ksyms=true, determines whether the traced_probes daemon
  // should keep the symbol map in memory (and reuse it for future tracing
  // sessions) or clear it (saving memory) and re-create it on each tracing
  // session (wasting cpu and wall time).
  // The tradeoff is roughly:
  //  KSYMS_RETAIN: pay a fixed ~1.2 MB cost after the first trace.
  //  KSYMS_CLEANUP_ON_STOP: pay a ~300-500ms cost when starting each trace.
  // Default behavior: KSYMS_CLEANUP_ON_STOP.
  enum KsymsMemPolicy {
    KSYMS_UNSPECIFIED = 0;
    KSYMS_CLEANUP_ON_STOP = 1;
    KSYMS_RETAIN = 2;
  }
  optional KsymsMemPolicy ksyms_mem_policy = 17;

  // By default the kernel symbolizer is lazily initialized on a deferred task
  // to reduce ftrace's time-to-start-recording. Unfortunately that makes
  // ksyms integration tests hard. This flag forces the kernel symbolizer to be
  // initialized synchronously on the data source start and hence avoiding
  // timing races in tests.
  // DEPRECATED in v28 / Android U. This is now the default behavior, setting it
  // to true is a no-op.
  optional bool initialize_ksyms_synchronously_for_testing = 14
      [deprecated = true];

  // When this boolean is true AND the ftrace_events contains "kmem/rss_stat",
  // this option causes traced_probes to enable the "kmem/rss_stat_throttled"
  // event instead if present, and fall back to "kmem/rss_stat" if not present.
  // The historical context for this is the following:
  // - Up to Android S (12), the rss_stat was internally throttled in its
  //   kernel implementation.
  // - A change introduced in the kernels after S has introduced a new
  //   "rss_stat_throttled" making the original "rss_stat" event unthrottled
  //   (hence very spammy).
  // - Not all Android T/13 devices will receive a new kernel though, hence we
  //   need to deal with both cases.
  // For more context: go/rss-stat-throttled.
  optional bool throttle_rss_stat = 15;

  // If true, avoid enabling events that aren't statically known by
  // traced_probes. Otherwise, the default is to emit such events as
  // GenericFtraceEvent protos.
  // Prefer to keep this flag at its default. This was added for Android
  // tracing, where atrace categories and/or atrace HAL requested events can
  // expand to events that aren't of interest to the tracing user.
  // Introduced in: Android T.
  optional bool disable_generic_events = 16;

  // The subset of syscalls to record. To record all syscalls, leave this unset
  // and add "ftrace_events: raw_syscalls/sys_{enter,exit}" to the config.
  // * before perfetto v43, requires the config to also enable
  //   raw_syscalls/sys_{enter,exit}.
  // * perfetto v43+ does the right thing if you set only this field.
  // Example: ["sys_read", "sys_open"].
  // Introduced in: Android U.
  repeated string syscall_events = 18;

  // If true, enable the "function_graph" kernel tracer that emits events
  // whenever a kernel function is entered and exited
  // (funcgraph_entry/funcgraph_exit).
  // Notes on use:
  // * Requires |symbolize_ksyms| for function name resolution.
  // * Use |function_filters| or |function_graph_roots| to constrain the traced
  //   set of functions, otherwise the event bandwidth will be too high for
  //   practical use.
  // * The data source might be rejected if there is already a concurrent
  //   ftrace data source that does not use function graph itself, as we do not
  //   support switching kernel tracers mid-trace.
  // * Requires a kernel compiled with CONFIG_FUNCTION_GRAPH_TRACER. This is
  //   enabled if "cat /sys/kernel/tracing/available_tracers" includes
  //   "function_graph".
  // Android:
  // * Available only on debuggable builds.
  // * Introduced in: Android U.
  optional bool enable_function_graph = 19;

  // Constrains the set of functions traced when |enable_function_graph| is
  // true. Supports globs, e.g. "sched*". You can specify multiple filters,
  // in which case all matching functions will be traced. See kernel
  // documentation on ftrace "set_ftrace_filter" file for more details.
  // Android:
  // * Available only on debuggable builds.
  // * Introduced in: Android U.
  repeated string function_filters = 20;

  // If |enable_function_graph| is true, trace this set of functions *and* all
  // of its callees. Supports globs. Can be set together with
  // |function_filters|, in which case only callees matching the filter will be
  // traced. If setting both, you most likely want all roots to also be
  // included in |function_filters|.
  // Android:
  // * Available only on debuggable builds.
  // * Introduced in: Android U.
  repeated string function_graph_roots = 21;

  // If true, does not clear ftrace buffers before the start of the program.
  // This makes sense only if this is the first ftrace data source instance
  // created after the daemon has been started. Can be useful for gathering boot
  // traces, if ftrace has been separately configured (e.g. via kernel
  // commandline).
  optional bool preserve_ftrace_buffer = 23;

  // If true, overrides the default timestamp clock and uses a raw hardware
  // based monotonic clock for getting timestamps.
  // * Introduced in: Android U.
  optional bool use_monotonic_raw_clock = 24;

  // If |instance_name| is not empty, then attempt to use that tracefs instance
  // for event recording. Normally, this means
  // `/sys/kernel/tracing/instances/$instance_name`.
  //
  // The name "hyp" is reserved.
  //
  // The instance must already exist, the tracing daemon *will not* create it
  // for you as it typically doesn't have such permissions.
  // Only a subset of features is guaranteed to work with non-default instances,
  // at the time of writing:
  //  * ftrace_events
  //  * buffer_size_kb
  optional string instance_name = 25;

  // If true, |buffer_size_kb| is interpreted as a lower bound, allowing the
  // implementation to choose a bigger buffer size.
  //
  // Most configs for perfetto v43+ should simply leave both fields unset.
  //
  // If you need a config compatible with a range of perfetto builds and you
  // used to set a non-default buffer_size_kb, consider setting both fields.
  // Example:
  //   buffer_size_kb: 4096
  //   buffer_size_lower_bound: true
  // On older builds, the per-cpu buffers will be exactly 4 MB.
  // On v43+, buffers will be at least 4 MB.
  // In both cases, neither is guaranteed if there are other concurrent
  // perfetto ftrace sessions, as the buffers cannot be resized without pausing
  // the recording in the kernel.
  // Introduced in: perfetto v43.
  optional bool buffer_size_lower_bound = 27;

  // Previously drain_buffer_percent, perfetto v43-v47.
  reserved 26;
}

// End of protos/perfetto/config/ftrace/ftrace_config.proto

// Begin of protos/perfetto/config/gpu/gpu_counter_config.proto

message GpuCounterConfig {
  // Desired sampling interval for counters.
  optional uint64 counter_period_ns = 1;

  // List of counters to be sampled. Counter IDs correspond to the ones
  // described in GpuCounterSpec in the data source descriptor.
  repeated uint32 counter_ids = 2;

  // Sample counters by instrumenting command buffers.
  optional bool instrumented_sampling = 3;

  // Fix gpu clock rate during trace session.
  optional bool fix_gpu_clock = 4;
}

// End of protos/perfetto/config/gpu/gpu_counter_config.proto

// Begin of protos/perfetto/config/gpu/gpu_renderstages_config.proto

message GpuRenderStagesConfig {
  // Enable to separate the color and depth/stencil load and store stages
  // into a separate stages. If disabled, the depth/stencil load and store
  // stages will be combined.  Disabled by default. This option has no effect if
  // Low Overhead mode is enabled.
  optional bool full_loadstore = 1;

  // Use the low overhead mode for traces. In this mode render stages are
  // combined into a single workload stage. This provides less granular data but
  // induces minimal GPU overhead. Disabled by default.
  optional bool low_overhead = 2;

  // Trace metrics to capture for each render stage
  repeated string trace_metrics = 3;
}

// End of protos/perfetto/config/gpu/gpu_renderstages_config.proto

// Begin of protos/perfetto/config/gpu/vulkan_memory_config.proto

message VulkanMemoryConfig {
  // Tracking driver memory usage events
  optional bool track_driver_memory_usage = 1;

  // Tracking device memory usage events
  optional bool track_device_memory_usage = 2;
}

// End of protos/perfetto/config/gpu/vulkan_memory_config.proto

// Begin of protos/perfetto/config/inode_file/inode_file_config.proto

message InodeFileConfig {
  message MountPointMappingEntry {
    optional string mountpoint = 1;
    repeated string scan_roots = 2;
  }

  // How long to pause between batches.
  optional uint32 scan_interval_ms = 1;

  // How long to wait before the first scan in order to accumulate inodes.
  optional uint32 scan_delay_ms = 2;

  // How many inodes to scan in one batch.
  optional uint32 scan_batch_size = 3;

  // Do not scan for inodes not found in the static map.
  optional bool do_not_scan = 4;

  // If non-empty, only scan inodes corresponding to block devices named in
  // this list.
  repeated string scan_mount_points = 5;

  // When encountering an inode belonging to a block device corresponding
  // to one of the mount points in this map, scan its scan_roots instead.
  repeated MountPointMappingEntry mount_point_mapping = 6;
}

// End of protos/perfetto/config/inode_file/inode_file_config.proto

// Begin of protos/perfetto/config/interceptors/console_config.proto

message ConsoleConfig {
  enum Output {
    OUTPUT_UNSPECIFIED = 0;
    OUTPUT_STDOUT = 1;
    OUTPUT_STDERR = 2;
  }
  optional Output output = 1;
  optional bool enable_colors = 2;
}

// End of protos/perfetto/config/interceptors/console_config.proto

// Begin of protos/perfetto/config/interceptor_config.proto

// Configuration for trace packet interception. Used for diverting trace data to
// non-Perfetto sources (e.g., logging to the console, ETW) when using the
// Perfetto SDK.
message InterceptorConfig {
  // Matches the name given to RegisterInterceptor().
  optional string name = 1;

  optional ConsoleConfig console_config = 100;
}

// End of protos/perfetto/config/interceptor_config.proto

// Begin of protos/perfetto/config/power/android_power_config.proto

message AndroidPowerConfig {
  enum BatteryCounters {
    BATTERY_COUNTER_UNSPECIFIED = 0;

    // Coulomb counter.
    BATTERY_COUNTER_CHARGE = 1;

    // Charge (%).
    BATTERY_COUNTER_CAPACITY_PERCENT = 2;

    // Instantaneous current.
    BATTERY_COUNTER_CURRENT = 3;

    // Avg current.
    BATTERY_COUNTER_CURRENT_AVG = 4;

    // Instantaneous voltage.
    BATTERY_COUNTER_VOLTAGE = 5;
  }
  optional uint32 battery_poll_ms = 1;
  repeated BatteryCounters battery_counters = 2;

  // Where available enables per-power-rail measurements.
  optional bool collect_power_rails = 3;

  // Provides a breakdown of energy estimation for various subsystem (e.g. GPU).
  // Available from Android S.
  optional bool collect_energy_estimation_breakdown = 4;

  // Provides a breakdown of time in state for various subsystems.
  // Available from Android U.
  optional bool collect_entity_state_residency = 5;
}

// End of protos/perfetto/config/power/android_power_config.proto

// Begin of protos/perfetto/config/process_stats/process_stats_config.proto

message ProcessStatsConfig {
  enum Quirks {
    QUIRKS_UNSPECIFIED = 0;

    // This has been deprecated and ignored as per 2018-05-01. Full scan at
    // startup is now disabled by default and can be re-enabled using the
    // |scan_all_processes_on_start| arg.
    DISABLE_INITIAL_DUMP = 1 [deprecated = true];

    DISABLE_ON_DEMAND = 2;
  }
  repeated Quirks quirks = 1;

  // If enabled all processes will be scanned and dumped when the trace starts.
  optional bool scan_all_processes_on_start = 2;

  // If enabled thread names are also recoded (this is redundant if sched_switch
  // is enabled).
  optional bool record_thread_names = 3;

  // If > 0 samples counters (see process_stats.proto) from
  // /proc/pid/status and oom_score_adj every X ms.
  // It will also sample /proc/pid/smaps_rollup if scan_smaps_rollup = true.
  // This is required to be > 100ms to avoid excessive CPU usage.
  optional uint32 proc_stats_poll_ms = 4;

  // id 5 never used

  // This is required to be either = 0 or a multiple of |proc_stats_poll_ms|
  // (default: |proc_stats_poll_ms|). If = 0, will be set to
  // |proc_stats_poll_ms|. Non-multiples will be rounded down to the nearest
  // multiple.
  optional uint32 proc_stats_cache_ttl_ms = 6;

  // Niche feature: If true this will resolve file descriptors for each process
  // so these can be mapped to their actual device or file.
  // Requires raw_syscalls/sys_{enter,exit} ftrace events to be enabled or
  // new fds opened after initially scanning a process will not be
  // recognized.
  optional bool resolve_process_fds = 9;

  // If true, output will include memory stats from /proc/pid/smaps_rollup.
  optional bool scan_smaps_rollup = 10;

  // If true: process descriptions will include process age (starttime in
  // /proc/pid/stat).
  // Introduced in: perfetto v44.
  optional bool record_process_age = 11;

  // If true and |proc_stats_poll_ms| is true, process stats will include time
  // spent running in user/kernel mode (utime/stime in /proc/pid/stat).
  // Introduced in: perfetto v44.
  optional bool record_process_runtime = 12;

  // record_thread_time_in_state
  reserved 7;
  // thread_time_in_state_cache_size
  reserved 8;
}

// End of protos/perfetto/config/process_stats/process_stats_config.proto

// Begin of protos/perfetto/common/perf_events.proto

// Next id: 12
message PerfEvents {
  // What event to sample on, and how often. Commented from the perspective of
  // its use in |PerfEventConfig|.
  message Timebase {
    // How often the per-cpu sampling will occur. Not guaranteed to be honored
    // as the kernel can throttle the sampling rate if it's too high.
    // If unset, an implementation-defined default is used.
    oneof interval {
      // Per-cpu sampling frequency in Hz, as requested from the kernel. Not the
      // same as 1/period.
      // Details: the actual sampling will still be based on a period, but the
      // kernel will dynamically adjust it based on the observed event rate, to
      // approximate this frequency. Works best with steady-rate events like
      // timers.
      uint64 frequency = 2;

      // Per-cpu sampling will occur every |period| counts of |event|.
      // Prefer |frequency| by default, as it's easier to oversample with a
      // fixed period.
      uint64 period = 1;
    }

    // Counting event to use as a timebase for the sampling.
    // If unset, implies the CPU timer (SW_CPU_CLOCK) as the event,
    // which is what you usually want.
    // See common/perf_events.proto for the definitions.
    oneof event {
      Counter counter = 4;
      Tracepoint tracepoint = 3;
      RawEvent raw_event = 5;
    }

    // If set, samples will be timestamped with the given clock.
    // If unset, the clock is chosen by the implementation.
    // For software events, prefer PERF_CLOCK_BOOTTIME. However it cannot be
    // used for hardware events (due to interrupt safety), for which the
    // recommendation is to use one of the monotonic clocks.
    optional PerfClock timestamp_clock = 11;

    // Optional arbitrary name for the event, to identify it in the parsed
    // trace. Does *not* affect the profiling itself. If unset, the trace
    // parser will choose a suitable name.
    optional string name = 10;
  }

  // Builtin counter names from the uapi header. Commented with their perf tool
  // aliases.
  // TODO(rsavitski): consider generating enums for cache events (should be
  // finite), and generally make this list as extensive as possible. Excluding
  // things like dynamic PMUs since those don't fit into a static enum.
  // Next id: 21
  enum Counter {
    UNKNOWN_COUNTER = 0;

    // cpu-clock
    SW_CPU_CLOCK = 1;
    // page-faults, faults
    SW_PAGE_FAULTS = 2;
    // task-clock
    SW_TASK_CLOCK = 3;
    // context-switches, cs
    SW_CONTEXT_SWITCHES = 4;
    // cpu-migrations, migrations
    SW_CPU_MIGRATIONS = 5;
    // minor-faults
    SW_PAGE_FAULTS_MIN = 6;
    // major-faults
    SW_PAGE_FAULTS_MAJ = 7;
    // alignment-faults
    SW_ALIGNMENT_FAULTS = 8;
    // emulation-faults
    SW_EMULATION_FAULTS = 9;
    // dummy
    SW_DUMMY = 20;

    // cpu-cycles, cycles
    HW_CPU_CYCLES = 10;
    // instructions
    HW_INSTRUCTIONS = 11;
    // cache-references
    HW_CACHE_REFERENCES = 12;
    // cache-misses
    HW_CACHE_MISSES = 13;
    // branch-instructions, branches
    HW_BRANCH_INSTRUCTIONS = 14;
    // branch-misses
    HW_BRANCH_MISSES = 15;
    // bus-cycles
    HW_BUS_CYCLES = 16;
    // stalled-cycles-frontend, idle-cycles-frontend
    HW_STALLED_CYCLES_FRONTEND = 17;
    // stalled-cycles-backend, idle-cycles-backend
    HW_STALLED_CYCLES_BACKEND = 18;
    // ref-cycles
    HW_REF_CPU_CYCLES = 19;
  }

  message Tracepoint {
    // Group and name for the tracepoint, acceptable forms:
    // * "sched/sched_switch"
    // * "sched:sched_switch"
    optional string name = 1;

    // Optional field-level filter for the tracepoint. Only events matching this
    // filter will be counted (and therefore contribute to the sampling period).
    // Example: "prev_pid >= 42 && next_pid == 0".
    // For full syntax, see kernel documentation on "Event filtering":
    // https://www.kernel.org/doc/Documentation/trace/events.txt
    optional string filter = 2;
  }

  // Syscall-level description of the event, propagated to the perf_event_attr
  // struct. Primarily for local use-cases, since the event availability and
  // encoding is hardware-specific.
  message RawEvent {
    optional uint32 type = 1;
    optional uint64 config = 2;
    optional uint64 config1 = 3;
    optional uint64 config2 = 4;
  }

  // Subset of clocks that is supported by perf timestamping.
  // CLOCK_TAI is excluded since it's not expected to be used in practice, but
  // would require additions to the trace clock synchronisation logic.
  enum PerfClock {
    UNKNOWN_PERF_CLOCK = 0;
    PERF_CLOCK_REALTIME = 1;
    PERF_CLOCK_MONOTONIC = 2;
    PERF_CLOCK_MONOTONIC_RAW = 3;
    PERF_CLOCK_BOOTTIME = 4;
  }
}

// Additional events associated with a leader.
// Configuration is similar to Timebase event. Because data acquisition is
// driven by the leader there is no option to configure the clock or the
// frequency.
message FollowerEvent {
  oneof event {
    PerfEvents.Counter counter = 1;
    PerfEvents.Tracepoint tracepoint = 2;
    PerfEvents.RawEvent raw_event = 3;
  }
  optional string name = 4;
}

// End of protos/perfetto/common/perf_events.proto

// Begin of protos/perfetto/config/profiling/perf_event_config.proto

// Configuration for the traced_perf profiler.
//
// Example config for basic cpu profiling:
//   perf_event_config {
//     timebase {
//       frequency: 80
//     }
//     callstack_sampling {
//       scope {
//         target_cmdline: "surfaceflinger"
//         target_cmdline: "system_server"
//       }
//       kernel_frames: true
//     }
//   }
//
// Next id: 20
message PerfEventConfig {
  // What event to sample on, and how often.
  // Defined in common/perf_events.proto.
  optional PerfEvents.Timebase timebase = 15;

  // Other events associated with the leader described in the timebase.
  repeated FollowerEvent followers = 19;

  // If set, the profiler will sample userspace processes' callstacks at the
  // interval specified by the |timebase|.
  // If unset, the profiler will record only the event counts.
  optional CallstackSampling callstack_sampling = 16;

  //
  // Kernel <-> userspace ring buffer options:
  //

  // How often the per-cpu ring buffers are read by the producer.
  // If unset, an implementation-defined default is used.
  optional uint32 ring_buffer_read_period_ms = 8;

  // Size (in 4k pages) of each per-cpu ring buffer that is filled by the
  // kernel. If set, must be a power of two.
  // If unset, an implementation-defined default is used.
  optional uint32 ring_buffer_pages = 3;

  //
  // Daemon's resource usage limits:
  //

  // Drop samples if the heap memory held by the samples in the unwinder queue
  // is above the given limit. This counts the memory across all concurrent data
  // sources (not just this one's), and there is no fairness guarantee - the
  // whole quota might be used up by a concurrent source.
  optional uint64 max_enqueued_footprint_kb = 17;

  // Stop the data source if traced_perf's combined {RssAnon + Swap} memory
  // footprint exceeds this value.
  optional uint32 max_daemon_memory_kb = 13;

  //
  // Uncommon options:
  //

  // Timeout for the remote /proc/<pid>/{maps,mem} file descriptors for a
  // sampled process. This is primarily for Android, where this lookup is
  // asynchronous. As long as the producer is waiting, the associated samples
  // will be kept enqueued (putting pressure on the capacity of the shared
  // unwinding queue). Once a lookup for a process expires, all associated
  // samples are discarded. However, if the lookup still succeeds after the
  // timeout, future samples will be handled normally.
  // If unset, an implementation-defined default is used.
  optional uint32 remote_descriptor_timeout_ms = 9;

  // Optional period for clearing state cached by the unwinder. This is a heavy
  // operation that is only necessary for traces that target a wide set of
  // processes, and require the memory footprint to be reset periodically.
  // If unset, the cached state will not be cleared.
  optional uint32 unwind_state_clear_period_ms = 10;

  // If set, only profile target if it was installed by a package with one of
  // these names. Special values:
  // * "@system": installed on the system partition
  // * "@product": installed on the product partition
  // * "@null": sideloaded
  // Supported on Android 12+.
  repeated string target_installed_by = 18;

  //
  // Deprecated (superseded by options above):
  //
  // Do not set *any* of these fields in new configs.
  //

  // Note: legacy configs had to set |all_cpus| to true to pass parsing.
  // We rely on this to detect such configs.
  optional bool all_cpus = 1;
  optional uint32 sampling_frequency = 2;
  optional bool kernel_frames = 12;
  repeated int32 target_pid = 4;
  repeated string target_cmdline = 5;
  repeated int32 exclude_pid = 6;
  repeated string exclude_cmdline = 7;
  optional uint32 additional_cmdline_count = 11;
  // previously |tracepoint|
  reserved 14;

  //
  // Sub-messages (nested for generated code namespacing).
  //

  message CallstackSampling {
    // Defines a set of processes for which samples are retained/skipped. If
    // unset, all samples are kept, but beware that it will be very heavy on the
    // stack unwinder, which might start dropping samples due to overload.
    optional Scope scope = 1;

    // If true, callstacks will include the kernel-space frames. Such frames can
    // be identified by a magical "kernel" string as their mapping name.
    // Requires traced_perf to be running as root, or kptr_restrict to have been
    // manually unrestricted. On Android, the platform should do the right thing
    // on debug builds.
    // This does *not* disclose KASLR, as only the function names are emitted.
    optional bool kernel_frames = 2;

    // Whether to record and unwind userspace callstacks. If unset, defaults to
    // including userspace (UNWIND_DWARF) both for backwards compatibility and
    // as the most common default (this defaulting is only applicable if the
    // outer CallstackSampling message is explicitly set).
    optional UnwindMode user_frames = 3;
  }

  message Scope {
    // Process ID (TGID) allowlist. If this list is not empty, only matching
    // samples will be retained. If multiple allow/deny-lists are
    // specified by the config, then all of them are evaluated for each sampled
    // process.
    repeated int32 target_pid = 1;

    // Command line allowlist, matched against the /proc/<pid>/cmdline (not the
    // comm string). The semantics of this field were changed since its original
    // introduction.
    //
    // On Android T+ (13+), this field can specify a single wildcard (*), and
    // the profiler will attempt to match it in two possible ways:
    // * if the pattern starts with a '/', then it is matched against the first
    //   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
    //   "/bin/echo".
    // * otherwise the pattern is matched against the part of argv0
    //   corresponding to the binary name (this is unrelated to /proc/pid/exe).
    //   For example "echo" would match "/bin/echo".
    //
    // On Android S (12) and below, both this pattern and /proc/pid/cmdline get
    // normalized prior to an exact string comparison. Normalization is as
    // follows: (1) trim everything beyond the first null or "@" byte; (2) if
    // the string contains forward slashes, trim everything up to and including
    // the last one.
    //
    // Implementation note: in either case, at most 511 characters of cmdline
    // are considered.
    repeated string target_cmdline = 2;

    // List of excluded pids.
    repeated int32 exclude_pid = 3;

    // List of excluded cmdlines. See description of |target_cmdline| for how
    // this is handled.
    repeated string exclude_cmdline = 4;

    // Niche features for systemwide callstacks:

    // Number of additional command lines to sample. Only those which are
    // neither explicitly included nor excluded will be considered. Processes
    // are accepted on a first come, first served basis.
    optional uint32 additional_cmdline_count = 5;

    // If set to N, all encountered processes will be put into one of the N
    // possible bins, and only one randomly-chosen bin will be selected for
    // unwinding. The binning is simply "pid % N", under the assumption that
    // low-order bits of pids are roughly uniformly distributed. Other explicit
    // inclusions/exclusions in this |Scope| message are still respected.
    //
    // The profiler will report the chosen shard in PerfSampleDefaults, and the
    // values will be queryable in trace processor under the "stats" table as
    // "perf_process_shard_count" and "perf_chosen_process_shard".
    //
    // NB: all data sources in a config that set |process_shard_count| must set
    // it to the same value. The profiler will choose one bin for all those data
    // sources.
    optional uint32 process_shard_count = 6;
  }

  // Userspace unwinding mode. A possible future addition is kernel-unwound
  // callchains for frame pointer based systems.
  enum UnwindMode {
    UNWIND_UNKNOWN = 0;
    // Do not unwind userspace:
    UNWIND_SKIP = 1;
    // Use libunwindstack (default):
    UNWIND_DWARF = 2;
    // Use userspace frame pointer unwinder:
    UNWIND_FRAME_POINTER = 3;
  }
}

// End of protos/perfetto/config/profiling/perf_event_config.proto


// Begin of protos/perfetto/common/sys_stats_counters.proto

// When editing entries here remember also to update "sys_stats_counters.h" with
// the corresponding string definitions for the actual /proc files parser.

// Counter definitions for Linux's /proc/meminfo.
enum MeminfoCounters {
  MEMINFO_UNSPECIFIED = 0;
  MEMINFO_MEM_TOTAL = 1;
  MEMINFO_MEM_FREE = 2;
  MEMINFO_MEM_AVAILABLE = 3;
  MEMINFO_BUFFERS = 4;
  MEMINFO_CACHED = 5;
  MEMINFO_SWAP_CACHED = 6;
  MEMINFO_ACTIVE = 7;
  MEMINFO_INACTIVE = 8;
  MEMINFO_ACTIVE_ANON = 9;
  MEMINFO_INACTIVE_ANON = 10;
  MEMINFO_ACTIVE_FILE = 11;
  MEMINFO_INACTIVE_FILE = 12;
  MEMINFO_UNEVICTABLE = 13;
  MEMINFO_MLOCKED = 14;
  MEMINFO_SWAP_TOTAL = 15;
  MEMINFO_SWAP_FREE = 16;
  MEMINFO_DIRTY = 17;
  MEMINFO_WRITEBACK = 18;
  MEMINFO_ANON_PAGES = 19;
  MEMINFO_MAPPED = 20;
  MEMINFO_SHMEM = 21;
  MEMINFO_SLAB = 22;
  MEMINFO_SLAB_RECLAIMABLE = 23;
  MEMINFO_SLAB_UNRECLAIMABLE = 24;
  MEMINFO_KERNEL_STACK = 25;
  MEMINFO_PAGE_TABLES = 26;
  MEMINFO_COMMIT_LIMIT = 27;
  MEMINFO_COMMITED_AS = 28;
  MEMINFO_VMALLOC_TOTAL = 29;
  MEMINFO_VMALLOC_USED = 30;
  MEMINFO_VMALLOC_CHUNK = 31;
  MEMINFO_CMA_TOTAL = 32;
  MEMINFO_CMA_FREE = 33;
  MEMINFO_GPU = 34;
  MEMINFO_ZRAM = 35;
  MEMINFO_MISC = 36;
  MEMINFO_ION_HEAP = 37;
  MEMINFO_ION_HEAP_POOL = 38;
}

// Counter definitions for Linux's /proc/vmstat.
enum VmstatCounters {
  VMSTAT_UNSPECIFIED = 0;
  VMSTAT_NR_FREE_PAGES = 1;
  VMSTAT_NR_ALLOC_BATCH = 2;
  VMSTAT_NR_INACTIVE_ANON = 3;
  VMSTAT_NR_ACTIVE_ANON = 4;
  VMSTAT_NR_INACTIVE_FILE = 5;
  VMSTAT_NR_ACTIVE_FILE = 6;
  VMSTAT_NR_UNEVICTABLE = 7;
  VMSTAT_NR_MLOCK = 8;
  VMSTAT_NR_ANON_PAGES = 9;
  VMSTAT_NR_MAPPED = 10;
  VMSTAT_NR_FILE_PAGES = 11;
  VMSTAT_NR_DIRTY = 12;
  VMSTAT_NR_WRITEBACK = 13;
  VMSTAT_NR_SLAB_RECLAIMABLE = 14;
  VMSTAT_NR_SLAB_UNRECLAIMABLE = 15;
  VMSTAT_NR_PAGE_TABLE_PAGES = 16;
  VMSTAT_NR_KERNEL_STACK = 17;
  VMSTAT_NR_OVERHEAD = 18;
  VMSTAT_NR_UNSTABLE = 19;
  VMSTAT_NR_BOUNCE = 20;
  VMSTAT_NR_VMSCAN_WRITE = 21;
  VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22;
  VMSTAT_NR_WRITEBACK_TEMP = 23;
  VMSTAT_NR_ISOLATED_ANON = 24;
  VMSTAT_NR_ISOLATED_FILE = 25;
  VMSTAT_NR_SHMEM = 26;
  VMSTAT_NR_DIRTIED = 27;
  VMSTAT_NR_WRITTEN = 28;
  VMSTAT_NR_PAGES_SCANNED = 29;
  VMSTAT_WORKINGSET_REFAULT = 30;
  VMSTAT_WORKINGSET_ACTIVATE = 31;
  VMSTAT_WORKINGSET_NODERECLAIM = 32;
  VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33;
  VMSTAT_NR_FREE_CMA = 34;
  VMSTAT_NR_SWAPCACHE = 35;
  VMSTAT_NR_DIRTY_THRESHOLD = 36;
  VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37;
  VMSTAT_PGPGIN = 38;
  VMSTAT_PGPGOUT = 39;
  VMSTAT_PGPGOUTCLEAN = 40;
  VMSTAT_PSWPIN = 41;
  VMSTAT_PSWPOUT = 42;
  VMSTAT_PGALLOC_DMA = 43;
  VMSTAT_PGALLOC_NORMAL = 44;
  VMSTAT_PGALLOC_MOVABLE = 45;
  VMSTAT_PGFREE = 46;
  VMSTAT_PGACTIVATE = 47;
  VMSTAT_PGDEACTIVATE = 48;
  VMSTAT_PGFAULT = 49;
  VMSTAT_PGMAJFAULT = 50;
  VMSTAT_PGREFILL_DMA = 51;
  VMSTAT_PGREFILL_NORMAL = 52;
  VMSTAT_PGREFILL_MOVABLE = 53;
  VMSTAT_PGSTEAL_KSWAPD_DMA = 54;
  VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55;
  VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56;
  VMSTAT_PGSTEAL_DIRECT_DMA = 57;
  VMSTAT_PGSTEAL_DIRECT_NORMAL = 58;
  VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59;
  VMSTAT_PGSCAN_KSWAPD_DMA = 60;
  VMSTAT_PGSCAN_KSWAPD_NORMAL = 61;
  VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62;
  VMSTAT_PGSCAN_DIRECT_DMA = 63;
  VMSTAT_PGSCAN_DIRECT_NORMAL = 64;
  VMSTAT_PGSCAN_DIRECT_MOVABLE = 65;
  VMSTAT_PGSCAN_DIRECT_THROTTLE = 66;
  VMSTAT_PGINODESTEAL = 67;
  VMSTAT_SLABS_SCANNED = 68;
  VMSTAT_KSWAPD_INODESTEAL = 69;
  VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70;
  VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71;
  VMSTAT_PAGEOUTRUN = 72;
  VMSTAT_ALLOCSTALL = 73;
  VMSTAT_PGROTATED = 74;
  VMSTAT_DROP_PAGECACHE = 75;
  VMSTAT_DROP_SLAB = 76;
  VMSTAT_PGMIGRATE_SUCCESS = 77;
  VMSTAT_PGMIGRATE_FAIL = 78;
  VMSTAT_COMPACT_MIGRATE_SCANNED = 79;
  VMSTAT_COMPACT_FREE_SCANNED = 80;
  VMSTAT_COMPACT_ISOLATED = 81;
  VMSTAT_COMPACT_STALL = 82;
  VMSTAT_COMPACT_FAIL = 83;
  VMSTAT_COMPACT_SUCCESS = 84;
  VMSTAT_COMPACT_DAEMON_WAKE = 85;
  VMSTAT_UNEVICTABLE_PGS_CULLED = 86;
  VMSTAT_UNEVICTABLE_PGS_SCANNED = 87;
  VMSTAT_UNEVICTABLE_PGS_RESCUED = 88;
  VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89;
  VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90;
  VMSTAT_UNEVICTABLE_PGS_CLEARED = 91;
  VMSTAT_UNEVICTABLE_PGS_STRANDED = 92;
  VMSTAT_NR_ZSPAGES = 93;
  VMSTAT_NR_ION_HEAP = 94;
  VMSTAT_NR_GPU_HEAP = 95;
  VMSTAT_ALLOCSTALL_DMA = 96;
  VMSTAT_ALLOCSTALL_MOVABLE = 97;
  VMSTAT_ALLOCSTALL_NORMAL = 98;
  VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99;
  VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100;
  VMSTAT_NR_FASTRPC = 101;
  VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102;
  VMSTAT_NR_ION_HEAP_POOL = 103;
  VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104;
  VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105;
  VMSTAT_NR_SHMEM_HUGEPAGES = 106;
  VMSTAT_NR_SHMEM_PMDMAPPED = 107;
  VMSTAT_NR_UNRECLAIMABLE_PAGES = 108;
  VMSTAT_NR_ZONE_ACTIVE_ANON = 109;
  VMSTAT_NR_ZONE_ACTIVE_FILE = 110;
  VMSTAT_NR_ZONE_INACTIVE_ANON = 111;
  VMSTAT_NR_ZONE_INACTIVE_FILE = 112;
  VMSTAT_NR_ZONE_UNEVICTABLE = 113;
  VMSTAT_NR_ZONE_WRITE_PENDING = 114;
  VMSTAT_OOM_KILL = 115;
  VMSTAT_PGLAZYFREE = 116;
  VMSTAT_PGLAZYFREED = 117;
  VMSTAT_PGREFILL = 118;
  VMSTAT_PGSCAN_DIRECT = 119;
  VMSTAT_PGSCAN_KSWAPD = 120;
  VMSTAT_PGSKIP_DMA = 121;
  VMSTAT_PGSKIP_MOVABLE = 122;
  VMSTAT_PGSKIP_NORMAL = 123;
  VMSTAT_PGSTEAL_DIRECT = 124;
  VMSTAT_PGSTEAL_KSWAPD = 125;
  VMSTAT_SWAP_RA = 126;
  VMSTAT_SWAP_RA_HIT = 127;
  VMSTAT_WORKINGSET_RESTORE = 128;
  VMSTAT_ALLOCSTALL_DEVICE = 129;
  VMSTAT_ALLOCSTALL_DMA32 = 130;
  VMSTAT_BALLOON_DEFLATE = 131;
  VMSTAT_BALLOON_INFLATE = 132;
  VMSTAT_BALLOON_MIGRATE = 133;
  VMSTAT_CMA_ALLOC_FAIL = 134;
  VMSTAT_CMA_ALLOC_SUCCESS = 135;
  VMSTAT_NR_FILE_HUGEPAGES = 136;
  VMSTAT_NR_FILE_PMDMAPPED = 137;
  VMSTAT_NR_FOLL_PIN_ACQUIRED = 138;
  VMSTAT_NR_FOLL_PIN_RELEASED = 139;
  VMSTAT_NR_SEC_PAGE_TABLE_PAGES = 140;
  VMSTAT_NR_SHADOW_CALL_STACK = 141;
  VMSTAT_NR_SWAPCACHED = 142;
  VMSTAT_NR_THROTTLED_WRITTEN = 143;
  VMSTAT_PGALLOC_DEVICE = 144;
  VMSTAT_PGALLOC_DMA32 = 145;
  VMSTAT_PGDEMOTE_DIRECT = 146;
  VMSTAT_PGDEMOTE_KSWAPD = 147;
  VMSTAT_PGREUSE = 148;
  VMSTAT_PGSCAN_ANON = 149;
  VMSTAT_PGSCAN_FILE = 150;
  VMSTAT_PGSKIP_DEVICE = 151;
  VMSTAT_PGSKIP_DMA32 = 152;
  VMSTAT_PGSTEAL_ANON = 153;
  VMSTAT_PGSTEAL_FILE = 154;
  VMSTAT_THP_COLLAPSE_ALLOC = 155;
  VMSTAT_THP_COLLAPSE_ALLOC_FAILED = 156;
  VMSTAT_THP_DEFERRED_SPLIT_PAGE = 157;
  VMSTAT_THP_FAULT_ALLOC = 158;
  VMSTAT_THP_FAULT_FALLBACK = 159;
  VMSTAT_THP_FAULT_FALLBACK_CHARGE = 160;
  VMSTAT_THP_FILE_ALLOC = 161;
  VMSTAT_THP_FILE_FALLBACK = 162;
  VMSTAT_THP_FILE_FALLBACK_CHARGE = 163;
  VMSTAT_THP_FILE_MAPPED = 164;
  VMSTAT_THP_MIGRATION_FAIL = 165;
  VMSTAT_THP_MIGRATION_SPLIT = 166;
  VMSTAT_THP_MIGRATION_SUCCESS = 167;
  VMSTAT_THP_SCAN_EXCEED_NONE_PTE = 168;
  VMSTAT_THP_SCAN_EXCEED_SHARE_PTE = 169;
  VMSTAT_THP_SCAN_EXCEED_SWAP_PTE = 170;
  VMSTAT_THP_SPLIT_PAGE = 171;
  VMSTAT_THP_SPLIT_PAGE_FAILED = 172;
  VMSTAT_THP_SPLIT_PMD = 173;
  VMSTAT_THP_SWPOUT = 174;
  VMSTAT_THP_SWPOUT_FALLBACK = 175;
  VMSTAT_THP_ZERO_PAGE_ALLOC = 176;
  VMSTAT_THP_ZERO_PAGE_ALLOC_FAILED = 177;
  VMSTAT_VMA_LOCK_ABORT = 178;
  VMSTAT_VMA_LOCK_MISS = 179;
  VMSTAT_VMA_LOCK_RETRY = 180;
  VMSTAT_VMA_LOCK_SUCCESS = 181;
  VMSTAT_WORKINGSET_ACTIVATE_ANON = 182;
  VMSTAT_WORKINGSET_ACTIVATE_FILE = 183;
  VMSTAT_WORKINGSET_NODES = 184;
  VMSTAT_WORKINGSET_REFAULT_ANON = 185;
  VMSTAT_WORKINGSET_REFAULT_FILE = 186;
  VMSTAT_WORKINGSET_RESTORE_ANON = 187;
  VMSTAT_WORKINGSET_RESTORE_FILE = 188;
}

// End of protos/perfetto/common/sys_stats_counters.proto

// Begin of protos/perfetto/config/sys_stats/sys_stats_config.proto

// This file defines the configuration for the Linux /proc poller data source,
// which injects counters in the trace.
// Counters that are needed in the trace must be explicitly listed in the
// *_counters fields. This is to avoid spamming the trace with all counters
// at all times.
// The sampling rate is configurable. All polling rates (*_period_ms) need
// to be integer multiples of each other.
// OK:     [10ms, 10ms, 10ms],  [10ms, 20ms, 10ms],  [10ms, 20ms, 60ms]
// Not OK: [10ms, 10ms, 11ms],  [10ms, 15ms, 20ms]
message SysStatsConfig {
  // Polls /proc/meminfo every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  // Cost: 0.3 ms [read] + 0.07 ms [parse + trace injection]
  optional uint32 meminfo_period_ms = 1;

  // If empty all known counters are reported. Otherwise, only the counters
  // specified below are reported.
  repeated MeminfoCounters meminfo_counters = 2;

  // Polls /proc/vmstat every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  // Cost: 0.2 ms [read] + 0.3 ms [parse + trace injection]
  optional uint32 vmstat_period_ms = 3;
  repeated VmstatCounters vmstat_counters = 4;

  // Pols /proc/stat every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  // Cost: 4.1 ms [read] + 1.9 ms [parse + trace injection]
  optional uint32 stat_period_ms = 5;
  enum StatCounters {
    STAT_UNSPECIFIED = 0;
    STAT_CPU_TIMES = 1;
    STAT_IRQ_COUNTS = 2;
    STAT_SOFTIRQ_COUNTS = 3;
    STAT_FORK_COUNT = 4;
  }
  repeated StatCounters stat_counters = 6;

  // Polls /sys/devfreq/*/curfreq every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  // This option can be used to record unchanging values.
  // Updates from frequency changes can come from ftrace/set_clock_rate.
  optional uint32 devfreq_period_ms = 7;

  // Polls /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq every X ms.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 cpufreq_period_ms = 8;

  // Polls /proc/buddyinfo every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 buddyinfo_period_ms = 9;

  // Polls /proc/diskstats every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 diskstat_period_ms = 10;

  // Polls /proc/pressure/* every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 psi_period_ms = 11;

  // Polls /sys/class/thermal/* every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 thermal_period_ms = 12;

  // Polls /sys/devices/system/cpu/cpu*/cpuidle/state* every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 cpuidle_period_ms = 13;

  // Polls device-specific GPU frequency info every X ms, if non-zero.
  // This is required to be > 10ms to avoid excessive CPU usage.
  optional uint32 gpufreq_period_ms = 14;
}

// End of protos/perfetto/config/sys_stats/sys_stats_config.proto

// Begin of protos/perfetto/config/system_info/system_info.proto

// This data-source does a one-off recording of system information when
// the trace starts.
// Currently this includes:
// - Values of
// /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies This
// datasource has no configuration options at present.
message SystemInfoConfig {}

// End of protos/perfetto/config/system_info/system_info.proto

// Begin of protos/perfetto/config/test_config.proto

// The configuration for a fake producer used in tests.
message TestConfig {
  message DummyFields {
    optional uint32 field_uint32 = 1;
    optional int32 field_int32 = 2;
    optional uint64 field_uint64 = 3;
    optional int64 field_int64 = 4;
    optional fixed64 field_fixed64 = 5;
    optional sfixed64 field_sfixed64 = 6;
    optional fixed32 field_fixed32 = 7;
    optional sfixed32 field_sfixed32 = 8;
    optional double field_double = 9;
    optional float field_float = 10;
    optional sint64 field_sint64 = 11;
    optional sint32 field_sint32 = 12;
    optional string field_string = 13;
    optional bytes field_bytes = 14;
  }

  // The number of messages the fake producer should send.
  optional uint32 message_count = 1;

  // The maximum number of messages which should be sent each second.
  // The actual obserced speed may be lower if the producer is unable to
  // work fast enough.
  // If this is zero or unset, the producer will send as fast as possible.
  optional uint32 max_messages_per_second = 2;

  // The seed value for a simple multiplicative congruential pseudo-random
  // number sequence.
  optional uint32 seed = 3;

  // The size of each message in bytes. Should be greater than or equal 5 to
  // account for the number of bytes needed to encode the random number and a
  // null byte for the string.
  optional uint32 message_size = 4;

  // Whether the producer should send a event batch when the data source is
  // is initially registered.
  optional bool send_batch_on_register = 5;

  optional DummyFields dummy_fields = 6;
}

// End of protos/perfetto/config/test_config.proto

// Begin of protos/perfetto/config/track_event/track_event_config.proto

message TrackEventConfig {
  // The following fields define the set of enabled trace categories. Each list
  // item is a glob.
  //
  // To determine if category is enabled, it is checked against the filters in
  // the following order:
  //
  //   1. Exact matches in enabled categories.
  //   2. Exact matches in enabled tags.
  //   3. Exact matches in disabled categories.
  //   4. Exact matches in disabled tags.
  //   5. Pattern matches in enabled categories.
  //   6. Pattern matches in enabled tags.
  //   7. Pattern matches in disabled categories.
  //   8. Pattern matches in disabled tags.
  //
  // If none of the steps produced a match:
  //  - In the C++ SDK (`perfetto::Category`), categories are enabled by
  //  default.
  //  - In the C SDK (`PerfettoTeCategory`), categories are disabled by default.
  //
  // Examples:
  //
  //  - To enable all non-slow/debug categories:
  //
  //       enabled_categories: "*"
  //
  //  - To enable specific categories:
  //
  //       disabled_categories: "*"
  //       enabled_categories: "my_category"
  //       enabled_categories: "my_category2"
  //
  //  - To enable only categories with a specific tag:
  //
  //       disabled_tags: "*"
  //       enabled_tags: "my_tag"
  //

  // Default: []
  repeated string disabled_categories = 1;

  // Default: []
  repeated string enabled_categories = 2;

  // Default: ["slow", "debug"]
  repeated string disabled_tags = 3;

  // Default: []
  repeated string enabled_tags = 4;

  // Default: false (i.e. enabled by default)
  optional bool disable_incremental_timestamps = 5;

  // Allows to specify a custom unit different than the default (ns).
  // Also affects thread timestamps if enable_thread_time_sampling = true.
  // A multiplier of 1000 means that a timestamp = 3 should be interpreted as
  // 3000 ns = 3 us.
  // Default: 1 (if unset, it should be read as 1).
  optional uint64 timestamp_unit_multiplier = 6;

  // Default: false (i.e. debug_annotations is NOT filtered out by default)
  // When true, any debug annotations provided as arguments to the
  // TRACE_EVENT macros are not written into the trace. Typed arguments will
  // still be emitted even if set to true.
  optional bool filter_debug_annotations = 7;

  // Default : false (i.e. disabled)
  // When true, the SDK samples and emits the current thread time counter value
  // for each event on the current thread's track. This value represents the
  // total CPU time consumed by that thread since its creation. Note that if a
  // thread is not scheduled by OS for some duration, that time won't be
  // included in thread_time.
  // Learn more : "CLOCK_THREAD_CPUTIME_ID" flag at
  // https://linux.die.net/man/3/clock_gettime
  optional bool enable_thread_time_sampling = 8;

  // Default: false (i.e. dynamic event names are NOT filtered out by default)
  // When true, event_names wrapped in perfetto::DynamicString will be filtered
  // out.
  optional bool filter_dynamic_event_names = 9;
}

// End of protos/perfetto/config/track_event/track_event_config.proto


// Begin of protos/perfetto/config/trace_config.proto

// The overall config that is used when starting a new tracing session through
// ProducerPort::StartTracing().
// It contains the general config for the logging buffer(s) and the configs for
// all the data source being enabled.
//
// Next id: 40.
message TraceConfig {
  message BufferConfig {
    optional uint32 size_kb = 1;

    // |page_size|, now deprecated.
    reserved 2;

    // |optimize_for|, now deprecated.
    reserved 3;

    enum FillPolicy {
      UNSPECIFIED = 0;

      // Default behavior. The buffer operates as a conventional ring buffer.
      // If the writer is faster than the reader (or if the reader reads only
      // after tracing is stopped) newly written packets will overwrite old
      // packets.
      RING_BUFFER = 1;

      // Behaves like RING_BUFFER as long as there is space in the buffer or
      // the reader catches up with the writer. As soon as the writer hits
      // an unread chunk, it stops accepting new data in the buffer.
      DISCARD = 2;
    }
    optional FillPolicy fill_policy = 4;

    // When true the buffer is moved (rather than copied) onto the cloned
    // session, and an empty buffer of the same size is allocated in the source
    // tracing session. This feature will likely get deprecated in the future.
    // It been introduced mainly to support the surfaceflinger snapshot dump
    // for bugreports, where SF can dumps O(400MB) into the bugreport trace. In
    // that case we don't want to retain another in-memory copy of the buffer.
    optional bool transfer_on_clone = 5;

    // Used in conjunction with transfer_on_clone. When true the buffer is
    // cleared before issuing the Flush(reason=kTraceClone). This is to ensure
    // that if the data source took too long to write the data in a previous
    // clone-related flush, we don't end up with a mixture of leftovers from
    // the previous write and new data.
    optional bool clear_before_clone = 6;
  }
  repeated BufferConfig buffers = 1;

  message DataSource {
    // Filters and data-source specific config. It contains also the unique name
    // of the data source, the one passed in the  DataSourceDescriptor when they
    // register on the service.
    //optional protos.DataSourceConfig config = 1;

    // Optional. If multiple producers (~processes) expose the same data source
    // and either |producer_name_filter| or |producer_name_regex_filter| is set,
    // the data source is enabled only for producers whose names match any of
    // the filters.
    // |producer_name_filter| has to be an exact match, while
    // |producer_name_regex_filter| is a regular expression.
    // This allows to enable a data source only for specific processes.
    // The "repeated" fields have OR semantics: specifying a filter ["foo",
    // "bar"] will enable data sources on both "foo" and "bar" (if they exist).
    repeated string producer_name_filter = 2;
    repeated string producer_name_regex_filter = 3;
  }
  repeated DataSource data_sources = 2;

  // Config for disabling builtin data sources in the tracing service.
  message BuiltinDataSource {
    // Disable emitting clock timestamps into the trace.
    optional bool disable_clock_snapshotting = 1;

    // Disable echoing the original trace config in the trace.
    optional bool disable_trace_config = 2;

    // Disable emitting system info (build fingerprint, cpuinfo, etc).
    optional bool disable_system_info = 3;

    // Disable emitting events for data-source state changes (e.g. the marker
    // for all data sources having ACKed the start of the trace).
    optional bool disable_service_events = 4;

    // The authoritative clock domain for the trace. Defaults to BOOTTIME. See
    // also ClockSnapshot's primary_trace_clock. The configured value is written
    // into the trace as part of the ClockSnapshots emitted by the service.
    // Trace processor will attempt to translate packet/event timestamps from
    // various data sources (and their chosen clock domains) to this domain
    // during import. Added in Android R.
    optional BuiltinClock primary_trace_clock = 5;

    // Time interval in between snapshotting of sync markers, clock snapshots,
    // stats, and other periodic service-emitted events. Note that the service
    // only keeps track of the first and the most recent snapshot until
    // ReadBuffers() is called.
    optional uint32 snapshot_interval_ms = 6;

    // Hints to the service that a suspend-aware (i.e. counting time in suspend)
    // clock should be used for periodic snapshots of service-emitted events.
    // This means, if a snapshot *should* have happened during suspend, it will
    // happen immediately after the device resumes.
    //
    // Choosing a clock like this is done on best-effort basis; not all
    // platforms (e.g. Windows) expose a clock which can be used for periodic
    // tasks counting suspend. If such a clock is not available, the service
    // falls back to the best-available alternative.
    //
    // Introduced in Android S.
    // TODO(lalitm): deprecate this in T and make this the default if nothing
    // crashes in S.
    optional bool prefer_suspend_clock_for_snapshot = 7;

    // Disables the reporting of per-trace-writer histograms in TraceStats.
    optional bool disable_chunk_usage_histograms = 8;
  }
  optional BuiltinDataSource builtin_data_sources = 20;

  // If specified, the trace will be stopped |duration_ms| after starting.
  // This does *not* count the time the system is suspended, so we will run
  // for duration_ms of system activity, not wall time.
  //
  // However in case of traces with triggers, see
  // TriggerConfig.trigger_timeout_ms instead.
  optional uint32 duration_ms = 3;

  // If true, tries to use CLOCK_BOOTTIME for duration_ms rather than
  // CLOCK_MONOTONIC (which doesn't count time in suspend). Supported only on
  // Linux/Android, no-op on other platforms. This is used when dealing with
  // long (e.g. 24h) traces, where suspend can inflate them to weeks of
  // wall-time, making them more likely to hit device reboots (and hence loss).
  // This option also changes consistently the semantic of
  // TriggerConfig.stop_delay_ms.
  optional bool prefer_suspend_clock_for_duration = 36;

  // This is set when --dropbox is passed to the Perfetto command line client
  // and enables guardrails that limit resource usage for traces requested
  // by statsd.
  optional bool enable_extra_guardrails = 4;

  enum LockdownModeOperation {
    LOCKDOWN_UNCHANGED = 0;
    LOCKDOWN_CLEAR = 1;
    LOCKDOWN_SET = 2;
  }
  // Reject producers that are not running under the same UID as the tracing
  // service.
  optional LockdownModeOperation lockdown_mode = 5;

  message ProducerConfig {
    // Identifies the producer for which this config is for.
    optional string producer_name = 1;

    // Specifies the preferred size of the shared memory buffer. If the size is
    // larger than the max size, the max will be used. If it is smaller than
    // the page size or doesn't fit pages evenly into it, it will fall back to
    // the size specified by the producer or finally the default shared memory
    // size.
    optional uint32 shm_size_kb = 2;

    // Specifies the preferred size of each page in the shared memory buffer.
    // Must be an integer multiple of 4K.
    optional uint32 page_size_kb = 3;
  }

  repeated ProducerConfig producers = 6;

  // Contains statsd-specific metadata about an alert associated with the trace.
  message StatsdMetadata {
    // The identifier of the alert which triggered this trace.
    optional int64 triggering_alert_id = 1;
    // The uid which registered the triggering configuration with statsd.
    optional int32 triggering_config_uid = 2;
    // The identifier of the config which triggered the alert.
    optional int64 triggering_config_id = 3;
    // The identifier of the subscription which triggered this trace.
    optional int64 triggering_subscription_id = 4;
  }

  // Statsd-specific metadata.
  optional StatsdMetadata statsd_metadata = 7;

  // When true && |output_path| is empty, the EnableTracing() request must
  // provide a file descriptor. The service will then periodically read packets
  // out of the trace buffer and store it into the passed file.
  // If |output_path| is not empty no fd should be passed, the service
  // will create a new file and write into that (see comment below).
  optional bool write_into_file = 8;

  // This must point to a non-existing file. If the file exists the service
  // will NOT overwrite and will fail instead as a security precaution.
  // On Android, when this is used with the system traced, the path must be
  // within /data/misc/perfetto-traces/ or the trace will fail.
  // This option has been introduced in Android R. Before R write_into_file
  // can be used only with the "pass a file descriptor over IPC" mode.
  optional string output_path = 29;

  // Optional. If non-zero tunes the write period. A min value of 100ms is
  // enforced (i.e. smaller values are ignored).
  optional uint32 file_write_period_ms = 9;

  // Optional. When non zero the periodic write stops once at most X bytes
  // have been written into the file. Tracing is disabled when this limit is
  // reached, even if |duration_ms| has not been reached yet.
  optional uint64 max_file_size_bytes = 10;

  // Contains flags which override the default values of the guardrails inside
  // Perfetto.
  message GuardrailOverrides {
    // Override the default limit (in bytes) for uploading data to server within
    // a 24 hour period.
    // On R-, this override only affected userdebug builds. Since S, it also
    // affects user builds.
    // In 24Q3+ (V+), this override is a noop because upload guardrail logic
    // was removed from Perfetto.
    optional uint64 max_upload_per_day_bytes = 1 [deprecated = true];

    // Overrides the guardrail for maximum trace buffer size.
    // Available on U+
    optional uint32 max_tracing_buffer_size_kb = 2;
  }
  optional GuardrailOverrides guardrail_overrides = 11;

  // When true, data sources are not started until an explicit call to
  // StartTracing() on the consumer port. This is to support early
  // initialization and fast trace triggering. This can be used only when the
  // Consumer explicitly triggers the StartTracing() method.
  // This should not be used in a remote trace config via statsd, doing so will
  // result in a hung trace session.
  optional bool deferred_start = 12;

  // When set, it periodically issues a Flush() to all data source, forcing them
  // to commit their data into the tracing service. This can be used for
  // quasi-real-time streaming mode and to guarantee some partial ordering of
  // events in the trace in windows of X ms.
  optional uint32 flush_period_ms = 13;

  // Wait for this long for producers to acknowledge flush requests.
  // Default 5s.
  optional uint32 flush_timeout_ms = 14;

  // Wait for this long for producers to acknowledge stop requests.
  // Default 5s.
  optional uint32 data_source_stop_timeout_ms = 23;

  // |disable_clock_snapshotting| moved.
  reserved 15;

  // Android-only. If set, sends an intent to the Traceur system app when the
  // trace ends to notify it about the trace readiness.
  optional bool notify_traceur = 16;

  // This field was introduced in Android S.
  // Android-only. If set to a value > 0, marks the trace session as a candidate
  // for being attached to a bugreport. This field effectively acts as a z-index
  // for bugreports. When Android's dumpstate runs perfetto
  // --save-for-bugreport, traced will pick the tracing session with the highest
  // score (score <= 0 is ignored) and:
  // On Android S, T:  will steal its contents, save the trace into
  //     a known path and stop prematurely.
  // On Android U+: will create a read-only snapshot and save that into a known
  //     path, without stoppin the original tracing session.
  // When this field is set the tracing session becomes eligible to be cloned
  // by other UIDs.
  optional int32 bugreport_score = 30;

  // When set, defines name of the file that will be saved under
  // /data/misc/perfetto-traces/bugreport/ when using --save-all-for-bugreport.
  // If omitted, traces will be named systrace.pftrace, systrace_1.pftrace, etc,
  // starting from the highest `bugreport_score`.
  // Introduced in v42 / Android V.
  optional string bugreport_filename = 38;

  // Triggers allow producers to start or stop the tracing session when an event
  // occurs.
  //
  // For example if we are tracing probabilistically, most traces will be
  // uninteresting. Triggers allow us to keep only the interesting ones such as
  // those traces during which the device temperature reached a certain
  // threshold. In this case the producer can activate a trigger to keep
  // (STOP_TRACING) the trace, otherwise it can also begin a trace
  // (START_TRACING) because it knows something is about to happen.
  message TriggerConfig {
    enum TriggerMode {
      UNSPECIFIED = 0;

      // When this mode is chosen, data sources are not started until one of the
      // |triggers| are received. This supports early initialization and fast
      // starting of the tracing system. On triggering, the session will then
      // record for |stop_delay_ms|. However if no trigger is seen
      // after |trigger_timeout_ms| the session will be stopped and no data will
      // be returned.
      START_TRACING = 1;

      // When this mode is chosen, the session will be started via the normal
      // EnableTracing() & StartTracing(). If no trigger is ever seen
      // the session will be stopped after |trigger_timeout_ms| and no data will
      // be returned. However if triggered the trace will stop after
      // |stop_delay_ms| and any data in the buffer will be returned to the
      // consumer.
      STOP_TRACING = 2;

      // 3 was taken by CLONE_SNAPSHOT but that has been moved to 4.
      // The early implementation of CLONE_SNAPSHOT had various bugs
      // (b/290798988, b/290799105) and made it into Android U. The number
      // change is to make sure nobody rolls out a config that hits the broken
      // behaviour.
      reserved 3;

      // When this mode is chosen, this causes a snapshot of the current tracing
      // session to be created after |stop_delay_ms| while the current tracing
      // session continues undisturbed (% an extra flush). This mode can be
      // used only when the tracing session is handled by the "perfetto" cmdline
      // client (which is true in 90% of cases). Part of the business logic
      // necessary for this behavior, and ensuing file handling, lives in
      // perfetto_cmd.cc . On other consumers, this causes only a notification
      // of the trigger through a CloneTriggerHit ObservableEvent. The custom
      // consumer is supposed to call CloneSession() itself after the event.
      // Use use_clone_snapshot_if_available=true when targeting older versions
      // of perfetto.
      CLONE_SNAPSHOT = 4;

      // NOTE: CLONE_SNAPSHOT should be used only when we targeting Android V+
      // (15+) / Perfetto v38+. A bug in older versions of the tracing service
      // might cause indefinitely long tracing sessions (see b/274931668).
    }
    optional TriggerMode trigger_mode = 1;

    // This flag is really a workaround for b/274931668. This is needed only
    // when deploying configs to different versions of the tracing service.
    // When this is set to true this has the same effect of setting trigger_mode
    // to CLONE_SNAPSHOT on newer versions of the service. This boolean has been
    // introduced to allow to have configs that use CLONE_SNAPSHOT on newer
    // versions of Android and fall back to STOP_TRACING on older versions where
    // CLONE_SNAPSHOT did not exist.
    // When using this flag, trigger_mode must be set to STOP_TRACING.
    optional bool use_clone_snapshot_if_available = 5;

    // DEPRECATED, was use_clone_snapshot_if_available in U. See the comment
    // around CLONE_SNAPSHOT.
    reserved 4;

    message Trigger {
      // The producer must specify this name to activate the trigger.
      optional string name = 1;

      // An std::regex that will match the producer that can activate this
      // trigger. This is optional. If unset any producers can activate this
      // trigger.
      optional string producer_name_regex = 2;

      // After a trigger is received either in START_TRACING or STOP_TRACING
      // mode then the trace will end |stop_delay_ms| after triggering.
      // In CLONE_SNAPSHOT mode, this is the delay between the trigger and the
      // snapshot.
      // If |prefer_suspend_clock_for_duration| is set, the duration will be
      // based on wall-clock, counting also time in suspend.
      optional uint32 stop_delay_ms = 3;

      // Limits the number of traces this trigger can start/stop in a rolling
      // 24 hour window. If this field is unset or zero, no limit is applied and
      // activiation of this trigger *always* starts/stops the trace.
      optional uint32 max_per_24_h = 4;

      // A value between 0 and 1 which encodes the probability of skipping a
      // trigger with this name. This is useful for reducing the probability
      // of high-frequency triggers from dominating trace finaization. If this
      // field is unset or zero, the trigger will *never* be skipped. If this
      // field is greater than or equal to 1, this trigger will *always* be
      // skipped i.e. it will be as if this trigger was never included in the
      // first place.
      // This probability check is applied *before* any other limits. For
      // example, if |max_per_24_h| is also set, first we will check if the
      // probability bar is met and only then will we check the |max_per_24_h|
      // limit.
      optional double skip_probability = 5;
    }
    // A list of triggers which are related to this configuration. If ANY
    // trigger is seen then an action will be performed based on |trigger_mode|.
    repeated Trigger triggers = 2;

    // Required and must be positive if a TriggerConfig is specified. This is
    // how long this TraceConfig should wait for a trigger to arrive. After this
    // period of time if no trigger is seen the TracingSession will be cleaned
    // up.
    optional uint32 trigger_timeout_ms = 3;
  }
  optional TriggerConfig trigger_config = 17;

  // When this is non-empty the perfetto command line tool will ignore the rest
  // of this TraceConfig and instead connect to the perfetto service as a
  // producer and send these triggers, potentially stopping or starting traces
  // that were previous configured to use a TriggerConfig.
  repeated string activate_triggers = 18;

  // Configuration for trace contents that reference earlier trace data. For
  // example, a data source might intern strings, and emit packets containing
  // {interned id : string} pairs. Future packets from that data source can then
  // use the interned ids instead of duplicating the raw string contents. The
  // trace parser will then need to use that interning table to fully interpret
  // the rest of the trace.
  message IncrementalStateConfig {
    // If nonzero, notify eligible data sources to clear their incremental state
    // periodically, with the given period. The notification is sent only to
    // data sources that have |handles_incremental_state_clear| set in their
    // DataSourceDescriptor. The notification requests that the data source
    // stops referring to past trace contents. This is particularly useful when
    // tracing in ring buffer mode, where it is not exceptional to overwrite old
    // trace data.
    //
    // Warning: this time-based global clearing is likely to be removed in the
    // future, to be replaced with a smarter way of sending the notifications
    // only when necessary.
    optional uint32 clear_period_ms = 1;
  }
  optional IncrementalStateConfig incremental_state_config = 21;

  // No longer needed as we unconditionally allow tracing on user builds.
  optional bool allow_user_build_tracing = 19 [deprecated = true];

  // If set the tracing service will ensure there is at most one tracing session
  // with this key.
  optional string unique_session_name = 22;

  // Compress trace with the given method. Best effort.
  enum CompressionType {
    COMPRESSION_TYPE_UNSPECIFIED = 0;
    COMPRESSION_TYPE_DEFLATE = 1;
  }
  optional CompressionType compression_type = 24;

  // DEPRECATED, was compress_from_cli.
  reserved 37;

  // Android-only. Not for general use. If set, saves the trace into an
  // incident. This field is read by perfetto_cmd, rather than the tracing
  // service. This field must be set when passing the --upload flag to
  // perfetto_cmd.
  message IncidentReportConfig {
    // In this message, either:
    //  * all of |destination_package|, |destination_class| and |privacy_level|
    //    must be set.
    //  * |skip_incidentd| must be explicitly set to true.

    optional string destination_package = 1;
    optional string destination_class = 2;
    // Level of filtering in the requested incident. See |Destination| in
    // frameworks/base/core/proto/android/privacy.proto.
    optional int32 privacy_level = 3;

    // If true, then skips saving the trace to incidentd.
    //
    // This flag is useful in testing (e.g. Perfetto-statsd integration tests)
    // or when we explicitly don't want traces to go to incidentd even when they
    // usually would (e.g. configs deployed using statsd but only used for
    // inclusion in bugreports using |bugreport_score|).
    //
    // The motivation for having this flag, instead of just not setting
    // |incident_report_config|, is prevent accidents where
    // |incident_report_config| is omitted by mistake.
    optional bool skip_incidentd = 5;

    // If true, do not write the trace into dropbox (i.e. incident only).
    // Otherwise, write to both dropbox and incident.
    // TODO(lalitm): remove this field as we no longer use Dropbox.
    optional bool skip_dropbox = 4 [deprecated = true];
  }
  optional IncidentReportConfig incident_report_config = 25;

  enum StatsdLogging {
    STATSD_LOGGING_UNSPECIFIED = 0;
    STATSD_LOGGING_ENABLED = 1;
    STATSD_LOGGING_DISABLED = 2;
  }

  // Android-only. Not for general use. If specified, sets the logging to statsd
  // of guardrails and checkpoints in the tracing service. perfetto_cmd sets
  // this to enabled (if not explicitly set in the config) when specifying
  // --upload.
  optional StatsdLogging statsd_logging = 31;

  // DEPRECATED. Was trace_uuid, use trace_uuid_msb and trace_uuid_lsb instead.
  reserved 26;

  // An identifier clients can use to tie this trace to other logging.
  // DEPRECATED as per v32. See TracePacket.trace_uuid for the authoritative
  // Trace UUID. If this field is set, the tracing service will respect the
  // requested UUID (i.e. TracePacket.trace_uuid == this field) but only if
  // gap-less snapshotting is not used.
  optional int64 trace_uuid_msb = 27 [deprecated = true];
  optional int64 trace_uuid_lsb = 28 [deprecated = true];

  // When set applies a post-filter to the trace contents using the filter
  // provided. The filter is applied at ReadBuffers() time and works both in the
  // case of IPC readback and write_into_file. This filter can be generated
  // using `tools/proto_filter -s schema.proto -F filter_out.bytes` or
  // `-T filter_out.escaped_string` (for .pbtx). See go/trace-filtering for
  // design.
  //
  // Introduced in Android S, but it was broken (b/195065199). Reintroduced in
  // Android T with a different field number. Updated in Android U with a new
  // bytecode version which supports string filtering.
  message TraceFilter {
    // =========================
    // Filter bytecode.
    // =========================

    // The bytecode as implemented in Android T.
    optional bytes bytecode = 1;

    // The bytecode as implemented in Android U. Adds support for string
    // filtering.
    optional bytes bytecode_v2 = 2;

    // =========================
    // String filtering
    // =========================

    // The principles and terminology of string filtering is heavily inspired by
    // iptables. A "rule" decide how strings should be filtered. Each rule
    // contains a "policy" which indicates the algorithm to use for filtering.
    // A "chain" is a list of rules which will be sequentially checked against
    // each string.
    //
    // The first rule which applies to the string terminates filtering for that
    // string. If no rules apply, the string is left unchanged.

    // A policy specifies which algorithm should be used for filtering the
    // string.
    enum StringFilterPolicy {
      SFP_UNSPECIFIED = 0;

      // Tries to match the string field against |regex_pattern|. If it
      // matches, all matching groups are "redacted" (i.e. replaced with a
      // constant string) and filtering is terminated (i.e. no further rules are
      // checked). If it doesn't match, the string is left unchanged and the
      // next rule in chain is considered.
      SFP_MATCH_REDACT_GROUPS = 1;

      // Like |SFP_MATCH_REDACT_GROUPS| but tries to do some pre-work before
      // checking the regex. Specifically, it tries to parse the string field as
      // an atrace tracepoint and checks if the post-tgid field starts with
      // |atrace_post_tgid_starts_with|. The regex matching is only performed if
      // this check succeeds.
      SFP_ATRACE_MATCH_REDACT_GROUPS = 2;

      // Tries to match the string field against |regex_pattern|. If it
      // matches, filtering is terminated (i.e. no further rules are checked).
      // If it doesn't match, the string is left unchanged and the next rule in
      // chain is considered.
      SFP_MATCH_BREAK = 3;

      // Like |SFP_MATCH_BREAK| but tries to do some pre-work before checking
      // the regex. Specifically, it tries to parse the string field as an
      // atrace tracepoint and checks if the post-tgid field starts with
      // |atrace_post_tgid_starts_with|. The regex matching is only performed if
      // this check succeeds.
      SFP_ATRACE_MATCH_BREAK = 4;

      // Tries to repeatedly search (i.e. find substrings of) the string field
      // with |regex_pattern|. For each match, redacts any matching groups (i.e.
      // replaced with a constant string). Once there are no further matches,
      // filtering is terminated (i.e. no further rules are checked).
      //
      // Note that this is policy is a "search" policy not a "match" policy
      // unlike the above policies:
      //  * Match policies require matching the full string i.e. there is an
      //    implicit leading `^` and trailing `$`.
      //  * Search policies perform repeated partial matching of the string
      //    e.g.
      //      - String: `foo=aaa,bar=123,foo=bbb,baz=456`
      //      - Pattern: `foo=(\d+)`
      //      - Output: `foo=P6O,bar=123,foo=P6O,baz=456`
      //    where P6O is the redaction string
      //
      // All of this is only performed after some pre-work where we try to parse
      // the string field as an atrace tracepoint and check if the post-tgid
      // field starts with |atrace_post_tgid_starts_with|.
      //
      // If there are no partial matches, the string is left unchanged and the
      // next rule in chain is considered.
      SFP_ATRACE_REPEATED_SEARCH_REDACT_GROUPS = 5;
    }

    // A rule specifies how strings should be filtered.
    message StringFilterRule {
      // The policy (i.e. algorithm) dictating how strings matching this rule
      // should be handled.
      optional StringFilterPolicy policy = 1;

      // The regex pattern used to match against each string.
      optional string regex_pattern = 2;

      // The string which should appear after the tgid in atrace tracepoint
      // strings.
      optional string atrace_payload_starts_with = 3;
    }

    // A chain is a list of rules which string will be sequentially checked
    // against.
    message StringFilterChain {
      repeated StringFilterRule rules = 1;
    }
    optional StringFilterChain string_filter_chain = 3;
  }
  // old field number for trace_filter
  reserved 32;
  optional TraceFilter trace_filter = 33;

  // Android-only. Not for general use. If set, reports the trace to the
  // Android framework. This field is read by perfetto_cmd, rather than the
  // tracing service. This field must be set when passing the --upload flag to
  // perfetto_cmd.
  message AndroidReportConfig {
    // In this message, either:
    //  * |reporter_service_package| and |reporter_service_class| must be set.
    //  * |skip_reporting| must be explicitly set to true.

    optional string reporter_service_package = 1;
    optional string reporter_service_class = 2;

    // If true, then skips reporting the trace to Android framework.
    //
    // This flag is useful in testing (e.g. Perfetto-statsd integration tests)
    // or when we explicitly don't want to report traces to the framework even
    // when they usually would (e.g. configs deployed using statsd but only
    // used for inclusion in bugreports using |bugreport_score|).
    //
    // The motivation for having this flag, instead of just not setting
    // |framework_report_config|, is prevent accidents where
    // |framework_report_config| is omitted by mistake.
    optional bool skip_report = 3;

    // If true, will direct the Android framework to read the data in trace
    // file and pass it to the reporter class over a pipe instead of passing
    // the file descriptor directly.
    //
    // This flag is needed because the Android test framework does not
    // currently support priv-app helper apps (in terms of SELinux) and we
    // really don't want to add an allow rule for untrusted_app to receive
    // trace fds.
    //
    // Because of this, we instead will direct the framework to create a new
    // pipe and pass this to the reporter process instead. As the pipe is
    // created by the framework, we won't have any problems with SELinux
    // (system_server is already allowed to pass pipe fds, even
    // to untrusted apps).
    //
    // As the name suggests this option *MUST* only be used for testing.
    // Note that the framework will reject (and drop) files which are too
    // large both for simplicity and to be minimize the amount of data we
    // pass to a non-priv app (note that the framework will still check
    // manifest permissions even though SELinux permissions are worked around).
    optional bool use_pipe_in_framework_for_testing = 4;
  }
  optional AndroidReportConfig android_report_config = 34;

  // If set, delays the start of tracing by a random duration. The duration is
  // chosen from a uniform distribution between the specified minimum and
  // maximum.
  // Note: this delay is implemented by perfetto_cmd *not* by traced so will
  // not work if you communicate with traced directly over the consumer API.
  // Introduced in Android T.
  message CmdTraceStartDelay {
    optional uint32 min_delay_ms = 1;
    optional uint32 max_delay_ms = 2;
  }
  optional CmdTraceStartDelay cmd_trace_start_delay = 35;

  // When non-empty, ensures that for a each semaphore named `name at most
  // `max_other_session_count`` *other* sessions (whose value is taken of the
  // minimum of all values specified by this config or any already-running
  // session) can be be running.
  //
  // If a semaphore "acquisition" fails, EnableTracing will return an error
  // and the tracing session will not be started (or elgible to start in
  // the case of deferred sessions).
  //
  // This is easiest to explain with an example. Suppose the tracing service has
  // the following active tracing sessions:
  //   S1 = [{name=foo, max_other_session_count=2},
  //         {name=bar, max_other_session_count=0}]
  //   S2 = [{name=foo, max_other_session_count=1},
  //         {name=baz, max_other_session_count=1}]
  //
  // Then, for a new session, the following would be the expected behaviour of
  // EnableSession given the state of `session_semaphores`.
  //   Q: session_semaphores = []
  //   A: Allowed because it does not specify any semaphores. Will be allowed
  //      no matter the state of any other tracing session.
  //   Q: session_semaphores = [{name=baz, max_other_session_count=1}]
  //   A: Allowed because both S2 and this config specify
  //      max_other_session_count=1 for baz.
  //   Q: session_semaphores = [{name=foo, max_other_session_count=3}]
  //   A: Denied because S2 specified max_other_session_count=1 for foo and S1
  //      takes that slot.
  //   Q: session_semaphores = [{name=bar, max_other_session_count=0}]
  //   A: Denied because S1 takes the the slot specified by both S1 and
  //      this config.
  //
  // Introduced in 24Q3 (Android V).
  message SessionSemaphore {
    // The name of the semaphore. Acts as a unique identifier across all
    // tracing sessions (including the one being started).
    optional string name = 1;

    // The maximum number of *other* sesssions which specify the same semaphore
    // which can be active. The minimum of this value across all tracing
    // sessions and the value specified by the config is used when deciding
    // whether the tracing session can be started.
    optional uint64 max_other_session_count = 2;
  }
  repeated SessionSemaphore session_semaphores = 39;
}

// End of protos/perfetto/config/trace_config.proto

// Begin of protos/perfetto/common/trace_stats.proto

// Statistics for the internals of the tracing service.
//
// Next id: 19.
message TraceStats {
  // From TraceBuffer::Stats.
  //
  // Next id: 21.
  message BufferStats {
    // Size of the circular buffer in bytes.
    optional uint64 buffer_size = 12;

    // Num. bytes written into the circular buffer, including chunk headers.
    optional uint64 bytes_written = 1;

    // Num. bytes overwritten before they have been read (i.e. loss of data).
    optional uint64 bytes_overwritten = 13;

    // Total size of chunks that were fully read from the circular buffer by the
    // consumer. This may not be equal to |bytes_written| either in the middle
    // of tracing, or if |chunks_overwritten| is non-zero. Note that this is the
    // size of the chunks read from the buffer, including chunk headers, which
    // will be different from the total size of packets returned to the
    // consumer.
    //
    // The current utilization of the trace buffer (mid-tracing) can be obtained
    // by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|,
    // adding the difference of |padding_bytes_written| and
    // |padding_bytes_cleared|, and comparing this sum to the |buffer_size|.
    // Note that this represents the total size of buffered data in the buffer,
    // yet this data may be spread non-contiguously through the buffer and may
    // be overridden before the utilization reaches 100%.
    optional uint64 bytes_read = 14;

    // Num. bytes that were allocated as padding between chunks in the circular
    // buffer.
    optional uint64 padding_bytes_written = 15;

    // Num. of padding bytes that were removed from the circular buffer when
    // they were overwritten.
    //
    // The difference between |padding_bytes_written| and
    // |padding_bytes_cleared| denotes the total size of padding currently
    // present in the buffer.
    optional uint64 padding_bytes_cleared = 16;

    // Num. chunks (!= packets) written into the buffer.
    optional uint64 chunks_written = 2;

    // Num. chunks (!= packets) rewritten into the buffer. This means we rewrote
    // the same chunk with additional packets appended to the end.
    optional uint64 chunks_rewritten = 10;

    // Num. chunks overwritten before they have been read (i.e. loss of data).
    optional uint64 chunks_overwritten = 3;

    // Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer
    // is configured with FillPolicy == DISCARD.
    optional uint64 chunks_discarded = 18;

    // Num. chunks (!= packets) that were fully read from the circular buffer by
    // the consumer. This may not be equal to |chunks_written| either in the
    // middle of tracing, or if |chunks_overwritten| is non-zero.
    optional uint64 chunks_read = 17;

    // Num. chunks that were committed out of order.
    optional uint64 chunks_committed_out_of_order = 11;

    // Num. times the ring buffer wrapped around.
    optional uint64 write_wrap_count = 4;

    // Num. out-of-band (OOB) patches that succeeded.
    optional uint64 patches_succeeded = 5;

    // Num. OOB patches that failed (e.g., the chunk to patch was gone).
    optional uint64 patches_failed = 6;

    // Num. readaheads (for large multi-chunk packet reads) that ended up in a
    // successful packet read.
    optional uint64 readaheads_succeeded = 7;

    // Num. readaheads aborted because of missing chunks in the sequence stream.
    // Note that a small number > 0 is totally expected: occasionally, when
    // issuing a read, the very last packet in a sequence might be incomplete
    // (because the producer is still writing it while we read). The read will
    // stop at that point, for that sequence, increasing this counter.
    optional uint64 readaheads_failed = 8;

    // Num. of violations of the SharedMemoryABI found while writing or reading
    // the buffer. This is an indication of either a bug in the producer(s) or
    // malicious producer(s).
    optional uint64 abi_violations = 9;

    // The fields below have been introduced in Android R.

    // Num. of times the service detected packet loss on a trace writer
    // sequence. This is usually caused by exhaustion of available chunks in the
    // writer process's SMB. Note that this relies on the client's TraceWriter
    // indicating this loss to the service -- packets lost for other reasons are
    // not reflected in this stat.
    optional uint64 trace_writer_packet_loss = 19;
  }

  // Stats for the TraceBuffer(s) of the current trace session.
  repeated BufferStats buffer_stats = 1;

  // Per TraceWriter stat. Each {producer, trace writer} tuple is publicly
  // visible as a unique sequence ID in the trace.
  message WriterStats {
    // This matches the TracePacket.trusted_packet_sequence_id and is used to
    // correlate the stats with the actual packet types.
    optional uint64 sequence_id = 1;

    // The buffer index (0..N, as defined in the TraceConfig).
    optional uint32 buffer = 4;

    // These two arrays have the same cardinality and match the cardinality of
    // chunk_payload_histogram_def + 1 (for the overflow bucket, see below).
    // `sum` contains the SUM(entries) and `counts` contains the COUNT(entries)
    // for each bucket.
    repeated uint64 chunk_payload_histogram_counts = 2 [packed = true];
    repeated int64 chunk_payload_histogram_sum = 3 [packed = true];
  }

  // The thresholds of each the `writer_stats` histogram buckets. This is
  // emitted only once as all WriterStats share the same bucket layout.
  // This field has the same cardinality of the
  // `writer_stats.chunk_payload_histogram_{counts,sum}` - 1.
  // (The -1 is because the last overflow bucket is not reported in the _def).
  // An array of values [10, 100, 1000] in the _def array means that there are
  // four buckets (3 + the implicit overflow bucket):
  // [0]: x <= 10; [1]: 100 < x <= 1000; [2]: 1000 < x <= 1000; [3]: x > 1000.
  repeated int64 chunk_payload_histogram_def = 17;
  repeated WriterStats writer_stats = 18;

  // Num. producers connected (whether they are involved in the current tracing
  // session or not).
  optional uint32 producers_connected = 2;

  // Num. producers ever seen for all trace sessions since startup (it's a good
  // proxy for inferring num. producers crashed / killed).
  optional uint64 producers_seen = 3;

  // Num. data sources registered for all trace sessions.
  optional uint32 data_sources_registered = 4;

  // Num. data sources ever seen for all trace sessions since startup.
  optional uint64 data_sources_seen = 5;

  // Num. concurrently active tracing sessions.
  optional uint32 tracing_sessions = 6;

  // Num. buffers for all tracing session (not just the current one). This will
  // be >= buffer_stats.size(), because the latter is only about the current
  // session.
  optional uint32 total_buffers = 7;

  // The fields below have been introduced in Android Q.

  // Num. chunks that were discarded by the service before attempting to commit
  // them to a buffer, e.g. because the producer specified an invalid buffer ID.
  optional uint64 chunks_discarded = 8;

  // Num. patches that were discarded by the service before attempting to apply
  // them to a buffer, e.g. because the producer specified an invalid buffer ID.
  optional uint64 patches_discarded = 9;

  // Packets that failed validation of the TrustedPacket. If this is > 0, there
  // is a bug in the producer.
  optional uint64 invalid_packets = 10;

  // This is set only when the TraceConfig specifies a TraceFilter.
  message FilterStats {
    optional uint64 input_packets = 1;
    optional uint64 input_bytes = 2;
    optional uint64 output_bytes = 3;
    optional uint64 errors = 4;
    optional uint64 time_taken_ns = 5;

    // The number of bytes discarded by the filter (i.e. output - input).
    // The array has one entry for each buffer defined in the config (unless no
    // packets for that buffer were seen and hence filtered).
    // Note: the SUM(bytes_discarded_per_buffer) will be <= but not == the total
    // (output_bytes - input_bytes) because the filter might also discard
    // server-generated synthetic packets, that have no buffer index.
    repeated uint64 bytes_discarded_per_buffer = 20;
  }
  optional FilterStats filter_stats = 11;

  // Count of Flush() requests (either from the Consumer, or self-induced
  // periodic flushes). The final Flush() is also included in the count.
  optional uint64 flushes_requested = 12;

  // The count of the Flush() requests that were completed successfully.
  // In a well behaving trace this should always be == `flush_requests`.
  optional uint64 flushes_succeeded = 13;

  // The count of the Flush() requests that failed (in most timed out).
  // In a well behaving trace this should always be == 0.
  optional uint64 flushes_failed = 14;

  enum FinalFlushOutcome {
    FINAL_FLUSH_UNSPECIFIED = 0;
    FINAL_FLUSH_SUCCEEDED = 1;
    FINAL_FLUSH_FAILED = 2;
  }
  optional FinalFlushOutcome final_flush_outcome = 15;
}

// End of protos/perfetto/common/trace_stats.proto

// Begin of protos/perfetto/trace/android/gpu_mem_event.proto

// Generated by Android's GpuService.
message GpuMemTotalEvent {
  optional uint32 gpu_id = 1;
  optional uint32 pid = 2;
  optional uint64 size = 3;
}

// End of protos/perfetto/trace/android/gpu_mem_event.proto

// Begin of protos/perfetto/trace/android/graphics_frame_event.proto

// Generated by Android's SurfaceFlinger.
message GraphicsFrameEvent {
  enum BufferEventType {
    UNSPECIFIED = 0;
    DEQUEUE = 1;
    QUEUE = 2;
    POST = 3;
    ACQUIRE_FENCE = 4;
    LATCH = 5;
    // HWC will compose this buffer
    HWC_COMPOSITION_QUEUED = 6;
    // renderEngine composition
    FALLBACK_COMPOSITION = 7;
    PRESENT_FENCE = 8;
    RELEASE_FENCE = 9;
    MODIFY = 10;
    DETACH = 11;
    ATTACH = 12;
    CANCEL = 13;
  }

  message BufferEvent {
    optional uint32 frame_number = 1;
    optional BufferEventType type = 2;
    optional string layer_name = 3;
    // If no duration is set, the event is an instant event.
    optional uint64 duration_ns = 4;
    // Unique buffer identifier.
    optional uint32 buffer_id = 5;
  }

  optional BufferEvent buffer_event = 1;
}

// End of protos/perfetto/trace/android/graphics_frame_event.proto

// Begin of protos/perfetto/trace/android/initial_display_state.proto

message InitialDisplayState {
  // Same values as android.view.Display.STATE_*
  optional int32 display_state = 1;
  optional double brightness = 2;
}

// End of protos/perfetto/trace/android/initial_display_state.proto

// Begin of protos/perfetto/trace/android/kernel_wakelock_data.proto

message KernelWakelockData {
  message Wakelock {
    enum Type {
      WAKELOCK_TYPE_UNKNOWN = 0;
      WAKELOCK_TYPE_KERNEL = 1;
      WAKELOCK_TYPE_NATIVE = 2;
    }

    // Interning id.
    optional uint32 wakelock_id = 1;

    // Name of the wakelock.
    optional string wakelock_name = 2;

    // Type of the wakelock. We record data about both true kernel wakelocks
    // and "native" wakelocks which are taken in userspace but are more
    // conceptually similar to kernel wakelocks than normal userspace ones.
    optional Type wakelock_type = 3;
  }

  // This is only emitted when we encounter new wakelocks.
  repeated Wakelock wakelock = 1;

  // Interning id.
  repeated uint32 wakelock_id = 2 [packed = true];

  // If we interned the wakelock name in this packet, this is the total time
  // the wakelock has been held.
  // If not, it's a delta from the last time we saw it.
  repeated uint64 time_held_millis = 3 [packed = true];
}

// End of protos/perfetto/trace/android/kernel_wakelock_data.proto

// Begin of protos/perfetto/trace/android/network_trace.proto

enum TrafficDirection {
  DIR_UNSPECIFIED = 0;
  DIR_INGRESS = 1;
  DIR_EGRESS = 2;
}

// NetworkPacketEvent records the details of a single packet sent or received
// on the network (in Linux kernel terminology, one sk_buff struct).
message NetworkPacketEvent {
  // The direction traffic is flowing for this event.
  optional TrafficDirection direction = 1;

  // The name of the interface if available (e.g. 'rmnet0').
  optional string interface = 2;

  // The length of the packet in bytes (wire_size - L2_header_size). Ignored
  // when using NetworkPacketEvent as the ctx in either NetworkPacketBundle or
  // NetworkPacketContext.
  optional uint32 length = 3;

  // The Linux user id associated with the packet's socket.
  optional uint32 uid = 4;

  // The Android network tag associated with the packet's socket.
  optional uint32 tag = 5;

  // The packet's IP protocol (TCP=6, UDP=17, etc).
  optional uint32 ip_proto = 6;

  // The packet's TCP flags as a bitmask (FIN=0x1, SYN=0x2, RST=0x4, etc).
  optional uint32 tcp_flags = 7;

  // The local udp/tcp port of the packet.
  optional uint32 local_port = 8;

  // The remote udp/tcp port of the packet.
  optional uint32 remote_port = 9;

  // The 1-byte ICMP type identifier.
  optional uint32 icmp_type = 10;

  // The 1-byte ICMP code identifier.
  optional uint32 icmp_code = 11;
}

// NetworkPacketBundle bundles one or more packets sharing the same attributes.
message NetworkPacketBundle {
  oneof packet_context {
    // The intern id for looking up the associated packet context.
    uint64 iid = 1;

    // The inlined context for events in this bundle.
    NetworkPacketEvent ctx = 2;
  }

  // The timestamp of the i-th packet encoded as the nanoseconds since the
  // enclosing TracePacket's timestamp.
  repeated uint64 packet_timestamps = 3 [packed = true];

  // The length of the i-th packet in bytes (wire_size - L2_header_size).
  repeated uint32 packet_lengths = 4 [packed = true];

  // Total number of packets in the bundle (when above aggregation_threshold).
  optional uint32 total_packets = 5;

  // Duration between first and last packet (when above aggregation_threshold).
  optional uint64 total_duration = 6;

  // Total packet length in bytes (when above aggregation_threshold).
  optional uint64 total_length = 7;
}

// An internable packet context.
message NetworkPacketContext {
  optional uint64 iid = 1;
  optional NetworkPacketEvent ctx = 2;
}

// End of protos/perfetto/trace/android/network_trace.proto

// Begin of protos/perfetto/common/descriptor.proto

// The protocol compiler can output a FileDescriptorSet containing the .proto
// files it parses.
message FileDescriptorSet {
  repeated FileDescriptorProto file = 1;
}

// Describes a complete .proto file.
message FileDescriptorProto {
  // file name, relative to root of source tree
  optional string name = 1;
  // e.g. "foo", "foo.bar", etc.
  optional string package = 2;

  // Names of files imported by this file.
  repeated string dependency = 3;
  // Indexes of the public imported files in the dependency list above.
  repeated int32 public_dependency = 10;
  // Indexes of the weak imported files in the dependency list.
  // For Google-internal migration only. Do not use.
  repeated int32 weak_dependency = 11;

  // All top-level definitions in this file.
  repeated DescriptorProto message_type = 4;
  repeated EnumDescriptorProto enum_type = 5;
  repeated FieldDescriptorProto extension = 7;

  reserved 6;
  reserved 8;
  reserved 9;
  reserved 12;
}

// Describes a message type.
message DescriptorProto {
  optional string name = 1;

  repeated FieldDescriptorProto field = 2;
  repeated FieldDescriptorProto extension = 6;

  repeated DescriptorProto nested_type = 3;
  repeated EnumDescriptorProto enum_type = 4;

  reserved 5;

  repeated OneofDescriptorProto oneof_decl = 8;

  reserved 7;

  // Range of reserved tag numbers. Reserved tag numbers may not be used by
  // fields or extension ranges in the same message. Reserved ranges may
  // not overlap.
  message ReservedRange {
    // Inclusive.
    optional int32 start = 1;
    // Exclusive.
    optional int32 end = 2;
  }
  repeated ReservedRange reserved_range = 9;
  // Reserved field names, which may not be used by fields in the same message.
  // A given name may only be reserved once.
  repeated string reserved_name = 10;
}

// A message representing a option the parser does not recognize. This only
// appears in options protos created by the compiler::Parser class.
// DescriptorPool resolves these when building Descriptor objects. Therefore,
// options protos in descriptor objects (e.g. returned by Descriptor::options(),
// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
// in them.
message UninterpretedOption {
  // The name of the uninterpreted option.  Each string represents a segment in
  // a dot-separated name.  is_extension is true iff a segment represents an
  // extension (denoted with parentheses in options specs in .proto files).
  // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
  // "foo.(bar.baz).moo".
  message NamePart {
    optional string name_part = 1;
    optional bool is_extension = 2;
  }
  repeated NamePart name = 2;

  // The value of the uninterpreted option, in whatever type the tokenizer
  // identified it as during parsing. Exactly one of these should be set.
  optional string identifier_value = 3;
  optional uint64 positive_int_value = 4;
  optional int64 negative_int_value = 5;
  optional double double_value = 6;
  optional bytes string_value = 7;
  optional string aggregate_value = 8;
}

message FieldOptions {
  // The packed option can be enabled for repeated primitive fields to enable
  // a more efficient representation on the wire. Rather than repeatedly
  // writing the tag and type for each element, the entire array is encoded as
  // a single length-delimited blob. In proto3, only explicit setting it to
  // false will avoid using packed encoding.
  optional bool packed = 2;

  // The parser stores options it doesn't recognize here. See above.
  repeated UninterpretedOption uninterpreted_option = 999;
}

// Describes a field within a message.
message FieldDescriptorProto {
  enum Type {
    // 0 is reserved for errors.
    // Order is weird for historical reasons.
    TYPE_DOUBLE = 1;
    TYPE_FLOAT = 2;
    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
    // negative values are likely.
    TYPE_INT64 = 3;
    TYPE_UINT64 = 4;
    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
    // negative values are likely.
    TYPE_INT32 = 5;
    TYPE_FIXED64 = 6;
    TYPE_FIXED32 = 7;
    TYPE_BOOL = 8;
    TYPE_STRING = 9;
    // Tag-delimited aggregate.
    // Group type is deprecated and not supported in proto3. However, Proto3
    // implementations should still be able to parse the group wire format and
    // treat group fields as unknown fields.
    TYPE_GROUP = 10;
    // Length-delimited aggregate.
    TYPE_MESSAGE = 11;

    // New in version 2.
    TYPE_BYTES = 12;
    TYPE_UINT32 = 13;
    TYPE_ENUM = 14;
    TYPE_SFIXED32 = 15;
    TYPE_SFIXED64 = 16;
    // Uses ZigZag encoding.
    TYPE_SINT32 = 17;
    // Uses ZigZag encoding.
    TYPE_SINT64 = 18;
  };

  enum Label {
    // 0 is reserved for errors
    LABEL_OPTIONAL = 1;
    LABEL_REQUIRED = 2;
    LABEL_REPEATED = 3;
  };

  optional string name = 1;
  optional int32 number = 3;
  optional Label label = 4;

  // If type_name is set, this need not be set.  If both this and type_name
  // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
  optional Type type = 5;

  // For message and enum types, this is the name of the type.  If the name
  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
  // rules are used to find the type (i.e. first the nested types within this
  // message are searched, then within the parent, on up to the root
  // namespace).
  optional string type_name = 6;

  // For extensions, this is the name of the type being extended.  It is
  // resolved in the same manner as type_name.
  optional string extendee = 2;

  // For numeric types, contains the original text representation of the value.
  // For booleans, "true" or "false".
  // For strings, contains the default text contents (not escaped in any way).
  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
  // TODO(kenton):  Base-64 encode?
  optional string default_value = 7;

  optional FieldOptions options = 8;

  // If set, gives the index of a oneof in the containing type's oneof_decl
  // list.  This field is a member of that oneof.
  optional int32 oneof_index = 9;

  reserved 10;
}

// Describes a oneof.
message OneofDescriptorProto {
  optional string name = 1;
  optional OneofOptions options = 2;
}

// Describes an enum type.
message EnumDescriptorProto {
  optional string name = 1;

  repeated EnumValueDescriptorProto value = 2;

  reserved 3;
  reserved 4;

  // Reserved enum value names, which may not be reused. A given name may only
  // be reserved once.
  repeated string reserved_name = 5;
}

// Describes a value within an enum.
message EnumValueDescriptorProto {
  optional string name = 1;
  optional int32 number = 2;

  reserved 3;
}

message OneofOptions {
  reserved 999;

  // Clients can define custom options in extensions of this message. See above.
  extensions 1000 to max;
}

// End of protos/perfetto/common/descriptor.proto

// Begin of protos/perfetto/trace/extension_descriptor.proto

// This message contains descriptors used to parse extension fields of
// TrackEvent.
//
// See docs/design-docs/extensions.md for more details.
message ExtensionDescriptor {
  optional FileDescriptorSet extension_set = 1;
}

// End of protos/perfetto/trace/extension_descriptor.proto

// Begin of protos/perfetto/trace/filesystem/inode_file_map.proto

// Represents the mapping between inode numbers in a block device and their path
// on the filesystem
message InodeFileMap {
  // Representation of Entry
  message Entry {
    optional uint64 inode_number = 1;

    // The path to the file, e.g. "etc/file.xml"
    // List of strings for multiple hardlinks
    repeated string paths = 2;

    // The file type
    enum Type {
      UNKNOWN = 0;
      FILE = 1;
      DIRECTORY = 2;
    }
    optional Type type = 3;
  }

  optional uint64 block_device_id = 1;

  // The mount points of the block device, e.g. ["system"].
  repeated string mount_points = 2;

  // The list of all the entries from the block device
  repeated Entry entries = 3;
}

// End of protos/perfetto/trace/filesystem/inode_file_map.proto


// Begin of protos/perfetto/trace/ftrace/binder.proto

message BinderTransactionFtraceEvent {
  optional int32 debug_id = 1;
  optional int32 target_node = 2;
  optional int32 to_proc = 3;
  optional int32 to_thread = 4;
  optional int32 reply = 5;
  optional uint32 code = 6;
  optional uint32 flags = 7;
}
message BinderTransactionReceivedFtraceEvent {
  optional int32 debug_id = 1;
}
message BinderSetPriorityFtraceEvent {
  optional int32 proc = 1;
  optional int32 thread = 2;
  optional uint32 old_prio = 3;
  optional uint32 new_prio = 4;
  optional uint32 desired_prio = 5;
}
message BinderLockFtraceEvent {
  optional string tag = 1;
}
message BinderLockedFtraceEvent {
  optional string tag = 1;
}
message BinderUnlockFtraceEvent {
  optional string tag = 1;
}
message BinderTransactionAllocBufFtraceEvent {
  optional uint64 data_size = 1;
  optional int32 debug_id = 2;
  optional uint64 offsets_size = 3;
  optional uint64 extra_buffers_size = 4;
}
message BinderCommandFtraceEvent {
  optional uint32 cmd = 1;
}
message BinderReturnFtraceEvent {
  optional uint32 cmd = 1;
}

// End of protos/perfetto/trace/ftrace/binder.proto

// Begin of protos/perfetto/trace/ftrace/block.proto

message BlockRqIssueFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional uint32 bytes = 4;
  optional string rwbs = 5;
  optional string comm = 6;
  optional string cmd = 7;
}
message BlockBioBackmergeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockBioBounceFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockBioCompleteFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional int32 error = 4;
  optional string rwbs = 5;
}
message BlockBioFrontmergeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockBioQueueFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockBioRemapFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional uint64 old_dev = 4;
  optional uint64 old_sector = 5;
  optional string rwbs = 6;
}
message BlockDirtyBufferFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint64 size = 3;
}
message BlockGetrqFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockPlugFtraceEvent {
  optional string comm = 1;
}
message BlockRqAbortFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional int32 errors = 4;
  optional string rwbs = 5;
  optional string cmd = 6;
}
message BlockRqCompleteFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional int32 errors = 4;
  optional string rwbs = 5;
  optional string cmd = 6;
  optional int32 error = 7;
}
message BlockRqInsertFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional uint32 bytes = 4;
  optional string rwbs = 5;
  optional string comm = 6;
  optional string cmd = 7;
}
message BlockRqRemapFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional uint64 old_dev = 4;
  optional uint64 old_sector = 5;
  optional uint32 nr_bios = 6;
  optional string rwbs = 7;
}
message BlockRqRequeueFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional int32 errors = 4;
  optional string rwbs = 5;
  optional string cmd = 6;
}
message BlockSleeprqFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockSplitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint64 new_sector = 3;
  optional string rwbs = 4;
  optional string comm = 5;
}
message BlockTouchBufferFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint64 size = 3;
}
message BlockUnplugFtraceEvent {
  optional int32 nr_rq = 1;
  optional string comm = 2;
}
message BlockIoStartFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional uint32 bytes = 4;
  optional uint32 ioprio = 5;
  optional string rwbs = 6;
  optional string comm = 7;
  optional string cmd = 8;
}
message BlockIoDoneFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 sector = 2;
  optional uint32 nr_sector = 3;
  optional uint32 bytes = 4;
  optional uint32 ioprio = 5;
  optional string rwbs = 6;
  optional string comm = 7;
  optional string cmd = 8;
}

// End of protos/perfetto/trace/ftrace/block.proto

// Begin of protos/perfetto/trace/ftrace/cgroup.proto

message CgroupAttachTaskFtraceEvent {
  optional int32 dst_root = 1;
  optional int32 dst_id = 2;
  optional int32 pid = 3;
  optional string comm = 4;
  optional string cname = 5;
  optional int32 dst_level = 6;
  optional string dst_path = 7;
}
message CgroupMkdirFtraceEvent {
  optional int32 root = 1;
  optional int32 id = 2;
  optional string cname = 3;
  optional int32 level = 4;
  optional string path = 5;
}
message CgroupRemountFtraceEvent {
  optional int32 root = 1;
  optional uint32 ss_mask = 2;
  optional string name = 3;
}
message CgroupRmdirFtraceEvent {
  optional int32 root = 1;
  optional int32 id = 2;
  optional string cname = 3;
  optional int32 level = 4;
  optional string path = 5;
}
message CgroupTransferTasksFtraceEvent {
  optional int32 dst_root = 1;
  optional int32 dst_id = 2;
  optional int32 pid = 3;
  optional string comm = 4;
  optional string cname = 5;
  optional int32 dst_level = 6;
  optional string dst_path = 7;
}
message CgroupDestroyRootFtraceEvent {
  optional int32 root = 1;
  optional uint32 ss_mask = 2;
  optional string name = 3;
}
message CgroupReleaseFtraceEvent {
  optional int32 root = 1;
  optional int32 id = 2;
  optional string cname = 3;
  optional int32 level = 4;
  optional string path = 5;
}
message CgroupRenameFtraceEvent {
  optional int32 root = 1;
  optional int32 id = 2;
  optional string cname = 3;
  optional int32 level = 4;
  optional string path = 5;
}
message CgroupSetupRootFtraceEvent {
  optional int32 root = 1;
  optional uint32 ss_mask = 2;
  optional string name = 3;
}

// End of protos/perfetto/trace/ftrace/cgroup.proto

// Begin of protos/perfetto/trace/ftrace/clk.proto

message ClkEnableFtraceEvent {
  optional string name = 1;
}
message ClkDisableFtraceEvent {
  optional string name = 1;
}
message ClkSetRateFtraceEvent {
  optional string name = 1;
  optional uint64 rate = 2;
}

// End of protos/perfetto/trace/ftrace/clk.proto

// Begin of protos/perfetto/trace/ftrace/cma.proto

message CmaAllocStartFtraceEvent {
  optional uint32 align = 1;
  optional uint32 count = 2;
  optional string name = 3;
}
message CmaAllocInfoFtraceEvent {
  optional uint32 align = 1;
  optional uint32 count = 2;
  optional uint32 err_iso = 3;
  optional uint32 err_mig = 4;
  optional uint32 err_test = 5;
  optional string name = 6;
  optional uint64 nr_mapped = 7;
  optional uint64 nr_migrated = 8;
  optional uint64 nr_reclaimed = 9;
  optional uint64 pfn = 10;
}

// End of protos/perfetto/trace/ftrace/cma.proto

// Begin of protos/perfetto/trace/ftrace/compaction.proto

message MmCompactionBeginFtraceEvent {
  optional uint64 zone_start = 1;
  optional uint64 migrate_pfn = 2;
  optional uint64 free_pfn = 3;
  optional uint64 zone_end = 4;
  optional uint32 sync = 5;
}
message MmCompactionDeferCompactionFtraceEvent {
  optional int32 nid = 1;
  optional uint32 idx = 2;
  optional int32 order = 3;
  optional uint32 considered = 4;
  optional uint32 defer_shift = 5;
  optional int32 order_failed = 6;
}
message MmCompactionDeferredFtraceEvent {
  optional int32 nid = 1;
  optional uint32 idx = 2;
  optional int32 order = 3;
  optional uint32 considered = 4;
  optional uint32 defer_shift = 5;
  optional int32 order_failed = 6;
}
message MmCompactionDeferResetFtraceEvent {
  optional int32 nid = 1;
  optional uint32 idx = 2;
  optional int32 order = 3;
  optional uint32 considered = 4;
  optional uint32 defer_shift = 5;
  optional int32 order_failed = 6;
}
message MmCompactionEndFtraceEvent {
  optional uint64 zone_start = 1;
  optional uint64 migrate_pfn = 2;
  optional uint64 free_pfn = 3;
  optional uint64 zone_end = 4;
  optional uint32 sync = 5;
  optional int32 status = 6;
}
message MmCompactionFinishedFtraceEvent {
  optional int32 nid = 1;
  optional uint32 idx = 2;
  optional int32 order = 3;
  optional int32 ret = 4;
}
message MmCompactionIsolateFreepagesFtraceEvent {
  optional uint64 start_pfn = 1;
  optional uint64 end_pfn = 2;
  optional uint64 nr_scanned = 3;
  optional uint64 nr_taken = 4;
}
message MmCompactionIsolateMigratepagesFtraceEvent {
  optional uint64 start_pfn = 1;
  optional uint64 end_pfn = 2;
  optional uint64 nr_scanned = 3;
  optional uint64 nr_taken = 4;
}
message MmCompactionKcompactdSleepFtraceEvent {
  optional int32 nid = 1;
}
message MmCompactionKcompactdWakeFtraceEvent {
  optional int32 nid = 1;
  optional int32 order = 2;
  optional uint32 classzone_idx = 3;
  optional uint32 highest_zoneidx = 4;
}
message MmCompactionMigratepagesFtraceEvent {
  optional uint64 nr_migrated = 1;
  optional uint64 nr_failed = 2;
}
message MmCompactionSuitableFtraceEvent {
  optional int32 nid = 1;
  optional uint32 idx = 2;
  optional int32 order = 3;
  optional int32 ret = 4;
}
message MmCompactionTryToCompactPagesFtraceEvent {
  optional int32 order = 1;
  optional uint32 gfp_mask = 2;
  optional uint32 mode = 3;
  optional int32 prio = 4;
}
message MmCompactionWakeupKcompactdFtraceEvent {
  optional int32 nid = 1;
  optional int32 order = 2;
  optional uint32 classzone_idx = 3;
  optional uint32 highest_zoneidx = 4;
}

// End of protos/perfetto/trace/ftrace/compaction.proto

// Begin of protos/perfetto/trace/ftrace/cpm_trace.proto

message ParamSetValueCpmFtraceEvent {
  optional string body = 1;
  optional uint32 value = 2;
  optional int64 timestamp = 3;
}

// End of protos/perfetto/trace/ftrace/cpm_trace.proto

// Begin of protos/perfetto/trace/ftrace/cpuhp.proto

message CpuhpExitFtraceEvent {
  optional uint32 cpu = 1;
  optional int32 idx = 2;
  optional int32 ret = 3;
  optional int32 state = 4;
}
message CpuhpMultiEnterFtraceEvent {
  optional uint32 cpu = 1;
  optional uint64 fun = 2;
  optional int32 idx = 3;
  optional int32 target = 4;
}
message CpuhpEnterFtraceEvent {
  optional uint32 cpu = 1;
  optional uint64 fun = 2;
  optional int32 idx = 3;
  optional int32 target = 4;
}
message CpuhpLatencyFtraceEvent {
  optional uint32 cpu = 1;
  optional int32 ret = 2;
  optional uint32 state = 3;
  optional uint64 time = 4;
}
message CpuhpPauseFtraceEvent {
  optional uint32 active_cpus = 1;
  optional uint32 cpus = 2;
  optional uint32 pause = 3;
  optional uint32 time = 4;
}

// End of protos/perfetto/trace/ftrace/cpuhp.proto

// Begin of protos/perfetto/trace/ftrace/cros_ec.proto

message CrosEcSensorhubDataFtraceEvent {
  optional int64 current_time = 1;
  optional int64 current_timestamp = 2;
  optional int64 delta = 3;
  optional uint32 ec_fifo_timestamp = 4;
  optional uint32 ec_sensor_num = 5;
  optional int64 fifo_timestamp = 6;
}

// End of protos/perfetto/trace/ftrace/cros_ec.proto

// Begin of protos/perfetto/trace/ftrace/dcvsh.proto

message DcvshFreqFtraceEvent {
  optional uint64 cpu = 1;
  optional uint64 freq = 2;
}

// End of protos/perfetto/trace/ftrace/dcvsh.proto

// Begin of protos/perfetto/trace/ftrace/devfreq.proto

message DevfreqFrequencyFtraceEvent {
  optional string dev_name = 1;
  optional uint64 freq = 2;
  optional uint64 prev_freq = 3;
  optional uint64 busy_time = 4;
  optional uint64 total_time = 5;
}

// End of protos/perfetto/trace/ftrace/devfreq.proto

// Begin of protos/perfetto/trace/ftrace/dma_fence.proto

message DmaFenceInitFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message DmaFenceEmitFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message DmaFenceSignaledFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message DmaFenceWaitStartFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message DmaFenceWaitEndFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}

// End of protos/perfetto/trace/ftrace/dma_fence.proto

// Begin of protos/perfetto/trace/ftrace/dmabuf_heap.proto

message DmaHeapStatFtraceEvent {
  optional uint64 inode = 1;
  optional int64 len = 2;
  optional uint64 total_allocated = 3;
}

// End of protos/perfetto/trace/ftrace/dmabuf_heap.proto

// Begin of protos/perfetto/trace/ftrace/dpu.proto

message DpuTracingMarkWriteFtraceEvent {
  optional int32 pid = 1;
  optional string trace_name = 2;
  optional uint32 trace_begin = 3;
  optional string name = 4;
  optional uint32 type = 5;
  optional int32 value = 6;
}
message DpuDsiCmdFifoStatusFtraceEvent {
  optional uint32 header = 1;
  optional uint32 payload = 2;
}
message DpuDsiRxFtraceEvent {
  optional uint32 cmd = 1;
  optional uint32 rx_buf = 2;
}
message DpuDsiTxFtraceEvent {
  optional uint32 type = 1;
  optional uint32 tx_buf = 2;
  optional uint32 last = 3;
  optional uint32 delay_ms = 4;
}

// End of protos/perfetto/trace/ftrace/dpu.proto

// Begin of protos/perfetto/trace/ftrace/drm.proto

message DrmVblankEventFtraceEvent {
  optional int32 crtc = 1;
  optional uint32 high_prec = 2;
  optional uint32 seq = 3;
  optional int64 time = 4;
}
message DrmVblankEventDeliveredFtraceEvent {
  optional int32 crtc = 1;
  optional uint64 file = 2;
  optional uint32 seq = 3;
}

// End of protos/perfetto/trace/ftrace/drm.proto

// Begin of protos/perfetto/trace/ftrace/ext4.proto

message Ext4DaWriteBeginFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 flags = 5;
}
message Ext4DaWriteEndFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 copied = 5;
}
message Ext4SyncFileEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 parent = 3;
  optional int32 datasync = 4;
}
message Ext4SyncFileExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message Ext4AllocDaBlocksFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 data_blocks = 3;
  optional uint32 meta_blocks = 4;
}
message Ext4AllocateBlocksFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 block = 3;
  optional uint32 len = 4;
  optional uint32 logical = 5;
  optional uint32 lleft = 6;
  optional uint32 lright = 7;
  optional uint64 goal = 8;
  optional uint64 pleft = 9;
  optional uint64 pright = 10;
  optional uint32 flags = 11;
}
message Ext4AllocateInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 dir = 3;
  optional uint32 mode = 4;
}
message Ext4BeginOrderedTruncateFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 new_size = 3;
}
message Ext4CollapseRangeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 offset = 3;
  optional int64 len = 4;
}
message Ext4DaReleaseSpaceFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 i_blocks = 3;
  optional int32 freed_blocks = 4;
  optional int32 reserved_data_blocks = 5;
  optional int32 reserved_meta_blocks = 6;
  optional int32 allocated_meta_blocks = 7;
  optional uint32 mode = 8;
}
message Ext4DaReserveSpaceFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 i_blocks = 3;
  optional int32 reserved_data_blocks = 4;
  optional int32 reserved_meta_blocks = 5;
  optional uint32 mode = 6;
  optional int32 md_needed = 7;
}
message Ext4DaUpdateReserveSpaceFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 i_blocks = 3;
  optional int32 used_blocks = 4;
  optional int32 reserved_data_blocks = 5;
  optional int32 reserved_meta_blocks = 6;
  optional int32 allocated_meta_blocks = 7;
  optional int32 quota_claim = 8;
  optional uint32 mode = 9;
}
message Ext4DaWritePagesFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 first_page = 3;
  optional int64 nr_to_write = 4;
  optional int32 sync_mode = 5;
  optional uint64 b_blocknr = 6;
  optional uint32 b_size = 7;
  optional uint32 b_state = 8;
  optional int32 io_done = 9;
  optional int32 pages_written = 10;
}
message Ext4DaWritePagesExtentFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 lblk = 3;
  optional uint32 len = 4;
  optional uint32 flags = 5;
}
message Ext4DirectIOEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint64 len = 4;
  optional int32 rw = 5;
}
message Ext4DirectIOExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint64 len = 4;
  optional int32 rw = 5;
  optional int32 ret = 6;
}
message Ext4DiscardBlocksFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 blk = 2;
  optional uint64 count = 3;
}
message Ext4DiscardPreallocationsFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 len = 3;
  optional uint32 needed = 4;
}
message Ext4DropInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 drop = 3;
}
message Ext4EsCacheExtentFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint64 pblk = 5;
  optional uint32 status = 6;
}
message Ext4EsFindDelayedExtentRangeEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
}
message Ext4EsFindDelayedExtentRangeExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint64 pblk = 5;
  optional uint64 status = 6;
}
message Ext4EsInsertExtentFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint64 pblk = 5;
  optional uint64 status = 6;
}
message Ext4EsLookupExtentEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
}
message Ext4EsLookupExtentExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint64 pblk = 5;
  optional uint64 status = 6;
  optional int32 found = 7;
}
message Ext4EsRemoveExtentFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 lblk = 3;
  optional int64 len = 4;
}
message Ext4EsShrinkFtraceEvent {
  optional uint64 dev = 1;
  optional int32 nr_shrunk = 2;
  optional uint64 scan_time = 3;
  optional int32 nr_skipped = 4;
  optional int32 retried = 5;
}
message Ext4EsShrinkCountFtraceEvent {
  optional uint64 dev = 1;
  optional int32 nr_to_scan = 2;
  optional int32 cache_cnt = 3;
}
message Ext4EsShrinkScanEnterFtraceEvent {
  optional uint64 dev = 1;
  optional int32 nr_to_scan = 2;
  optional int32 cache_cnt = 3;
}
message Ext4EsShrinkScanExitFtraceEvent {
  optional uint64 dev = 1;
  optional int32 nr_shrunk = 2;
  optional int32 cache_cnt = 3;
}
message Ext4EvictInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 nlink = 3;
}
message Ext4ExtConvertToInitializedEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 m_lblk = 3;
  optional uint32 m_len = 4;
  optional uint32 u_lblk = 5;
  optional uint32 u_len = 6;
  optional uint64 u_pblk = 7;
}
message Ext4ExtConvertToInitializedFastpathFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 m_lblk = 3;
  optional uint32 m_len = 4;
  optional uint32 u_lblk = 5;
  optional uint32 u_len = 6;
  optional uint64 u_pblk = 7;
  optional uint32 i_lblk = 8;
  optional uint32 i_len = 9;
  optional uint64 i_pblk = 10;
}
message Ext4ExtHandleUnwrittenExtentsFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 flags = 3;
  optional uint32 lblk = 4;
  optional uint64 pblk = 5;
  optional uint32 len = 6;
  optional uint32 allocated = 7;
  optional uint64 newblk = 8;
}
message Ext4ExtInCacheFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional int32 ret = 4;
}
message Ext4ExtLoadExtentFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pblk = 3;
  optional uint32 lblk = 4;
}
message Ext4ExtMapBlocksEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint32 flags = 5;
}
message Ext4ExtMapBlocksExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 flags = 3;
  optional uint64 pblk = 4;
  optional uint32 lblk = 5;
  optional uint32 len = 6;
  optional uint32 mflags = 7;
  optional int32 ret = 8;
}
message Ext4ExtPutInCacheFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint64 start = 5;
}
message Ext4ExtRemoveSpaceFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 start = 3;
  optional uint32 end = 4;
  optional int32 depth = 5;
}
message Ext4ExtRemoveSpaceDoneFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 start = 3;
  optional uint32 end = 4;
  optional int32 depth = 5;
  optional int64 partial = 6;
  optional uint32 eh_entries = 7;
  optional uint32 pc_lblk = 8;
  optional uint64 pc_pclu = 9;
  optional int32 pc_state = 10;
}
message Ext4ExtRmIdxFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pblk = 3;
}
message Ext4ExtRmLeafFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 partial = 3;
  optional uint32 start = 4;
  optional uint32 ee_lblk = 5;
  optional uint64 ee_pblk = 6;
  optional int32 ee_len = 7;
  optional uint32 pc_lblk = 8;
  optional uint64 pc_pclu = 9;
  optional int32 pc_state = 10;
}
message Ext4ExtShowExtentFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pblk = 3;
  optional uint32 lblk = 4;
  optional uint32 len = 5;
}
message Ext4FallocateEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 offset = 3;
  optional int64 len = 4;
  optional int32 mode = 5;
  optional int64 pos = 6;
}
message Ext4FallocateExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 blocks = 4;
  optional int32 ret = 5;
}
message Ext4FindDelallocRangeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 from = 3;
  optional uint32 to = 4;
  optional int32 reverse = 5;
  optional int32 found = 6;
  optional uint32 found_blk = 7;
}
message Ext4ForgetFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 block = 3;
  optional int32 is_metadata = 4;
  optional uint32 mode = 5;
}
message Ext4FreeBlocksFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 block = 3;
  optional uint64 count = 4;
  optional int32 flags = 5;
  optional uint32 mode = 6;
}
message Ext4FreeInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 uid = 3;
  optional uint32 gid = 4;
  optional uint64 blocks = 5;
  optional uint32 mode = 6;
}
message Ext4GetImpliedClusterAllocExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 flags = 2;
  optional uint32 lblk = 3;
  optional uint64 pblk = 4;
  optional uint32 len = 5;
  optional int32 ret = 6;
}
message Ext4GetReservedClusterAllocFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
}
message Ext4IndMapBlocksEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 lblk = 3;
  optional uint32 len = 4;
  optional uint32 flags = 5;
}
message Ext4IndMapBlocksExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 flags = 3;
  optional uint64 pblk = 4;
  optional uint32 lblk = 5;
  optional uint32 len = 6;
  optional uint32 mflags = 7;
  optional int32 ret = 8;
}
message Ext4InsertRangeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 offset = 3;
  optional int64 len = 4;
}
message Ext4InvalidatepageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 index = 3;
  optional uint64 offset = 4;
  optional uint32 length = 5;
}
message Ext4JournalStartFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ip = 2;
  optional int32 blocks = 3;
  optional int32 rsv_blocks = 4;
  optional int32 nblocks = 5;
  optional int32 revoke_creds = 6;
}
message Ext4JournalStartReservedFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ip = 2;
  optional int32 blocks = 3;
}
message Ext4JournalledInvalidatepageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 index = 3;
  optional uint64 offset = 4;
  optional uint32 length = 5;
}
message Ext4JournalledWriteEndFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 copied = 5;
}
message Ext4LoadInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
}
message Ext4LoadInodeBitmapFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 group = 2;
}
message Ext4MarkInodeDirtyFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 ip = 3;
}
message Ext4MbBitmapLoadFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 group = 2;
}
message Ext4MbBuddyBitmapLoadFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 group = 2;
}
message Ext4MbDiscardPreallocationsFtraceEvent {
  optional uint64 dev = 1;
  optional int32 needed = 2;
}
message Ext4MbNewGroupPaFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pa_pstart = 3;
  optional uint64 pa_lstart = 4;
  optional uint32 pa_len = 5;
}
message Ext4MbNewInodePaFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pa_pstart = 3;
  optional uint64 pa_lstart = 4;
  optional uint32 pa_len = 5;
}
message Ext4MbReleaseGroupPaFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 pa_pstart = 2;
  optional uint32 pa_len = 3;
}
message Ext4MbReleaseInodePaFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 block = 3;
  optional uint32 count = 4;
}
message Ext4MballocAllocFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 orig_logical = 3;
  optional int32 orig_start = 4;
  optional uint32 orig_group = 5;
  optional int32 orig_len = 6;
  optional uint32 goal_logical = 7;
  optional int32 goal_start = 8;
  optional uint32 goal_group = 9;
  optional int32 goal_len = 10;
  optional uint32 result_logical = 11;
  optional int32 result_start = 12;
  optional uint32 result_group = 13;
  optional int32 result_len = 14;
  optional uint32 found = 15;
  optional uint32 groups = 16;
  optional uint32 buddy = 17;
  optional uint32 flags = 18;
  optional uint32 tail = 19;
  optional uint32 cr = 20;
}
message Ext4MballocDiscardFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 result_start = 3;
  optional uint32 result_group = 4;
  optional int32 result_len = 5;
}
message Ext4MballocFreeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 result_start = 3;
  optional uint32 result_group = 4;
  optional int32 result_len = 5;
}
message Ext4MballocPreallocFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 orig_logical = 3;
  optional int32 orig_start = 4;
  optional uint32 orig_group = 5;
  optional int32 orig_len = 6;
  optional uint32 result_logical = 7;
  optional int32 result_start = 8;
  optional uint32 result_group = 9;
  optional int32 result_len = 10;
}
message Ext4OtherInodeUpdateTimeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 orig_ino = 3;
  optional uint32 uid = 4;
  optional uint32 gid = 5;
  optional uint32 mode = 6;
}
message Ext4PunchHoleFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 offset = 3;
  optional int64 len = 4;
  optional int32 mode = 5;
}
message Ext4ReadBlockBitmapLoadFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 group = 2;
  optional uint32 prefetch = 3;
}
message Ext4ReadpageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 index = 3;
}
message Ext4ReleasepageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 index = 3;
}
message Ext4RemoveBlocksFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 from = 3;
  optional uint32 to = 4;
  optional int64 partial = 5;
  optional uint64 ee_pblk = 6;
  optional uint32 ee_lblk = 7;
  optional uint32 ee_len = 8;
  optional uint32 pc_lblk = 9;
  optional uint64 pc_pclu = 10;
  optional int32 pc_state = 11;
}
message Ext4RequestBlocksFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 len = 3;
  optional uint32 logical = 4;
  optional uint32 lleft = 5;
  optional uint32 lright = 6;
  optional uint64 goal = 7;
  optional uint64 pleft = 8;
  optional uint64 pright = 9;
  optional uint32 flags = 10;
}
message Ext4RequestInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 dir = 2;
  optional uint32 mode = 3;
}
message Ext4SyncFsFtraceEvent {
  optional uint64 dev = 1;
  optional int32 wait = 2;
}
message Ext4TrimAllFreeFtraceEvent {
  optional int32 dev_major = 1;
  optional int32 dev_minor = 2;
  optional uint32 group = 3;
  optional int32 start = 4;
  optional int32 len = 5;
}
message Ext4TrimExtentFtraceEvent {
  optional int32 dev_major = 1;
  optional int32 dev_minor = 2;
  optional uint32 group = 3;
  optional int32 start = 4;
  optional int32 len = 5;
}
message Ext4TruncateEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 blocks = 3;
}
message Ext4TruncateExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 blocks = 3;
}
message Ext4UnlinkEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 parent = 3;
  optional int64 size = 4;
}
message Ext4UnlinkExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message Ext4WriteBeginFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 flags = 5;
}
message Ext4WriteEndFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 copied = 5;
}
message Ext4WritepageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 index = 3;
}
message Ext4WritepagesFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 nr_to_write = 3;
  optional int64 pages_skipped = 4;
  optional int64 range_start = 5;
  optional int64 range_end = 6;
  optional uint64 writeback_index = 7;
  optional int32 sync_mode = 8;
  optional uint32 for_kupdate = 9;
  optional uint32 range_cyclic = 10;
}
message Ext4WritepagesResultFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
  optional int32 pages_written = 4;
  optional int64 pages_skipped = 5;
  optional uint64 writeback_index = 6;
  optional int32 sync_mode = 7;
}
message Ext4ZeroRangeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 offset = 3;
  optional int64 len = 4;
  optional int32 mode = 5;
}

// End of protos/perfetto/trace/ftrace/ext4.proto

// Begin of protos/perfetto/trace/ftrace/f2fs.proto

message F2fsDoSubmitBioFtraceEvent {
  optional uint64 dev = 1;
  optional int32 btype = 2;
  optional uint32 sync = 3;
  optional uint64 sector = 4;
  optional uint32 size = 5;
}
message F2fsEvictInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pino = 3;
  optional uint32 mode = 4;
  optional int64 size = 5;
  optional uint32 nlink = 6;
  optional uint64 blocks = 7;
  optional uint32 advise = 8;
}
message F2fsFallocateFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 mode = 3;
  optional int64 offset = 4;
  optional int64 len = 5;
  optional int64 size = 6;
  optional uint64 blocks = 7;
  optional int32 ret = 8;
}
message F2fsGetDataBlockFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 iblock = 3;
  optional uint64 bh_start = 4;
  optional uint64 bh_size = 5;
  optional int32 ret = 6;
}
message F2fsGetVictimFtraceEvent {
  optional uint64 dev = 1;
  optional int32 type = 2;
  optional int32 gc_type = 3;
  optional int32 alloc_mode = 4;
  optional int32 gc_mode = 5;
  optional uint32 victim = 6;
  optional uint32 ofs_unit = 7;
  optional uint32 pre_victim = 8;
  optional uint32 prefree = 9;
  optional uint32 free = 10;
  optional uint32 cost = 11;
}
message F2fsIgetFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pino = 3;
  optional uint32 mode = 4;
  optional int64 size = 5;
  optional uint32 nlink = 6;
  optional uint64 blocks = 7;
  optional uint32 advise = 8;
}
message F2fsIgetExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message F2fsNewInodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message F2fsReadpageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 index = 3;
  optional uint64 blkaddr = 4;
  optional int32 type = 5;
  optional int32 dir = 6;
  optional int32 dirty = 7;
  optional int32 uptodate = 8;
}
message F2fsReserveNewBlockFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 nid = 2;
  optional uint32 ofs_in_node = 3;
}
message F2fsSetPageDirtyFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 type = 3;
  optional int32 dir = 4;
  optional uint64 index = 5;
  optional int32 dirty = 6;
  optional int32 uptodate = 7;
}
message F2fsSubmitWritePageFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 type = 3;
  optional uint64 index = 4;
  optional uint32 block = 5;
}
message F2fsSyncFileEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pino = 3;
  optional uint32 mode = 4;
  optional int64 size = 5;
  optional uint32 nlink = 6;
  optional uint64 blocks = 7;
  optional uint32 advise = 8;
}
message F2fsSyncFileExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 need_cp = 3;
  optional int32 datasync = 4;
  optional int32 ret = 5;
  optional int32 cp_reason = 6;
}
message F2fsSyncFsFtraceEvent {
  optional uint64 dev = 1;
  optional int32 dirty = 2;
  optional int32 wait = 3;
}
message F2fsTruncateFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint64 pino = 3;
  optional uint32 mode = 4;
  optional int64 size = 5;
  optional uint32 nlink = 6;
  optional uint64 blocks = 7;
  optional uint32 advise = 8;
}
message F2fsTruncateBlocksEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 size = 3;
  optional uint64 blocks = 4;
  optional uint64 from = 5;
}
message F2fsTruncateBlocksExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message F2fsTruncateDataBlocksRangeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 nid = 3;
  optional uint32 ofs = 4;
  optional int32 free = 5;
}
message F2fsTruncateInodeBlocksEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 size = 3;
  optional uint64 blocks = 4;
  optional uint64 from = 5;
}
message F2fsTruncateInodeBlocksExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message F2fsTruncateNodeFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 nid = 3;
  optional uint32 blk_addr = 4;
}
message F2fsTruncateNodesEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 nid = 3;
  optional uint32 blk_addr = 4;
}
message F2fsTruncateNodesExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message F2fsTruncatePartialNodesFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional uint32 nid = 3;
  optional int32 depth = 4;
  optional int32 err = 5;
}
message F2fsUnlinkEnterFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 size = 3;
  optional uint64 blocks = 4;
  optional string name = 5;
}
message F2fsUnlinkExitFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 ret = 3;
}
message F2fsVmPageMkwriteFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int32 type = 3;
  optional int32 dir = 4;
  optional uint64 index = 5;
  optional int32 dirty = 6;
  optional int32 uptodate = 7;
}
message F2fsWriteBeginFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 flags = 5;
}
message F2fsWriteCheckpointFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 is_umount = 2;
  optional string msg = 3;
  optional int32 reason = 4;
}
message F2fsWriteEndFtraceEvent {
  optional uint64 dev = 1;
  optional uint64 ino = 2;
  optional int64 pos = 3;
  optional uint32 len = 4;
  optional uint32 copied = 5;
}
message F2fsIostatFtraceEvent {
  optional uint64 app_bio = 1;
  optional uint64 app_brio = 2;
  optional uint64 app_dio = 3;
  optional uint64 app_drio = 4;
  optional uint64 app_mio = 5;
  optional uint64 app_mrio = 6;
  optional uint64 app_rio = 7;
  optional uint64 app_wio = 8;
  optional uint64 dev = 9;
  optional uint64 fs_cdrio = 10;
  optional uint64 fs_cp_dio = 11;
  optional uint64 fs_cp_mio = 12;
  optional uint64 fs_cp_nio = 13;
  optional uint64 fs_dio = 14;
  optional uint64 fs_discard = 15;
  optional uint64 fs_drio = 16;
  optional uint64 fs_gc_dio = 17;
  optional uint64 fs_gc_nio = 18;
  optional uint64 fs_gdrio = 19;
  optional uint64 fs_mio = 20;
  optional uint64 fs_mrio = 21;
  optional uint64 fs_nio = 22;
  optional uint64 fs_nrio = 23;
}
message F2fsIostatLatencyFtraceEvent {
  optional uint32 d_rd_avg = 1;
  optional uint32 d_rd_cnt = 2;
  optional uint32 d_rd_peak = 3;
  optional uint32 d_wr_as_avg = 4;
  optional uint32 d_wr_as_cnt = 5;
  optional uint32 d_wr_as_peak = 6;
  optional uint32 d_wr_s_avg = 7;
  optional uint32 d_wr_s_cnt = 8;
  optional uint32 d_wr_s_peak = 9;
  optional uint64 dev = 10;
  optional uint32 m_rd_avg = 11;
  optional uint32 m_rd_cnt = 12;
  optional uint32 m_rd_peak = 13;
  optional uint32 m_wr_as_avg = 14;
  optional uint32 m_wr_as_cnt = 15;
  optional uint32 m_wr_as_peak = 16;
  optional uint32 m_wr_s_avg = 17;
  optional uint32 m_wr_s_cnt = 18;
  optional uint32 m_wr_s_peak = 19;
  optional uint32 n_rd_avg = 20;
  optional uint32 n_rd_cnt = 21;
  optional uint32 n_rd_peak = 22;
  optional uint32 n_wr_as_avg = 23;
  optional uint32 n_wr_as_cnt = 24;
  optional uint32 n_wr_as_peak = 25;
  optional uint32 n_wr_s_avg = 26;
  optional uint32 n_wr_s_cnt = 27;
  optional uint32 n_wr_s_peak = 28;
}
message F2fsBackgroundGcFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 wait_ms = 2;
  optional uint32 prefree = 3;
  optional uint32 free = 4;
}
message F2fsGcBeginFtraceEvent {
  optional uint64 dev = 1;
  optional uint32 sync = 2;
  optional uint32 background = 3;
  optional int64 dirty_nodes = 4;
  optional int64 dirty_dents = 5;
  optional int64 dirty_imeta = 6;
  optional uint32 free_sec = 7;
  optional uint32 free_seg = 8;
  optional int32 reserved_seg = 9;
  optional uint32 prefree_seg = 10;
  optional int32 gc_type = 11;
  optional uint32 no_bg_gc = 12;
  optional uint32 nr_free_secs = 13;
}
message F2fsGcEndFtraceEvent {
  optional uint64 dev = 1;
  optional int32 ret = 2;
  optional int32 seg_freed = 3;
  optional int32 sec_freed = 4;
  optional int64 dirty_nodes = 5;
  optional int64 dirty_dents = 6;
  optional int64 dirty_imeta = 7;
  optional uint32 free_sec = 8;
  optional uint32 free_seg = 9;
  optional int32 reserved_seg = 10;
  optional uint32 prefree_seg = 11;
}

// End of protos/perfetto/trace/ftrace/f2fs.proto

// Begin of protos/perfetto/trace/ftrace/fastrpc.proto

message FastrpcDmaStatFtraceEvent {
  optional int32 cid = 1;
  optional int64 len = 2;
  optional uint64 total_allocated = 3;
}
message FastrpcDmaFreeFtraceEvent {
  optional int32 cid = 1;
  optional uint64 phys = 2;
  optional uint64 size = 3;
}
message FastrpcDmaAllocFtraceEvent {
  optional int32 cid = 1;
  optional uint64 phys = 2;
  optional uint64 size = 3;
  optional uint64 attr = 4;
  optional int32 mflags = 5;
}
message FastrpcDmaUnmapFtraceEvent {
  optional int32 cid = 1;
  optional uint64 phys = 2;
  optional uint64 size = 3;
}
message FastrpcDmaMapFtraceEvent {
  optional int32 cid = 1;
  optional int32 fd = 2;
  optional uint64 phys = 3;
  optional uint64 size = 4;
  optional uint64 len = 5;
  optional uint32 attr = 6;
  optional int32 mflags = 7;
}

// End of protos/perfetto/trace/ftrace/fastrpc.proto

// Begin of protos/perfetto/trace/ftrace/fence.proto

message FenceInitFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message FenceDestroyFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message FenceEnableSignalFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}
message FenceSignaledFtraceEvent {
  optional uint32 context = 1;
  optional string driver = 2;
  optional uint32 seqno = 3;
  optional string timeline = 4;
}

// End of protos/perfetto/trace/ftrace/fence.proto

// Begin of protos/perfetto/trace/ftrace/filemap.proto

message MmFilemapAddToPageCacheFtraceEvent {
  optional uint64 pfn = 1;
  optional uint64 i_ino = 2;
  optional uint64 index = 3;
  optional uint64 s_dev = 4;
  optional uint64 page = 5;
}
message MmFilemapDeleteFromPageCacheFtraceEvent {
  optional uint64 pfn = 1;
  optional uint64 i_ino = 2;
  optional uint64 index = 3;
  optional uint64 s_dev = 4;
  optional uint64 page = 5;
}

// End of protos/perfetto/trace/ftrace/filemap.proto

// Begin of protos/perfetto/trace/ftrace/fs.proto

message DoSysOpenFtraceEvent {
  optional string filename = 1;
  optional int32 flags = 2;
  optional int32 mode = 3;
}
message OpenExecFtraceEvent {
  optional string filename = 1;
}

// End of protos/perfetto/trace/ftrace/fs.proto

// Begin of protos/perfetto/trace/ftrace/ftrace.proto

message PrintFtraceEvent {
  optional uint64 ip = 1;
  optional string buf = 2;
}
message FuncgraphEntryFtraceEvent {
  optional int32 depth = 1;
  optional uint64 func = 2;
}
message FuncgraphExitFtraceEvent {
  optional uint64 calltime = 1;
  optional int32 depth = 2;
  optional uint64 func = 3;
  optional uint64 overrun = 4;
  optional uint64 rettime = 5;
}

// End of protos/perfetto/trace/ftrace/ftrace.proto

// Begin of protos/perfetto/trace/ftrace/g2d.proto

message G2dTracingMarkWriteFtraceEvent {
  optional int32 pid = 1;
  optional string name = 4;
  optional uint32 type = 5;
  optional int32 value = 6;
}

// End of protos/perfetto/trace/ftrace/g2d.proto

// Begin of protos/perfetto/trace/ftrace/generic.proto

// This generic proto is used to output events in the trace
// when a specific proto for that event does not exist.
message GenericFtraceEvent {
  message Field {
    optional string name = 1;
    oneof value {
      string str_value = 3;
      int64 int_value = 4;
      uint64 uint_value = 5;
    }
  }

  optional string event_name = 1;
  repeated Field field = 2;
}

message KprobeEvent {
  enum KprobeType {
    KPROBE_TYPE_UNKNOWN = 0;
    KPROBE_TYPE_BEGIN = 1;
    KPROBE_TYPE_END = 2;
    KPROBE_TYPE_INSTANT = 3;
  }
  optional string name = 1;
  optional KprobeType type = 2;
}

// End of protos/perfetto/trace/ftrace/generic.proto

// Begin of protos/perfetto/trace/ftrace/google_icc_trace.proto

message GoogleIccEventFtraceEvent {
  optional string event = 1;
  optional uint64 timestamp = 2;
}

// End of protos/perfetto/trace/ftrace/google_icc_trace.proto

// Begin of protos/perfetto/trace/ftrace/google_irm_trace.proto

message GoogleIrmEventFtraceEvent {
  optional string event = 1;
  optional uint64 timestamp = 2;
}

// End of protos/perfetto/trace/ftrace/google_irm_trace.proto

// Begin of protos/perfetto/trace/ftrace/gpu_mem.proto

message GpuMemTotalFtraceEvent {
  optional uint32 gpu_id = 1;
  optional uint32 pid = 2;
  optional uint64 size = 3;
}

// End of protos/perfetto/trace/ftrace/gpu_mem.proto

// Begin of protos/perfetto/trace/ftrace/gpu_scheduler.proto

message DrmSchedJobFtraceEvent {
  optional uint64 entity = 1;
  optional uint64 fence = 2;
  optional int32 hw_job_count = 3;
  optional uint64 id = 4;
  optional uint32 job_count = 5;
  optional string name = 6;
}
message DrmRunJobFtraceEvent {
  optional uint64 entity = 1;
  optional uint64 fence = 2;
  optional int32 hw_job_count = 3;
  optional uint64 id = 4;
  optional uint32 job_count = 5;
  optional string name = 6;
}
message DrmSchedProcessJobFtraceEvent {
  optional uint64 fence = 1;
}

// End of protos/perfetto/trace/ftrace/gpu_scheduler.proto

// Begin of protos/perfetto/trace/ftrace/hyp.proto

message HypEnterFtraceEvent {}
message HypExitFtraceEvent {}
message HostHcallFtraceEvent {
  optional uint32 id = 1;
  optional uint32 invalid = 2;
}
message HostSmcFtraceEvent {
  optional uint64 id = 1;
  optional uint32 forwarded = 2;
}
message HostMemAbortFtraceEvent {
  optional uint64 esr = 1;
  optional uint64 addr = 2;
}

// End of protos/perfetto/trace/ftrace/hyp.proto

// Begin of protos/perfetto/trace/ftrace/i2c.proto

message I2cReadFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 msg_nr = 2;
  optional uint32 addr = 3;
  optional uint32 flags = 4;
  optional uint32 len = 5;
}
message I2cWriteFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 msg_nr = 2;
  optional uint32 addr = 3;
  optional uint32 flags = 4;
  optional uint32 len = 5;
  optional uint32 buf = 6;
}
message I2cResultFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 nr_msgs = 2;
  optional int32 ret = 3;
}
message I2cReplyFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 msg_nr = 2;
  optional uint32 addr = 3;
  optional uint32 flags = 4;
  optional uint32 len = 5;
  optional uint32 buf = 6;
}
message SmbusReadFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 flags = 2;
  optional uint32 addr = 3;
  optional uint32 command = 4;
  optional uint32 protocol = 5;
}
message SmbusWriteFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 addr = 2;
  optional uint32 flags = 3;
  optional uint32 command = 4;
  optional uint32 len = 5;
  optional uint32 protocol = 6;
}
message SmbusResultFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 addr = 2;
  optional uint32 flags = 3;
  optional uint32 read_write = 4;
  optional uint32 command = 5;
  optional int32 res = 6;
  optional uint32 protocol = 7;
}
message SmbusReplyFtraceEvent {
  optional int32 adapter_nr = 1;
  optional uint32 addr = 2;
  optional uint32 flags = 3;
  optional uint32 command = 4;
  optional uint32 len = 5;
  optional uint32 protocol = 6;
}

// End of protos/perfetto/trace/ftrace/i2c.proto

// Begin of protos/perfetto/trace/ftrace/ion.proto

message IonStatFtraceEvent {
  optional uint32 buffer_id = 1;
  optional int64 len = 2;
  optional uint64 total_allocated = 3;
}

// End of protos/perfetto/trace/ftrace/ion.proto

// Begin of protos/perfetto/trace/ftrace/ipi.proto

message IpiEntryFtraceEvent {
  optional string reason = 1;
}
message IpiExitFtraceEvent {
  optional string reason = 1;
}
message IpiRaiseFtraceEvent {
  optional uint32 target_cpus = 1;
  optional string reason = 2;
}

// End of protos/perfetto/trace/ftrace/ipi.proto

// Begin of protos/perfetto/trace/ftrace/irq.proto

message SoftirqEntryFtraceEvent {
  optional uint32 vec = 1;
}
message SoftirqExitFtraceEvent {
  optional uint32 vec = 1;
}
message SoftirqRaiseFtraceEvent {
  optional uint32 vec = 1;
}
message IrqHandlerEntryFtraceEvent {
  optional int32 irq = 1;
  optional string name = 2;
  optional uint32 handler = 3;
}
message IrqHandlerExitFtraceEvent {
  optional int32 irq = 1;
  optional int32 ret = 2;
}

// End of protos/perfetto/trace/ftrace/irq.proto

// Begin of protos/perfetto/trace/ftrace/kgsl.proto

message KgslGpuFrequencyFtraceEvent {
  optional uint32 gpu_freq = 1;
  optional uint32 gpu_id = 2;
}
message KgslAdrenoCmdbatchQueuedFtraceEvent {
  optional uint32 id = 1;
  optional uint32 timestamp = 2;
  optional uint32 queued = 3;
  optional uint32 flags = 4;
  optional uint32 prio = 5;
}
message KgslAdrenoCmdbatchSubmittedFtraceEvent {
  optional uint32 id = 1;
  optional uint32 timestamp = 2;
  optional int64 inflight = 3;
  optional uint32 flags = 4;
  optional uint64 ticks = 5;
  optional uint64 secs = 6;
  optional uint64 usecs = 7;
  optional int32 prio = 8;
  optional int32 rb_id = 9;
  optional uint32 rptr = 10;
  optional uint32 wptr = 11;
  optional int32 q_inflight = 12;
  optional int32 dispatch_queue = 13;
}
message KgslAdrenoCmdbatchSyncFtraceEvent {
  optional uint32 id = 1;
  optional uint32 timestamp = 2;
  optional uint64 ticks = 3;
  optional int32 prio = 4;
}
message KgslAdrenoCmdbatchRetiredFtraceEvent {
  optional uint32 id = 1;
  optional uint32 timestamp = 2;
  optional int64 inflight = 3;
  optional uint32 recovery = 4;
  optional uint32 flags = 5;
  optional uint64 start = 6;
  optional uint64 retire = 7;
  optional int32 prio = 8;
  optional int32 rb_id = 9;
  optional uint32 rptr = 10;
  optional uint32 wptr = 11;
  optional int32 q_inflight = 12;
  optional uint64 fault_recovery = 13;
  optional uint32 dispatch_queue = 14;
  optional uint64 submitted_to_rb = 15;
  optional uint64 retired_on_gmu = 16;
  optional uint64 active = 17;
}

// End of protos/perfetto/trace/ftrace/kgsl.proto

// Begin of protos/perfetto/trace/ftrace/kmem.proto

message AllocPagesIommuEndFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional uint32 order = 2;
}
message AllocPagesIommuFailFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional uint32 order = 2;
}
message AllocPagesIommuStartFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional uint32 order = 2;
}
message AllocPagesSysEndFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional uint32 order = 2;
}
message AllocPagesSysFailFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional uint32 order = 2;
}
message AllocPagesSysStartFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional uint32 order = 2;
}
message DmaAllocContiguousRetryFtraceEvent {
  optional int32 tries = 1;
}
message IommuMapRangeFtraceEvent {
  optional uint64 chunk_size = 1;
  optional uint64 len = 2;
  optional uint64 pa = 3;
  optional uint64 va = 4;
}
message IommuSecPtblMapRangeEndFtraceEvent {
  optional uint64 len = 1;
  optional int32 num = 2;
  optional uint32 pa = 3;
  optional int32 sec_id = 4;
  optional uint64 va = 5;
}
message IommuSecPtblMapRangeStartFtraceEvent {
  optional uint64 len = 1;
  optional int32 num = 2;
  optional uint32 pa = 3;
  optional int32 sec_id = 4;
  optional uint64 va = 5;
}
message IonAllocBufferEndFtraceEvent {
  optional string client_name = 1;
  optional uint32 flags = 2;
  optional string heap_name = 3;
  optional uint64 len = 4;
  optional uint32 mask = 5;
}
message IonAllocBufferFailFtraceEvent {
  optional string client_name = 1;
  optional int64 error = 2;
  optional uint32 flags = 3;
  optional string heap_name = 4;
  optional uint64 len = 5;
  optional uint32 mask = 6;
}
message IonAllocBufferFallbackFtraceEvent {
  optional string client_name = 1;
  optional int64 error = 2;
  optional uint32 flags = 3;
  optional string heap_name = 4;
  optional uint64 len = 5;
  optional uint32 mask = 6;
}
message IonAllocBufferStartFtraceEvent {
  optional string client_name = 1;
  optional uint32 flags = 2;
  optional string heap_name = 3;
  optional uint64 len = 4;
  optional uint32 mask = 5;
}
message IonCpAllocRetryFtraceEvent {
  optional int32 tries = 1;
}
message IonCpSecureBufferEndFtraceEvent {
  optional uint64 align = 1;
  optional uint64 flags = 2;
  optional string heap_name = 3;
  optional uint64 len = 4;
}
message IonCpSecureBufferStartFtraceEvent {
  optional uint64 align = 1;
  optional uint64 flags = 2;
  optional string heap_name = 3;
  optional uint64 len = 4;
}
message IonPrefetchingFtraceEvent {
  optional uint64 len = 1;
}
message IonSecureCmaAddToPoolEndFtraceEvent {
  optional uint32 is_prefetch = 1;
  optional uint64 len = 2;
  optional int32 pool_total = 3;
}
message IonSecureCmaAddToPoolStartFtraceEvent {
  optional uint32 is_prefetch = 1;
  optional uint64 len = 2;
  optional int32 pool_total = 3;
}
message IonSecureCmaAllocateEndFtraceEvent {
  optional uint64 align = 1;
  optional uint64 flags = 2;
  optional string heap_name = 3;
  optional uint64 len = 4;
}
message IonSecureCmaAllocateStartFtraceEvent {
  optional uint64 align = 1;
  optional uint64 flags = 2;
  optional string heap_name = 3;
  optional uint64 len = 4;
}
message IonSecureCmaShrinkPoolEndFtraceEvent {
  optional uint64 drained_size = 1;
  optional uint64 skipped_size = 2;
}
message IonSecureCmaShrinkPoolStartFtraceEvent {
  optional uint64 drained_size = 1;
  optional uint64 skipped_size = 2;
}
message KfreeFtraceEvent {
  optional uint64 call_site = 1;
  optional uint64 ptr = 2;
}
message KmallocFtraceEvent {
  optional uint64 bytes_alloc = 1;
  optional uint64 bytes_req = 2;
  optional uint64 call_site = 3;
  optional uint32 gfp_flags = 4;
  optional uint64 ptr = 5;
}
message KmallocNodeFtraceEvent {
  optional uint64 bytes_alloc = 1;
  optional uint64 bytes_req = 2;
  optional uint64 call_site = 3;
  optional uint32 gfp_flags = 4;
  optional int32 node = 5;
  optional uint64 ptr = 6;
}
message KmemCacheAllocFtraceEvent {
  optional uint64 bytes_alloc = 1;
  optional uint64 bytes_req = 2;
  optional uint64 call_site = 3;
  optional uint32 gfp_flags = 4;
  optional uint64 ptr = 5;
}
message KmemCacheAllocNodeFtraceEvent {
  optional uint64 bytes_alloc = 1;
  optional uint64 bytes_req = 2;
  optional uint64 call_site = 3;
  optional uint32 gfp_flags = 4;
  optional int32 node = 5;
  optional uint64 ptr = 6;
}
message KmemCacheFreeFtraceEvent {
  optional uint64 call_site = 1;
  optional uint64 ptr = 2;
}
message MigratePagesEndFtraceEvent {
  optional int32 mode = 1;
}
message MigratePagesStartFtraceEvent {
  optional int32 mode = 1;
}
message MigrateRetryFtraceEvent {
  optional int32 tries = 1;
}
message MmPageAllocFtraceEvent {
  optional uint32 gfp_flags = 1;
  optional int32 migratetype = 2;
  optional uint32 order = 3;
  optional uint64 page = 4;
  optional uint64 pfn = 5;
}
message MmPageAllocExtfragFtraceEvent {
  optional int32 alloc_migratetype = 1;
  optional int32 alloc_order = 2;
  optional int32 fallback_migratetype = 3;
  optional int32 fallback_order = 4;
  optional uint64 page = 5;
  optional int32 change_ownership = 6;
  optional uint64 pfn = 7;
}
message MmPageAllocZoneLockedFtraceEvent {
  optional int32 migratetype = 1;
  optional uint32 order = 2;
  optional uint64 page = 3;
  optional uint64 pfn = 4;
}
message MmPageFreeFtraceEvent {
  optional uint32 order = 1;
  optional uint64 page = 2;
  optional uint64 pfn = 3;
}
message MmPageFreeBatchedFtraceEvent {
  optional int32 cold = 1;
  optional uint64 page = 2;
  optional uint64 pfn = 3;
}
message MmPagePcpuDrainFtraceEvent {
  optional int32 migratetype = 1;
  optional uint32 order = 2;
  optional uint64 page = 3;
  optional uint64 pfn = 4;
}
message RssStatFtraceEvent {
  optional int32 member = 1;
  optional int64 size = 2;
  optional uint32 curr = 3;
  optional uint32 mm_id = 4;
}
message IonHeapShrinkFtraceEvent {
  optional string heap_name = 1;
  optional uint64 len = 2;
  optional int64 total_allocated = 3;
}
message IonHeapGrowFtraceEvent {
  optional string heap_name = 1;
  optional uint64 len = 2;
  optional int64 total_allocated = 3;
}
message IonBufferCreateFtraceEvent {
  optional uint64 addr = 1;
  optional uint64 len = 2;
}
message IonBufferDestroyFtraceEvent {
  optional uint64 addr = 1;
  optional uint64 len = 2;
}

// End of protos/perfetto/trace/ftrace/kmem.proto

// Begin of protos/perfetto/trace/ftrace/kvm.proto

message KvmAccessFaultFtraceEvent {
  optional uint64 ipa = 1;
}
message KvmAckIrqFtraceEvent {
  optional uint32 irqchip = 1;
  optional uint32 pin = 2;
}
message KvmAgeHvaFtraceEvent {
  optional uint64 end = 1;
  optional uint64 start = 2;
}
message KvmAgePageFtraceEvent {
  optional uint64 gfn = 1;
  optional uint64 hva = 2;
  optional uint32 level = 3;
  optional uint32 referenced = 4;
}
message KvmArmClearDebugFtraceEvent {
  optional uint32 guest_debug = 1;
}
message KvmArmSetDreg32FtraceEvent {
  optional string name = 1;
  optional uint32 value = 2;
}
message KvmArmSetRegsetFtraceEvent {
  optional int32 len = 1;
  optional string name = 2;
}
message KvmArmSetupDebugFtraceEvent {
  optional uint32 guest_debug = 1;
  optional uint64 vcpu = 2;
}
message KvmEntryFtraceEvent {
  optional uint64 vcpu_pc = 1;
}
message KvmExitFtraceEvent {
  optional uint32 esr_ec = 1;
  optional int32 ret = 2;
  optional uint64 vcpu_pc = 3;
}
message KvmFpuFtraceEvent {
  optional uint32 load = 1;
}
message KvmGetTimerMapFtraceEvent {
  optional int32 direct_ptimer = 1;
  optional int32 direct_vtimer = 2;
  optional int32 emul_ptimer = 3;
  optional uint64 vcpu_id = 4;
}
message KvmGuestFaultFtraceEvent {
  optional uint64 hsr = 1;
  optional uint64 hxfar = 2;
  optional uint64 ipa = 3;
  optional uint64 vcpu_pc = 4;
}
message KvmHandleSysRegFtraceEvent {
  optional uint64 hsr = 1;
}
message KvmHvcArm64FtraceEvent {
  optional uint64 imm = 1;
  optional uint64 r0 = 2;
  optional uint64 vcpu_pc = 3;
}
message KvmIrqLineFtraceEvent {
  optional int32 irq_num = 1;
  optional int32 level = 2;
  optional uint32 type = 3;
  optional int32 vcpu_idx = 4;
}
message KvmMmioFtraceEvent {
  optional uint64 gpa = 1;
  optional uint32 len = 2;
  optional uint32 type = 3;
  optional uint64 val = 4;
}
message KvmMmioEmulateFtraceEvent {
  optional uint64 cpsr = 1;
  optional uint64 instr = 2;
  optional uint64 vcpu_pc = 3;
}
message KvmSetGuestDebugFtraceEvent {
  optional uint32 guest_debug = 1;
  optional uint64 vcpu = 2;
}
message KvmSetIrqFtraceEvent {
  optional uint32 gsi = 1;
  optional int32 irq_source_id = 2;
  optional int32 level = 3;
}
message KvmSetSpteHvaFtraceEvent {
  optional uint64 hva = 1;
}
message KvmSetWayFlushFtraceEvent {
  optional uint32 cache = 1;
  optional uint64 vcpu_pc = 2;
}
message KvmSysAccessFtraceEvent {
  optional uint32 CRm = 1;
  optional uint32 CRn = 2;
  optional uint32 Op0 = 3;
  optional uint32 Op1 = 4;
  optional uint32 Op2 = 5;
  optional uint32 is_write = 6;
  optional string name = 7;
  optional uint64 vcpu_pc = 8;
}
message KvmTestAgeHvaFtraceEvent {
  optional uint64 hva = 1;
}
message KvmTimerEmulateFtraceEvent {
  optional uint32 should_fire = 1;
  optional int32 timer_idx = 2;
}
message KvmTimerHrtimerExpireFtraceEvent {
  optional int32 timer_idx = 1;
}
message KvmTimerRestoreStateFtraceEvent {
  optional uint64 ctl = 1;
  optional uint64 cval = 2;
  optional int32 timer_idx = 3;
}
message KvmTimerSaveStateFtraceEvent {
  optional uint64 ctl = 1;
  optional uint64 cval = 2;
  optional int32 timer_idx = 3;
}
message KvmTimerUpdateIrqFtraceEvent {
  optional uint32 irq = 1;
  optional int32 level = 2;
  optional uint64 vcpu_id = 3;
}
message KvmToggleCacheFtraceEvent {
  optional uint32 now = 1;
  optional uint64 vcpu_pc = 2;
  optional uint32 was = 3;
}
message KvmUnmapHvaRangeFtraceEvent {
  optional uint64 end = 1;
  optional uint64 start = 2;
}
message KvmUserspaceExitFtraceEvent {
  optional uint32 reason = 1;
}
message KvmVcpuWakeupFtraceEvent {
  optional uint64 ns = 1;
  optional uint32 valid = 2;
  optional uint32 waited = 3;
}
message KvmWfxArm64FtraceEvent {
  optional uint32 is_wfe = 1;
  optional uint64 vcpu_pc = 2;
}
message TrapRegFtraceEvent {
  optional string fn = 1;
  optional uint32 is_write = 2;
  optional int32 reg = 3;
  optional uint64 write_value = 4;
}
message VgicUpdateIrqPendingFtraceEvent {
  optional uint32 irq = 1;
  optional uint32 level = 2;
  optional uint64 vcpu_id = 3;
}

// End of protos/perfetto/trace/ftrace/kvm.proto

// Begin of protos/perfetto/trace/ftrace/lowmemorykiller.proto

message LowmemoryKillFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int64 pagecache_size = 3;
  optional int64 pagecache_limit = 4;
  optional int64 free = 5;
}

// End of protos/perfetto/trace/ftrace/lowmemorykiller.proto

// Begin of protos/perfetto/trace/ftrace/lwis.proto

message LwisTracingMarkWriteFtraceEvent {
  optional string lwis_name = 1;
  optional uint32 type = 2;
  optional int32 pid = 3;
  optional string func_name = 4;
  optional int64 value = 5;
}

// End of protos/perfetto/trace/ftrace/lwis.proto

// Begin of protos/perfetto/trace/ftrace/mali.proto

message MaliTracingMarkWriteFtraceEvent {
  optional string name = 1;
  optional int32 pid = 2;
  optional uint32 type = 3;
  optional int32 value = 4;
}
message MaliMaliKCPUCQSSETFtraceEvent {
  optional uint32 id = 1;
  optional uint64 info_val1 = 2;
  optional uint64 info_val2 = 3;
  optional uint32 kctx_id = 4;
  optional int32 kctx_tgid = 5;
}
message MaliMaliKCPUCQSWAITSTARTFtraceEvent {
  optional uint32 id = 1;
  optional uint64 info_val1 = 2;
  optional uint64 info_val2 = 3;
  optional uint32 kctx_id = 4;
  optional int32 kctx_tgid = 5;
}
message MaliMaliKCPUCQSWAITENDFtraceEvent {
  optional uint32 id = 1;
  optional uint64 info_val1 = 2;
  optional uint64 info_val2 = 3;
  optional uint32 kctx_id = 4;
  optional int32 kctx_tgid = 5;
}
message MaliMaliKCPUFENCESIGNALFtraceEvent {
  optional uint64 info_val1 = 1;
  optional uint64 info_val2 = 2;
  optional int32 kctx_tgid = 3;
  optional uint32 kctx_id = 4;
  optional uint32 id = 5;
}
message MaliMaliKCPUFENCEWAITSTARTFtraceEvent {
  optional uint64 info_val1 = 1;
  optional uint64 info_val2 = 2;
  optional int32 kctx_tgid = 3;
  optional uint32 kctx_id = 4;
  optional uint32 id = 5;
}
message MaliMaliKCPUFENCEWAITENDFtraceEvent {
  optional uint64 info_val1 = 1;
  optional uint64 info_val2 = 2;
  optional int32 kctx_tgid = 3;
  optional uint32 kctx_id = 4;
  optional uint32 id = 5;
}
message MaliMaliCSFINTERRUPTSTARTFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliCSFINTERRUPTENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLCORESDOWNSCALENOTIFYPENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLCORESNOTIFYPENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLCOREINACTIVEPENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLMCUONRECHECKFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLSHADERSCOREOFFPENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLSHADERSPENDOFFFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLSHADERSPENDONFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUHCTLSHADERSREADYOFFFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUINSLEEPFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUOFFFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONCOREATTRUPDATEPENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONGLBREINITPENDFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONHALTFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONHWCNTDISABLEFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONHWCNTENABLEFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONPENDHALTFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONPENDSLEEPFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUONSLEEPINITIATEFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUPENDOFFFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUPENDONRELOADFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCUPOWERDOWNFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}
message MaliMaliPMMCURESETWAITFtraceEvent {
  optional int32 kctx_tgid = 1;
  optional uint32 kctx_id = 2;
  optional uint64 info_val = 3;
}

// End of protos/perfetto/trace/ftrace/mali.proto

// Begin of protos/perfetto/trace/ftrace/mdss.proto

message MdpCmdKickoffFtraceEvent {
  optional uint32 ctl_num = 1;
  optional int32 kickoff_cnt = 2;
}
message MdpCommitFtraceEvent {
  optional uint32 num = 1;
  optional uint32 play_cnt = 2;
  optional uint32 clk_rate = 3;
  optional uint64 bandwidth = 4;
}
message MdpPerfSetOtFtraceEvent {
  optional uint32 pnum = 1;
  optional uint32 xin_id = 2;
  optional uint32 rd_lim = 3;
  optional uint32 is_vbif_rt = 4;
}
message MdpSsppChangeFtraceEvent {
  optional uint32 num = 1;
  optional uint32 play_cnt = 2;
  optional uint32 mixer = 3;
  optional uint32 stage = 4;
  optional uint32 flags = 5;
  optional uint32 format = 6;
  optional uint32 img_w = 7;
  optional uint32 img_h = 8;
  optional uint32 src_x = 9;
  optional uint32 src_y = 10;
  optional uint32 src_w = 11;
  optional uint32 src_h = 12;
  optional uint32 dst_x = 13;
  optional uint32 dst_y = 14;
  optional uint32 dst_w = 15;
  optional uint32 dst_h = 16;
}
message TracingMarkWriteFtraceEvent {
  optional int32 pid = 1;
  optional string trace_name = 2;
  optional uint32 trace_begin = 3;
}
message MdpCmdPingpongDoneFtraceEvent {
  optional uint32 ctl_num = 1;
  optional uint32 intf_num = 2;
  optional uint32 pp_num = 3;
  optional int32 koff_cnt = 4;
}
message MdpCompareBwFtraceEvent {
  optional uint64 new_ab = 1;
  optional uint64 new_ib = 2;
  optional uint64 new_wb = 3;
  optional uint64 old_ab = 4;
  optional uint64 old_ib = 5;
  optional uint64 old_wb = 6;
  optional uint32 params_changed = 7;
  optional uint32 update_bw = 8;
}
message MdpPerfSetPanicLutsFtraceEvent {
  optional uint32 pnum = 1;
  optional uint32 fmt = 2;
  optional uint32 mode = 3;
  optional uint32 panic_lut = 4;
  optional uint32 robust_lut = 5;
}
message MdpSsppSetFtraceEvent {
  optional uint32 num = 1;
  optional uint32 play_cnt = 2;
  optional uint32 mixer = 3;
  optional uint32 stage = 4;
  optional uint32 flags = 5;
  optional uint32 format = 6;
  optional uint32 img_w = 7;
  optional uint32 img_h = 8;
  optional uint32 src_x = 9;
  optional uint32 src_y = 10;
  optional uint32 src_w = 11;
  optional uint32 src_h = 12;
  optional uint32 dst_x = 13;
  optional uint32 dst_y = 14;
  optional uint32 dst_w = 15;
  optional uint32 dst_h = 16;
}
message MdpCmdReadptrDoneFtraceEvent {
  optional uint32 ctl_num = 1;
  optional int32 koff_cnt = 2;
}
message MdpMisrCrcFtraceEvent {
  optional uint32 block_id = 1;
  optional uint32 vsync_cnt = 2;
  optional uint32 crc = 3;
}
message MdpPerfSetQosLutsFtraceEvent {
  optional uint32 pnum = 1;
  optional uint32 fmt = 2;
  optional uint32 intf = 3;
  optional uint32 rot = 4;
  optional uint32 fl = 5;
  optional uint32 lut = 6;
  optional uint32 linear = 7;
}
message MdpTraceCounterFtraceEvent {
  optional int32 pid = 1;
  optional string counter_name = 2;
  optional int32 value = 3;
}
message MdpCmdReleaseBwFtraceEvent {
  optional uint32 ctl_num = 1;
}
message MdpMixerUpdateFtraceEvent {
  optional uint32 mixer_num = 1;
}
message MdpPerfSetWmLevelsFtraceEvent {
  optional uint32 pnum = 1;
  optional uint32 use_space = 2;
  optional uint32 priority_bytes = 3;
  optional uint32 wm0 = 4;
  optional uint32 wm1 = 5;
  optional uint32 wm2 = 6;
  optional uint32 mb_cnt = 7;
  optional uint32 mb_size = 8;
}
message MdpVideoUnderrunDoneFtraceEvent {
  optional uint32 ctl_num = 1;
  optional uint32 underrun_cnt = 2;
}
message MdpCmdWaitPingpongFtraceEvent {
  optional uint32 ctl_num = 1;
  optional int32 kickoff_cnt = 2;
}
message MdpPerfPrefillCalcFtraceEvent {
  optional uint32 pnum = 1;
  optional uint32 latency_buf = 2;
  optional uint32 ot = 3;
  optional uint32 y_buf = 4;
  optional uint32 y_scaler = 5;
  optional uint32 pp_lines = 6;
  optional uint32 pp_bytes = 7;
  optional uint32 post_sc = 8;
  optional uint32 fbc_bytes = 9;
  optional uint32 prefill_bytes = 10;
}
message MdpPerfUpdateBusFtraceEvent {
  optional int32 client = 1;
  optional uint64 ab_quota = 2;
  optional uint64 ib_quota = 3;
}
message RotatorBwAoAsContextFtraceEvent {
  optional uint32 state = 1;
}

// End of protos/perfetto/trace/ftrace/mdss.proto

// Begin of protos/perfetto/trace/ftrace/mm_event.proto

message MmEventRecordFtraceEvent {
  optional uint32 avg_lat = 1;
  optional uint32 count = 2;
  optional uint32 max_lat = 3;
  optional uint32 type = 4;
}

// End of protos/perfetto/trace/ftrace/mm_event.proto

// Begin of protos/perfetto/trace/ftrace/net.proto

message NetifReceiveSkbFtraceEvent {
  optional uint32 len = 1;
  optional string name = 2;
  optional uint64 skbaddr = 3;
}
message NetDevXmitFtraceEvent {
  optional uint32 len = 1;
  optional string name = 2;
  optional int32 rc = 3;
  optional uint64 skbaddr = 4;
}
message NapiGroReceiveEntryFtraceEvent {
  optional uint32 data_len = 1;
  optional uint32 gso_size = 2;
  optional uint32 gso_type = 3;
  optional uint32 hash = 4;
  optional uint32 ip_summed = 5;
  optional uint32 l4_hash = 6;
  optional uint32 len = 7;
  optional int32 mac_header = 8;
  optional uint32 mac_header_valid = 9;
  optional string name = 10;
  optional uint32 napi_id = 11;
  optional uint32 nr_frags = 12;
  optional uint32 protocol = 13;
  optional uint32 queue_mapping = 14;
  optional uint64 skbaddr = 15;
  optional uint32 truesize = 16;
  optional uint32 vlan_proto = 17;
  optional uint32 vlan_tagged = 18;
  optional uint32 vlan_tci = 19;
}
message NapiGroReceiveExitFtraceEvent {
  optional int32 ret = 1;
}

// End of protos/perfetto/trace/ftrace/net.proto

// Begin of protos/perfetto/trace/ftrace/oom.proto

message OomScoreAdjUpdateFtraceEvent {
  optional string comm = 1;
  optional int32 oom_score_adj = 2;
  optional int32 pid = 3;
}
message MarkVictimFtraceEvent {
  optional int32 pid = 1;
}

// End of protos/perfetto/trace/ftrace/oom.proto

// Begin of protos/perfetto/trace/ftrace/panel.proto

message DsiCmdFifoStatusFtraceEvent {
  optional uint32 header = 1;
  optional uint32 payload = 2;
}
message DsiRxFtraceEvent {
  optional uint32 cmd = 1;
  optional uint32 rx_buf = 2;
}
message DsiTxFtraceEvent {
  optional uint32 last = 1;
  optional uint32 tx_buf = 2;
  optional uint32 type = 3;
}
message PanelWriteGenericFtraceEvent {
  optional int32 pid = 1;
  optional string trace_name = 2;
  optional uint32 trace_begin = 3;
  optional string name = 4;
  optional uint32 type = 5;
  optional int32 value = 6;
}

// End of protos/perfetto/trace/ftrace/panel.proto

// Begin of protos/perfetto/trace/ftrace/perf_trace_counters.proto

message SchedSwitchWithCtrsFtraceEvent {
  optional int32 old_pid = 1;
  optional int32 new_pid = 2;
  optional uint64 cctr = 3;
  optional uint64 ctr0 = 4;
  optional uint64 ctr1 = 5;
  optional uint64 ctr2 = 6;
  optional uint64 ctr3 = 7;
  optional uint32 lctr0 = 8;
  optional uint32 lctr1 = 9;
  optional uint64 ctr4 = 10;
  optional uint64 ctr5 = 11;
  optional string prev_comm = 12;
  optional int32 prev_pid = 13;
  optional uint32 cyc = 14;
  optional uint32 inst = 15;
  optional uint32 stallbm = 16;
  optional uint32 l3dm = 17;
  optional int32 next_pid = 18;
  optional string next_comm = 19;
  optional int64 prev_state = 20;
  optional uint64 amu0 = 21;
  optional uint64 amu1 = 22;
  optional uint64 amu2 = 23;
}

// End of protos/perfetto/trace/ftrace/perf_trace_counters.proto

// Begin of protos/perfetto/trace/ftrace/pixel_mm.proto

message PixelMmKswapdWakeFtraceEvent {
  optional int32 whatever = 1;
}
message PixelMmKswapdDoneFtraceEvent {
  optional uint64 delta_nr_scanned = 1;
  optional uint64 delta_nr_reclaimed = 2;
}

// End of protos/perfetto/trace/ftrace/pixel_mm.proto

// Begin of protos/perfetto/trace/ftrace/power.proto

message CpuFrequencyFtraceEvent {
  optional uint32 state = 1;
  optional uint32 cpu_id = 2;
}
message CpuFrequencyLimitsFtraceEvent {
  optional uint32 min_freq = 1;
  optional uint32 max_freq = 2;
  optional uint32 cpu_id = 3;
}
message CpuIdleFtraceEvent {
  optional uint32 state = 1;
  optional uint32 cpu_id = 2;
}
message ClockEnableFtraceEvent {
  optional string name = 1;
  optional uint64 state = 2;
  optional uint64 cpu_id = 3;
}
message ClockDisableFtraceEvent {
  optional string name = 1;
  optional uint64 state = 2;
  optional uint64 cpu_id = 3;
}
message ClockSetRateFtraceEvent {
  optional string name = 1;
  optional uint64 state = 2;
  optional uint64 cpu_id = 3;
}
message SuspendResumeFtraceEvent {
  optional string action = 1;
  optional int32 val = 2;
  optional uint32 start = 3;
}
message GpuFrequencyFtraceEvent {
  optional uint32 gpu_id = 1;
  optional uint32 state = 2;
}
message WakeupSourceActivateFtraceEvent {
  optional string name = 1;
  optional uint64 state = 2;
}
message WakeupSourceDeactivateFtraceEvent {
  optional string name = 1;
  optional uint64 state = 2;
}
message GpuWorkPeriodFtraceEvent {
  optional uint32 gpu_id = 1;
  optional uint32 uid = 2;
  optional uint64 start_time_ns = 3;
  optional uint64 end_time_ns = 4;
  optional uint64 total_active_duration_ns = 5;
}
message DevicePmCallbackStartFtraceEvent {
  optional string device = 1;
  optional string driver = 2;
  optional string parent = 3;
  optional string pm_ops = 4;
  optional int32 event = 5;
}
message DevicePmCallbackEndFtraceEvent {
  optional string device = 1;
  optional string driver = 2;
  optional int32 error = 3;
}

// End of protos/perfetto/trace/ftrace/power.proto

// Begin of protos/perfetto/trace/ftrace/printk.proto

message ConsoleFtraceEvent {
  optional string msg = 1;
}

// End of protos/perfetto/trace/ftrace/printk.proto

// Begin of protos/perfetto/trace/ftrace/raw_syscalls.proto

message SysEnterFtraceEvent {
  optional int64 id = 1;
  repeated uint64 args = 2;
}
message SysExitFtraceEvent {
  optional int64 id = 1;
  optional int64 ret = 2;
}

// End of protos/perfetto/trace/ftrace/raw_syscalls.proto

// Begin of protos/perfetto/trace/ftrace/regulator.proto

message RegulatorDisableFtraceEvent {
  optional string name = 1;
}
message RegulatorDisableCompleteFtraceEvent {
  optional string name = 1;
}
message RegulatorEnableFtraceEvent {
  optional string name = 1;
}
message RegulatorEnableCompleteFtraceEvent {
  optional string name = 1;
}
message RegulatorEnableDelayFtraceEvent {
  optional string name = 1;
}
message RegulatorSetVoltageFtraceEvent {
  optional string name = 1;
  optional int32 min = 2;
  optional int32 max = 3;
}
message RegulatorSetVoltageCompleteFtraceEvent {
  optional string name = 1;
  optional uint32 val = 2;
}

// End of protos/perfetto/trace/ftrace/regulator.proto

// Begin of protos/perfetto/trace/ftrace/rpm.proto

message RpmStatusFtraceEvent {
  optional string name = 1;
  optional int32 status = 2;
}

// End of protos/perfetto/trace/ftrace/rpm.proto

// Begin of protos/perfetto/trace/ftrace/samsung.proto

message SamsungTracingMarkWriteFtraceEvent {
  optional int32 pid = 1;
  optional string trace_name = 2;
  optional uint32 trace_begin = 3;
  optional uint32 trace_type = 4;
  optional int32 value = 5;
}

// End of protos/perfetto/trace/ftrace/samsung.proto

// Begin of protos/perfetto/trace/ftrace/sched.proto

message SchedSwitchFtraceEvent {
  optional string prev_comm = 1;
  optional int32 prev_pid = 2;
  optional int32 prev_prio = 3;
  optional int64 prev_state = 4;
  optional string next_comm = 5;
  optional int32 next_pid = 6;
  optional int32 next_prio = 7;
}
message SchedWakeupFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 prio = 3;
  optional int32 success = 4;
  optional int32 target_cpu = 5;
}
message SchedBlockedReasonFtraceEvent {
  optional int32 pid = 1;
  optional uint64 caller = 2;
  optional uint32 io_wait = 3;
}
message SchedCpuHotplugFtraceEvent {
  optional int32 affected_cpu = 1;
  optional int32 error = 2;
  optional int32 status = 3;
}
message SchedWakingFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 prio = 3;
  optional int32 success = 4;
  optional int32 target_cpu = 5;
}
message SchedWakeupNewFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 prio = 3;
  optional int32 success = 4;
  optional int32 target_cpu = 5;
}
message SchedProcessExecFtraceEvent {
  optional string filename = 1;
  optional int32 pid = 2;
  optional int32 old_pid = 3;
}
message SchedProcessExitFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 tgid = 3;
  optional int32 prio = 4;
}
message SchedProcessForkFtraceEvent {
  optional string parent_comm = 1;
  optional int32 parent_pid = 2;
  optional string child_comm = 3;
  optional int32 child_pid = 4;
}
message SchedProcessFreeFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 prio = 3;
}
message SchedProcessHangFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
}
message SchedProcessWaitFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 prio = 3;
}
message SchedPiSetprioFtraceEvent {
  optional string comm = 1;
  optional int32 newprio = 2;
  optional int32 oldprio = 3;
  optional int32 pid = 4;
}
message SchedCpuUtilCfsFtraceEvent {
  optional int32 active = 1;
  optional uint64 capacity = 2;
  optional uint64 capacity_orig = 3;
  optional uint32 cpu = 4;
  optional uint64 cpu_importance = 5;
  optional uint64 cpu_util = 6;
  optional uint32 exit_lat = 7;
  optional uint64 group_capacity = 8;
  optional uint32 grp_overutilized = 9;
  optional uint32 idle_cpu = 10;
  optional uint32 nr_running = 11;
  optional int64 spare_cap = 12;
  optional uint32 task_fits = 13;
  optional uint64 wake_group_util = 14;
  optional uint64 wake_util = 15;
}
message SchedMigrateTaskFtraceEvent {
  optional string comm = 1;
  optional int32 pid = 2;
  optional int32 prio = 3;
  optional int32 orig_cpu = 4;
  optional int32 dest_cpu = 5;
  optional int32 running = 6;
  optional uint32 load = 7;
}
message SchedWakeupTaskAttrFtraceEvent {
  optional int32 pid = 1;
  optional uint64 cpu_affinity = 2;
  optional uint64 task_util = 3;
  optional uint64 uclamp_min = 4;
  optional uint64 vruntime = 5;
}

// End of protos/perfetto/trace/ftrace/sched.proto

// Begin of protos/perfetto/trace/ftrace/scm.proto

message ScmCallStartFtraceEvent {
  optional uint32 arginfo = 1;
  optional uint64 x0 = 2;
  optional uint64 x5 = 3;
}
message ScmCallEndFtraceEvent {}

// End of protos/perfetto/trace/ftrace/scm.proto

// Begin of protos/perfetto/trace/ftrace/sde.proto

message SdeTracingMarkWriteFtraceEvent {
  optional int32 pid = 1;
  optional string trace_name = 2;
  optional uint32 trace_type = 3;
  optional int32 value = 4;
  optional uint32 trace_begin = 5;
}
message SdeSdeEvtlogFtraceEvent {
  optional string evtlog_tag = 1;
  optional int32 pid = 2;
  optional uint32 tag_id = 3;
}
message SdeSdePerfCalcCrtcFtraceEvent {
  optional uint64 bw_ctl_ebi = 1;
  optional uint64 bw_ctl_llcc = 2;
  optional uint64 bw_ctl_mnoc = 3;
  optional uint32 core_clk_rate = 4;
  optional uint32 crtc = 5;
  optional uint64 ib_ebi = 6;
  optional uint64 ib_llcc = 7;
  optional uint64 ib_mnoc = 8;
}
message SdeSdePerfCrtcUpdateFtraceEvent {
  optional uint64 bw_ctl_ebi = 1;
  optional uint64 bw_ctl_llcc = 2;
  optional uint64 bw_ctl_mnoc = 3;
  optional uint32 core_clk_rate = 4;
  optional uint32 crtc = 5;
  optional int32 params = 6;
  optional uint64 per_pipe_ib_ebi = 7;
  optional uint64 per_pipe_ib_llcc = 8;
  optional uint64 per_pipe_ib_mnoc = 9;
  optional uint32 stop_req = 10;
  optional uint32 update_bus = 11;
  optional uint32 update_clk = 12;
}
message SdeSdePerfSetQosLutsFtraceEvent {
  optional uint32 fl = 1;
  optional uint32 fmt = 2;
  optional uint64 lut = 3;
  optional uint32 lut_usage = 4;
  optional uint32 pnum = 5;
  optional uint32 rt = 6;
}
message SdeSdePerfUpdateBusFtraceEvent {
  optional uint64 ab_quota = 1;
  optional uint32 bus_id = 2;
  optional int32 client = 3;
  optional uint64 ib_quota = 4;
}

// End of protos/perfetto/trace/ftrace/sde.proto

// Begin of protos/perfetto/trace/ftrace/signal.proto

message SignalDeliverFtraceEvent {
  optional int32 code = 1;
  optional uint64 sa_flags = 2;
  optional int32 sig = 3;
}
message SignalGenerateFtraceEvent {
  optional int32 code = 1;
  optional string comm = 2;
  optional int32 group = 3;
  optional int32 pid = 4;
  optional int32 result = 5;
  optional int32 sig = 6;
}

// End of protos/perfetto/trace/ftrace/signal.proto

// Begin of protos/perfetto/trace/ftrace/skb.proto

message KfreeSkbFtraceEvent {
  optional uint64 location = 1;
  optional uint32 protocol = 2;
  optional uint64 skbaddr = 3;
}

// End of protos/perfetto/trace/ftrace/skb.proto

// Begin of protos/perfetto/trace/ftrace/sock.proto

message InetSockSetStateFtraceEvent {
  optional uint32 daddr = 1;
  optional uint32 dport = 2;
  optional uint32 family = 3;
  optional int32 newstate = 4;
  optional int32 oldstate = 5;
  optional uint32 protocol = 6;
  optional uint32 saddr = 7;
  optional uint64 skaddr = 8;
  optional uint32 sport = 9;
}

// End of protos/perfetto/trace/ftrace/sock.proto

// Begin of protos/perfetto/trace/ftrace/sync.proto

message SyncPtFtraceEvent {
  optional string timeline = 1;
  optional string value = 2;
}
message SyncTimelineFtraceEvent {
  optional string name = 1;
  optional string value = 2;
}
message SyncWaitFtraceEvent {
  optional string name = 1;
  optional int32 status = 2;
  optional uint32 begin = 3;
}

// End of protos/perfetto/trace/ftrace/sync.proto

// Begin of protos/perfetto/trace/ftrace/synthetic.proto

message RssStatThrottledFtraceEvent {
  optional uint32 curr = 1;
  optional int32 member = 2;
  optional uint32 mm_id = 3;
  optional int64 size = 4;
}
message SuspendResumeMinimalFtraceEvent {
  optional uint32 start = 1;
}

// End of protos/perfetto/trace/ftrace/synthetic.proto

// Begin of protos/perfetto/trace/ftrace/systrace.proto

message ZeroFtraceEvent {
  optional int32 flag = 1;
  optional string name = 2;
  optional int32 pid = 3;
  optional int64 value = 4;
}

// End of protos/perfetto/trace/ftrace/systrace.proto

// Begin of protos/perfetto/trace/ftrace/task.proto

message TaskNewtaskFtraceEvent {
  optional int32 pid = 1;
  optional string comm = 2;
  optional uint64 clone_flags = 3;
  optional int32 oom_score_adj = 4;
}
message TaskRenameFtraceEvent {
  optional int32 pid = 1;
  optional string oldcomm = 2;
  optional string newcomm = 3;
  optional int32 oom_score_adj = 4;
}

// End of protos/perfetto/trace/ftrace/task.proto

// Begin of protos/perfetto/trace/ftrace/tcp.proto

message TcpRetransmitSkbFtraceEvent {
  optional uint32 daddr = 1;
  optional uint32 dport = 2;
  optional uint32 saddr = 3;
  optional uint64 skaddr = 4;
  optional uint64 skbaddr = 5;
  optional uint32 sport = 6;
  optional int32 state = 7;
}

// End of protos/perfetto/trace/ftrace/tcp.proto

// Begin of protos/perfetto/trace/ftrace/thermal.proto

message ThermalTemperatureFtraceEvent {
  optional int32 id = 1;
  optional int32 temp = 2;
  optional int32 temp_prev = 3;
  optional string thermal_zone = 4;
}
message CdevUpdateFtraceEvent {
  optional uint64 target = 1;
  optional string type = 2;
}

// End of protos/perfetto/trace/ftrace/thermal.proto

// Begin of protos/perfetto/trace/ftrace/thermal_exynos.proto

message ThermalExynosAcpmBulkFtraceEvent {
  optional uint32 tz_id = 1;
  optional uint32 current_temp = 2;
  optional uint32 ctrl_temp = 3;
  optional uint32 cdev_state = 4;
  optional int32 pid_et_p = 5;
  optional int32 pid_power_range = 6;
  optional int32 pid_p = 7;
  optional int32 pid_i = 8;
  optional int32 k_p = 9;
  optional int32 k_i = 10;
  optional uint64 timestamp = 11;
}
message ThermalExynosAcpmHighOverheadFtraceEvent {
  optional int32 tz_id = 1;
  optional uint32 current_temp = 2;
  optional uint32 ctrl_temp = 3;
  optional uint32 cdev_state = 4;
  optional int32 pid_et_p = 5;
  optional int32 k_p = 6;
  optional int32 k_i = 7;
}

// End of protos/perfetto/trace/ftrace/thermal_exynos.proto

// Begin of protos/perfetto/trace/ftrace/trusty.proto

message TrustySmcFtraceEvent {
  optional uint64 r0 = 1;
  optional uint64 r1 = 2;
  optional uint64 r2 = 3;
  optional uint64 r3 = 4;
}
message TrustySmcDoneFtraceEvent {
  optional uint64 ret = 1;
}
message TrustyStdCall32FtraceEvent {
  optional uint64 r0 = 1;
  optional uint64 r1 = 2;
  optional uint64 r2 = 3;
  optional uint64 r3 = 4;
}
message TrustyStdCall32DoneFtraceEvent {
  optional int64 ret = 1;
}
message TrustyShareMemoryFtraceEvent {
  optional uint64 len = 1;
  optional uint32 lend = 2;
  optional uint32 nents = 3;
}
message TrustyShareMemoryDoneFtraceEvent {
  optional uint64 handle = 1;
  optional uint64 len = 2;
  optional uint32 lend = 3;
  optional uint32 nents = 4;
  optional int32 ret = 5;
}
message TrustyReclaimMemoryFtraceEvent {
  optional uint64 id = 1;
}
message TrustyReclaimMemoryDoneFtraceEvent {
  optional uint64 id = 1;
  optional int32 ret = 2;
}
message TrustyIrqFtraceEvent {
  optional int32 irq = 1;
}
message TrustyIpcHandleEventFtraceEvent {
  optional uint32 chan = 1;
  optional uint32 event_id = 2;
  optional string srv_name = 3;
}
message TrustyIpcConnectFtraceEvent {
  optional uint32 chan = 1;
  optional string port = 2;
  optional int32 state = 3;
}
message TrustyIpcConnectEndFtraceEvent {
  optional uint32 chan = 1;
  optional int32 err = 2;
  optional int32 state = 3;
}
message TrustyIpcWriteFtraceEvent {
  optional uint64 buf_id = 1;
  optional uint32 chan = 2;
  optional int32 kind_shm = 3;
  optional int32 len_or_err = 4;
  optional uint64 shm_cnt = 5;
  optional string srv_name = 6;
}
message TrustyIpcPollFtraceEvent {
  optional uint32 chan = 1;
  optional uint32 poll_mask = 2;
  optional string srv_name = 3;
}
message TrustyIpcReadFtraceEvent {
  optional uint32 chan = 1;
  optional string srv_name = 2;
}
message TrustyIpcReadEndFtraceEvent {
  optional uint64 buf_id = 1;
  optional uint32 chan = 2;
  optional int32 len_or_err = 3;
  optional uint64 shm_cnt = 4;
  optional string srv_name = 5;
}
message TrustyIpcRxFtraceEvent {
  optional uint64 buf_id = 1;
  optional uint32 chan = 2;
  optional string srv_name = 3;
}
message TrustyEnqueueNopFtraceEvent {
  optional uint32 arg1 = 1;
  optional uint32 arg2 = 2;
  optional uint32 arg3 = 3;
}

// End of protos/perfetto/trace/ftrace/trusty.proto

// Begin of protos/perfetto/trace/ftrace/ufs.proto

message UfshcdCommandFtraceEvent {
  optional string dev_name = 1;
  optional uint32 doorbell = 2;
  optional uint32 intr = 3;
  optional uint64 lba = 4;
  optional uint32 opcode = 5;
  optional string str = 6;
  optional uint32 tag = 7;
  optional int32 transfer_len = 8;
  optional uint32 group_id = 9;
  optional uint32 str_t = 10;
}
message UfshcdClkGatingFtraceEvent {
  optional string dev_name = 1;
  optional int32 state = 2;
}

// End of protos/perfetto/trace/ftrace/ufs.proto

// Begin of protos/perfetto/trace/ftrace/v4l2.proto

message V4l2QbufFtraceEvent {
  optional uint32 bytesused = 1;
  optional uint32 field = 2;
  optional uint32 flags = 3;
  optional uint32 index = 4;
  optional int32 minor = 5;
  optional uint32 sequence = 6;
  optional uint32 timecode_flags = 7;
  optional uint32 timecode_frames = 8;
  optional uint32 timecode_hours = 9;
  optional uint32 timecode_minutes = 10;
  optional uint32 timecode_seconds = 11;
  optional uint32 timecode_type = 12;
  optional uint32 timecode_userbits0 = 13;
  optional uint32 timecode_userbits1 = 14;
  optional uint32 timecode_userbits2 = 15;
  optional uint32 timecode_userbits3 = 16;
  optional int64 timestamp = 17;
  optional uint32 type = 18;
}
message V4l2DqbufFtraceEvent {
  optional uint32 bytesused = 1;
  optional uint32 field = 2;
  optional uint32 flags = 3;
  optional uint32 index = 4;
  optional int32 minor = 5;
  optional uint32 sequence = 6;
  optional uint32 timecode_flags = 7;
  optional uint32 timecode_frames = 8;
  optional uint32 timecode_hours = 9;
  optional uint32 timecode_minutes = 10;
  optional uint32 timecode_seconds = 11;
  optional uint32 timecode_type = 12;
  optional uint32 timecode_userbits0 = 13;
  optional uint32 timecode_userbits1 = 14;
  optional uint32 timecode_userbits2 = 15;
  optional uint32 timecode_userbits3 = 16;
  optional int64 timestamp = 17;
  optional uint32 type = 18;
}
message Vb2V4l2BufQueueFtraceEvent {
  optional uint32 field = 1;
  optional uint32 flags = 2;
  optional int32 minor = 3;
  optional uint32 sequence = 4;
  optional uint32 timecode_flags = 5;
  optional uint32 timecode_frames = 6;
  optional uint32 timecode_hours = 7;
  optional uint32 timecode_minutes = 8;
  optional uint32 timecode_seconds = 9;
  optional uint32 timecode_type = 10;
  optional uint32 timecode_userbits0 = 11;
  optional uint32 timecode_userbits1 = 12;
  optional uint32 timecode_userbits2 = 13;
  optional uint32 timecode_userbits3 = 14;
  optional int64 timestamp = 15;
}
message Vb2V4l2BufDoneFtraceEvent {
  optional uint32 field = 1;
  optional uint32 flags = 2;
  optional int32 minor = 3;
  optional uint32 sequence = 4;
  optional uint32 timecode_flags = 5;
  optional uint32 timecode_frames = 6;
  optional uint32 timecode_hours = 7;
  optional uint32 timecode_minutes = 8;
  optional uint32 timecode_seconds = 9;
  optional uint32 timecode_type = 10;
  optional uint32 timecode_userbits0 = 11;
  optional uint32 timecode_userbits1 = 12;
  optional uint32 timecode_userbits2 = 13;
  optional uint32 timecode_userbits3 = 14;
  optional int64 timestamp = 15;
}
message Vb2V4l2QbufFtraceEvent {
  optional uint32 field = 1;
  optional uint32 flags = 2;
  optional int32 minor = 3;
  optional uint32 sequence = 4;
  optional uint32 timecode_flags = 5;
  optional uint32 timecode_frames = 6;
  optional uint32 timecode_hours = 7;
  optional uint32 timecode_minutes = 8;
  optional uint32 timecode_seconds = 9;
  optional uint32 timecode_type = 10;
  optional uint32 timecode_userbits0 = 11;
  optional uint32 timecode_userbits1 = 12;
  optional uint32 timecode_userbits2 = 13;
  optional uint32 timecode_userbits3 = 14;
  optional int64 timestamp = 15;
}
message Vb2V4l2DqbufFtraceEvent {
  optional uint32 field = 1;
  optional uint32 flags = 2;
  optional int32 minor = 3;
  optional uint32 sequence = 4;
  optional uint32 timecode_flags = 5;
  optional uint32 timecode_frames = 6;
  optional uint32 timecode_hours = 7;
  optional uint32 timecode_minutes = 8;
  optional uint32 timecode_seconds = 9;
  optional uint32 timecode_type = 10;
  optional uint32 timecode_userbits0 = 11;
  optional uint32 timecode_userbits1 = 12;
  optional uint32 timecode_userbits2 = 13;
  optional uint32 timecode_userbits3 = 14;
  optional int64 timestamp = 15;
}

// End of protos/perfetto/trace/ftrace/v4l2.proto

// Begin of protos/perfetto/trace/ftrace/virtio_gpu.proto

message VirtioGpuCmdQueueFtraceEvent {
  optional uint32 ctx_id = 1;
  optional int32 dev = 2;
  optional uint64 fence_id = 3;
  optional uint32 flags = 4;
  optional string name = 5;
  optional uint32 num_free = 6;
  optional uint32 seqno = 7;
  optional uint32 type = 8;
  optional uint32 vq = 9;
}
message VirtioGpuCmdResponseFtraceEvent {
  optional uint32 ctx_id = 1;
  optional int32 dev = 2;
  optional uint64 fence_id = 3;
  optional uint32 flags = 4;
  optional string name = 5;
  optional uint32 num_free = 6;
  optional uint32 seqno = 7;
  optional uint32 type = 8;
  optional uint32 vq = 9;
}

// End of protos/perfetto/trace/ftrace/virtio_gpu.proto

// Begin of protos/perfetto/trace/ftrace/virtio_video.proto

message VirtioVideoCmdFtraceEvent {
  optional uint32 stream_id = 1;
  optional uint32 type = 2;
}
message VirtioVideoCmdDoneFtraceEvent {
  optional uint32 stream_id = 1;
  optional uint32 type = 2;
}
message VirtioVideoResourceQueueFtraceEvent {
  optional uint32 data_size0 = 1;
  optional uint32 data_size1 = 2;
  optional uint32 data_size2 = 3;
  optional uint32 data_size3 = 4;
  optional uint32 queue_type = 5;
  optional int32 resource_id = 6;
  optional int32 stream_id = 7;
  optional uint64 timestamp = 8;
}
message VirtioVideoResourceQueueDoneFtraceEvent {
  optional uint32 data_size0 = 1;
  optional uint32 data_size1 = 2;
  optional uint32 data_size2 = 3;
  optional uint32 data_size3 = 4;
  optional uint32 queue_type = 5;
  optional int32 resource_id = 6;
  optional int32 stream_id = 7;
  optional uint64 timestamp = 8;
}

// End of protos/perfetto/trace/ftrace/virtio_video.proto

// Begin of protos/perfetto/trace/ftrace/vmscan.proto

message MmVmscanDirectReclaimBeginFtraceEvent {
  optional int32 order = 1;
  optional int32 may_writepage = 2;
  optional uint32 gfp_flags = 3;
}
message MmVmscanDirectReclaimEndFtraceEvent {
  optional uint64 nr_reclaimed = 1;
}
message MmVmscanKswapdWakeFtraceEvent {
  optional int32 nid = 1;
  optional int32 order = 2;
  optional int32 zid = 3;
}
message MmVmscanKswapdSleepFtraceEvent {
  optional int32 nid = 1;
}
message MmShrinkSlabStartFtraceEvent {
  optional uint64 cache_items = 1;
  optional uint64 delta = 2;
  optional uint32 gfp_flags = 3;
  optional uint64 lru_pgs = 4;
  optional int64 nr_objects_to_shrink = 5;
  optional uint64 pgs_scanned = 6;
  optional uint64 shr = 7;
  optional uint64 shrink = 8;
  optional uint64 total_scan = 9;
  optional int32 nid = 10;
  optional int32 priority = 11;
}
message MmShrinkSlabEndFtraceEvent {
  optional int64 new_scan = 1;
  optional int32 retval = 2;
  optional uint64 shr = 3;
  optional uint64 shrink = 4;
  optional int64 total_scan = 5;
  optional int64 unused_scan = 6;
  optional int32 nid = 7;
}

// End of protos/perfetto/trace/ftrace/vmscan.proto

// Begin of protos/perfetto/trace/ftrace/workqueue.proto

message WorkqueueActivateWorkFtraceEvent {
  optional uint64 work = 1;
}
message WorkqueueExecuteEndFtraceEvent {
  optional uint64 work = 1;
  optional uint64 function = 2;
}
message WorkqueueExecuteStartFtraceEvent {
  optional uint64 work = 1;
  optional uint64 function = 2;
}
message WorkqueueQueueWorkFtraceEvent {
  optional uint64 work = 1;
  optional uint64 function = 2;
  optional uint64 workqueue = 3;
  optional uint32 req_cpu = 4;
  optional uint32 cpu = 5;
}

// End of protos/perfetto/trace/ftrace/workqueue.proto

// Begin of protos/perfetto/trace/ftrace/ftrace_event.proto

message FtraceEvent {
  // Timestamp in nanoseconds using .../tracing/trace_clock.
  optional uint64 timestamp = 1;

  // Kernel pid (do not confuse with userspace pid aka tgid).
  optional uint32 pid = 2;

  // Not populated in actual traces. Wire format might change.
  // Placeholder declaration so that the ftrace parsing code accepts the
  // existence of this common field. If this becomes needed for all events:
  // consider merging with common_preempt_count to avoid extra proto tags.
  optional uint32 common_flags = 5;

  oneof event {
    PrintFtraceEvent print = 3;
    SchedSwitchFtraceEvent sched_switch = 4;
    // removed field with id 5;
    // removed field with id 6;
    // removed field with id 7;
    // removed field with id 8;
    // removed field with id 9;
    // removed field with id 10;
    CpuFrequencyFtraceEvent cpu_frequency = 11;
    CpuFrequencyLimitsFtraceEvent cpu_frequency_limits = 12;
    CpuIdleFtraceEvent cpu_idle = 13;
    ClockEnableFtraceEvent clock_enable = 14;
    ClockDisableFtraceEvent clock_disable = 15;
    ClockSetRateFtraceEvent clock_set_rate = 16;
    SchedWakeupFtraceEvent sched_wakeup = 17;
    SchedBlockedReasonFtraceEvent sched_blocked_reason = 18;
    SchedCpuHotplugFtraceEvent sched_cpu_hotplug = 19;
    SchedWakingFtraceEvent sched_waking = 20;
    IpiEntryFtraceEvent ipi_entry = 21;
    IpiExitFtraceEvent ipi_exit = 22;
    IpiRaiseFtraceEvent ipi_raise = 23;
    SoftirqEntryFtraceEvent softirq_entry = 24;
    SoftirqExitFtraceEvent softirq_exit = 25;
    SoftirqRaiseFtraceEvent softirq_raise = 26;
    I2cReadFtraceEvent i2c_read = 27;
    I2cWriteFtraceEvent i2c_write = 28;
    I2cResultFtraceEvent i2c_result = 29;
    I2cReplyFtraceEvent i2c_reply = 30;
    SmbusReadFtraceEvent smbus_read = 31;
    SmbusWriteFtraceEvent smbus_write = 32;
    SmbusResultFtraceEvent smbus_result = 33;
    SmbusReplyFtraceEvent smbus_reply = 34;
    LowmemoryKillFtraceEvent lowmemory_kill = 35;
    IrqHandlerEntryFtraceEvent irq_handler_entry = 36;
    IrqHandlerExitFtraceEvent irq_handler_exit = 37;
    SyncPtFtraceEvent sync_pt = 38;
    SyncTimelineFtraceEvent sync_timeline = 39;
    SyncWaitFtraceEvent sync_wait = 40;
    Ext4DaWriteBeginFtraceEvent ext4_da_write_begin = 41;
    Ext4DaWriteEndFtraceEvent ext4_da_write_end = 42;
    Ext4SyncFileEnterFtraceEvent ext4_sync_file_enter = 43;
    Ext4SyncFileExitFtraceEvent ext4_sync_file_exit = 44;
    BlockRqIssueFtraceEvent block_rq_issue = 45;
    MmVmscanDirectReclaimBeginFtraceEvent mm_vmscan_direct_reclaim_begin = 46;
    MmVmscanDirectReclaimEndFtraceEvent mm_vmscan_direct_reclaim_end = 47;
    MmVmscanKswapdWakeFtraceEvent mm_vmscan_kswapd_wake = 48;
    MmVmscanKswapdSleepFtraceEvent mm_vmscan_kswapd_sleep = 49;
    BinderTransactionFtraceEvent binder_transaction = 50;
    BinderTransactionReceivedFtraceEvent binder_transaction_received = 51;
    BinderSetPriorityFtraceEvent binder_set_priority = 52;
    BinderLockFtraceEvent binder_lock = 53;
    BinderLockedFtraceEvent binder_locked = 54;
    BinderUnlockFtraceEvent binder_unlock = 55;
    WorkqueueActivateWorkFtraceEvent workqueue_activate_work = 56;
    WorkqueueExecuteEndFtraceEvent workqueue_execute_end = 57;
    WorkqueueExecuteStartFtraceEvent workqueue_execute_start = 58;
    WorkqueueQueueWorkFtraceEvent workqueue_queue_work = 59;
    RegulatorDisableFtraceEvent regulator_disable = 60;
    RegulatorDisableCompleteFtraceEvent regulator_disable_complete = 61;
    RegulatorEnableFtraceEvent regulator_enable = 62;
    RegulatorEnableCompleteFtraceEvent regulator_enable_complete = 63;
    RegulatorEnableDelayFtraceEvent regulator_enable_delay = 64;
    RegulatorSetVoltageFtraceEvent regulator_set_voltage = 65;
    RegulatorSetVoltageCompleteFtraceEvent regulator_set_voltage_complete = 66;
    CgroupAttachTaskFtraceEvent cgroup_attach_task = 67;
    CgroupMkdirFtraceEvent cgroup_mkdir = 68;
    CgroupRemountFtraceEvent cgroup_remount = 69;
    CgroupRmdirFtraceEvent cgroup_rmdir = 70;
    CgroupTransferTasksFtraceEvent cgroup_transfer_tasks = 71;
    CgroupDestroyRootFtraceEvent cgroup_destroy_root = 72;
    CgroupReleaseFtraceEvent cgroup_release = 73;
    CgroupRenameFtraceEvent cgroup_rename = 74;
    CgroupSetupRootFtraceEvent cgroup_setup_root = 75;
    MdpCmdKickoffFtraceEvent mdp_cmd_kickoff = 76;
    MdpCommitFtraceEvent mdp_commit = 77;
    MdpPerfSetOtFtraceEvent mdp_perf_set_ot = 78;
    MdpSsppChangeFtraceEvent mdp_sspp_change = 79;
    TracingMarkWriteFtraceEvent tracing_mark_write = 80;
    MdpCmdPingpongDoneFtraceEvent mdp_cmd_pingpong_done = 81;
    MdpCompareBwFtraceEvent mdp_compare_bw = 82;
    MdpPerfSetPanicLutsFtraceEvent mdp_perf_set_panic_luts = 83;
    MdpSsppSetFtraceEvent mdp_sspp_set = 84;
    MdpCmdReadptrDoneFtraceEvent mdp_cmd_readptr_done = 85;
    MdpMisrCrcFtraceEvent mdp_misr_crc = 86;
    MdpPerfSetQosLutsFtraceEvent mdp_perf_set_qos_luts = 87;
    MdpTraceCounterFtraceEvent mdp_trace_counter = 88;
    MdpCmdReleaseBwFtraceEvent mdp_cmd_release_bw = 89;
    MdpMixerUpdateFtraceEvent mdp_mixer_update = 90;
    MdpPerfSetWmLevelsFtraceEvent mdp_perf_set_wm_levels = 91;
    MdpVideoUnderrunDoneFtraceEvent mdp_video_underrun_done = 92;
    MdpCmdWaitPingpongFtraceEvent mdp_cmd_wait_pingpong = 93;
    MdpPerfPrefillCalcFtraceEvent mdp_perf_prefill_calc = 94;
    MdpPerfUpdateBusFtraceEvent mdp_perf_update_bus = 95;
    RotatorBwAoAsContextFtraceEvent rotator_bw_ao_as_context = 96;
    MmFilemapAddToPageCacheFtraceEvent mm_filemap_add_to_page_cache = 97;
    MmFilemapDeleteFromPageCacheFtraceEvent mm_filemap_delete_from_page_cache =
        98;
    MmCompactionBeginFtraceEvent mm_compaction_begin = 99;
    MmCompactionDeferCompactionFtraceEvent mm_compaction_defer_compaction = 100;
    MmCompactionDeferredFtraceEvent mm_compaction_deferred = 101;
    MmCompactionDeferResetFtraceEvent mm_compaction_defer_reset = 102;
    MmCompactionEndFtraceEvent mm_compaction_end = 103;
    MmCompactionFinishedFtraceEvent mm_compaction_finished = 104;
    MmCompactionIsolateFreepagesFtraceEvent mm_compaction_isolate_freepages =
        105;
    MmCompactionIsolateMigratepagesFtraceEvent
        mm_compaction_isolate_migratepages = 106;
    MmCompactionKcompactdSleepFtraceEvent mm_compaction_kcompactd_sleep = 107;
    MmCompactionKcompactdWakeFtraceEvent mm_compaction_kcompactd_wake = 108;
    MmCompactionMigratepagesFtraceEvent mm_compaction_migratepages = 109;
    MmCompactionSuitableFtraceEvent mm_compaction_suitable = 110;
    MmCompactionTryToCompactPagesFtraceEvent
        mm_compaction_try_to_compact_pages = 111;
    MmCompactionWakeupKcompactdFtraceEvent mm_compaction_wakeup_kcompactd = 112;
    SuspendResumeFtraceEvent suspend_resume = 113;
    SchedWakeupNewFtraceEvent sched_wakeup_new = 114;
    BlockBioBackmergeFtraceEvent block_bio_backmerge = 115;
    BlockBioBounceFtraceEvent block_bio_bounce = 116;
    BlockBioCompleteFtraceEvent block_bio_complete = 117;
    BlockBioFrontmergeFtraceEvent block_bio_frontmerge = 118;
    BlockBioQueueFtraceEvent block_bio_queue = 119;
    BlockBioRemapFtraceEvent block_bio_remap = 120;
    BlockDirtyBufferFtraceEvent block_dirty_buffer = 121;
    BlockGetrqFtraceEvent block_getrq = 122;
    BlockPlugFtraceEvent block_plug = 123;
    BlockRqAbortFtraceEvent block_rq_abort = 124;
    BlockRqCompleteFtraceEvent block_rq_complete = 125;
    BlockRqInsertFtraceEvent block_rq_insert = 126;
    // removed field with id 127;
    BlockRqRemapFtraceEvent block_rq_remap = 128;
    BlockRqRequeueFtraceEvent block_rq_requeue = 129;
    BlockSleeprqFtraceEvent block_sleeprq = 130;
    BlockSplitFtraceEvent block_split = 131;
    BlockTouchBufferFtraceEvent block_touch_buffer = 132;
    BlockUnplugFtraceEvent block_unplug = 133;
    Ext4AllocDaBlocksFtraceEvent ext4_alloc_da_blocks = 134;
    Ext4AllocateBlocksFtraceEvent ext4_allocate_blocks = 135;
    Ext4AllocateInodeFtraceEvent ext4_allocate_inode = 136;
    Ext4BeginOrderedTruncateFtraceEvent ext4_begin_ordered_truncate = 137;
    Ext4CollapseRangeFtraceEvent ext4_collapse_range = 138;
    Ext4DaReleaseSpaceFtraceEvent ext4_da_release_space = 139;
    Ext4DaReserveSpaceFtraceEvent ext4_da_reserve_space = 140;
    Ext4DaUpdateReserveSpaceFtraceEvent ext4_da_update_reserve_space = 141;
    Ext4DaWritePagesFtraceEvent ext4_da_write_pages = 142;
    Ext4DaWritePagesExtentFtraceEvent ext4_da_write_pages_extent = 143;
    Ext4DirectIOEnterFtraceEvent ext4_direct_IO_enter = 144;
    Ext4DirectIOExitFtraceEvent ext4_direct_IO_exit = 145;
    Ext4DiscardBlocksFtraceEvent ext4_discard_blocks = 146;
    Ext4DiscardPreallocationsFtraceEvent ext4_discard_preallocations = 147;
    Ext4DropInodeFtraceEvent ext4_drop_inode = 148;
    Ext4EsCacheExtentFtraceEvent ext4_es_cache_extent = 149;
    Ext4EsFindDelayedExtentRangeEnterFtraceEvent
        ext4_es_find_delayed_extent_range_enter = 150;
    Ext4EsFindDelayedExtentRangeExitFtraceEvent
        ext4_es_find_delayed_extent_range_exit = 151;
    Ext4EsInsertExtentFtraceEvent ext4_es_insert_extent = 152;
    Ext4EsLookupExtentEnterFtraceEvent ext4_es_lookup_extent_enter = 153;
    Ext4EsLookupExtentExitFtraceEvent ext4_es_lookup_extent_exit = 154;
    Ext4EsRemoveExtentFtraceEvent ext4_es_remove_extent = 155;
    Ext4EsShrinkFtraceEvent ext4_es_shrink = 156;
    Ext4EsShrinkCountFtraceEvent ext4_es_shrink_count = 157;
    Ext4EsShrinkScanEnterFtraceEvent ext4_es_shrink_scan_enter = 158;
    Ext4EsShrinkScanExitFtraceEvent ext4_es_shrink_scan_exit = 159;
    Ext4EvictInodeFtraceEvent ext4_evict_inode = 160;
    Ext4ExtConvertToInitializedEnterFtraceEvent
        ext4_ext_convert_to_initialized_enter = 161;
    Ext4ExtConvertToInitializedFastpathFtraceEvent
        ext4_ext_convert_to_initialized_fastpath = 162;
    Ext4ExtHandleUnwrittenExtentsFtraceEvent ext4_ext_handle_unwritten_extents =
        163;
    Ext4ExtInCacheFtraceEvent ext4_ext_in_cache = 164;
    Ext4ExtLoadExtentFtraceEvent ext4_ext_load_extent = 165;
    Ext4ExtMapBlocksEnterFtraceEvent ext4_ext_map_blocks_enter = 166;
    Ext4ExtMapBlocksExitFtraceEvent ext4_ext_map_blocks_exit = 167;
    Ext4ExtPutInCacheFtraceEvent ext4_ext_put_in_cache = 168;
    Ext4ExtRemoveSpaceFtraceEvent ext4_ext_remove_space = 169;
    Ext4ExtRemoveSpaceDoneFtraceEvent ext4_ext_remove_space_done = 170;
    Ext4ExtRmIdxFtraceEvent ext4_ext_rm_idx = 171;
    Ext4ExtRmLeafFtraceEvent ext4_ext_rm_leaf = 172;
    Ext4ExtShowExtentFtraceEvent ext4_ext_show_extent = 173;
    Ext4FallocateEnterFtraceEvent ext4_fallocate_enter = 174;
    Ext4FallocateExitFtraceEvent ext4_fallocate_exit = 175;
    Ext4FindDelallocRangeFtraceEvent ext4_find_delalloc_range = 176;
    Ext4ForgetFtraceEvent ext4_forget = 177;
    Ext4FreeBlocksFtraceEvent ext4_free_blocks = 178;
    Ext4FreeInodeFtraceEvent ext4_free_inode = 179;
    Ext4GetImpliedClusterAllocExitFtraceEvent
        ext4_get_implied_cluster_alloc_exit = 180;
    Ext4GetReservedClusterAllocFtraceEvent ext4_get_reserved_cluster_alloc =
        181;
    Ext4IndMapBlocksEnterFtraceEvent ext4_ind_map_blocks_enter = 182;
    Ext4IndMapBlocksExitFtraceEvent ext4_ind_map_blocks_exit = 183;
    Ext4InsertRangeFtraceEvent ext4_insert_range = 184;
    Ext4InvalidatepageFtraceEvent ext4_invalidatepage = 185;
    Ext4JournalStartFtraceEvent ext4_journal_start = 186;
    Ext4JournalStartReservedFtraceEvent ext4_journal_start_reserved = 187;
    Ext4JournalledInvalidatepageFtraceEvent ext4_journalled_invalidatepage =
        188;
    Ext4JournalledWriteEndFtraceEvent ext4_journalled_write_end = 189;
    Ext4LoadInodeFtraceEvent ext4_load_inode = 190;
    Ext4LoadInodeBitmapFtraceEvent ext4_load_inode_bitmap = 191;
    Ext4MarkInodeDirtyFtraceEvent ext4_mark_inode_dirty = 192;
    Ext4MbBitmapLoadFtraceEvent ext4_mb_bitmap_load = 193;
    Ext4MbBuddyBitmapLoadFtraceEvent ext4_mb_buddy_bitmap_load = 194;
    Ext4MbDiscardPreallocationsFtraceEvent ext4_mb_discard_preallocations = 195;
    Ext4MbNewGroupPaFtraceEvent ext4_mb_new_group_pa = 196;
    Ext4MbNewInodePaFtraceEvent ext4_mb_new_inode_pa = 197;
    Ext4MbReleaseGroupPaFtraceEvent ext4_mb_release_group_pa = 198;
    Ext4MbReleaseInodePaFtraceEvent ext4_mb_release_inode_pa = 199;
    Ext4MballocAllocFtraceEvent ext4_mballoc_alloc = 200;
    Ext4MballocDiscardFtraceEvent ext4_mballoc_discard = 201;
    Ext4MballocFreeFtraceEvent ext4_mballoc_free = 202;
    Ext4MballocPreallocFtraceEvent ext4_mballoc_prealloc = 203;
    Ext4OtherInodeUpdateTimeFtraceEvent ext4_other_inode_update_time = 204;
    Ext4PunchHoleFtraceEvent ext4_punch_hole = 205;
    Ext4ReadBlockBitmapLoadFtraceEvent ext4_read_block_bitmap_load = 206;
    Ext4ReadpageFtraceEvent ext4_readpage = 207;
    Ext4ReleasepageFtraceEvent ext4_releasepage = 208;
    Ext4RemoveBlocksFtraceEvent ext4_remove_blocks = 209;
    Ext4RequestBlocksFtraceEvent ext4_request_blocks = 210;
    Ext4RequestInodeFtraceEvent ext4_request_inode = 211;
    Ext4SyncFsFtraceEvent ext4_sync_fs = 212;
    Ext4TrimAllFreeFtraceEvent ext4_trim_all_free = 213;
    Ext4TrimExtentFtraceEvent ext4_trim_extent = 214;
    Ext4TruncateEnterFtraceEvent ext4_truncate_enter = 215;
    Ext4TruncateExitFtraceEvent ext4_truncate_exit = 216;
    Ext4UnlinkEnterFtraceEvent ext4_unlink_enter = 217;
    Ext4UnlinkExitFtraceEvent ext4_unlink_exit = 218;
    Ext4WriteBeginFtraceEvent ext4_write_begin = 219;
    // removed field with id 220;
    // removed field with id 221;
    // removed field with id 222;
    // removed field with id 223;
    // removed field with id 224;
    // removed field with id 225;
    // removed field with id 226;
    // removed field with id 227;
    // removed field with id 228;
    // removed field with id 229;
    Ext4WriteEndFtraceEvent ext4_write_end = 230;
    Ext4WritepageFtraceEvent ext4_writepage = 231;
    Ext4WritepagesFtraceEvent ext4_writepages = 232;
    Ext4WritepagesResultFtraceEvent ext4_writepages_result = 233;
    Ext4ZeroRangeFtraceEvent ext4_zero_range = 234;
    TaskNewtaskFtraceEvent task_newtask = 235;
    TaskRenameFtraceEvent task_rename = 236;
    SchedProcessExecFtraceEvent sched_process_exec = 237;
    SchedProcessExitFtraceEvent sched_process_exit = 238;
    SchedProcessForkFtraceEvent sched_process_fork = 239;
    SchedProcessFreeFtraceEvent sched_process_free = 240;
    SchedProcessHangFtraceEvent sched_process_hang = 241;
    SchedProcessWaitFtraceEvent sched_process_wait = 242;
    F2fsDoSubmitBioFtraceEvent f2fs_do_submit_bio = 243;
    F2fsEvictInodeFtraceEvent f2fs_evict_inode = 244;
    F2fsFallocateFtraceEvent f2fs_fallocate = 245;
    F2fsGetDataBlockFtraceEvent f2fs_get_data_block = 246;
    F2fsGetVictimFtraceEvent f2fs_get_victim = 247;
    F2fsIgetFtraceEvent f2fs_iget = 248;
    F2fsIgetExitFtraceEvent f2fs_iget_exit = 249;
    F2fsNewInodeFtraceEvent f2fs_new_inode = 250;
    F2fsReadpageFtraceEvent f2fs_readpage = 251;
    F2fsReserveNewBlockFtraceEvent f2fs_reserve_new_block = 252;
    F2fsSetPageDirtyFtraceEvent f2fs_set_page_dirty = 253;
    F2fsSubmitWritePageFtraceEvent f2fs_submit_write_page = 254;
    F2fsSyncFileEnterFtraceEvent f2fs_sync_file_enter = 255;
    F2fsSyncFileExitFtraceEvent f2fs_sync_file_exit = 256;
    F2fsSyncFsFtraceEvent f2fs_sync_fs = 257;
    F2fsTruncateFtraceEvent f2fs_truncate = 258;
    F2fsTruncateBlocksEnterFtraceEvent f2fs_truncate_blocks_enter = 259;
    F2fsTruncateBlocksExitFtraceEvent f2fs_truncate_blocks_exit = 260;
    F2fsTruncateDataBlocksRangeFtraceEvent f2fs_truncate_data_blocks_range =
        261;
    F2fsTruncateInodeBlocksEnterFtraceEvent f2fs_truncate_inode_blocks_enter =
        262;
    F2fsTruncateInodeBlocksExitFtraceEvent f2fs_truncate_inode_blocks_exit =
        263;
    F2fsTruncateNodeFtraceEvent f2fs_truncate_node = 264;
    F2fsTruncateNodesEnterFtraceEvent f2fs_truncate_nodes_enter = 265;
    F2fsTruncateNodesExitFtraceEvent f2fs_truncate_nodes_exit = 266;
    F2fsTruncatePartialNodesFtraceEvent f2fs_truncate_partial_nodes = 267;
    F2fsUnlinkEnterFtraceEvent f2fs_unlink_enter = 268;
    F2fsUnlinkExitFtraceEvent f2fs_unlink_exit = 269;
    F2fsVmPageMkwriteFtraceEvent f2fs_vm_page_mkwrite = 270;
    F2fsWriteBeginFtraceEvent f2fs_write_begin = 271;
    F2fsWriteCheckpointFtraceEvent f2fs_write_checkpoint = 272;
    F2fsWriteEndFtraceEvent f2fs_write_end = 273;
    AllocPagesIommuEndFtraceEvent alloc_pages_iommu_end = 274;
    AllocPagesIommuFailFtraceEvent alloc_pages_iommu_fail = 275;
    AllocPagesIommuStartFtraceEvent alloc_pages_iommu_start = 276;
    AllocPagesSysEndFtraceEvent alloc_pages_sys_end = 277;
    AllocPagesSysFailFtraceEvent alloc_pages_sys_fail = 278;
    AllocPagesSysStartFtraceEvent alloc_pages_sys_start = 279;
    DmaAllocContiguousRetryFtraceEvent dma_alloc_contiguous_retry = 280;
    IommuMapRangeFtraceEvent iommu_map_range = 281;
    IommuSecPtblMapRangeEndFtraceEvent iommu_sec_ptbl_map_range_end = 282;
    IommuSecPtblMapRangeStartFtraceEvent iommu_sec_ptbl_map_range_start = 283;
    IonAllocBufferEndFtraceEvent ion_alloc_buffer_end = 284;
    IonAllocBufferFailFtraceEvent ion_alloc_buffer_fail = 285;
    IonAllocBufferFallbackFtraceEvent ion_alloc_buffer_fallback = 286;
    IonAllocBufferStartFtraceEvent ion_alloc_buffer_start = 287;
    IonCpAllocRetryFtraceEvent ion_cp_alloc_retry = 288;
    IonCpSecureBufferEndFtraceEvent ion_cp_secure_buffer_end = 289;
    IonCpSecureBufferStartFtraceEvent ion_cp_secure_buffer_start = 290;
    IonPrefetchingFtraceEvent ion_prefetching = 291;
    IonSecureCmaAddToPoolEndFtraceEvent ion_secure_cma_add_to_pool_end = 292;
    IonSecureCmaAddToPoolStartFtraceEvent ion_secure_cma_add_to_pool_start =
        293;
    IonSecureCmaAllocateEndFtraceEvent ion_secure_cma_allocate_end = 294;
    IonSecureCmaAllocateStartFtraceEvent ion_secure_cma_allocate_start = 295;
    IonSecureCmaShrinkPoolEndFtraceEvent ion_secure_cma_shrink_pool_end = 296;
    IonSecureCmaShrinkPoolStartFtraceEvent ion_secure_cma_shrink_pool_start =
        297;
    KfreeFtraceEvent kfree = 298;
    KmallocFtraceEvent kmalloc = 299;
    KmallocNodeFtraceEvent kmalloc_node = 300;
    KmemCacheAllocFtraceEvent kmem_cache_alloc = 301;
    KmemCacheAllocNodeFtraceEvent kmem_cache_alloc_node = 302;
    KmemCacheFreeFtraceEvent kmem_cache_free = 303;
    MigratePagesEndFtraceEvent migrate_pages_end = 304;
    MigratePagesStartFtraceEvent migrate_pages_start = 305;
    MigrateRetryFtraceEvent migrate_retry = 306;
    MmPageAllocFtraceEvent mm_page_alloc = 307;
    MmPageAllocExtfragFtraceEvent mm_page_alloc_extfrag = 308;
    MmPageAllocZoneLockedFtraceEvent mm_page_alloc_zone_locked = 309;
    MmPageFreeFtraceEvent mm_page_free = 310;
    MmPageFreeBatchedFtraceEvent mm_page_free_batched = 311;
    MmPagePcpuDrainFtraceEvent mm_page_pcpu_drain = 312;
    RssStatFtraceEvent rss_stat = 313;
    IonHeapShrinkFtraceEvent ion_heap_shrink = 314;
    IonHeapGrowFtraceEvent ion_heap_grow = 315;
    FenceInitFtraceEvent fence_init = 316;
    FenceDestroyFtraceEvent fence_destroy = 317;
    FenceEnableSignalFtraceEvent fence_enable_signal = 318;
    FenceSignaledFtraceEvent fence_signaled = 319;
    ClkEnableFtraceEvent clk_enable = 320;
    ClkDisableFtraceEvent clk_disable = 321;
    ClkSetRateFtraceEvent clk_set_rate = 322;
    BinderTransactionAllocBufFtraceEvent binder_transaction_alloc_buf = 323;
    SignalDeliverFtraceEvent signal_deliver = 324;
    SignalGenerateFtraceEvent signal_generate = 325;
    OomScoreAdjUpdateFtraceEvent oom_score_adj_update = 326;
    GenericFtraceEvent generic = 327;
    MmEventRecordFtraceEvent mm_event_record = 328;
    SysEnterFtraceEvent sys_enter = 329;
    SysExitFtraceEvent sys_exit = 330;
    ZeroFtraceEvent zero = 331;
    GpuFrequencyFtraceEvent gpu_frequency = 332;
    SdeTracingMarkWriteFtraceEvent sde_tracing_mark_write = 333;
    MarkVictimFtraceEvent mark_victim = 334;
    IonStatFtraceEvent ion_stat = 335;
    IonBufferCreateFtraceEvent ion_buffer_create = 336;
    IonBufferDestroyFtraceEvent ion_buffer_destroy = 337;
    ScmCallStartFtraceEvent scm_call_start = 338;
    ScmCallEndFtraceEvent scm_call_end = 339;
    GpuMemTotalFtraceEvent gpu_mem_total = 340;
    ThermalTemperatureFtraceEvent thermal_temperature = 341;
    CdevUpdateFtraceEvent cdev_update = 342;
    CpuhpExitFtraceEvent cpuhp_exit = 343;
    CpuhpMultiEnterFtraceEvent cpuhp_multi_enter = 344;
    CpuhpEnterFtraceEvent cpuhp_enter = 345;
    CpuhpLatencyFtraceEvent cpuhp_latency = 346;
    FastrpcDmaStatFtraceEvent fastrpc_dma_stat = 347;
    DpuTracingMarkWriteFtraceEvent dpu_tracing_mark_write = 348;
    G2dTracingMarkWriteFtraceEvent g2d_tracing_mark_write = 349;
    MaliTracingMarkWriteFtraceEvent mali_tracing_mark_write = 350;
    DmaHeapStatFtraceEvent dma_heap_stat = 351;
    CpuhpPauseFtraceEvent cpuhp_pause = 352;
    SchedPiSetprioFtraceEvent sched_pi_setprio = 353;
    SdeSdeEvtlogFtraceEvent sde_sde_evtlog = 354;
    SdeSdePerfCalcCrtcFtraceEvent sde_sde_perf_calc_crtc = 355;
    SdeSdePerfCrtcUpdateFtraceEvent sde_sde_perf_crtc_update = 356;
    SdeSdePerfSetQosLutsFtraceEvent sde_sde_perf_set_qos_luts = 357;
    SdeSdePerfUpdateBusFtraceEvent sde_sde_perf_update_bus = 358;
    RssStatThrottledFtraceEvent rss_stat_throttled = 359;
    NetifReceiveSkbFtraceEvent netif_receive_skb = 360;
    NetDevXmitFtraceEvent net_dev_xmit = 361;
    InetSockSetStateFtraceEvent inet_sock_set_state = 362;
    TcpRetransmitSkbFtraceEvent tcp_retransmit_skb = 363;
    CrosEcSensorhubDataFtraceEvent cros_ec_sensorhub_data = 364;
    NapiGroReceiveEntryFtraceEvent napi_gro_receive_entry = 365;
    NapiGroReceiveExitFtraceEvent napi_gro_receive_exit = 366;
    KfreeSkbFtraceEvent kfree_skb = 367;
    KvmAccessFaultFtraceEvent kvm_access_fault = 368;
    KvmAckIrqFtraceEvent kvm_ack_irq = 369;
    KvmAgeHvaFtraceEvent kvm_age_hva = 370;
    KvmAgePageFtraceEvent kvm_age_page = 371;
    KvmArmClearDebugFtraceEvent kvm_arm_clear_debug = 372;
    KvmArmSetDreg32FtraceEvent kvm_arm_set_dreg32 = 373;
    KvmArmSetRegsetFtraceEvent kvm_arm_set_regset = 374;
    KvmArmSetupDebugFtraceEvent kvm_arm_setup_debug = 375;
    KvmEntryFtraceEvent kvm_entry = 376;
    KvmExitFtraceEvent kvm_exit = 377;
    KvmFpuFtraceEvent kvm_fpu = 378;
    KvmGetTimerMapFtraceEvent kvm_get_timer_map = 379;
    KvmGuestFaultFtraceEvent kvm_guest_fault = 380;
    KvmHandleSysRegFtraceEvent kvm_handle_sys_reg = 381;
    KvmHvcArm64FtraceEvent kvm_hvc_arm64 = 382;
    KvmIrqLineFtraceEvent kvm_irq_line = 383;
    KvmMmioFtraceEvent kvm_mmio = 384;
    KvmMmioEmulateFtraceEvent kvm_mmio_emulate = 385;
    KvmSetGuestDebugFtraceEvent kvm_set_guest_debug = 386;
    KvmSetIrqFtraceEvent kvm_set_irq = 387;
    KvmSetSpteHvaFtraceEvent kvm_set_spte_hva = 388;
    KvmSetWayFlushFtraceEvent kvm_set_way_flush = 389;
    KvmSysAccessFtraceEvent kvm_sys_access = 390;
    KvmTestAgeHvaFtraceEvent kvm_test_age_hva = 391;
    KvmTimerEmulateFtraceEvent kvm_timer_emulate = 392;
    KvmTimerHrtimerExpireFtraceEvent kvm_timer_hrtimer_expire = 393;
    KvmTimerRestoreStateFtraceEvent kvm_timer_restore_state = 394;
    KvmTimerSaveStateFtraceEvent kvm_timer_save_state = 395;
    KvmTimerUpdateIrqFtraceEvent kvm_timer_update_irq = 396;
    KvmToggleCacheFtraceEvent kvm_toggle_cache = 397;
    KvmUnmapHvaRangeFtraceEvent kvm_unmap_hva_range = 398;
    KvmUserspaceExitFtraceEvent kvm_userspace_exit = 399;
    KvmVcpuWakeupFtraceEvent kvm_vcpu_wakeup = 400;
    KvmWfxArm64FtraceEvent kvm_wfx_arm64 = 401;
    TrapRegFtraceEvent trap_reg = 402;
    VgicUpdateIrqPendingFtraceEvent vgic_update_irq_pending = 403;
    WakeupSourceActivateFtraceEvent wakeup_source_activate = 404;
    WakeupSourceDeactivateFtraceEvent wakeup_source_deactivate = 405;
    UfshcdCommandFtraceEvent ufshcd_command = 406;
    UfshcdClkGatingFtraceEvent ufshcd_clk_gating = 407;
    ConsoleFtraceEvent console = 408;
    DrmVblankEventFtraceEvent drm_vblank_event = 409;
    DrmVblankEventDeliveredFtraceEvent drm_vblank_event_delivered = 410;
    DrmSchedJobFtraceEvent drm_sched_job = 411;
    DrmRunJobFtraceEvent drm_run_job = 412;
    DrmSchedProcessJobFtraceEvent drm_sched_process_job = 413;
    DmaFenceInitFtraceEvent dma_fence_init = 414;
    DmaFenceEmitFtraceEvent dma_fence_emit = 415;
    DmaFenceSignaledFtraceEvent dma_fence_signaled = 416;
    DmaFenceWaitStartFtraceEvent dma_fence_wait_start = 417;
    DmaFenceWaitEndFtraceEvent dma_fence_wait_end = 418;
    F2fsIostatFtraceEvent f2fs_iostat = 419;
    F2fsIostatLatencyFtraceEvent f2fs_iostat_latency = 420;
    SchedCpuUtilCfsFtraceEvent sched_cpu_util_cfs = 421;
    V4l2QbufFtraceEvent v4l2_qbuf = 422;
    V4l2DqbufFtraceEvent v4l2_dqbuf = 423;
    Vb2V4l2BufQueueFtraceEvent vb2_v4l2_buf_queue = 424;
    Vb2V4l2BufDoneFtraceEvent vb2_v4l2_buf_done = 425;
    Vb2V4l2QbufFtraceEvent vb2_v4l2_qbuf = 426;
    Vb2V4l2DqbufFtraceEvent vb2_v4l2_dqbuf = 427;
    DsiCmdFifoStatusFtraceEvent dsi_cmd_fifo_status = 428;
    DsiRxFtraceEvent dsi_rx = 429;
    DsiTxFtraceEvent dsi_tx = 430;
    // AndroidFsDatareadEndFtraceEvent android_fs_dataread_end = 431;
    // AndroidFsDatareadStartFtraceEvent android_fs_dataread_start = 432;
    // AndroidFsDatawriteEndFtraceEvent android_fs_datawrite_end = 433;
    // AndroidFsDatawriteStartFtraceEvent android_fs_datawrite_start = 434;
    // AndroidFsFsyncEndFtraceEvent android_fs_fsync_end = 435;
    // AndroidFsFsyncStartFtraceEvent android_fs_fsync_start = 436;
    FuncgraphEntryFtraceEvent funcgraph_entry = 437;
    FuncgraphExitFtraceEvent funcgraph_exit = 438;
    VirtioVideoCmdFtraceEvent virtio_video_cmd = 439;
    VirtioVideoCmdDoneFtraceEvent virtio_video_cmd_done = 440;
    VirtioVideoResourceQueueFtraceEvent virtio_video_resource_queue = 441;
    VirtioVideoResourceQueueDoneFtraceEvent virtio_video_resource_queue_done =
        442;
    MmShrinkSlabStartFtraceEvent mm_shrink_slab_start = 443;
    MmShrinkSlabEndFtraceEvent mm_shrink_slab_end = 444;
    TrustySmcFtraceEvent trusty_smc = 445;
    TrustySmcDoneFtraceEvent trusty_smc_done = 446;
    TrustyStdCall32FtraceEvent trusty_std_call32 = 447;
    TrustyStdCall32DoneFtraceEvent trusty_std_call32_done = 448;
    TrustyShareMemoryFtraceEvent trusty_share_memory = 449;
    TrustyShareMemoryDoneFtraceEvent trusty_share_memory_done = 450;
    TrustyReclaimMemoryFtraceEvent trusty_reclaim_memory = 451;
    TrustyReclaimMemoryDoneFtraceEvent trusty_reclaim_memory_done = 452;
    TrustyIrqFtraceEvent trusty_irq = 453;
    TrustyIpcHandleEventFtraceEvent trusty_ipc_handle_event = 454;
    TrustyIpcConnectFtraceEvent trusty_ipc_connect = 455;
    TrustyIpcConnectEndFtraceEvent trusty_ipc_connect_end = 456;
    TrustyIpcWriteFtraceEvent trusty_ipc_write = 457;
    TrustyIpcPollFtraceEvent trusty_ipc_poll = 458;
    // removed field with id 459;
    TrustyIpcReadFtraceEvent trusty_ipc_read = 460;
    TrustyIpcReadEndFtraceEvent trusty_ipc_read_end = 461;
    TrustyIpcRxFtraceEvent trusty_ipc_rx = 462;
    // removed field with id 463;
    TrustyEnqueueNopFtraceEvent trusty_enqueue_nop = 464;
    CmaAllocStartFtraceEvent cma_alloc_start = 465;
    CmaAllocInfoFtraceEvent cma_alloc_info = 466;
    LwisTracingMarkWriteFtraceEvent lwis_tracing_mark_write = 467;
    VirtioGpuCmdQueueFtraceEvent virtio_gpu_cmd_queue = 468;
    VirtioGpuCmdResponseFtraceEvent virtio_gpu_cmd_response = 469;
    // MaliMaliKCPUCQSSETFtraceEvent mali_mali_KCPU_CQS_SET = 470;
    // MaliMaliKCPUCQSWAITSTARTFtraceEvent mali_mali_KCPU_CQS_WAIT_START = 471;
    // MaliMaliKCPUCQSWAITENDFtraceEvent mali_mali_KCPU_CQS_WAIT_END = 472;
    // MaliMaliKCPUFENCESIGNALFtraceEvent mali_mali_KCPU_FENCE_SIGNAL = 473;
    // MaliMaliKCPUFENCEWAITSTARTFtraceEvent mali_mali_KCPU_FENCE_WAIT_START = 474;
    // MaliMaliKCPUFENCEWAITENDFtraceEvent mali_mali_KCPU_FENCE_WAIT_END = 475;
    // HypEnterFtraceEvent hyp_enter = 476;
    // HypExitFtraceEvent hyp_exit = 477;
    // HostHcallFtraceEvent host_hcall = 478;
    // HostSmcFtraceEvent host_smc = 479;
    // HostMemAbortFtraceEvent host_mem_abort = 480;
    // SuspendResumeMinimalFtraceEvent suspend_resume_minimal = 481;
    // MaliMaliCSFINTERRUPTSTARTFtraceEvent mali_mali_CSF_INTERRUPT_START = 482;
    // MaliMaliCSFINTERRUPTENDFtraceEvent mali_mali_CSF_INTERRUPT_END = 483;
    // SamsungTracingMarkWriteFtraceEvent samsung_tracing_mark_write = 484;
    // BinderCommandFtraceEvent binder_command = 485;
    // BinderReturnFtraceEvent binder_return = 486;
    // SchedSwitchWithCtrsFtraceEvent sched_switch_with_ctrs = 487;
    // GpuWorkPeriodFtraceEvent gpu_work_period = 488;
    // RpmStatusFtraceEvent rpm_status = 489;
    // PanelWriteGenericFtraceEvent panel_write_generic = 490;
    // SchedMigrateTaskFtraceEvent sched_migrate_task = 491;
    // DpuDsiCmdFifoStatusFtraceEvent dpu_dsi_cmd_fifo_status = 492;
    // DpuDsiRxFtraceEvent dpu_dsi_rx = 493;
    // DpuDsiTxFtraceEvent dpu_dsi_tx = 494;
    // F2fsBackgroundGcFtraceEvent f2fs_background_gc = 495;
    // F2fsGcBeginFtraceEvent f2fs_gc_begin = 496;
    // F2fsGcEndFtraceEvent f2fs_gc_end = 497;
    // FastrpcDmaFreeFtraceEvent fastrpc_dma_free = 498;
    // FastrpcDmaAllocFtraceEvent fastrpc_dma_alloc = 499;
    // FastrpcDmaUnmapFtraceEvent fastrpc_dma_unmap = 500;
    // FastrpcDmaMapFtraceEvent fastrpc_dma_map = 501;
    // GoogleIccEventFtraceEvent google_icc_event = 502;
    // GoogleIrmEventFtraceEvent google_irm_event = 503;
    // DevicePmCallbackStartFtraceEvent device_pm_callback_start = 504;
    // DevicePmCallbackEndFtraceEvent device_pm_callback_end = 505;
    // ThermalExynosAcpmBulkFtraceEvent thermal_exynos_acpm_bulk = 506;
    // ThermalExynosAcpmHighOverheadFtraceEvent thermal_exynos_acpm_high_overhead =
    //     507;
    // DcvshFreqFtraceEvent dcvsh_freq = 508;
    // KgslGpuFrequencyFtraceEvent kgsl_gpu_frequency = 509;
    // MaliMaliPMMCUHCTLCORESDOWNSCALENOTIFYPENDFtraceEvent
    //     mali_mali_PM_MCU_HCTL_CORES_DOWN_SCALE_NOTIFY_PEND = 510;
    // MaliMaliPMMCUHCTLCORESNOTIFYPENDFtraceEvent
    //     mali_mali_PM_MCU_HCTL_CORES_NOTIFY_PEND = 511;
    // MaliMaliPMMCUHCTLCOREINACTIVEPENDFtraceEvent
    //     mali_mali_PM_MCU_HCTL_CORE_INACTIVE_PEND = 512;
    // MaliMaliPMMCUHCTLMCUONRECHECKFtraceEvent
    //     mali_mali_PM_MCU_HCTL_MCU_ON_RECHECK = 513;
    // MaliMaliPMMCUHCTLSHADERSCOREOFFPENDFtraceEvent
    //     mali_mali_PM_MCU_HCTL_SHADERS_CORE_OFF_PEND = 514;
    // MaliMaliPMMCUHCTLSHADERSPENDOFFFtraceEvent
    //     mali_mali_PM_MCU_HCTL_SHADERS_PEND_OFF = 515;
    // MaliMaliPMMCUHCTLSHADERSPENDONFtraceEvent
    //     mali_mali_PM_MCU_HCTL_SHADERS_PEND_ON = 516;
    // MaliMaliPMMCUHCTLSHADERSREADYOFFFtraceEvent
    //     mali_mali_PM_MCU_HCTL_SHADERS_READY_OFF = 517;
    // MaliMaliPMMCUINSLEEPFtraceEvent mali_mali_PM_MCU_IN_SLEEP = 518;
    // MaliMaliPMMCUOFFFtraceEvent mali_mali_PM_MCU_OFF = 519;
    // MaliMaliPMMCUONFtraceEvent mali_mali_PM_MCU_ON = 520;
    // MaliMaliPMMCUONCOREATTRUPDATEPENDFtraceEvent
    //     mali_mali_PM_MCU_ON_CORE_ATTR_UPDATE_PEND = 521;
    // MaliMaliPMMCUONGLBREINITPENDFtraceEvent
    //     mali_mali_PM_MCU_ON_GLB_REINIT_PEND = 522;
    // MaliMaliPMMCUONHALTFtraceEvent mali_mali_PM_MCU_ON_HALT = 523;
    // MaliMaliPMMCUONHWCNTDISABLEFtraceEvent mali_mali_PM_MCU_ON_HWCNT_DISABLE =
    //     524;
    // MaliMaliPMMCUONHWCNTENABLEFtraceEvent mali_mali_PM_MCU_ON_HWCNT_ENABLE =
    //     525;
    // MaliMaliPMMCUONPENDHALTFtraceEvent mali_mali_PM_MCU_ON_PEND_HALT = 526;
    // MaliMaliPMMCUONPENDSLEEPFtraceEvent mali_mali_PM_MCU_ON_PEND_SLEEP = 527;
    // MaliMaliPMMCUONSLEEPINITIATEFtraceEvent mali_mali_PM_MCU_ON_SLEEP_INITIATE =
    //     528;
    // MaliMaliPMMCUPENDOFFFtraceEvent mali_mali_PM_MCU_PEND_OFF = 529;
    // MaliMaliPMMCUPENDONRELOADFtraceEvent mali_mali_PM_MCU_PEND_ON_RELOAD = 530;
    // MaliMaliPMMCUPOWERDOWNFtraceEvent mali_mali_PM_MCU_POWER_DOWN = 531;
    // MaliMaliPMMCURESETWAITFtraceEvent mali_mali_PM_MCU_RESET_WAIT = 532;
    // BclIrqTriggerFtraceEvent bcl_irq_trigger = 533;
    // KgslAdrenoCmdbatchQueuedFtraceEvent kgsl_adreno_cmdbatch_queued = 534;
    // KgslAdrenoCmdbatchSubmittedFtraceEvent kgsl_adreno_cmdbatch_submitted = 535;
    // KgslAdrenoCmdbatchSyncFtraceEvent kgsl_adreno_cmdbatch_sync = 536;
    // KgslAdrenoCmdbatchRetiredFtraceEvent kgsl_adreno_cmdbatch_retired = 537;
    // PixelMmKswapdWakeFtraceEvent pixel_mm_kswapd_wake = 538;
    // PixelMmKswapdDoneFtraceEvent pixel_mm_kswapd_done = 539;
    SchedWakeupTaskAttrFtraceEvent sched_wakeup_task_attr = 540;
    DevfreqFrequencyFtraceEvent devfreq_frequency = 541;
    KprobeEvent kprobe_event = 542;
    ParamSetValueCpmFtraceEvent param_set_value_cpm = 543;
    DoSysOpenFtraceEvent do_sys_open = 544;
    OpenExecFtraceEvent open_exec = 545;
    BlockIoStartFtraceEvent block_io_start = 546;
    BlockIoDoneFtraceEvent block_io_done = 547;
  }
}

// End of protos/perfetto/trace/ftrace/ftrace_event.proto

// Begin of protos/perfetto/trace/ftrace/ftrace_stats.proto

// Per-CPU kernel buffer stats for the ftrace data source gathered from
// /sys/kernel/tracing/per_cpu/cpuX/stats.
message FtraceCpuStats {
  // CPU index.
  optional uint64 cpu = 1;

  // Number of entries currently in the kernel buffer.
  optional uint64 entries = 2;

  // Number of events lost in kernel buffers due to overwriting of old events
  // before userspace had a chance to drain them. Valid if the buffer is in
  // "overwrite" mode, otherwise see |dropped_events|.
  optional uint64 overrun = 3;

  // This should always be zero. If not the buffer size is way too small or
  // something went wrong with the tracer. Quoting the kernel: "number of
  // commits failing due to the buffer wrapping around while there are
  // uncommitted events, such as during an interrupt storm".
  optional uint64 commit_overrun = 4;

  // Size of entries currently in the kernel buffer (see |entries|) in bytes.
  // The field should be named "bytes", but is misnamed for historical reasons.
  // This value has known inaccuracies before Linux v6.6:
  // https://github.com/torvalds/linux/commit/45d99ea
  optional uint64 bytes_read = 5;

  // The timestamp for the oldest event still in the ring buffer.
  // Unit: seconds for typical trace clocks (i.e. not tsc/counter).
  optional double oldest_event_ts = 6;

  // The current timestamp.
  // Unit: seconds for typical trace clocks (i.e. not tsc/counter).
  optional double now_ts = 7;

  // If the kernel buffer has overwrite mode disabled, this will show the number
  // of new events that were lost because the buffer was full. This is similar
  // to |overrun| but only for the overwrite=false case.
  optional uint64 dropped_events = 8;

  // The number of events read (consumed) from the buffer by userspace.
  optional uint64 read_events = 9;
}

// Kprobe statistical data, gathered from /sys/kernel/tracing/kprobe_profile.
message FtraceKprobeStats {
  // Cumulative number of kprobe events generated for this function
  optional int64 hits = 1;
  // Cumulative number of kprobe events that could not be generated for this
  // function and were missed.  This happens when too much nesting
  // happens between a kprobe and its kretprobe, overflowing the
  // maxactives buffer.
  optional int64 misses = 2;
}

// Errors and kernel buffer stats for the ftrace data source.
message FtraceStats {
  enum Phase {
    UNSPECIFIED = 0;
    START_OF_TRACE = 1;
    END_OF_TRACE = 2;
  }

  // A pair of FtraceStats is written on every trace flush:
  // * START_OF_TRACE - stats recorded at the beginning of the trace.
  // * END_OF_TRACE - stats recorded during the flush. In other words shortly
  //                  before this packet was written. For simple traces this
  //                  will be once at the end of the trace.
  optional Phase phase = 1;

  // Per-CPU stats (one entry for each CPU).
  repeated FtraceCpuStats cpu_stats = 2;

  // When FtraceConfig.symbolize_ksyms = true, this records the number of
  // symbols parsed from /proc/kallsyms, whether they have been seen in the
  // trace or not. It can be used to debug kptr_restrict or security-related
  // errors.
  // Note: this will be valid only when phase = END_OF_TRACE. The symbolizer is
  // initialized. When START_OF_TRACE is emitted it is not ready yet.
  optional uint32 kernel_symbols_parsed = 3;

  // The memory used by the kernel symbolizer (KernelSymbolMap.size_bytes()).
  optional uint32 kernel_symbols_mem_kb = 4;

  // Atrace errors (even non-fatal ones) are reported here. A typical example is
  // one or more atrace categories not available on the device.
  optional string atrace_errors = 5;

  // Ftrace events requested by the config but not present on device.
  repeated string unknown_ftrace_events = 6;

  // Ftrace events requested by the config and present on device, but which we
  // failed to enable due to permissions, or due to a conflicting option
  // (currently FtraceConfig.disable_generic_events).
  repeated string failed_ftrace_events = 7;

  // The data source was configured to preserve existing events in the ftrace
  // buffer before the start of the trace.
  optional bool preserve_ftrace_buffer = 8;

  // Unique errors encountered during reading and parsing of the raw ftrace
  // data. Ring buffer ABI related errors will also be recorded in the
  // affected FtraceEventBundles with a timestamp.
  // Any traces with entries in this field should be investigated, as they
  // indicate a bug in perfetto or the kernel.
  repeated FtraceParseStatus ftrace_parse_errors = 9;

  // Kprobe profile stats for functions hits and misses
  optional FtraceKprobeStats kprobe_stats = 10;
}

enum FtraceParseStatus {
  FTRACE_STATUS_UNSPECIFIED = 0;
  // Not written, used for convenience of implementation:
  FTRACE_STATUS_OK = 1;
  // Issues with reading data out of the ftrace ring buffer:
  FTRACE_STATUS_UNEXPECTED_READ_ERROR = 2;
  FTRACE_STATUS_PARTIAL_PAGE_READ = 3;
  // Ring buffer binary data not matching our understanding of the layout:
  FTRACE_STATUS_ABI_INVALID_PAGE_HEADER = 4;
  FTRACE_STATUS_ABI_SHORT_EVENT_HEADER = 5;
  FTRACE_STATUS_ABI_NULL_PADDING = 6;
  FTRACE_STATUS_ABI_SHORT_PADDING_LENGTH = 7;
  FTRACE_STATUS_ABI_INVALID_PADDING_LENGTH = 8;
  FTRACE_STATUS_ABI_SHORT_TIME_EXTEND = 9;
  FTRACE_STATUS_ABI_SHORT_TIME_STAMP = 10;
  FTRACE_STATUS_ABI_SHORT_DATA_LENGTH = 11;
  FTRACE_STATUS_ABI_ZERO_DATA_LENGTH = 12;
  FTRACE_STATUS_ABI_INVALID_DATA_LENGTH = 13;
  FTRACE_STATUS_ABI_SHORT_EVENT_ID = 14;
  FTRACE_STATUS_ABI_END_OVERFLOW = 15;
  // Issues with parsing the event payload:
  FTRACE_STATUS_SHORT_COMPACT_EVENT = 16;
  FTRACE_STATUS_INVALID_EVENT = 17;
}

// End of protos/perfetto/trace/ftrace/ftrace_stats.proto

// Begin of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto

// The result of tracing one or more ftrace data pages from a single per-cpu
// kernel ring buffer. If collating multiple pages' worth of events, all of
// them come from contiguous pages, with no kernel data loss in between.
message FtraceEventBundle {
  optional uint32 cpu = 1;
  repeated FtraceEvent event = 2;

  // Set to true if there was data loss between the last time we've read from
  // the corresponding per-cpu kernel buffer, and the earliest event recorded
  // in this bundle.
  optional bool lost_events = 3;

  // Optionally-enabled compact encoding of a batch of scheduling events. Only
  // a subset of events & their fields is recorded.
  // All fields (except comms) are stored in a structure-of-arrays form, one
  // entry in each repeated field per event.
  message CompactSched {
    // Interned table of unique strings for this bundle.
    repeated string intern_table = 5;

    // Delta-encoded timestamps across all sched_switch events within this
    // bundle. The first is absolute, each next one is relative to its
    // predecessor.
    repeated uint64 switch_timestamp = 1 [packed = true];
    repeated int64 switch_prev_state = 2 [packed = true];
    repeated int32 switch_next_pid = 3 [packed = true];
    repeated int32 switch_next_prio = 4 [packed = true];
    // One per event, index into |intern_table| corresponding to the
    // next_comm field of the event.
    repeated uint32 switch_next_comm_index = 6 [packed = true];

    // Delta-encoded timestamps across all sched_waking events within this
    // bundle. The first is absolute, each next one is relative to its
    // predecessor.
    repeated uint64 waking_timestamp = 7 [packed = true];
    repeated int32 waking_pid = 8 [packed = true];
    repeated int32 waking_target_cpu = 9 [packed = true];
    repeated int32 waking_prio = 10 [packed = true];
    // One per event, index into |intern_table| corresponding to the
    // comm field of the event.
    repeated uint32 waking_comm_index = 11 [packed = true];
    repeated uint32 waking_common_flags = 12 [packed = true];
  }
  optional CompactSched compact_sched = 4;

  // traced_probes always sets the ftrace_clock to "boot". That is not available
  // in older kernels (v3.x). In that case we fallback on "global" or "local".
  // When we do that, we report the fallback clock in each bundle so we can do
  // proper clock syncing at parsing time in TraceProcessor. We cannot use the
  // TracePacket timestamp_clock_id because: (1) there is no per-packet
  // timestamp for ftrace bundles; (2) "global" does not match CLOCK_MONOTONIC.
  // Having a dedicated and explicit flag allows us to correct further misakes
  // in future by looking at the kernel version.
  // This field has been introduced in perfetto v19 / Android T (13).
  // This field is omitted when the ftrace clock is just "boot", as that is the
  // default assumption (and for consistency with the past).
  optional FtraceClock ftrace_clock = 5;

  // The timestamp according to the ftrace clock, taken at the same instant
  // as |boot_timestamp|. This is used to sync ftrace events when a non-boot
  // clock is used as the ftrace clock. We don't use the ClockSnapshot packet
  // because the ftrace global/local clocks don't match any of the clock_gettime
  // domains and can be only read by traced_probes.
  //
  // Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
  //
  // Implementation note: Populated by reading the 'now ts:' field in
  // tracefs/per_cpu/cpuX/stat.
  optional int64 ftrace_timestamp = 6;

  // The timestamp according to CLOCK_BOOTTIME, taken at the same instant as
  // |ftrace_timestamp|. See documentation of |ftrace_timestamp| for
  // more info.
  //
  // Only set when |ftrace_clock| != FTRACE_CLOCK_UNSPECIFIED.
  optional int64 boot_timestamp = 7;

  // Errors encountered during parsing of the raw ftrace data. In case of ring
  // buffer layout errors, the parser skips the rest of the offending kernel
  // buffer page and continues from the next page.
  // See also FtraceStats.ftrace_parse_errors, which collates all unique errors
  // seen within the duration of the trace (even if the affected bundles get
  // overwritten in ring buffer mode).
  message FtraceError {
    // Timestamp of the data that we're unable to parse, in the ftrace clock
    // domain. Currently, we use the base timestamp of the tracing page
    // containing the bad record rather than the time of the record itself.
    optional uint64 timestamp = 1;
    optional FtraceParseStatus status = 2;
  }
  repeated FtraceError error = 8;

  // Superseded by |previous_bundle_end_timestamp| in perfetto v47+. The
  // primary difference is that this field tracked the last timestamp read from
  // the per-cpu buffer, while the newer field tracks events that get
  // serialised into the trace.
  // Added in: perfetto v44.
  optional uint64 last_read_event_timestamp = 9;

  // The timestamp (using ftrace clock) of the last event written into this
  // data source on this cpu. In other words: the last event in the previous
  // bundle.
  // Lets the trace processing find an initial timestamp after which ftrace
  // data is known to be valid across all cpus. Of particular importance when
  // the perfetto trace buffer is a ring buffer as well, as the overwriting of
  // oldest bundles can skew the first valid timestamp per cpu significantly.
  // Added in: perfetto v47.
  optional uint64 previous_bundle_end_timestamp = 10;
}

enum FtraceClock {
  // There is no FTRACE_CLOCK_BOOT entry as that's the default assumption. When
  // the ftrace clock is "boot", it's just omitted (so UNSPECIFIED == BOOT).
  FTRACE_CLOCK_UNSPECIFIED = 0;
  FTRACE_CLOCK_UNKNOWN = 1;
  FTRACE_CLOCK_GLOBAL = 2;
  FTRACE_CLOCK_LOCAL = 3;
  FTRACE_CLOCK_MONO_RAW = 4;
}

// End of protos/perfetto/trace/ftrace/ftrace_event_bundle.proto

// Begin of protos/perfetto/trace/gpu/gpu_counter_event.proto

message GpuCounterEvent {
  // The first trace packet of each session should include counter_spec.
  optional GpuCounterDescriptor counter_descriptor = 1;

  message GpuCounter {
    // required. Identifier for counter.
    optional uint32 counter_id = 1;
    // required. Value of the counter.
    oneof value {
      int64 int_value = 2;
      double double_value = 3;
    }
  }
  repeated GpuCounter counters = 2;

  // optional. Identifier for GPU in a multi-gpu device.
  optional int32 gpu_id = 3;
}

// End of protos/perfetto/trace/gpu/gpu_counter_event.proto

// Begin of protos/perfetto/trace/gpu/gpu_log.proto

// Message for logging events GPU data producer.
message GpuLog {
  enum Severity {
    LOG_SEVERITY_UNSPECIFIED = 0;
    LOG_SEVERITY_VERBOSE = 1;
    LOG_SEVERITY_DEBUG = 2;
    LOG_SEVERITY_INFO = 3;
    LOG_SEVERITY_WARNING = 4;
    LOG_SEVERITY_ERROR = 5;
  };
  optional Severity severity = 1;

  optional string tag = 2;

  optional string log_message = 3;
}

// End of protos/perfetto/trace/gpu/gpu_log.proto

// Begin of protos/perfetto/trace/gpu/gpu_render_stage_event.proto

// next id: 15
message GpuRenderStageEvent {
  // required. Unique ID for the event.
  optional uint64 event_id = 1;

  // optional. Duration of the event in nanoseconds. If unset, this is a
  // single time point event.
  optional uint64 duration = 2;

  // required. ID to a hardware queue description in the specifications.
  // InternedGpuRenderStageSpecification
  optional uint64 hw_queue_iid = 13;

  // required. ID to a render stage description in the specifications.
  // InternedGpuRenderStageSpecification
  optional uint64 stage_iid = 14;

  // optional. Identifier for GPU in a multi-gpu device.
  optional int32 gpu_id = 11;

  // required. Graphics context for the event.
  // For OpenGL, this is the GL context.
  // For Vulkan, this is the VkDevice.
  optional uint64 context = 5;

  // optional. The render target for this event.
  // For OpenGL, this is the GL frame buffer handle.
  // For Vulkan, this is the VkFrameBuffer handle.
  optional uint64 render_target_handle = 8;

  // optional. Submission ID generated by the UMD.
  // For OpenGL, the ID should map to an API submission (e.g., glFlush,
  // glFinish, eglSwapBufffers) event.  The set of submissions to the HW due
  // to a single API submission should share the same ID.
  // For Vulkan, it should map 1:1 with a vkQueueSubmit.
  optional uint32 submission_id = 10;

  // optional. Additional data for the user. This may include attributes for
  // the event like resource ids, shaders, etc.
  message ExtraData {
    optional string name = 1;
    optional string value = 2;
  }
  repeated ExtraData extra_data = 6;

  // VULKAN SPECIFICS

  // optional. The Vulkan render pass handle.
  optional uint64 render_pass_handle = 9;

  // optional. A bit mask representing which render subpasses contributed to
  // this render stage event.  Subpass index 0 is represented by setting the
  // LSB of the mask.  Additional mask can be added for subpass index greater
  // than 63.
  repeated uint64 render_subpass_index_mask = 15;

  // optional. The Vulkan command buffer handle.
  optional uint64 command_buffer_handle = 12;

  // DEPRECATED

  // Deprecated.  Use InternedGpuRenderStageSpecification instead.
  // The first trace packet of each session should include a Specifications
  // to enumerate *all* IDs that will be used. The timestamp of this packet
  // must be earlier than all other packets. Only one packet with Specifications
  // is expected.
  message Specifications {
    message ContextSpec {
      optional uint64 context = 1;
      optional int32 pid = 2;
    }
    optional ContextSpec context_spec = 1;

    message Description {
      optional string name = 1;
      optional string description = 2;
    }

    // Labels to categorize the hw Queue this event goes on.
    repeated Description hw_queue = 2;

    // Labels to categorize render stage(binning, render, compute etc).
    repeated Description stage = 3;
  }
  // Deprecated.  Use hw_queue_iid and stage_iid to refer to
  // InternedGpuRenderStageSpecification instead.
  optional Specifications specifications = 7 [deprecated = true];

  // Deprecated. Use hw_queue_iid instead;
  optional int32 hw_queue_id = 3 [deprecated = true];

  // Deprecated. Use stage_iid instead;
  optional int32 stage_id = 4 [deprecated = true];

  // Extension for vendor's custom proto.
  extensions 100;
}

// Interned data.

// The iid is the numeric value of either the GL Context or the VkDevice
// handle.
message InternedGraphicsContext {
  optional uint64 iid = 1;
  optional int32 pid = 2;
  enum Api {
    UNDEFINED = 0;
    OPEN_GL = 1;
    VULKAN = 2;
    OPEN_CL = 3;
  }
  optional Api api = 3;
}

message InternedGpuRenderStageSpecification {
  optional uint64 iid = 1;
  optional string name = 2;
  optional string description = 3;

  enum RenderStageCategory {
    OTHER = 0;
    GRAPHICS = 1;
    COMPUTE = 2;
  }
  optional RenderStageCategory category = 4;
}

// End of protos/perfetto/trace/gpu/gpu_render_stage_event.proto

// Begin of protos/perfetto/trace/gpu/vulkan_api_event.proto

// Message for recording the Vulkan call.
message VulkanApiEvent {
  oneof event {
    VkDebugUtilsObjectName vk_debug_utils_object_name = 1;
    VkQueueSubmit vk_queue_submit = 2;
  }

  // For recording vkSetDebugUtilsObjectNameEXT and
  // vkDebugMarkerSetObjectNameEXT
  message VkDebugUtilsObjectName {
    optional uint32 pid = 1;
    optional uint64 vk_device = 2;
    // VkObjectType.  Value must match
    // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkObjectType.html.
    optional int32 object_type = 3;
    optional uint64 object = 4;
    optional string object_name = 5;
  }

  // For recording vkQueueSubmit call.
  message VkQueueSubmit {
    optional uint64 duration_ns = 1;
    optional uint32 pid = 2;
    optional uint32 tid = 3;
    optional uint64 vk_queue = 4;
    repeated uint64 vk_command_buffers = 5;
    // Submission ID.  An identifier unique to each vkQueueSubmit call.  This
    // submission_id must match GpuRenderStageEvent.submission_id if the
    // GpuRenderStageEvent is created due to this vkQueueSubmit.
    optional uint32 submission_id = 6;
  }
}

// End of protos/perfetto/trace/gpu/vulkan_api_event.proto

// Begin of protos/perfetto/trace/gpu/vulkan_memory_event.proto

// All the information that cannot be sent within a VulkanMemoryEvent message,
// are sent as annotations to the main memory event. One example is the
// properties of the object that consumes the allocated memory, for example, a
// buffer or an image.
// key_iid and string_iid are both interned strings. Original string value is
// stored in vulkan_memory_keys from
// protos/perfetto/trace/interned_data/interned_data.proto.
message VulkanMemoryEventAnnotation {
  optional uint64 key_iid = 1;
  oneof value {
    int64 int_value = 2;
    double double_value = 3;
    uint64 string_iid = 4;
  }
}

// Each VulkanMemoryEvent encompasses information regarding one single function
// call that results in reserving, binding or freeing host or GPU memory. There
// is a special message type, ANNOTATIONS, which is used to communicate
// information that are not directly related to a memory event, nonetheless are
// essential to understand the memory usage. An example is the size and memory
// types of the memory heaps.
//
// Next reserved id: 10 (up to 15).
// Next id: 21.
message VulkanMemoryEvent {
  enum Source {
    SOURCE_UNSPECIFIED = 0;
    SOURCE_DRIVER = 1;
    SOURCE_DEVICE = 2;
    SOURCE_DEVICE_MEMORY = 3;
    SOURCE_BUFFER = 4;
    SOURCE_IMAGE = 5;
  }

  enum Operation {
    OP_UNSPECIFIED = 0;

    // alloc, create
    OP_CREATE = 1;

    // free, destroy(non-bound)
    OP_DESTROY = 2;

    // bind buffer and image
    OP_BIND = 3;

    // destroy (bound)
    OP_DESTROY_BOUND = 4;

    // only annotations
    OP_ANNOTATIONS = 5;
  }

  enum AllocationScope {
    SCOPE_UNSPECIFIED = 0;
    SCOPE_COMMAND = 1;
    SCOPE_OBJECT = 2;
    SCOPE_CACHE = 3;
    SCOPE_DEVICE = 4;
    SCOPE_INSTANCE = 5;
  }

  optional Source source = 1;
  optional Operation operation = 2;
  optional int64 timestamp = 3;
  optional uint32 pid = 4;
  optional fixed64 memory_address = 5;
  optional uint64 memory_size = 6;
  // Interned string. Original string value is stored in function_names from
  // protos/perfetto/trace/interned_data/interned_data.proto.
  optional uint64 caller_iid = 7;
  optional AllocationScope allocation_scope = 8;
  // Extra related information, e.g., create configs, etc.
  repeated VulkanMemoryEventAnnotation annotations = 9;

  // Field IDs used for device memory (low sampling rate)
  optional fixed64 device = 16;
  optional fixed64 device_memory = 17;
  optional uint32 memory_type = 18;
  optional uint32 heap = 19;
  optional fixed64 object_handle = 20;
}

// End of protos/perfetto/trace/gpu/vulkan_memory_event.proto

// Begin of protos/perfetto/trace/profiling/profile_common.proto

// TODO(fmayer): Figure out naming thoroughout this file to get a
// nomenclature that works between Windows and Linux.

// The interning fields in this file can refer to 2 different intern tables,
// depending on the message they are used in. If the interned fields are present
// in ProfilePacket proto, then the intern tables included in the ProfilePacket
// should be used. If the intered fields are present in the
// StreamingProfilePacket proto, then the intern tables included in all of the
// previous InternedData message with same sequence ID should be used.
// TODO(fmayer): Move to the intern tables to a common location.
message InternedString {
  optional uint64 iid = 1;
  optional bytes str = 2;
}

// A symbol field that is emitted after the trace is written. These tables would
// be appended as the last packets in the trace that the profiler will use, so
// that the actual trace need not be rewritten to symbolize the profiles.
message ProfiledFrameSymbols {
  // Use the frame id as the interning key for the symbols.
  optional uint64 frame_iid = 1;

  // These are repeated because when inlining happens, multiple functions'
  // frames can be at a single address. Imagine function Foo calling the
  // std::vector<int> constructor, which gets inlined at 0xf00. We then get
  // both Foo and the std::vector<int> constructor when we symbolize the
  // address.

  // key to InternedString
  repeated uint64 function_name_id = 2;

  // key to InternedString
  repeated uint64 file_name_id = 3;

  repeated uint32 line_number = 4;
}

message Line {
  optional string function_name = 1;
  optional string source_file_name = 2;
  optional uint32 line_number = 3;
}

// Symbols for a given address in a module.
message AddressSymbols {
  optional uint64 address = 1;

  // Source lines that correspond to this address.
  //
  // These are repeated because when inlining happens, multiple functions'
  // frames can be at a single address. Imagine function Foo calling the
  // std::vector<int> constructor, which gets inlined at 0xf00. We then get
  // both Foo and the std::vector<int> constructor when we symbolize the
  // address.
  repeated Line lines = 2;
}

// Symbols for addresses seen in a module.
message ModuleSymbols {
  // Fully qualified path to the mapping.
  // E.g. /system/lib64/libc.so.
  optional string path = 1;

  // .note.gnu.build-id on Linux (not hex encoded).
  // uuid on MacOS.
  // Module GUID on Windows.
  optional string build_id = 2;
  repeated AddressSymbols address_symbols = 3;
}

message Mapping {
  // Interning key.
  optional uint64 iid = 1;

  // Interning key.
  optional uint64 build_id = 2;

  // The linker may create multiple memory mappings for the same shared
  // library.
  // This is so that the ELF header is mapped as read only, while the
  // executable memory is mapped as executable only.
  // The details of this depend on the linker, a possible mapping of an ELF
  // file is this:
  //         +----------------------+
  // ELF     |xxxxxxxxxyyyyyyyyyyyyy|
  //         +---------+------------+
  //         |         |
  //         | read    | executable
  //         v mapping v mapping
  //         +----------------------+
  // Memory  |xxxxxxxxx|yyyyyyyyyyyy|
  //         +------------------+---+
  //         ^         ^        ^
  //         +         +        +
  //       start     exact    relpc
  //       offset   offset    0x1800
  //       0x0000   0x1000
  //
  // exact_offset is the offset into the library file of this mapping.
  // start_offset is the offset into the library file of the first mapping
  // for that library. For native libraries (.so files) this should be 0.

  // This is not set on Android 10.
  optional uint64 exact_offset = 8;

  optional uint64 start_offset = 3;
  optional uint64 start = 4;
  optional uint64 end = 5;
  optional uint64 load_bias = 6;

  // E.g. ["system", "lib64", "libc.so"]
  // id of string.
  repeated uint64 path_string_ids = 7;
}

message Frame {
  // Interning key
  optional uint64 iid = 1;

  // E.g. "fopen"
  // id of string.
  optional uint64 function_name_id = 2;

  optional uint64 mapping_id = 3;
  optional uint64 rel_pc = 4;
}

message Callstack {
  optional uint64 iid = 1;
  // Frames of this callstack. Bottom frame first.
  repeated uint64 frame_ids = 2;
}

// End of protos/perfetto/trace/profiling/profile_common.proto

// Begin of protos/perfetto/trace/track_event/debug_annotation.proto

// Proto representation of untyped key/value annotations provided in TRACE_EVENT
// macros. Users of the Perfetto SDK should prefer to use the
// perfetto::TracedValue API to fill these protos, rather than filling them
// manually.
//
// Debug annotations are intended for debug use and are not considered a stable
// API of the trace contents. Trace-based metrics that use debug annotation
// values are prone to breakage, so please rely on typed TrackEvent fields for
// these instead.
//
// DebugAnnotations support nested arrays and dictionaries. Each entry is
// encoded as a single DebugAnnotation message. Only dictionary entries
// set the "name" field. The TrackEvent message forms an implicit root
// dictionary.
//
// Example TrackEvent with nested annotations:
//   track_event {
//     debug_annotations {
//       name: "foo"
//       dict_entries {
//         name: "a"
//         bool_value: true
//       }
//       dict_entries {
//         name: "b"
//         int_value: 123
//       }
//     }
//     debug_annotations {
//       name: "bar"
//       array_values {
//         string_value: "hello"
//       }
//       array_values {
//         string_value: "world"
//       }
//     }
//   }
//
// Next ID: 18.
// Reserved ID: 15
message DebugAnnotation {
  // Name fields are set only for dictionary entries.
  oneof name_field {
    // interned DebugAnnotationName.
    uint64 name_iid = 1;
    // non-interned variant.
    string name = 10;
  }

  oneof value {
    bool bool_value = 2;
    uint64 uint_value = 3;
    int64 int_value = 4;
    double double_value = 5;
    // Pointers are stored in a separate type as the JSON output treats them
    // differently from other uint64 values.
    uint64 pointer_value = 7;

    // Deprecated. Use dict_entries / array_values instead.
    NestedValue nested_value = 8;

    // Legacy instrumentation may not support conversion of nested data to
    // NestedValue yet.
    string legacy_json_value = 9;

    // interned and non-interned variants of strings.
    string string_value = 6;
    // Corresponds to |debug_annotation_string_values| field in InternedData.
    uint64 string_value_iid = 17;
  }

  // Used to embed arbitrary proto messages (which are also typically used to
  // represent typed TrackEvent arguments). |proto_type_name| or
  // |proto_type_name_iid| are storing the full name of the proto messages (e.g.
  // .perfetto.protos.DebugAnnotation) and |proto_value| contains the serialised
  // proto messages. See |TracedValue::WriteProto| for more details.
  oneof proto_type_descriptor {
    string proto_type_name = 16;
    // interned DebugAnnotationValueTypeName.
    uint64 proto_type_name_iid = 13;
  }
  optional bytes proto_value = 14;

  repeated DebugAnnotation dict_entries = 11;
  repeated DebugAnnotation array_values = 12;

  // Deprecated legacy way to use nested values. Only kept for
  // backwards-compatibility in TraceProcessor. May be removed in the future -
  // code filling protos should use |dict_entries| and |array_values| instead.
  message NestedValue {
    enum NestedType {
      // leaf value.
      UNSPECIFIED = 0;
      DICT = 1;
      ARRAY = 2;
    }
    optional NestedType nested_type = 1;

    repeated string dict_keys = 2;
    repeated NestedValue dict_values = 3;
    repeated NestedValue array_values = 4;
    optional int64 int_value = 5;
    optional double double_value = 6;
    optional bool bool_value = 7;
    optional string string_value = 8;
  }
}

// --------------------
// Interned data types:
// --------------------

message DebugAnnotationName {
  optional uint64 iid = 1;
  optional string name = 2;
}

// See the |proto_type_descriptor| comment.
message DebugAnnotationValueTypeName {
  optional uint64 iid = 1;
  optional string name = 2;
}

// End of protos/perfetto/trace/track_event/debug_annotation.proto

// Begin of protos/perfetto/trace/track_event/log_message.proto

message LogMessage {
  // interned SourceLocation.
  optional uint64 source_location_iid = 1;
  // interned LogMessageBody.
  optional uint64 body_iid = 2;
  enum Priority {
    PRIO_UNSPECIFIED = 0;
    PRIO_UNUSED = 1;
    PRIO_VERBOSE = 2;
    PRIO_DEBUG = 3;
    PRIO_INFO = 4;
    PRIO_WARN = 5;
    PRIO_ERROR = 6;
    PRIO_FATAL = 7;
  }
  optional Priority prio = 3;
}

// --------------------
// Interned data types:
// --------------------

message LogMessageBody {
  optional uint64 iid = 1;
  optional string body = 2;
}

// End of protos/perfetto/trace/track_event/log_message.proto

// Begin of protos/perfetto/trace/track_event/source_location.proto

// --------------------
// Interned data types:
// --------------------

// A source location, represented as a native symbol.
// This is similar to `message Frame` from
// protos/perfetto/trace/profiling/profile_common.proto, but for abitrary
// source code locations (for example in track event args), not stack frames.
message UnsymbolizedSourceLocation {
  optional uint64 iid = 1;
  optional uint64 mapping_id = 2;
  optional uint64 rel_pc = 3;
}

message SourceLocation {
  optional uint64 iid = 1;
  optional string file_name = 2;
  optional string function_name = 3;
  optional uint32 line_number = 4;
}

// End of protos/perfetto/trace/track_event/source_location.proto

// Begin of protos/perfetto/trace/track_event/chrome_active_processes.proto

// A list of processes connected to the tracing service.
message ChromeActiveProcesses {
  repeated int32 pid = 1;
}
// End of protos/perfetto/trace/track_event/chrome_active_processes.proto

// Begin of protos/perfetto/trace/track_event/task_execution.proto

// TrackEvent arguments describing the execution of a task.
message TaskExecution {
  // Source location that the task was posted from.
  // interned SourceLocation.
  optional uint64 posted_from_iid = 1;
}
// End of protos/perfetto/trace/track_event/task_execution.proto

// Begin of protos/perfetto/trace/track_event/track_event.proto

// NOTE: Full TrackEvent support in the client lib and chrome is WIP, thus these
// protos are still subject to change. Don't depend on them staying as they are.

// Trace events emitted by client instrumentation library (TRACE_EVENT macros),
// which describe activity on a track, such as a thread or asynchronous event
// track. The track is specified using separate TrackDescriptor messages and
// referred to via the track's UUID.
//
// A simple TrackEvent packet specifies a timestamp, category, name and type:
// ```protobuf
//   trace_packet {
//     timestamp: 1000
//     track_event {
//       categories: ["my_cat"]
//       name: "my_event"
//       type: TYPE_INSTANT
//      }
//    }
// ```
//
// To associate an event with a custom track (e.g. a thread), the track is
// defined in a separate packet and referred to from the TrackEvent by its UUID:
// ```protobuf
//   trace_packet {
//     track_descriptor {
//       track_uuid: 1234
//       name: "my_track"
//
//       // Optionally, associate the track with a thread.
//       thread_descriptor {
//         pid: 10
//         tid: 10
//         ..
//       }
//     }
//   }
// ```
//
// A pair of TYPE_SLICE_BEGIN and _END events form a slice on the track:
//
// ```protobuf
//   trace_packet {
//     timestamp: 1200
//     track_event {
//       track_uuid: 1234
//       categories: ["my_cat"]
//       name: "my_slice"
//       type: TYPE_SLICE_BEGIN
//     }
//   }
//   trace_packet {
//     timestamp: 1400
//     track_event {
//       track_uuid: 1234
//       type: TYPE_SLICE_END
//     }
//   }
// ```
// TrackEvents also support optimizations to reduce data repetition and encoded
// data size, e.g. through data interning (names, categories, ...) and delta
// encoding of timestamps/counters. For details, see the InternedData message.
// Further, default values for attributes of events on the same sequence (e.g.
// their default track association) can be emitted as part of a
// TrackEventDefaults message.
//
// Next reserved id: 13 (up to 15). Next id: 52.
message TrackEvent {
  // Names of categories of the event. In the client library, categories are a
  // way to turn groups of individual events on or off.
  // interned EventCategoryName.
  repeated uint64 category_iids = 3;
  // non-interned variant.
  repeated string categories = 22;

  // Optional name of the event for its display in trace viewer. May be left
  // unspecified for events with typed arguments.
  //
  // Note that metrics should not rely on event names, as they are prone to
  // changing. Instead, they should use typed arguments to identify the events
  // they are interested in.
  oneof name_field {
    // interned EventName.
    uint64 name_iid = 10;
    // non-interned variant.
    string name = 23;
  }

  // TODO(eseckler): Support using binary symbols for category/event names.

  // Type of the TrackEvent (required if |phase| in LegacyEvent is not set).
  enum Type {
    TYPE_UNSPECIFIED = 0;

    // Slice events are events that have a begin and end timestamp, i.e. a
    // duration. They can be nested similar to a callstack: If, on the same
    // track, event B begins after event A, but before A ends, B is a child
    // event of A and will be drawn as a nested event underneath A in the UI.
    // Note that child events should always end before their parents (e.g. B
    // before A).
    //
    // Each slice event is formed by a pair of BEGIN + END events. The END event
    // does not need to repeat any TrackEvent fields it has in common with its
    // corresponding BEGIN event. Arguments and debug annotations of the BEGIN +
    // END pair will be merged during trace import.
    //
    // Note that we deliberately chose not to support COMPLETE events (which
    // would specify a duration directly) since clients would need to delay
    // writing them until the slice is completed, which can result in reordered
    // events in the trace and loss of unfinished events at the end of a trace.
    TYPE_SLICE_BEGIN = 1;
    TYPE_SLICE_END = 2;

    // Instant events are nestable events without duration. They can be children
    // of slice events on the same track.
    TYPE_INSTANT = 3;

    // Event that provides a value for a counter track. |track_uuid| should
    // refer to a counter track and |counter_value| set to the new value. Note
    // that most other TrackEvent fields (e.g. categories, name, ..) are not
    // supported for TYPE_COUNTER events. See also CounterDescriptor.
    TYPE_COUNTER = 4;
  }
  optional Type type = 9;

  // Identifies the track of the event. The default value may be overridden
  // using TrackEventDefaults, e.g., to specify the track of the TraceWriter's
  // sequence (in most cases sequence = one thread). If no value is specified
  // here or in TrackEventDefaults, the TrackEvent will be associated with an
  // implicit trace-global track (uuid 0). See TrackDescriptor::uuid.
  optional uint64 track_uuid = 11;

  // A new value for a counter track. |track_uuid| should refer to a track with
  // a CounterDescriptor, and |type| should be TYPE_COUNTER. For a more
  // efficient encoding of counter values that are sampled at the beginning/end
  // of a slice, see |extra_counter_values| and |extra_counter_track_uuids|.
  // Counter values can optionally be encoded in as delta values (positive or
  // negative) on each packet sequence (see CounterIncrementalBase).
  oneof counter_value_field {
    int64 counter_value = 30;
    double double_counter_value = 44;
  }

  // To encode counter values more efficiently, we support attaching additional
  // counter values to a TrackEvent of any type. All values will share the same
  // timestamp specified in the TracePacket. The value at
  // extra_counter_values[N] is for the counter track referenced by
  // extra_counter_track_uuids[N].
  //
  // |extra_counter_track_uuids| may also be set via TrackEventDefaults. There
  // should always be equal or more uuids than values. It is valid to set more
  // uuids (e.g. via defaults) than values. If uuids are specified in
  // TrackEventDefaults and a TrackEvent, the TrackEvent uuids override the
  // default uuid list.
  //
  // For example, this allows snapshotting the thread time clock at each
  // thread-track BEGIN and END event to capture the cpu time delta of a slice.
  repeated uint64 extra_counter_track_uuids = 31;
  repeated int64 extra_counter_values = 12;

  // Counter snapshots using floating point instead of integer values.
  repeated uint64 extra_double_counter_track_uuids = 45;
  repeated double extra_double_counter_values = 46;

  // IDs of flows originating, passing through, or ending at this event.
  // Flow IDs are global within a trace.
  //
  // A flow connects a sequence of TrackEvents within or across tracks, e.g.
  // an input event may be handled on one thread but cause another event on
  // a different thread - a flow between the two events can associate them.
  //
  // The direction of the flows between events is inferred from the events'
  // timestamps. The earliest event with the same flow ID becomes the source
  // of the flow. Any events thereafter are intermediate steps of the flow,
  // until the flow terminates at the last event with the flow ID.
  //
  // Flows can also be explicitly terminated (see |terminating_flow_ids|), so
  // that the same ID can later be reused for another flow.
  // DEPRECATED. Only kept for backwards compatibility. Use |flow_ids|.
  repeated uint64 flow_ids_old = 36 [deprecated = true];
  // TODO(b/204341740): replace "flow_ids_old" with "flow_ids" to reduce memory
  // consumption.
  repeated fixed64 flow_ids = 47;

  // List of flow ids which should terminate on this event, otherwise same as
  // |flow_ids|.
  // Any one flow ID should be either listed as part of |flow_ids| OR
  // |terminating_flow_ids|, not both.
  // DEPRECATED. Only kept for backwards compatibility.  Use
  // |terminating_flow_ids|.
  repeated uint64 terminating_flow_ids_old = 42 [deprecated = true];
  // TODO(b/204341740): replace "terminating_flow_ids_old" with
  // "terminating_flow_ids" to reduce memory consumption.
  repeated fixed64 terminating_flow_ids = 48;

  // ---------------------------------------------------------------------------
  // TrackEvent arguments:
  // ---------------------------------------------------------------------------

  // Unstable key/value annotations shown in the trace viewer but not intended
  // for metrics use.
  repeated DebugAnnotation debug_annotations = 4;

  // Typed event arguments:
  optional TaskExecution task_execution = 5;
  optional LogMessage log_message = 21;
  // optional ChromeCompositorSchedulerState cc_scheduler_state = 24;
  // optional ChromeUserEvent chrome_user_event = 25;
  // optional ChromeKeyedService chrome_keyed_service = 26;
  // optional ChromeLegacyIpc chrome_legacy_ipc = 27;
  // optional ChromeHistogramSample chrome_histogram_sample = 28;
  // optional ChromeLatencyInfo chrome_latency_info = 29;
  // optional ChromeFrameReporter chrome_frame_reporter = 32;
  // optional ChromeApplicationStateInfo chrome_application_state_info = 39;
  // optional ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40;
  // optional ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41;
  // optional ChromeContentSettingsEventInfo chrome_content_settings_event_info =
  //     43;
  // optional ChromeActiveProcesses chrome_active_processes = 49;
  // optional Screenshot screenshot = 50;

  // This field is used only if the source location represents the function that
  // executes during this event.
  oneof source_location_field {
    // Non-interned field.
    SourceLocation source_location = 33;
    // Interned field.
    uint64 source_location_iid = 34;
  }

  // optional ChromeMessagePump chrome_message_pump = 35;
  // optional ChromeMojoEventInfo chrome_mojo_event_info = 38;

  // New argument types go here :)

  // Extension range for typed events defined externally.
  // See docs/design-docs/extensions.md for more details.
  //
  // Extension support is work-in-progress, in the future the way to reserve a
  // subrange for a particular project will be described here and in the design
  // document linked above.
  //
  // Contact perfetto-dev@googlegroups.com if you are interested in a subrange
  // for your project.

  // Extension range reserved for chromium:
  // https://source.chromium.org/chromium/chromium/src/+/main:base/tracing/protos/chrome_track_event.proto
  extensions 1000 to 1999;
  // Extension range reserved for https://b.corp.google.com/issues/301227627.
  extensions 2000 to 2000;
  // Extension range reserved for android:
  // protos/perfetto/trace/android/android_track_event.proto
  extensions 2001 to 2999;
  // Extension range for future use.
  extensions 3000 to 9899;
  // Reserved for Perfetto unit and integration tests.
  extensions 9900 to 10000;

  // ---------------------------------------------------------------------------
  // Deprecated / legacy event fields, which will be removed in the future:
  // ---------------------------------------------------------------------------

  // Deprecated. Use the |timestamp| and |timestamp_clock_id| fields in
  // TracePacket instead.
  //
  // Timestamp in microseconds (usually CLOCK_MONOTONIC).
  oneof timestamp {
    // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
    // calculate the absolute timestamp value, sum up all delta values of the
    // preceding TrackEvents since the last ThreadDescriptor and add the sum to
    // the |reference_timestamp| in ThreadDescriptor. This value should always
    // be positive.
    int64 timestamp_delta_us = 1;
    // Absolute value (e.g. a manually specified timestamp in the macro).
    // This is a one-off value that does not affect delta timestamp computation
    // in subsequent TrackEvents.
    int64 timestamp_absolute_us = 16;
  }

  // Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to
  // encode thread time instead.
  //
  // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
  // microseconds.
  oneof thread_time {
    // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
    // calculate the absolute timestamp value, sum up all delta values of the
    // preceding TrackEvents since the last ThreadDescriptor and add the sum to
    // the |reference_timestamp| in ThreadDescriptor. This value should always
    // be positive.
    int64 thread_time_delta_us = 2;
    // This is a one-off absolute value that does not affect delta timestamp
    // computation in subsequent TrackEvents.
    int64 thread_time_absolute_us = 17;
  }

  // Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to
  // encode thread instruction count instead.
  //
  // Value of the instruction counter for the current thread.
  oneof thread_instruction_count {
    // Same encoding as |thread_time| field above.
    int64 thread_instruction_count_delta = 8;
    int64 thread_instruction_count_absolute = 20;
  }

  // Apart from {category, time, thread time, tid, pid}, other legacy trace
  // event attributes are initially simply proxied for conversion to a JSON
  // trace. We intend to gradually transition these attributes to similar native
  // features in TrackEvent (e.g. async + flow events), or deprecate them
  // without replacement where transition is unsuitable.
  //
  // Next reserved id: 16 (up to 16).
  // Next id: 20.
  message LegacyEvent {
    // Deprecated, use TrackEvent::name(_iid) instead.
    // interned EventName.
    optional uint64 name_iid = 1;
    optional int32 phase = 2;
    optional int64 duration_us = 3;
    optional int64 thread_duration_us = 4;

    // Elapsed retired instruction count during the event.
    optional int64 thread_instruction_delta = 15;

    // used to be |flags|.
    reserved 5;

    oneof id {
      uint64 unscoped_id = 6;
      uint64 local_id = 10;
      uint64 global_id = 11;
    }
    // Additional optional scope for |id|.
    optional string id_scope = 7;

    // Consider the thread timestamps for async BEGIN/END event pairs as valid.
    optional bool use_async_tts = 9;

    // Idenfifies a flow. Flow events with the same bind_id are connected.
    optional uint64 bind_id = 8;
    // Use the enclosing slice as binding point for a flow end event instead of
    // the next slice. Flow start/step events always bind to the enclosing
    // slice.
    optional bool bind_to_enclosing = 12;

    enum FlowDirection {
      FLOW_UNSPECIFIED = 0;
      FLOW_IN = 1;
      FLOW_OUT = 2;
      FLOW_INOUT = 3;
    }
    optional FlowDirection flow_direction = 13;

    enum InstantEventScope {
      SCOPE_UNSPECIFIED = 0;
      SCOPE_GLOBAL = 1;
      SCOPE_PROCESS = 2;
      SCOPE_THREAD = 3;
    }
    optional InstantEventScope instant_event_scope = 14;

    // Override the pid/tid if the writer needs to emit events on behalf of
    // another process/thread. This should be the exception. Normally, the
    // pid+tid from ThreadDescriptor is used.
    optional int32 pid_override = 18;
    optional int32 tid_override = 19;
  }

  optional LegacyEvent legacy_event = 6;

  reserved 51;
}

// Default values for fields of all TrackEvents on the same packet sequence.
// Should be emitted as part of TracePacketDefaults whenever incremental state
// is cleared. It's defined here because field IDs should match those of the
// corresponding fields in TrackEvent.
message TrackEventDefaults {
  optional uint64 track_uuid = 11;
  repeated uint64 extra_counter_track_uuids = 31;
  repeated uint64 extra_double_counter_track_uuids = 45;

  // TODO(eseckler): Support default values for more TrackEvent fields.
}

// --------------------
// Interned data types:
// --------------------

message EventCategory {
  optional uint64 iid = 1;
  optional string name = 2;
}

message EventName {
  optional uint64 iid = 1;
  optional string name = 2;
}

// End of protos/perfetto/trace/track_event/track_event.proto

// Begin of protos/perfetto/trace/interned_data/interned_data.proto

// ------------------------------ DATA INTERNING: ------------------------------
// Interning indexes are built up gradually by adding the entries contained in
// each TracePacket of the same packet sequence (packets emitted by the same
// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
// can only refer to interned data from other packets in the same sequence.
//
// The writer will emit new entries when it encounters new internable values
// that aren't yet in the index. Data in current and subsequent TracePackets can
// then refer to the entry by its position (interning ID, abbreviated "iid") in
// its index. An interning ID with value 0 is considered invalid (not set).
//
// Because of the incremental build-up, the interning index will miss data when
// TracePackets are lost, e.g. because a chunk was overridden in the central
// ring buffer. To avoid invalidation of the whole trace in such a case, the
// index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED).
// When packet loss occurs, the reader will only lose interning data up to the
// next reset.
// -----------------------------------------------------------------------------

// Message that contains new entries for the interning indices of a packet
// sequence.
//
// The writer will usually emit new entries in the same TracePacket that first
// refers to them (since the last reset of interning state). They may also be
// emitted proactively in advance of referring to them in later packets.
//
// Next reserved id: 8 (up to 15).
// Next id: 42.
message InternedData {
  // TODO(eseckler): Replace iid fields inside interned messages with
  // map<iid, message> type fields in InternedData.

  // Each field's message type needs to specify an |iid| field, which is the ID
  // of the entry in the field's interning index. Each field constructs its own
  // index, thus interning IDs are scoped to the tracing session and field
  // (usually as a counter for efficient var-int encoding), and optionally to
  // the incremental state generation of the packet sequence.
  repeated EventCategory event_categories = 1;
  repeated EventName event_names = 2;
  repeated DebugAnnotationName debug_annotation_names = 3;
  repeated DebugAnnotationValueTypeName debug_annotation_value_type_names = 27;
  repeated SourceLocation source_locations = 4;
  repeated UnsymbolizedSourceLocation unsymbolized_source_locations = 28;
  repeated LogMessageBody log_message_body = 20;
  // repeated HistogramName histogram_names = 25;

  // Note: field IDs up to 15 should be used for frequent data only.

  // Build IDs of exectuable files.
  repeated InternedString build_ids = 16;
  // Paths to executable files.
  repeated InternedString mapping_paths = 17;
  // Paths to source files.
  repeated InternedString source_paths = 18;
  // Names of functions used in frames below.
  repeated InternedString function_names = 5;
  // Symbols that were added to this trace after the fact.
  repeated ProfiledFrameSymbols profiled_frame_symbols = 21;

  // Executable files mapped into processes.
  repeated Mapping mappings = 19;
  // Frames of callstacks of a program.
  repeated Frame frames = 6;
  // A callstack of a program.
  repeated Callstack callstacks = 7;

  // Additional Vulkan information sent in a VulkanMemoryEvent message
  repeated InternedString vulkan_memory_keys = 22;

  // Graphics context of a render stage event.  This represent the GL
  // context for an OpenGl app or the VkDevice for a Vulkan app.
  repeated InternedGraphicsContext graphics_contexts = 23;

  // Description of a GPU hardware queue or render stage.
  repeated InternedGpuRenderStageSpecification gpu_specifications = 24;

  // This is set when FtraceConfig.symbolize_ksyms = true.
  // The id of each symbol the number that will be reported in ftrace events
  // like sched_block_reason.caller and is obtained from a monotonic counter.
  // The same symbol can have different indexes in different bundles.
  // This is is NOT the real address. This is to avoid disclosing KASLR through
  // traces.
  repeated InternedString kernel_symbols = 26;

  // Interned string values in the DebugAnnotation proto.
  repeated InternedString debug_annotation_string_values = 29;

  // Interned packet context for android.network_packets.
  repeated NetworkPacketContext packet_context = 30;

  // Interned name of a js function. We only intern js functions as there is a
  // lot of duplication for them, but less so for other strings in the V8 data
  // source.
  // repeated InternedV8String v8_js_function_name = 31;
  // Js functions can be emitted multiple times for various compilation tiers,
  // so it makes sense to deduplicate all this.
  // repeated InternedV8JsFunction v8_js_function = 32;
  // Interned JS script (there is one associated with each JS function)
  // repeated InternedV8JsScript v8_js_script = 33;
  // Interned Wasm script (there is one associated with each Wasm function)
  // repeated InternedV8WasmScript v8_wasm_script = 34;
  // Every V8 event is associated with an isolate, intern the isolate to remove
  // duplication.
  // repeated InternedV8Isolate v8_isolate = 35;

  // Interned protolog strings args.
  repeated InternedString protolog_string_args = 36;
  // Interned protolog stacktraces.
  repeated InternedString protolog_stacktrace = 37;

  // viewcapture
  repeated InternedString viewcapture_package_name = 38;
  repeated InternedString viewcapture_window_name = 39;
  repeated InternedString viewcapture_view_id = 40;
  repeated InternedString viewcapture_class_name = 41;
}

// End of protos/perfetto/trace/interned_data/interned_data.proto

// Begin of protos/perfetto/trace/memory_graph.proto

// Message definitions for app-reported memory breakdowns. At the moment, this
// is a Chrome-only tracing feature, historically known as 'memory-infra'. See
// https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/ .
// This is unrelated to the native or java heap profilers (those protos live
// in //protos/perfetto/trace/profiling/).

message MemoryTrackerSnapshot {
  // Memory snapshot of a process. The snapshot contains memory data that is
  // from 2 different sources, namely system stats and instrumentation stats.
  // The system memory usage stats come from the OS based on standard API
  // available in the platform to query memory usage. The instrumentation stats
  // are added by instrumenting specific piece of code which tracks memory
  // allocations and deallocations made by a small sub-system within the
  // application.
  // The system stats of the global memory snapshot are recorded as part of
  // ProcessStats and SmapsPacket fields in trace packet with the same
  // timestamp.
  message ProcessSnapshot {
    // Process ID of the process
    optional int32 pid = 1;

    // Memory dumps are represented as a graph of memory nodes which contain
    // statistics. To avoid double counting the same memory across different
    // nodes, edges are used to mark nodes that account for the same memory. See
    // this doc for examples of the usage:
    // https://docs.google.com/document/d/1WGQRJ1sjJrfVkNcgPVY6frm64UqPc94tsxUOXImZUZI

    // A single node in the memory graph.
    message MemoryNode {
      // Unique ID of the node across all processes involved in the global
      // memory dump. The ID is only unique within this particular global dump
      // identified by GlobalMemoryDumpPacket.global_dump_id.
      optional uint64 id = 1;

      // Absolute name is a unique name for the memory node within the process
      // with ProcessMemoryDump.pid. The name can contain multiple parts
      // separated by '/', which traces the edges of the node from the root
      // node.
      // Eg: "partition_allocator/array_buffers/buffer1" refers to the child
      // node "buffer1" in a graph structure of:
      //   root -> partition_allocator -> array_buffers -> buffer1.
      optional string absolute_name = 2;

      // A weak node means that the instrumentation that added the current node
      // is unsure about the existence of the actual memory. Unless a "strong"
      // (non-weak is default) node that has an edge to the current node exists
      // in the current global dump, the current node will be discarded.
      optional bool weak = 3;

      // Size of the node in bytes, used to compute the effective size of the
      // nodes without double counting.
      optional uint64 size_bytes = 4;

      // Entries in the memory node that contain statistics and additional
      // debuggable information about the memory. The size of the node is
      // tracked separately in the |size_bytes| field.
      message MemoryNodeEntry {
        optional string name = 1;

        enum Units {
          UNSPECIFIED = 0;
          BYTES = 1;
          COUNT = 2;
        }
        optional Units units = 2;

        // Contains either one of uint64 or string value.
        optional uint64 value_uint64 = 3;
        optional string value_string = 4;
      }
      repeated MemoryNodeEntry entries = 5;
    }
    repeated MemoryNode allocator_dumps = 2;

    // A directed edge that connects any 2 nodes in the graph above. These are
    // in addition to the inherent edges added due to the tree structure of the
    // node's absolute names.
    // Node with id |source_id| owns the node with id |target_id|, and has the
    // effect of attributing the memory usage of target to source. |importance|
    // is optional and relevant only for the cases of co-ownership, where it
    // acts as a z-index: the owner with the highest importance will be
    // attributed target's memory.
    message MemoryEdge {
      optional uint64 source_id = 1;
      optional uint64 target_id = 2;
      optional uint32 importance = 3;
      optional bool overridable = 4;
    }
    repeated MemoryEdge memory_edges = 3;
  }

  // Unique ID that represents the global memory dump.
  optional uint64 global_dump_id = 1;

  enum LevelOfDetail {
    DETAIL_FULL = 0;
    DETAIL_LIGHT = 1;
    DETAIL_BACKGROUND = 2;
  }
  optional LevelOfDetail level_of_detail = 2;

  repeated ProcessSnapshot process_memory_dumps = 3;
}

// End of protos/perfetto/trace/memory_graph.proto

// Begin of protos/perfetto/trace/perfetto/perfetto_metatrace.proto

// Used to trace the execution of perfetto itself.
message PerfettoMetatrace {
  // See base/metatrace_events.h for definitions.
  oneof record_type {
    uint32 event_id = 1;
    uint32 counter_id = 2;

    // For trace processor metatracing.
    string event_name = 8;
    uint64 event_name_iid = 11;

    string counter_name = 9;
  }
  message Arg {
    oneof key_or_interned_key {
      string key = 1;
      uint64 key_iid = 3;
    }
    oneof value_or_interned_value {
      string value = 2;
      uint64 value_iid = 4;
    }
  }

  // Only when using |event_id|.
  optional uint64 event_duration_ns = 3;

  // Only when using |counter_id|.
  optional int32 counter_value = 4;

  // ID of the thread that emitted the event.
  optional uint32 thread_id = 5;

  // If true the meta-tracing ring buffer had overruns and hence some data is
  // missing from this point.
  optional bool has_overruns = 6;

  // Args for the event.
  repeated Arg args = 7;

  // Interned strings corresponding to the |event_name_iid|, |key_iid| and
  // |value_iid| above.
  message InternedString {
    optional uint64 iid = 1;
    optional string value = 2;
  };
  repeated InternedString interned_strings = 10;
}

// End of protos/perfetto/trace/perfetto/perfetto_metatrace.proto

// Begin of protos/perfetto/trace/perfetto/tracing_service_event.proto

// Events emitted by the tracing service.
// Next id: 12.
message TracingServiceEvent {
  message DataSources {
    message DataSource {
      optional string producer_name = 1;
      optional string data_source_name = 2;
    }
    repeated DataSource data_source = 1;
  }
  oneof event_type {
    // When each of the following booleans are set to true, they report the
    // point in time (through TracePacket's timestamp) where the condition
    // they describe happened.
    // The order of the booleans below matches the timestamp ordering
    // they would generally be expected to have.

    // Emitted when we start tracing and specifically, this will be before any
    // producer is notified about the existence of this trace. This is always
    // emitted before the all_data_sources_started event. This event is also
    // guaranteed to be seen (byte-offset wise) before any data packets from
    // producers.
    bool tracing_started = 2;

    // Emitted after all data sources saw the start event and ACKed it.
    // This identifies the point in time when it's safe to assume that all data
    // sources have been recording events.
    bool all_data_sources_started = 1;

    // Emitted when a flush is started.
    bool flush_started = 9;

    // Emitted when all data sources have been flushed successfully or with an
    // error (including timeouts). This can generally happen many times over the
    // course of the trace.
    bool all_data_sources_flushed = 3;

    // Emitted when reading back the central tracing buffers has been completed.
    // If |write_into_file| is specified, this can happen many times over the
    // course of the trace.
    bool read_tracing_buffers_completed = 4;

    // Emitted after tracing has been disabled and specifically, this will be
    // after all packets from producers have been included in the central
    // tracing buffer.
    bool tracing_disabled = 5;

    // Emitted if perfetto --save-for-bugreport was invoked while the current
    // tracing session was running and it had the highest bugreport_score. In
    // this case the original consumer will see a nearly empty trace, because
    // the contents are routed onto the bugreport file. This event flags the
    // situation explicitly. Traces that contain this marker should be discarded
    // by test infrastructures / pipelines.
    // Deprecated since Android U, where --save-for-bugreport uses
    // non-destructive cloning.
    bool seized_for_bugreport = 6;

    // Emitted when not all data sources in all producers reply to a start
    // request after some time.
    DataSources slow_starting_data_sources = 7;

    // Emitted when the last flush request has failed. Lists data sources that
    // did not reply on time.
    DataSources last_flush_slow_data_sources = 8;

    // If this was a cloned tracing session, emitted when the tracing serice
    // started the clone operation.
    bool clone_started = 10;

    // If this was a cloned tracing session, emitted when the tracing service
    // finished the clone operation (for a specific buffer).
    uint32 buffer_cloned = 11;
  }
}

// End of protos/perfetto/trace/perfetto/tracing_service_event.proto

// Begin of protos/perfetto/common/android_energy_consumer_descriptor.proto

// Energy consumer based on aidl class:
// android.hardware.power.stats.EnergyConsumer.
message AndroidEnergyConsumer {
  // Unique ID of this energy consumer.  Matches the ID in a
  // AndroidEnergyEstimationBreakdown.
  optional int32 energy_consumer_id = 1;

  // For a group of energy consumers of the same logical type, sorting by
  // ordinal gives their physical order. Ordinals must be consecutive integers
  // starting from 0.
  optional int32 ordinal = 2;

  // Type of this energy consumer.
  optional string type = 3;

  // Unique name of this energy consumer. Vendor/device specific. Opaque to
  // framework.
  optional string name = 4;
}

message AndroidEnergyConsumerDescriptor {
  repeated AndroidEnergyConsumer energy_consumers = 1;
}

// End of protos/perfetto/common/android_energy_consumer_descriptor.proto

// Begin of protos/perfetto/trace/power/android_energy_estimation_breakdown.proto

// Energy data retrieve using the ODPM(On Device Power Monitor) API.
// This proto represents the aidl class:
// android.hardware.power.stats.EnergyConsumerResult.
message AndroidEnergyEstimationBreakdown {
  // The first trace packet of each session should include a energy consumer
  // descriptor.
  optional AndroidEnergyConsumerDescriptor energy_consumer_descriptor = 1;

  // ID of the AndroidEnergyConsumer associated with this result.  Matches
  // the energy_consumer_id in the AndroidEnergyConsumerDescriptor that
  // should be sent at the beginning of a trace.
  optional int32 energy_consumer_id = 2;

  // Total accumulated energy since boot in microwatt-seconds (uWs)
  optional int64 energy_uws = 3;

  message EnergyUidBreakdown {
    // Android ID/Linux UID, the accumulated energy is attributed to.
    optional int32 uid = 1;

    // Accumulated energy since boot in microwatt-seconds (uWs).
    optional int64 energy_uws = 2;
  }
  // Optional attributed energy per Android ID / Linux UID for this
  // EnergyConsumer. Sum total of attributed energy must be less than or equal
  // to total accumulated energy.
  repeated EnergyUidBreakdown per_uid_breakdown = 4;
}

// End of protos/perfetto/trace/power/android_energy_estimation_breakdown.proto

// Begin of protos/perfetto/trace/power/android_entity_state_residency.proto

message EntityStateResidency {
  message PowerEntityState {
    // Index corresponding to the entity
    optional int32 entity_index = 1;

    // Index corresponding to the state
    optional int32 state_index = 2;

    // Name of the entity. This is device-specific, determined by the PowerStats
    // HAL, and cannot be configured by the user. An example would be
    // "Bluetooth".
    optional string entity_name = 3;

    // Name of the state. This is device-specific, determined by the PowerStats
    // HAL, and cannot be configured by the user. An example would be
    // "Active".
    optional string state_name = 4;
  }

  // This is only emitted at the beginning of the trace.
  repeated PowerEntityState power_entity_state = 1;

  message StateResidency {
    // Index corresponding to PowerEntityState.entity_index
    optional int32 entity_index = 1;

    // Index corresponding to PowerEntityState.state_index
    optional int32 state_index = 2;

    // Time since boot that this entity has been in this state
    optional uint64 total_time_in_state_ms = 3;

    // Total number of times since boot that the entity has entered this state
    optional uint64 total_state_entry_count = 4;

    // Timestamp of the last time the entity entered this state
    optional uint64 last_entry_timestamp_ms = 5;
  }

  repeated StateResidency residency = 2;
}

// End of protos/perfetto/trace/power/android_entity_state_residency.proto

// Begin of protos/perfetto/trace/power/battery_counters.proto

message BatteryCounters {
  // Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
  optional int64 charge_counter_uah = 1;

  // Remaining battery capacity percentage of total capacity
  optional float capacity_percent = 2;

  // Instantaneous battery current in microamperes(µA).
  // Negative values indicate current being drained from the battery and
  // positive values indicate current feeding the battery from a charge source
  // (USB).
  //
  // See https://perfetto.dev/docs/data-sources/battery-counters for more info.
  optional int64 current_ua = 3;

  // Instantaneous battery current in microamperes(µA).
  optional int64 current_avg_ua = 4;

  // Battery name, emitted only on multiple batteries.
  optional string name = 5;

  // Battery capacity in microwatt-hours(µWh).
  optional int64 energy_counter_uwh = 6;

  // Battery voltage in microvolts(µV).
  optional int64 voltage_uv = 7;
}

// End of protos/perfetto/trace/power/battery_counters.proto

// Begin of protos/perfetto/trace/power/power_rails.proto

message PowerRails {

  message RailDescriptor {
    // Index corresponding to the rail
    optional uint32 index = 1;

    // Name of the rail
    optional string rail_name = 2;

    // Name of the subsystem to which this rail belongs
    optional string subsys_name = 3;

    // Hardware sampling rate (Hz).
    optional uint32 sampling_rate = 4;
  }

  // This is only emitted at the beginning of the trace.
  repeated RailDescriptor rail_descriptor = 1;

  message EnergyData {
    // Index corresponding to RailDescriptor.index
    optional uint32 index = 1;

    // Time since device boot(CLOCK_BOOTTIME) in milli-seconds.
    optional uint64 timestamp_ms = 2;

    // Accumulated energy since device boot in microwatt-seconds (uWs).
    optional uint64 energy = 3;
  }

  repeated EnergyData energy_data = 2;
}

// End of protos/perfetto/trace/power/power_rails.proto


// Begin of protos/perfetto/trace/profiling/smaps.proto

message SmapsEntry {
  optional string path = 1;
  optional uint64 size_kb = 2;
  optional uint64 private_dirty_kb = 3;
  optional uint64 swap_kb = 4;

  // for field upload (instead of path).
  optional string file_name = 5;

  // TODO(crbug.com/1098746): Consider encoding this as incremental values.
  optional uint64 start_address = 6;
  optional uint64 module_timestamp = 7;
  optional string module_debugid = 8;
  optional string module_debug_path = 9;
  optional uint32 protection_flags = 10;

  optional uint64 private_clean_resident_kb = 11;
  optional uint64 shared_dirty_resident_kb = 12;
  optional uint64 shared_clean_resident_kb = 13;
  optional uint64 locked_kb = 14;
  optional uint64 proportional_resident_kb = 15;
};

message SmapsPacket {
  optional uint32 pid = 1;
  repeated SmapsEntry entries = 2;
};

// End of protos/perfetto/trace/profiling/smaps.proto

// Begin of protos/perfetto/trace/ps/process_stats.proto

// Per-process periodically sampled stats. These samples are wrapped in a
// dedicated message (as opposite to be fields in process_tree.proto) because
// they are dumped at a different rate than cmdline and thread list.
// Note: not all of these stats will be present in every ProcessStats message
// and sometimes processes may be missing. This is because counters are
// cached to reduce emission of counters which do not change.
message ProcessStats {
  // Per-thread periodically sampled stats.
  // Note: not all of these stats will be present in every message. See the note
  // for ProcessStats.
  message Thread {
    optional int32 tid = 1;

    // DEPRECATED cpu_freq_indices
    reserved 2;

    // DEPRECATED cpu_freq_ticks
    reserved 3;

    // DEPRECATED cpu_freq_full
    reserved 4;
  }

  message FDInfo {
    optional uint64 fd = 1;
    optional string path = 2;
  }

  message Process {
    optional int32 pid = 1;

    repeated Thread threads = 11;

    // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
    optional uint64 vm_size_kb = 2;
    optional uint64 vm_rss_kb = 3;
    optional uint64 rss_anon_kb = 4;
    optional uint64 rss_file_kb = 5;
    optional uint64 rss_shmem_kb = 6;
    optional uint64 vm_swap_kb = 7;
    optional uint64 vm_locked_kb = 8;
    optional uint64 vm_hwm_kb = 9;
    // When adding a new field remember to update kProcMemCounterSize in
    // the trace processor.

    optional int64 oom_score_adj = 10;

    // The peak resident set size is resettable in newer Posix kernels.
    // This field specifies if reset is supported and if the writer had reset
    // the peaks after each process stats recording.
    optional bool is_peak_rss_resettable = 12;

    // Private, shared and swap footprint of the process as measured by
    // Chrome. To know more about these metrics refer to:
    // https://docs.google.com/document/d/1_WmgE1F5WUrhwkPqJis3dWyOiUmQKvpXp5cd4w86TvA
    optional uint32 chrome_private_footprint_kb = 13;
    optional uint32 chrome_peak_resident_set_kb = 14;

    repeated FDInfo fds = 15;

    // These fields are set only when scan_smaps_rollup=true
    optional uint64 smr_rss_kb = 16;
    optional uint64 smr_pss_kb = 17;
    optional uint64 smr_pss_anon_kb = 18;
    optional uint64 smr_pss_file_kb = 19;
    optional uint64 smr_pss_shmem_kb = 20;
    optional uint64 smr_swap_pss_kb = 23;

    // Time spent scheduled in user mode in nanoseconds. Parsed from utime in
    // /proc/pid/stat. Recorded if record_process_runtime config option is set.
    // Resolution of "clock ticks", usually 10ms.
    optional uint64 runtime_user_mode = 21;

    // Time spent scheduled in kernel mode in nanoseconds. Parsed from stime in
    // /proc/pid/stat. Recorded if record_process_runtime config option is set.
    // Resolution of "clock ticks", usually 10ms.
    optional uint64 runtime_kernel_mode = 22;
  }
  repeated Process processes = 1;

  // The time at which we finish collecting this batch of samples;
  // the top-level packet timestamp is the time at which
  // we begin collection.
  optional uint64 collection_end_timestamp = 2;
}

// End of protos/perfetto/trace/ps/process_stats.proto

// Begin of protos/perfetto/trace/ps/process_tree.proto

// Metadata about the processes and threads in the trace.
// Note: this proto was designed to be filled in by traced_probes and should
// only be populated with accurate information coming from the system. Other
// trace writers should prefer to fill ThreadDescriptor and ProcessDescriptor
// in TrackDescriptor.
message ProcessTree {
  // Representation of a thread.
  message Thread {
    // The thread ID (as per gettid()) in the root PID namespace.
    optional int32 tid = 1;

    // Thread group id (i.e. the PID of the process, == TID of the main thread)
    optional int32 tgid = 3;

    // The name of the thread.
    optional string name = 2;

    // The non-root-level thread IDs if the thread runs in a PID namespace. Read
    // from the NSpid entry of /proc/<tid>/status, with the first element (root-
    // level thread ID) omitted.
    repeated int32 nstid = 4;
  }

  // Representation of a process.
  message Process {
    // The UNIX process ID, aka thread group ID (as per getpid()) in the root
    // PID namespace.
    optional int32 pid = 1;

    // The parent process ID, as per getppid().
    optional int32 ppid = 2;

    // The command line for the process, as per /proc/pid/cmdline.
    // If it is a kernel thread there will only be one cmdline field
    // and it will contain /proc/pid/comm.
    repeated string cmdline = 3;

    // The uid for the process, as per /proc/pid/status.
    optional int32 uid = 5;

    // The non-root-level process IDs if the process runs in a PID namespace.
    // Read from the NSpid entry of /proc/<pid>/status, with the first element
    // (root-level process ID) omitted.
    repeated int32 nspid = 6;

    // Timestamp of when the process was created, in nanoseconds
    // from boot. Parsed from starttime in /proc/pid/stat.
    // Recorded if record_process_age config option is set.
    // Resolution of "clock ticks", usually 10ms.
    optional uint64 process_start_from_boot = 7;

    // threads_deprecated
    reserved 4;
  }

  // List of processes and threads in the client. These lists are incremental
  // and not exhaustive. A process and its threads might show up separately in
  // different ProcessTree messages. A thread might event not show up at all, if
  // no sched_switch activity was detected, for instance:
  // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
  // #1 { threads: [{pid: 12, tgid: 10}] }
  // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
  repeated Process processes = 1;
  repeated Thread threads = 2;

  // The time at which we finish collecting this process tree;
  // the top-level packet timestamp is the time at which
  // we begin collection.
  optional uint64 collection_end_timestamp = 3;
}

// End of protos/perfetto/trace/ps/process_tree.proto

// Begin of protos/perfetto/trace/remote_clock_sync.proto

// Begin of protos/perfetto/trace/sys_stats/sys_stats.proto

// Various Linux system stat counters from /proc.
// The fields in this message can be reported at different rates and with
// different granularity. See sys_stats_config.proto.
message SysStats {
  // Counters from /proc/meminfo. Values are in KB.
  message MeminfoValue {
    optional MeminfoCounters key = 1;
    optional uint64 value = 2;
  };
  repeated MeminfoValue meminfo = 1;

  // Counter from /proc/vmstat. Units are often pages, not KB.
  message VmstatValue {
    optional VmstatCounters key = 1;
    optional uint64 value = 2;
  };
  repeated VmstatValue vmstat = 2;

  // Times in each mode, since boot. Unit: nanoseconds.
  message CpuTimes {
    optional uint32 cpu_id = 1;

    // Time spent in user mode.
    optional uint64 user_ns = 2;

    // Time spent in user mode (low prio).
    optional uint64 user_nice_ns = 3;

    // Time spent in system mode.
    optional uint64 system_mode_ns = 4;

    // Time spent in the idle task.
    optional uint64 idle_ns = 5;

    // Time spent waiting for I/O.
    optional uint64 io_wait_ns = 6;

    // Time spent servicing interrupts.
    optional uint64 irq_ns = 7;

    // Time spent servicing softirqs.
    optional uint64 softirq_ns = 8;
  }
  // One entry per cpu.
  repeated CpuTimes cpu_stat = 3;

  // Num processes forked since boot.
  // Populated only if FORK_COUNT in config.stat_counters.
  optional uint64 num_forks = 4;

  message InterruptCount {
    optional int32 irq = 1;
    optional uint64 count = 2;
  }

  // Number of interrupts, broken by IRQ number.
  // Populated only if IRQ_COUNTS in config.stat_counters.

  // Total num of irqs serviced since boot.
  optional uint64 num_irq_total = 5;
  repeated InterruptCount num_irq = 6;

  // Number of softirqs, broken by softirq number.
  // Populated only if SOFTIRQ_COUNTS in config.stat_counters.

  // Total num of softirqs since boot.
  optional uint64 num_softirq_total = 7;

  // Per-softirq count.
  repeated InterruptCount num_softirq = 8;

  // The time at which we finish collecting this set of samples;
  // the top-level packet timestamp is the time at which
  // we begin collection.
  optional uint64 collection_end_timestamp = 9;

  // Frequencies for /sys/class/devfreq/ entries in kHz.
  message DevfreqValue {
    optional string key = 1;
    optional uint64 value = 2;
  };

  // One entry per device.
  repeated DevfreqValue devfreq = 10;

  // Cpu current frequency from
  // /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq in kHz.
  // One entry per cpu. Report 0 for offline cpu
  repeated uint32 cpufreq_khz = 11;

  message BuddyInfo {
    optional string node = 1;
    optional string zone = 2;
    repeated uint32 order_pages = 3;
  }
  // One entry per each node's zones.
  repeated BuddyInfo buddy_info = 12;

  // Counters from /proc/diskstats.
  message DiskStat {
    optional string device_name = 1;
    optional uint64 read_sectors = 2;
    optional uint64 read_time_ms = 3;
    optional uint64 write_sectors = 4;
    optional uint64 write_time_ms = 5;
    optional uint64 discard_sectors = 6;
    optional uint64 discard_time_ms = 7;
    optional uint64 flush_count = 8;
    optional uint64 flush_time_ms = 9;
  }
  // One entry per disk device.
  repeated DiskStat disk_stat = 13;

  // Reading from /proc/pressure/*.
  message PsiSample {
    // Type of resource that may have exhibited pressure stalls.
    //    * _SOME indicates some resource tasks stalled.
    //    * _FULL indicates all non-idle resource tasks stalled simultaneously.
    enum PsiResource {
      PSI_RESOURCE_UNSPECIFIED = 0;
      PSI_RESOURCE_CPU_SOME = 1;
      PSI_RESOURCE_CPU_FULL = 2;
      PSI_RESOURCE_IO_SOME = 3;
      PSI_RESOURCE_IO_FULL = 4;
      PSI_RESOURCE_MEMORY_SOME = 5;
      PSI_RESOURCE_MEMORY_FULL = 6;
    }
    optional PsiResource resource = 1;

    // Total absolute stall time (in nanos) for a given resource.
    // While PSI readings are in micros, we store in nanos for consistency with
    // most other time-based counters.
    optional uint64 total_ns = 2;

    // Note that /proc/pressure/* exposes historical average utilization values
    // (as a %), but we don't yet sample those. They could easily be added as
    // additional fields should the total stall time readings be insufficient.
  }
  // One entry per PsiResource type.
  repeated PsiSample psi = 14;

  // Reading from /sys/class/thermal/*.
  message ThermalZone {
    optional string name = 1;
    optional uint64 temp = 2;
    optional string type = 3;
  }
  repeated ThermalZone thermal_zone = 15;

  // Reading from /sys/devices/system/cpu/cpu*/cpuidle/state*.
  message CpuIdleStateEntry {
    // Name of the idle state, e.g. C1-C10
    optional string state = 1;
    optional uint64 duration_us = 2;
  }
  message CpuIdleState {
    optional uint32 cpu_id = 1;
    repeated CpuIdleStateEntry cpuidle_state_entry = 2;
  }
  repeated CpuIdleState cpuidle_state = 16;

  // Read GPU frequency info on Intel/AMD devices.
  repeated uint64 gpufreq_mhz = 17;
}

// End of protos/perfetto/trace/sys_stats/sys_stats.proto

// Begin of protos/perfetto/trace/system_info.proto

message Utsname {
  optional string sysname = 1;
  optional string version = 2;
  optional string release = 3;
  optional string machine = 4;
}

// Next id: 15;
message SystemInfo {
  optional Utsname utsname = 1;
  optional string android_build_fingerprint = 2;

  // The manufacturer of the product/hardware.
  // Source : "ro.product.manufacturer"
  // Introduced after Android W in Nov 2024 and is not supported on older
  // versions.
  optional string android_device_manufacturer = 14;

  // The SoC model from which trace is collected
  optional string android_soc_model = 9;

  // The guest SoC model from which trace is collected in case of VMs
  optional string android_guest_soc_model = 13;

  // The hardware reversion from android device
  optional string android_hardware_revision = 10;

  // The storage component from android_device. This field has been introduced
  // after Android W in Aug 2024 and is not supported on older versions.
  optional string android_storage_model = 11;

  // The RAM component information from android device. This field has been
  // introduced after Android W in Aug 2024 and is not supported on older
  // versions.
  optional string android_ram_model = 12;

  // The version of traced (the same returned by `traced --version`).
  // This is a human readable string with and its format varies depending on
  // the build system and the repo (standalone vs AOSP).
  // This is intended for human debugging only.
  optional string tracing_service_version = 4;

  // The Android SDK vesion (e.g. 21 for L, 31 for S etc).
  // Introduced in Android T.
  optional uint64 android_sdk_version = 5;

  // Kernel page size - sysconf(_SC_PAGESIZE).
  optional uint32 page_size = 6;

  // Number of cpus - sysconf(_SC_NPROCESSORS_CONF).
  // Might be different to the number of online cpus.
  // Introduced in perfetto v44.
  optional uint32 num_cpus = 8;

  // The timezone offset from UTC, as per strftime("%z"), in minutes.
  // Introduced in v38 / Android V.
  optional int32 timezone_off_mins = 7;

  // Ticks per second - sysconf(_SC_CLK_TCK).
  // Not serialised as of perfetto v44.
  optional int64 hz = 3;
}

// End of protos/perfetto/trace/system_info.proto

// Begin of protos/perfetto/trace/system_info/cpu_info.proto

// Information about CPUs from procfs and sysfs.
message CpuInfo {
  message ArmCpuIdentifier {
    // Implementer code
    optional uint32 implementer = 1;

    // Architecture code
    optional uint32 architecture = 2;

    // CPU variant
    optional uint32 variant = 3;

    // CPU part
    optional uint32 part = 4;

    // CPU revision
    optional uint32 revision = 5;
  }

  // Information about a single CPU.
  message Cpu {
    // Value of "Processor" field from /proc/cpuinfo for this CPU.
    // Example: "AArch64 Processor rev 12 (aarch64)"
    optional string processor = 1;

    // Frequencies from
    // /sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies
    // where X is the index of this CPU.
    repeated uint32 frequencies = 2;

    // Cpu capacity from /sys/devices/system/cpu/cpuX/cpu_capacity where X is
    // the index of this CPU.
    optional uint32 capacity = 3;

    // Code to identify the CPU
    oneof identifier {
      ArmCpuIdentifier arm_identifier = 4;
    }
  }

  // Describes available CPUs, one entry per CPU.
  repeated Cpu cpus = 1;
}

// End of protos/perfetto/trace/system_info/cpu_info.proto

// Begin of protos/perfetto/trace/test_event.proto

// Event used by testing code.
message TestEvent {
  // Arbitrary string used in tests.
  optional string str = 1;

  // The current value of the random number sequence used in tests.
  optional uint32 seq_value = 2;

  // Monotonically increased on each packet.
  optional uint64 counter = 3;

  // No more packets should follow (from the current sequence).
  optional bool is_last = 4;

  message TestPayload {
    repeated string str = 1;
    repeated TestPayload nested = 2;

    optional string single_string = 4;

    optional int32 single_int = 5;
    repeated int32 repeated_ints = 6;

    // When 0 this is the bottom-most nested message.
    optional uint32 remaining_nesting_depth = 3;

    repeated DebugAnnotation debug_annotations = 7;
  }
  optional TestPayload payload = 5;
}

// End of protos/perfetto/trace/test_event.proto

// Begin of protos/perfetto/trace/trace_packet_defaults.proto

// Default values for TracePacket fields that hold for a particular TraceWriter
// packet sequence. This message contains a subset of the TracePacket fields
// with matching IDs. When provided, these fields define the default values
// that should be applied, at import time, to all TracePacket(s) with the same
// |trusted_packet_sequence_id|, unless otherwise specified in each packet.
//
// Should be reemitted whenever incremental state is cleared on the sequence.
message TracePacketDefaults {
  optional uint32 timestamp_clock_id = 58;

  // Default values for TrackEvents (e.g. default track).
  optional TrackEventDefaults track_event_defaults = 11;

  // Defaults for perf profiler packets (PerfSample).
  // optional PerfSampleDefaults perf_sample_defaults = 12;

  // Defaults for V8 code packets (V8JsCode, V8InternalCode, V8WasmCode,
  // V8RegexpCode)
  // optional V8CodeDefaults v8_code_defaults = 99;
}
// End of protos/perfetto/trace/trace_packet_defaults.proto

// Begin of protos/perfetto/trace/trace_uuid.proto

// A random unique ID that identifies the trace.
// This message has been introduced in v32. Prior to that, the UUID was
// only (optionally) present in the TraceConfig.trace_uuid_msb/lsb fields.
// This has been moved to a standalone packet to deal with new use-cases for
// go/gapless-aot, where the same tracing session can be serialized several
// times, in which case the UUID is changed on each snapshot and does not match
// the one in the TraceConfig.
message TraceUuid {
  optional int64 msb = 1;
  optional int64 lsb = 2;
}

// End of protos/perfetto/trace/trace_uuid.proto

// Begin of protos/perfetto/trace/track_event/process_descriptor.proto

// Describes a process's attributes. Emitted as part of a TrackDescriptor,
// usually by the process's main thread.
//
// Next id: 9.
message ProcessDescriptor {
  optional int32 pid = 1;
  repeated string cmdline = 2;
  optional string process_name = 6;

  optional int32 process_priority = 5;
  // Process start time in nanoseconds.
  // The timestamp refers to the trace clock by default. Other clock IDs
  // provided in TracePacket are not supported.
  optional int64 start_timestamp_ns = 7;

  // ---------------------------------------------------------------------------
  // Deprecated / legacy fields, which will be removed in the future:
  // ---------------------------------------------------------------------------

  // See chromium's content::ProcessType.
  enum ChromeProcessType {
    PROCESS_UNSPECIFIED = 0;
    PROCESS_BROWSER = 1;
    PROCESS_RENDERER = 2;
    PROCESS_UTILITY = 3;
    PROCESS_ZYGOTE = 4;
    PROCESS_SANDBOX_HELPER = 5;
    PROCESS_GPU = 6;
    PROCESS_PPAPI_PLUGIN = 7;
    PROCESS_PPAPI_BROKER = 8;
  }
  optional ChromeProcessType chrome_process_type = 4;

  // To support old UI. New UI should determine default sorting by process_type.
  optional int32 legacy_sort_index = 3;

  // Labels can be used to further describe properties of the work performed by
  // the process. For example, these can be used by Chrome renderer process to
  // provide titles of frames being rendered.
  repeated string process_labels = 8;
}

// End of protos/perfetto/trace/track_event/process_descriptor.proto

// Begin of protos/perfetto/trace/track_event/range_of_interest.proto

// This message specifies the "range of interest" for track events. With the
// `drop_track_event_data_before` option set to `kTrackEventRangeOfInterest`,
// Trace Processor drops track events outside of this range.
message TrackEventRangeOfInterest {
  optional int64 start_us = 1;
}
// End of protos/perfetto/trace/track_event/range_of_interest.proto

// Begin of protos/perfetto/trace/track_event/thread_descriptor.proto

// Describes a thread's attributes. Emitted as part of a TrackDescriptor,
// usually by the thread's trace writer.
//
// Next id: 9.
message ThreadDescriptor {
  optional int32 pid = 1;
  optional int32 tid = 2;

  optional string thread_name = 5;

  // ---------------------------------------------------------------------------
  // Deprecated / legacy fields, which will be removed in the future:
  // ---------------------------------------------------------------------------

  enum ChromeThreadType {
    CHROME_THREAD_UNSPECIFIED = 0;

    CHROME_THREAD_MAIN = 1;
    CHROME_THREAD_IO = 2;

    // Scheduler:
    CHROME_THREAD_POOL_BG_WORKER = 3;
    CHROME_THREAD_POOL_FG_WORKER = 4;
    CHROME_THREAD_POOL_FB_BLOCKING = 5;
    CHROME_THREAD_POOL_BG_BLOCKING = 6;
    CHROME_THREAD_POOL_SERVICE = 7;

    // Compositor:
    CHROME_THREAD_COMPOSITOR = 8;
    CHROME_THREAD_VIZ_COMPOSITOR = 9;
    CHROME_THREAD_COMPOSITOR_WORKER = 10;

    // Renderer:
    CHROME_THREAD_SERVICE_WORKER = 11;

    // Tracing related threads:
    CHROME_THREAD_MEMORY_INFRA = 50;
    CHROME_THREAD_SAMPLING_PROFILER = 51;
  };
  optional ChromeThreadType chrome_thread_type = 4;

  // Deprecated. Use ClockSnapshot in combination with TracePacket's timestamp
  // and timestamp_clock_id fields instead.
  optional int64 reference_timestamp_us = 6;

  // Absolute reference values. Clock values in subsequent TrackEvents can be
  // encoded accumulatively and relative to these. This reduces their var-int
  // encoding size.
  // TODO(eseckler): Deprecated. Replace these with ClockSnapshot encoding.
  optional int64 reference_thread_time_us = 7;
  optional int64 reference_thread_instruction_count = 8;

  // To support old UI. New UI should determine default sorting by thread_type.
  optional int32 legacy_sort_index = 3;
}

// End of protos/perfetto/trace/track_event/thread_descriptor.proto

// Begin of protos/perfetto/trace/track_event/counter_descriptor.proto

// Defines properties of a counter track, e.g. for built-in counters (thread
// time, instruction count, ..) or user-specified counters (e.g. memory usage of
// a specific app component).
//
// Counter tracks only support TYPE_COUNTER track events, which specify new
// values for the counter. For counters that require per-slice values, counter
// values can instead be provided in a more efficient encoding via TrackEvent's
// |extra_counter_track_uuids| and |extra_counter_values| fields. However,
// slice-type events cannot be emitted onto a counter track.
//
// Values for counters that are only emitted on a single packet sequence can
// optionally be delta-encoded, see |is_incremental|.
//
// Next id: 7.
message CounterDescriptor {
  // Built-in counters, usually with special meaning in the client library,
  // trace processor, legacy JSON format, or UI. Trace processor will infer a
  // track name from the enum value if none is provided in TrackDescriptor.
  enum BuiltinCounterType {
    COUNTER_UNSPECIFIED = 0;

    // Thread-scoped counters. The thread's track should be specified via
    // |parent_uuid| in the TrackDescriptor for such a counter.

    // implies UNIT_TIME_NS.
    COUNTER_THREAD_TIME_NS = 1;

    // implies UNIT_COUNT.
    COUNTER_THREAD_INSTRUCTION_COUNT = 2;
  }

  // Type of the values for the counters - to supply lower granularity units,
  // see also |unit_multiplier|.
  enum Unit {
    UNIT_UNSPECIFIED = 0;
    UNIT_TIME_NS = 1;
    UNIT_COUNT = 2;
    UNIT_SIZE_BYTES = 3;
    // TODO(eseckler): Support more units as necessary.
  }

  // For built-in counters (e.g. thread time). Custom user-specified counters
  // (e.g. those emitted by TRACE_COUNTER macros of the client library)
  // shouldn't set this, and instead provide a counter name via TrackDescriptor.
  optional BuiltinCounterType type = 1;

  // Names of categories of the counter (usually for user-specified counters).
  // In the client library, categories are a way to turn groups of individual
  // counters (or events) on or off.
  repeated string categories = 2;

  // Type of the counter's values. Built-in counters imply a value for this
  // field.
  optional Unit unit = 3;

  // In order to use a unit not defined as a part of |Unit|, a free-form unit
  // name can be used instead.
  optional string unit_name = 6;

  // Multiplication factor of this counter's values, e.g. to supply
  // COUNTER_THREAD_TIME_NS timestamps in microseconds instead.
  optional int64 unit_multiplier = 4;

  // Whether values for this counter are provided as delta values. Only
  // supported for counters that are emitted on a single packet-sequence (e.g.
  // thread time). Counter values in subsequent packets on the current packet
  // sequence will be interpreted as delta values from the sequence's most
  // recent value for the counter. When incremental state is cleared, the
  // counter value is considered to be reset to 0. Thus, the first value after
  // incremental state is cleared is effectively an absolute value.
  optional bool is_incremental = 5;

  // TODO(eseckler): Support arguments describing the counter (?).
  // repeated DebugAnnotation debug_annotations;
}

// End of protos/perfetto/trace/track_event/counter_descriptor.proto

// Begin of protos/perfetto/trace/track_event/track_descriptor.proto

// Defines a track for TrackEvents. Slices and instant events on the same track
// will be nested based on their timestamps, see TrackEvent::Type.
//
// A TrackDescriptor only needs to be emitted by one trace writer / producer and
// is valid for the entirety of the trace. To ensure the descriptor isn't lost
// when the ring buffer wraps, it should be reemitted whenever incremental state
// is cleared.
//
// As a fallback, TrackEvents emitted without an explicit track association will
// be associated with an implicit trace-global track (uuid = 0), see also
// |TrackEvent::track_uuid|. It is possible but not necessary to emit a
// TrackDescriptor for this implicit track.
//
// Next id: 14.
message TrackDescriptor {
  // Unique ID that identifies this track. This ID is global to the whole trace.
  // Producers should ensure that it is unlikely to clash with IDs emitted by
  // other producers. A value of 0 denotes the implicit trace-global track.
  //
  // For example, legacy TRACE_EVENT macros may use a hash involving the async
  // event id + id_scope, pid, and/or tid to compute this ID.
  optional uint64 uuid = 1;

  // A parent track reference can be used to describe relationships between
  // tracks. For example, to define an asynchronous track which is scoped to a
  // specific process, specify the uuid for that process's process track here.
  // Similarly, to associate a COUNTER_THREAD_TIME_NS counter track with a
  // thread, specify the uuid for that thread's thread track here.
  optional uint64 parent_uuid = 5;

  // Name of the track. Optional - if unspecified, it may be derived from the
  // process/thread name (process/thread tracks), the first event's name (async
  // tracks), or counter name (counter tracks).
  oneof static_or_dynamic_name {
    string name = 2;
    // This field is only set by the SDK when perfetto::StaticString is
    // provided.
    string static_name = 10;
    // Equivalent to name, used just to mark that the data is coming from
    // android.os.Trace.
    string atrace_name = 13;
  }

  // Associate the track with a process, making it the process-global track.
  // There should only be one such track per process (usually for instant
  // events; trace processor uses this fact to detect pid reuse). If you need
  // more (e.g. for asynchronous events), create child tracks using parent_uuid.
  //
  // Trace processor will merge events on a process track with slice-type events
  // from other sources (e.g. ftrace) for the same process into a single
  // timeline view.
  optional ProcessDescriptor process = 3;
  // optional ChromeProcessDescriptor chrome_process = 6;

  // Associate the track with a thread, indicating that the track's events
  // describe synchronous code execution on the thread. There should only be one
  // such track per thread (trace processor uses this fact to detect tid reuse).
  //
  // Trace processor will merge events on a thread track with slice-type events
  // from other sources (e.g. ftrace) for the same thread into a single timeline
  // view.
  optional ThreadDescriptor thread = 4;
  // optional ChromeThreadDescriptor chrome_thread = 7;

  // Descriptor for a counter track. If set, the track will only support
  // TYPE_COUNTER TrackEvents (and values provided via TrackEvent's
  // |extra_counter_values|).
  optional CounterDescriptor counter = 8;

  // If true, forces Trace Processor to use separate tracks for track events
  // and system events for the same thread.
  // Track events timestamps in Chrome have microsecond resolution, while
  // system events use nanoseconds. It results in broken event nesting when
  // track events and system events share a track.
  optional bool disallow_merging_with_system_tracks = 9;

  // Specifies how the UI should display child tracks of this track (i.e. tracks
  // where `parent_uuid` is specified to this track `uuid`). Note that this
  // value is simply a *hint* to the UI: the UI is not guarnateed to respect
  // this if it has a good reason not to do so.
  enum ChildTracksOrdering {
    // The default ordering, with no bearing on how the UI will visualise the
    // tracks.
    UNKNOWN = 0;

    // Order tracks by `name` or `static_name` depending on which one has been
    // specified.
    LEXICOGRAPHIC = 1;

    // Order tracks by the first `ts` event in a track.
    CHRONOLOGICAL = 2;

    // Order tracks by `sibling_order_rank` of child tracks. Child tracks with
    // the lower values will be shown before tracks with higher values. Tracks
    // with no value will be treated as having 0 rank.
    EXPLICIT = 3;
  }
  optional ChildTracksOrdering child_ordering = 11;

  // An opaque value which allows specifying how two sibling tracks should be
  // ordered relative to each other: tracks with lower ranks will appear before
  // tracks with higher ranks. An unspecified rank will be treated as a rank of
  // 0.
  optional int32 sibling_order_rank = 12;
}

// End of protos/perfetto/trace/track_event/track_descriptor.proto

// Begin of protos/perfetto/trace/translation/translation_table.proto

// Translation rules for the trace processor.
// See the comments for each rule type for specific meaning.
message TranslationTable {
  oneof table {
    ChromeHistorgramTranslationTable chrome_histogram = 1;
    ChromeUserEventTranslationTable chrome_user_event = 2;
    ChromePerformanceMarkTranslationTable chrome_performance_mark = 3;
    SliceNameTranslationTable slice_name = 4;
    ProcessTrackNameTranslationTable process_track_name = 5;
    ChromeStudyTranslationTable chrome_study = 6;
  }
}

// Chrome histogram sample hash -> name translation rules.
message ChromeHistorgramTranslationTable {
  map<uint64, string> hash_to_name = 1;
}

// Chrome user event action hash -> name translation rules.
message ChromeUserEventTranslationTable {
  map<uint64, string> action_hash_to_name = 1;
}

// Chrome performance mark translation rules.
message ChromePerformanceMarkTranslationTable {
  map<uint32, string> site_hash_to_name = 1;
  map<uint32, string> mark_hash_to_name = 2;
};

// Raw -> deobfuscated slice name translation rules.
message SliceNameTranslationTable {
  map<string, string> raw_to_deobfuscated_name = 1;
};

// Raw -> deobfuscated process track name translation rules.
message ProcessTrackNameTranslationTable {
  map<string, string> raw_to_deobfuscated_name = 1;
};

// Chrome study hash -> name translation rules.
message ChromeStudyTranslationTable {
  map<uint64, string> hash_to_name = 1;
};

// End of protos/perfetto/trace/translation/translation_table.proto

// Begin of protos/perfetto/trace/trigger.proto

// When a TracingSession receives a trigger it records the boot time nanoseconds
// in the TracePacket's timestamp field as well as the name of the producer that
// triggered it. We emit this data so filtering can be done on triggers received
// in the trace.
message Trigger {
  // Name of the trigger which was received.
  optional string trigger_name = 1;
  // The actual producer that activated |trigger|.
  optional string producer_name = 2;
  // The verified UID of the producer.
  optional int32 trusted_producer_uid = 3;
}

// End of protos/perfetto/trace/trigger.proto

// Begin of protos/perfetto/trace/ui_state.proto

// Common state for UIs visualizing Perfetto traces.
// This message can be appended as a TracePacket by UIs to save the
// visible state (e.g. scroll position/zoom state) for future opening
// of the trace.
// Design doc: go/trace-ui-state.
message UiState {
  // The start and end bounds of the viewport of the UI in nanoseconds.
  //
  // This is the absolute time associated to slices and other events in
  // trace processor tables (i.e. the |ts| column of most tables)
  optional int64 timeline_start_ts = 1;
  optional int64 timeline_end_ts = 2;

  // Indicates that the given process should be highlighted by the UI.
  message HighlightProcess {
    oneof selector {
      // The pid of the process to highlight. This is useful for UIs to focus
      // on tracks of a particular process in the trace.
      //
      // If more than one process in a trace has the same pid, it is UI
      // implementation specific how the process to be focused will be
      // chosen.
      uint32 pid = 1;

      // The command line of the process to highlight; for most Android apps,
      // this is the package name of the app. This is useful for UIs to focus
      // on a particular app in the trace.
      //
      // If more than one process hasthe same cmdline, it is UI implementation
      // specific how the process to be focused will be chosen.
      string cmdline = 2;
    }
  }
  optional HighlightProcess highlight_process = 3;
}
// End of protos/perfetto/trace/ui_state.proto

// Begin of protos/perfetto/trace/trace_packet.proto

// TracePacket is the root object of a Perfetto trace.
// A Perfetto trace is a linear sequence of TracePacket(s).
//
// The tracing service guarantees that all TracePacket(s) written by a given
// TraceWriter are seen in-order, without gaps or duplicates. If, for any
// reason, a TraceWriter sequence becomes invalid, no more packets are returned
// to the Consumer (or written into the trace file).
// TracePacket(s) written by different TraceWriter(s), hence even different
// data sources, can be seen in arbitrary order.
// The consumer can re-establish a total order, if interested, using the packet
// timestamps, after having synchronized the different clocks onto a global
// clock.
//
// The tracing service is agnostic of the content of TracePacket, with the
// exception of few fields (e.g.. trusted_*, trace_config) that are written by
// the service itself.
//
// See the [Buffers and Dataflow](/docs/concepts/buffers.md) doc for details.
//
// Next reserved id: 14 (up to 15).
// Next id: 116.
message TracePacket {
  // The timestamp of the TracePacket.
  // By default this timestamps refers to the trace clock (CLOCK_BOOTTIME on
  // Android). It can be overridden using a different timestamp_clock_id.
  // The clock domain definition in ClockSnapshot can also override:
  // - The unit (default: 1ns).
  // - The absolute vs delta encoding (default: absolute timestamp).
  optional uint64 timestamp = 8;

  // Specifies the ID of the clock used for the TracePacket |timestamp|. Can be
  // one of the built-in types from ClockSnapshot::BuiltinClocks, or a
  // producer-defined clock id.
  // If unspecified and if no default per-sequence value has been provided via
  // TracePacketDefaults, it defaults to BuiltinClocks::BOOTTIME.
  optional uint32 timestamp_clock_id = 58;

  oneof data {
    ProcessTree process_tree = 2;
    ProcessStats process_stats = 9;
    InodeFileMap inode_file_map = 4;
    // ChromeEventBundle chrome_events = 5;
    // ClockSnapshot clock_snapshot = 6;
    SysStats sys_stats = 7;
    TrackEvent track_event = 11;

    // IDs up to 15 are reserved. They take only one byte to encode their
    // preamble so should be used for frequent events.

    TraceUuid trace_uuid = 89;
    TraceConfig trace_config = 33;
    FtraceStats ftrace_stats = 34;
    TraceStats trace_stats = 35;
    // ProfilePacket profile_packet = 37;
    // StreamingAllocation streaming_allocation = 74;
    // StreamingFree streaming_free = 75;
    BatteryCounters battery = 38;
    PowerRails power_rails = 40;
    // AndroidLogPacket android_log = 39;
    SystemInfo system_info = 45;
    Trigger trigger = 46;
    // ChromeTrigger chrome_trigger = 109;
    // PackagesList packages_list = 47;
    // ChromeBenchmarkMetadata chrome_benchmark_metadata = 48;
    PerfettoMetatrace perfetto_metatrace = 49;
    // ChromeMetadataPacket chrome_metadata = 51;
    GpuCounterEvent gpu_counter_event = 52;
    GpuRenderStageEvent gpu_render_stage_event = 53;
    // StreamingProfilePacket streaming_profile_packet = 54;
    // HeapGraph heap_graph = 56;
    GraphicsFrameEvent graphics_frame_event = 57;
    VulkanMemoryEvent vulkan_memory_event = 62;
    GpuLog gpu_log = 63;
    VulkanApiEvent vulkan_api_event = 65;
    // PerfSample perf_sample = 66;
    CpuInfo cpu_info = 67;
    SmapsPacket smaps_packet = 68;
    TracingServiceEvent service_event = 69;
    InitialDisplayState initial_display_state = 70;
    GpuMemTotalEvent gpu_mem_total_event = 71;
    MemoryTrackerSnapshot memory_tracker_snapshot = 73;
    // FrameTimelineEvent frame_timeline_event = 76;
    // AndroidEnergyEstimationBreakdown android_energy_estimation_breakdown = 77;
    // UiState ui_state = 78;
    // AndroidCameraFrameEvent android_camera_frame_event = 80;
    // AndroidCameraSessionStats android_camera_session_stats = 81;
    TranslationTable translation_table = 82;
    // AndroidGameInterventionList android_game_intervention_list = 83;
    // StatsdAtom statsd_atom = 84;
    // AndroidSystemProperty android_system_property = 86;
    // EntityStateResidency entity_state_residency = 91;

    // Only used in profile packets.
    ProfiledFrameSymbols profiled_frame_symbols = 55;
    ModuleSymbols module_symbols = 61;
    // DeobfuscationMapping deobfuscation_mapping = 64;

    // Only used by TrackEvent.
    TrackDescriptor track_descriptor = 60;

    // Deprecated, use TrackDescriptor instead.
    ProcessDescriptor process_descriptor = 43;

    // Deprecated, use TrackDescriptor instead.
    ThreadDescriptor thread_descriptor = 44;

    // Events from the Linux kernel ftrace infrastructure.
    FtraceEventBundle ftrace_events = 1;

    // This field is emitted at periodic intervals (~10s) and
    // contains always the binary representation of the UUID
    // {82477a76-b28d-42ba-81dc-33326d57a079}. This is used to be able to
    // efficiently partition long traces without having to fully parse them.
    bytes synchronization_marker = 36;

    // Zero or more proto encoded trace packets compressed using deflate.
    // Each compressed_packets TracePacket (including the two field ids and
    // sizes) should be less than 512KB.
    bytes compressed_packets = 50;

    // Data sources can extend the trace proto with custom extension protos (see
    // docs/design-docs/extensions.md). When they do that, the descriptor of
    // their extension proto descriptor is serialized in this packet. This
    // allows trace_processor to deserialize extended messages using reflection
    // even if the extension proto is not checked in the Perfetto repo.
    ExtensionDescriptor extension_descriptor = 72;

    // Represents a single packet sent or received by the network.
    NetworkPacketEvent network_packet = 88;

    // Represents one or more packets sent or received by the network.
    NetworkPacketBundle network_packet_bundle = 92;

    // The "range of interest" for track events. See the message definition
    // comments for more details.
    TrackEventRangeOfInterest track_event_range_of_interest = 90;

    // Winscope traces
    // LayersSnapshotProto surfaceflinger_layers_snapshot = 93;
    // TransactionTraceEntry surfaceflinger_transactions = 94;
    // ShellTransition shell_transition = 96;
    // ShellHandlerMappings shell_handler_mappings = 97;
    // ProtoLogMessage protolog_message = 104;
    // ProtoLogViewerConfig protolog_viewer_config = 105;
    // WinscopeExtensions winscope_extensions = 112;

    // Events from the Windows etw infrastructure.
    // EtwTraceEventBundle etw_events = 95;

    // V8JsCode v8_js_code = 99;
    // V8InternalCode v8_internal_code = 100;
    // V8WasmCode v8_wasm_code = 101;
    // V8RegExpCode v8_reg_exp_code = 102;
    // V8CodeMove v8_code_move = 103;
    // Clock synchronization with remote machines.
    // RemoteClockSync remote_clock_sync = 107;

    // PixelModemEvents pixel_modem_events = 110;
    // PixelModemTokenDatabase pixel_modem_token_database = 111;

    Trigger clone_snapshot_trigger = 113;

    // BluetoothTraceEvent bluetooth_trace_event = 114;

    KernelWakelockData kernel_wakelock_data = 115;

    // This field is only used for testing.
    // In previous versions of this proto this field had the id 268435455
    // This caused many problems:
    // - protozero decoder does not handle field ids larger than 999.
    // - old versions of protoc produce Java bindings with syntax errors when
    //   the field id is large enough.
    TestEvent for_testing = 900;
  }

  // AndroidInputEvent android_input_event (moved to winscope_extensions)
  reserved 106;

  // Trusted user id of the producer which generated this packet. Keep in sync
  // with TrustedPacket.trusted_uid.
  //
  // TODO(eseckler): Emit this field in a PacketSequenceDescriptor message
  // instead.
  oneof optional_trusted_uid {
    int32 trusted_uid = 3;
  };

  // Service-assigned identifier of the packet sequence this packet belongs to.
  // Uniquely identifies a producer + writer pair within the tracing session. A
  // value of zero denotes an invalid ID. Keep in sync with
  // TrustedPacket.trusted_packet_sequence_id.
  oneof optional_trusted_packet_sequence_id {
    uint32 trusted_packet_sequence_id = 10;
  }

  // Trusted process id of the producer which generated this packet, written by
  // the service.
  optional int32 trusted_pid = 79;

  // Incrementally emitted interned data, valid only on the packet's sequence
  // (packets with the same |trusted_packet_sequence_id|). The writer will
  // usually emit new interned data in the same TracePacket that first refers to
  // it (since the last reset of interning state). It may also be emitted
  // proactively in advance of referring to them in later packets.
  optional InternedData interned_data = 12;

  enum SequenceFlags {
    SEQ_UNSPECIFIED = 0;

    // Set by the writer to indicate that it will re-emit any incremental data
    // for the packet's sequence before referring to it again. This includes
    // interned data as well as periodically emitted data like
    // Process/ThreadDescriptors. This flag only affects the current packet
    // sequence (see |trusted_packet_sequence_id|).
    //
    // When set, this TracePacket and subsequent TracePackets on the same
    // sequence will not refer to any incremental data emitted before this
    // TracePacket. For example, previously emitted interned data will be
    // re-emitted if it is referred to again.
    //
    // When the reader detects packet loss (|previous_packet_dropped|), it needs
    // to skip packets in the sequence until the next one with this flag set, to
    // ensure intact incremental data.
    SEQ_INCREMENTAL_STATE_CLEARED = 1;

    // This packet requires incremental state, such as TracePacketDefaults or
    // InternedData, to be parsed correctly. The trace reader should skip this
    // packet if incremental state is not valid on this sequence, i.e. if no
    // packet with the SEQ_INCREMENTAL_STATE_CLEARED flag has been seen on the
    // current |trusted_packet_sequence_id|.
    SEQ_NEEDS_INCREMENTAL_STATE = 2;
  };
  optional uint32 sequence_flags = 13;

  // DEPRECATED. Moved to SequenceFlags::SEQ_INCREMENTAL_STATE_CLEARED.
  optional bool incremental_state_cleared = 41;

  // Default values for fields of later TracePackets emitted on this packet's
  // sequence (TracePackets with the same |trusted_packet_sequence_id|).
  // It must be reemitted when incremental state is cleared (see
  // |incremental_state_cleared|).
  // Requires that any future packet emitted on the same sequence specifies
  // the SEQ_NEEDS_INCREMENTAL_STATE flag.
  // TracePacketDefaults always override the global defaults for any future
  // packet on this sequence (regardless of SEQ_NEEDS_INCREMENTAL_STATE).
  optional TracePacketDefaults trace_packet_defaults = 59;

  // Flag set by the service if, for the current packet sequence (see
  // |trusted_packet_sequence_id|), either:
  // * this is the first packet, or
  // * one or multiple packets were dropped since the last packet that the
  //   consumer read from the sequence. This can happen if chunks in the trace
  //   buffer are overridden before the consumer could read them when the trace
  //   is configured in ring buffer mode.
  //
  // When packet loss occurs, incrementally emitted data (including interned
  // data) on the sequence should be considered invalid up until the next packet
  // with SEQ_INCREMENTAL_STATE_CLEARED set.
  optional bool previous_packet_dropped = 42;

  // Flag set by a producer (starting from SDK v29) if, for the current packet
  // sequence (see |trusted_packet_sequence_id|), this is the first packet.
  //
  // This flag can be used for distinguishing the two situations when
  // processing the trace:
  // 1. There are no prior events for the sequence because of data loss, e.g.
  //    due to ring buffer wrapping.
  // 2. There are no prior events for the sequence because it didn't start
  //    before this packet (= there's definitely no preceding data loss).
  //
  // Given that older SDK versions do not support this flag, this flag not
  // being present for a particular sequence does not necessarily imply data
  // loss.
  optional bool first_packet_on_sequence = 87;

  // The machine ID for identifying trace packets in a multi-machine tracing
  // session. Is emitted by the tracing service for producers running on a
  // remote host (e.g. a VM guest). For more context: go/crosetto-vm-tracing.
  optional uint32 machine_id = 98;
}

// End of protos/perfetto/trace/trace_packet.proto

// Begin of protos/perfetto/trace/trace.proto

message Trace {
  repeated TracePacket packet = 1;

  // Do NOT add any other field here. This is just a convenience wrapper for
  // the use case of a trace being saved to a file. There are other cases
  // (streaming) where TracePacket are directly streamed without being wrapped
  // in a Trace proto. Nothing should ever rely on the full trace, all the
  // logic should be based on TracePacket(s).
}

// End of protos/perfetto/trace/trace.proto
