//
// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Use proto3 syntax as an optimization. The difference is that proto2 stores
// unknown fields seen while decoding in an internal buffer (std::string) while
// proto3 completely drops them. Since during validation we only need to check
// for the presence of the trusted fields below, we can use proto3 as a way to
// speed up this process.
//
// See https://developers.google.com/protocol-buffers/docs/proto3#unknowns and
// https://android-review.googlesource.com/c/platform/external/perfetto/+/
// 591673#17 for details.

// @generated by protoc-gen-es v2.2.2 with parameter "target=ts"
// @generated from file protos/perfetto/trace/chrome/chrome_trace_packet.proto (package perfetto.protos, syntax proto3)
/* eslint-disable */

import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { TraceStats } from "../../common/trace_stats_pb";
import { file_protos_perfetto_common_trace_stats } from "../../common/trace_stats_pb";
import type { TraceConfig } from "../../config/trace_config_pb";
import { file_protos_perfetto_config_trace_config } from "../../config/trace_config_pb";
import type { ChromeEventBundle } from "./chrome_trace_event_pb";
import { file_protos_perfetto_trace_chrome_chrome_trace_event } from "./chrome_trace_event_pb";
import type { ChromeTrigger } from "./chrome_trigger_pb";
import { file_protos_perfetto_trace_chrome_chrome_trigger } from "./chrome_trigger_pb";
import type { ClockSnapshot } from "../clock_snapshot_pb";
import { file_protos_perfetto_trace_clock_snapshot } from "../clock_snapshot_pb";
import type { InternedData } from "../interned_data/interned_data_pb";
import { file_protos_perfetto_trace_interned_data_interned_data } from "../interned_data/interned_data_pb";
import type { StreamingProfilePacket } from "../profiling/profile_packet_pb";
import { file_protos_perfetto_trace_profiling_profile_packet } from "../profiling/profile_packet_pb";
import type { ProfiledFrameSymbols } from "../profiling/profile_common_pb";
import { file_protos_perfetto_trace_profiling_profile_common } from "../profiling/profile_common_pb";
import type { ProcessDescriptor } from "../track_event/process_descriptor_pb";
import { file_protos_perfetto_trace_track_event_process_descriptor } from "../track_event/process_descriptor_pb";
import type { ThreadDescriptor } from "../track_event/thread_descriptor_pb";
import { file_protos_perfetto_trace_track_event_thread_descriptor } from "../track_event/thread_descriptor_pb";
import type { TrackEvent } from "../track_event/track_event_pb";
import { file_protos_perfetto_trace_track_event_track_event } from "../track_event/track_event_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace/chrome/chrome_trace_packet.proto.
 */
export const file_protos_perfetto_trace_chrome_chrome_trace_packet: GenFile = /*@__PURE__*/
  fileDesc("CjZwcm90b3MvcGVyZmV0dG8vdHJhY2UvY2hyb21lL2Nocm9tZV90cmFjZV9wYWNrZXQucHJvdG8SD3BlcmZldHRvLnByb3RvcyKEBgoRQ2hyb21lVHJhY2VQYWNrZXQSOQoNY2hyb21lX2V2ZW50cxgFIAEoCzIiLnBlcmZldHRvLnByb3Rvcy5DaHJvbWVFdmVudEJ1bmRsZRI2Cg5jbG9ja19zbmFwc2hvdBgGIAEoCzIeLnBlcmZldHRvLnByb3Rvcy5DbG9ja1NuYXBzaG90EjAKC3RyYWNrX2V2ZW50GAsgASgLMhsucGVyZmV0dG8ucHJvdG9zLlRyYWNrRXZlbnQSPgoScHJvY2Vzc19kZXNjcmlwdG9yGCsgASgLMiIucGVyZmV0dG8ucHJvdG9zLlByb2Nlc3NEZXNjcmlwdG9yEjwKEXRocmVhZF9kZXNjcmlwdG9yGCwgASgLMiEucGVyZmV0dG8ucHJvdG9zLlRocmVhZERlc2NyaXB0b3ISSQoYc3RyZWFtaW5nX3Byb2ZpbGVfcGFja2V0GDYgASgLMicucGVyZmV0dG8ucHJvdG9zLlN0cmVhbWluZ1Byb2ZpbGVQYWNrZXQSRQoWcHJvZmlsZWRfZnJhbWVfc3ltYm9scxg3IAEoCzIlLnBlcmZldHRvLnByb3Rvcy5Qcm9maWxlZEZyYW1lU3ltYm9scxI2Cg5jaHJvbWVfdHJpZ2dlchhtIAEoCzIeLnBlcmZldHRvLnByb3Rvcy5DaHJvbWVUcmlnZ2VyEjIKDHRyYWNlX2NvbmZpZxghIAEoCzIcLnBlcmZldHRvLnByb3Rvcy5UcmFjZUNvbmZpZxIwCgt0cmFjZV9zdGF0cxgjIAEoCzIbLnBlcmZldHRvLnByb3Rvcy5UcmFjZVN0YXRzEiIKGnRydXN0ZWRfcGFja2V0X3NlcXVlbmNlX2lkGAogASgNEjQKDWludGVybmVkX2RhdGEYDCABKAsyHS5wZXJmZXR0by5wcm90b3MuSW50ZXJuZWREYXRhEiEKGWluY3JlbWVudGFsX3N0YXRlX2NsZWFyZWQYKSABKAgSHwoXcHJldmlvdXNfcGFja2V0X2Ryb3BwZWQYKiABKAhiBnByb3RvMw", [file_protos_perfetto_common_trace_stats, file_protos_perfetto_config_trace_config, file_protos_perfetto_trace_chrome_chrome_trace_event, file_protos_perfetto_trace_chrome_chrome_trigger, file_protos_perfetto_trace_clock_snapshot, file_protos_perfetto_trace_interned_data_interned_data, file_protos_perfetto_trace_profiling_profile_packet, file_protos_perfetto_trace_profiling_profile_common, file_protos_perfetto_trace_track_event_process_descriptor, file_protos_perfetto_trace_track_event_thread_descriptor, file_protos_perfetto_trace_track_event_track_event]);

/**
 * This proto contains only the TracePacket fields that Chrome needs.
 * Note that the field ids here must be kept in sync with TracePacket.
 * This protobuf is here to avoid bloating the Chrome binary with symbols
 * for all possible trace protos.
 * TODO(b/78898755): Try using weak bindings instead of a separate proto.
 *
 * @generated from message perfetto.protos.ChromeTracePacket
 */
export type ChromeTracePacket = Message<"perfetto.protos.ChromeTracePacket"> & {
  /**
   * @generated from field: perfetto.protos.ChromeEventBundle chrome_events = 5;
   */
  chromeEvents?: ChromeEventBundle;

  /**
   * @generated from field: perfetto.protos.ClockSnapshot clock_snapshot = 6;
   */
  clockSnapshot?: ClockSnapshot;

  /**
   * @generated from field: perfetto.protos.TrackEvent track_event = 11;
   */
  trackEvent?: TrackEvent;

  /**
   * @generated from field: perfetto.protos.ProcessDescriptor process_descriptor = 43;
   */
  processDescriptor?: ProcessDescriptor;

  /**
   * @generated from field: perfetto.protos.ThreadDescriptor thread_descriptor = 44;
   */
  threadDescriptor?: ThreadDescriptor;

  /**
   * @generated from field: perfetto.protos.StreamingProfilePacket streaming_profile_packet = 54;
   */
  streamingProfilePacket?: StreamingProfilePacket;

  /**
   * @generated from field: perfetto.protos.ProfiledFrameSymbols profiled_frame_symbols = 55;
   */
  profiledFrameSymbols?: ProfiledFrameSymbols;

  /**
   * @generated from field: perfetto.protos.ChromeTrigger chrome_trigger = 109;
   */
  chromeTrigger?: ChromeTrigger;

  /**
   * The original trace config.
   *
   * @generated from field: perfetto.protos.TraceConfig trace_config = 33;
   */
  traceConfig?: TraceConfig;

  /**
   * @generated from field: perfetto.protos.TraceStats trace_stats = 35;
   */
  traceStats?: TraceStats;

  /**
   * @generated from field: uint32 trusted_packet_sequence_id = 10;
   */
  trustedPacketSequenceId: number;

  /**
   * @generated from field: perfetto.protos.InternedData interned_data = 12;
   */
  internedData?: InternedData;

  /**
   * @generated from field: bool incremental_state_cleared = 41;
   */
  incrementalStateCleared: boolean;

  /**
   * @generated from field: bool previous_packet_dropped = 42;
   */
  previousPacketDropped: boolean;
};

/**
 * Describes the message perfetto.protos.ChromeTracePacket.
 * Use `create(ChromeTracePacketSchema)` to create a new message.
 */
export const ChromeTracePacketSchema: GenMessage<ChromeTracePacket> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_chrome_chrome_trace_packet, 0);

