//
// Copyright (C) 2019 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.

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

import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace/profiling/profile_common.proto.
 */
export const file_protos_perfetto_trace_profiling_profile_common: GenFile = /*@__PURE__*/
  fileDesc("CjRwcm90b3MvcGVyZmV0dG8vdHJhY2UvcHJvZmlsaW5nL3Byb2ZpbGVfY29tbW9uLnByb3RvEg9wZXJmZXR0by5wcm90b3MiKgoOSW50ZXJuZWRTdHJpbmcSCwoDaWlkGAEgASgEEgsKA3N0chgCIAEoDCJuChRQcm9maWxlZEZyYW1lU3ltYm9scxIRCglmcmFtZV9paWQYASABKAQSGAoQZnVuY3Rpb25fbmFtZV9pZBgCIAMoBBIUCgxmaWxlX25hbWVfaWQYAyADKAQSEwoLbGluZV9udW1iZXIYBCADKA0iTAoETGluZRIVCg1mdW5jdGlvbl9uYW1lGAEgASgJEhgKEHNvdXJjZV9maWxlX25hbWUYAiABKAkSEwoLbGluZV9udW1iZXIYAyABKA0iRwoOQWRkcmVzc1N5bWJvbHMSDwoHYWRkcmVzcxgBIAEoBBIkCgVsaW5lcxgCIAMoCzIVLnBlcmZldHRvLnByb3Rvcy5MaW5lImkKDU1vZHVsZVN5bWJvbHMSDAoEcGF0aBgBIAEoCRIQCghidWlsZF9pZBgCIAEoCRI4Cg9hZGRyZXNzX3N5bWJvbHMYAyADKAsyHy5wZXJmZXR0by5wcm90b3MuQWRkcmVzc1N5bWJvbHMinAEKB01hcHBpbmcSCwoDaWlkGAEgASgEEhAKCGJ1aWxkX2lkGAIgASgEEhQKDGV4YWN0X29mZnNldBgIIAEoBBIUCgxzdGFydF9vZmZzZXQYAyABKAQSDQoFc3RhcnQYBCABKAQSCwoDZW5kGAUgASgEEhEKCWxvYWRfYmlhcxgGIAEoBBIXCg9wYXRoX3N0cmluZ19pZHMYByADKAQiUgoFRnJhbWUSCwoDaWlkGAEgASgEEhgKEGZ1bmN0aW9uX25hbWVfaWQYAiABKAQSEgoKbWFwcGluZ19pZBgDIAEoBBIOCgZyZWxfcGMYBCABKAQiKwoJQ2FsbHN0YWNrEgsKA2lpZBgBIAEoBBIRCglmcmFtZV9pZHMYAiADKAQ");

/**
 * 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.
 *
 * @generated from message perfetto.protos.InternedString
 */
export type InternedString = Message<"perfetto.protos.InternedString"> & {
  /**
   * @generated from field: optional uint64 iid = 1;
   */
  iid: bigint;

  /**
   * @generated from field: optional bytes str = 2;
   */
  str: Uint8Array;
};

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

/**
 * 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.
 *
 * @generated from message perfetto.protos.ProfiledFrameSymbols
 */
export type ProfiledFrameSymbols = Message<"perfetto.protos.ProfiledFrameSymbols"> & {
  /**
   * Use the frame id as the interning key for the symbols.
   *
   * @generated from field: optional uint64 frame_iid = 1;
   */
  frameIid: bigint;

  /**
   * key to InternedString
   *
   * @generated from field: repeated uint64 function_name_id = 2;
   */
  functionNameId: bigint[];

  /**
   * key to InternedString
   *
   * @generated from field: repeated uint64 file_name_id = 3;
   */
  fileNameId: bigint[];

  /**
   * @generated from field: repeated uint32 line_number = 4;
   */
  lineNumber: number[];
};

/**
 * Describes the message perfetto.protos.ProfiledFrameSymbols.
 * Use `create(ProfiledFrameSymbolsSchema)` to create a new message.
 */
export const ProfiledFrameSymbolsSchema: GenMessage<ProfiledFrameSymbols> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 1);

/**
 * @generated from message perfetto.protos.Line
 */
export type Line = Message<"perfetto.protos.Line"> & {
  /**
   * @generated from field: optional string function_name = 1;
   */
  functionName: string;

  /**
   * @generated from field: optional string source_file_name = 2;
   */
  sourceFileName: string;

  /**
   * @generated from field: optional uint32 line_number = 3;
   */
  lineNumber: number;
};

/**
 * Describes the message perfetto.protos.Line.
 * Use `create(LineSchema)` to create a new message.
 */
export const LineSchema: GenMessage<Line> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 2);

/**
 * Symbols for a given address in a module.
 *
 * @generated from message perfetto.protos.AddressSymbols
 */
export type AddressSymbols = Message<"perfetto.protos.AddressSymbols"> & {
  /**
   * @generated from field: optional uint64 address = 1;
   */
  address: bigint;

  /**
   * 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.
   *
   * @generated from field: repeated perfetto.protos.Line lines = 2;
   */
  lines: Line[];
};

/**
 * Describes the message perfetto.protos.AddressSymbols.
 * Use `create(AddressSymbolsSchema)` to create a new message.
 */
export const AddressSymbolsSchema: GenMessage<AddressSymbols> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 3);

/**
 * Symbols for addresses seen in a module.
 *
 * @generated from message perfetto.protos.ModuleSymbols
 */
export type ModuleSymbols = Message<"perfetto.protos.ModuleSymbols"> & {
  /**
   * Fully qualified path to the mapping.
   * E.g. /system/lib64/libc.so.
   *
   * @generated from field: optional string path = 1;
   */
  path: string;

  /**
   * .note.gnu.build-id on Linux (not hex encoded).
   * uuid on MacOS.
   * Module GUID on Windows.
   *
   * @generated from field: optional string build_id = 2;
   */
  buildId: string;

  /**
   * @generated from field: repeated perfetto.protos.AddressSymbols address_symbols = 3;
   */
  addressSymbols: AddressSymbols[];
};

/**
 * Describes the message perfetto.protos.ModuleSymbols.
 * Use `create(ModuleSymbolsSchema)` to create a new message.
 */
export const ModuleSymbolsSchema: GenMessage<ModuleSymbols> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 4);

/**
 * @generated from message perfetto.protos.Mapping
 */
export type Mapping = Message<"perfetto.protos.Mapping"> & {
  /**
   * Interning key.
   *
   * @generated from field: optional uint64 iid = 1;
   */
  iid: bigint;

  /**
   * Interning key.
   *
   * @generated from field: optional uint64 build_id = 2;
   */
  buildId: bigint;

  /**
   * This is not set on Android 10.
   *
   * @generated from field: optional uint64 exact_offset = 8;
   */
  exactOffset: bigint;

  /**
   * @generated from field: optional uint64 start_offset = 3;
   */
  startOffset: bigint;

  /**
   * @generated from field: optional uint64 start = 4;
   */
  start: bigint;

  /**
   * @generated from field: optional uint64 end = 5;
   */
  end: bigint;

  /**
   * @generated from field: optional uint64 load_bias = 6;
   */
  loadBias: bigint;

  /**
   * E.g. ["system", "lib64", "libc.so"]
   * id of string.
   *
   * @generated from field: repeated uint64 path_string_ids = 7;
   */
  pathStringIds: bigint[];
};

/**
 * Describes the message perfetto.protos.Mapping.
 * Use `create(MappingSchema)` to create a new message.
 */
export const MappingSchema: GenMessage<Mapping> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 5);

/**
 * @generated from message perfetto.protos.Frame
 */
export type Frame = Message<"perfetto.protos.Frame"> & {
  /**
   * Interning key
   *
   * @generated from field: optional uint64 iid = 1;
   */
  iid: bigint;

  /**
   * E.g. "fopen"
   * id of string.
   *
   * @generated from field: optional uint64 function_name_id = 2;
   */
  functionNameId: bigint;

  /**
   * @generated from field: optional uint64 mapping_id = 3;
   */
  mappingId: bigint;

  /**
   * @generated from field: optional uint64 rel_pc = 4;
   */
  relPc: bigint;
};

/**
 * Describes the message perfetto.protos.Frame.
 * Use `create(FrameSchema)` to create a new message.
 */
export const FrameSchema: GenMessage<Frame> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 6);

/**
 * @generated from message perfetto.protos.Callstack
 */
export type Callstack = Message<"perfetto.protos.Callstack"> & {
  /**
   * @generated from field: optional uint64 iid = 1;
   */
  iid: bigint;

  /**
   * Frames of this callstack. Bottom frame first.
   *
   * @generated from field: repeated uint64 frame_ids = 2;
   */
  frameIds: bigint[];
};

/**
 * Describes the message perfetto.protos.Callstack.
 * Use `create(CallstackSchema)` to create a new message.
 */
export const CallstackSchema: GenMessage<Callstack> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_profiling_profile_common, 7);

