//
// 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.

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

import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { DescriptorProto } from "../common/descriptor_pb";
import { file_protos_perfetto_common_descriptor } from "../common/descriptor_pb";
import type { MetatraceCategories } from "./metatrace_categories_pb";
import { file_protos_perfetto_trace_processor_metatrace_categories } from "./metatrace_categories_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace_processor/trace_processor.proto.
 */
export const file_protos_perfetto_trace_processor_trace_processor: GenFile = /*@__PURE__*/
  fileDesc("CjVwcm90b3MvcGVyZmV0dG8vdHJhY2VfcHJvY2Vzc29yL3RyYWNlX3Byb2Nlc3Nvci5wcm90bxIPcGVyZmV0dG8ucHJvdG9zIkoKF1RyYWNlUHJvY2Vzc29yUnBjU3RyZWFtEi8KA21zZxgBIAMoCzIiLnBlcmZldHRvLnByb3Rvcy5UcmFjZVByb2Nlc3NvclJwYyLlDAoRVHJhY2VQcm9jZXNzb3JScGMSCwoDc2VxGAEgASgDEhMKC2ZhdGFsX2Vycm9yGAUgASgJEkoKB3JlcXVlc3QYAiABKA4yNy5wZXJmZXR0by5wcm90b3MuVHJhY2VQcm9jZXNzb3JScGMuVHJhY2VQcm9jZXNzb3JNZXRob2RIABJLCghyZXNwb25zZRgDIAEoDjI3LnBlcmZldHRvLnByb3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OVF9SQU5HRV9PRl9JTlRFUkVTVBABIkQKC1BhcnNpbmdNb2RlEgsKB0RFRkFVTFQQABIRCg1UT0tFTklaRV9PTkxZEAESFQoRVE9LRU5JWkVfQU5EX1NPUlQQAiKsAQoWUmVnaXN0ZXJTcWxQYWNrYWdlQXJncxIUCgxwYWNrYWdlX25hbWUYASABKAkSPwoHbW9kdWxlcxgCIAMoCzIuLnBlcmZldHRvLnByb3Rvcy5SZWdpc3RlclNxbFBhY2thZ2VBcmdzLk1vZHVsZRIWCg5hbGxvd19vdmVycmlkZRgDIAEoCBojCgZNb2R1bGUSDAoEbmFtZRgBIAEoCRILCgNzcWwYAiABKAkiKQoYUmVnaXN0ZXJTcWxQYWNrYWdlUmVzdWx0Eg0KBWVycm9yGAEgASgJIiMKEkZpbmFsaXplRGF0YVJlc3VsdBINCgVlcnJvchgBIAEoCSpDChhUcmFjZVByb2Nlc3NvckFwaVZlcnNpb24SJwojVFJBQ0VfUFJPQ0VTU09SX0NVUlJFTlRfQVBJX1ZFUlNJT04QDg", [file_protos_perfetto_common_descriptor, file_protos_perfetto_trace_processor_metatrace_categories]);

/**
 * @generated from message perfetto.protos.TraceProcessorRpcStream
 */
export type TraceProcessorRpcStream = Message<"perfetto.protos.TraceProcessorRpcStream"> & {
  /**
   * @generated from field: repeated perfetto.protos.TraceProcessorRpc msg = 1;
   */
  msg: TraceProcessorRpc[];
};

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

/**
 * @generated from message perfetto.protos.TraceProcessorRpc
 */
export type TraceProcessorRpc = Message<"perfetto.protos.TraceProcessorRpc"> & {
  /**
   * A monotonic counter used only for debugging purposes, to detect if the
   * underlying stream is missing or duping data. The counter starts at 0 on
   * each side of the pipe and is incremented on each message.
   * Do NOT expect that a response has the same |seq| of its corresponding
   * request: some requests (e.g., a query returning many rows) can yield more
   * than one response message, bringing the tx and rq seq our of sync.
   *
   * @generated from field: optional int64 seq = 1;
   */
  seq: bigint;

  /**
   * This is returned when some unrecoverable error has been detected by the
   * peer. The typical case is TraceProcessor detecting that the |seq| sequence
   * is broken (e.g. when having two tabs open with the same --httpd instance).
   *
   * @generated from field: optional string fatal_error = 5;
   */
  fatalError: string;

  /**
   * @generated from oneof perfetto.protos.TraceProcessorRpc.type
   */
  type: {
    /**
     * Client -> TraceProcessor requests.
     *
     * @generated from field: perfetto.protos.TraceProcessorRpc.TraceProcessorMethod request = 2;
     */
    value: TraceProcessorRpc_TraceProcessorMethod;
    case: "request";
  } | {
    /**
     * TraceProcessor -> Client responses.
     *
     * @generated from field: perfetto.protos.TraceProcessorRpc.TraceProcessorMethod response = 3;
     */
    value: TraceProcessorRpc_TraceProcessorMethod;
    case: "response";
  } | {
    /**
     * This is sent back instead of filling |response| when the client sends a
     * |request| which is not known by the TraceProcessor service. This can
     * happen when the client is newer than the service.
     *
     * @generated from field: perfetto.protos.TraceProcessorRpc.TraceProcessorMethod invalid_request = 4;
     */
    value: TraceProcessorRpc_TraceProcessorMethod;
    case: "invalidRequest";
  } | { case: undefined; value?: undefined };

  /**
   * TraceProcessorMethod request args.
   *
   * @generated from oneof perfetto.protos.TraceProcessorRpc.args
   */
  args: {
    /**
     * For TPM_APPEND_TRACE_DATA.
     *
     * @generated from field: bytes append_trace_data = 101;
     */
    value: Uint8Array;
    case: "appendTraceData";
  } | {
    /**
     * For TPM_QUERY_STREAMING.
     *
     * @generated from field: perfetto.protos.QueryArgs query_args = 103;
     */
    value: QueryArgs;
    case: "queryArgs";
  } | {
    /**
     * For TPM_COMPUTE_METRIC.
     *
     * @generated from field: perfetto.protos.ComputeMetricArgs compute_metric_args = 105;
     */
    value: ComputeMetricArgs;
    case: "computeMetricArgs";
  } | {
    /**
     * For TPM_ENABLE_METATRACE.
     *
     * @generated from field: perfetto.protos.EnableMetatraceArgs enable_metatrace_args = 106;
     */
    value: EnableMetatraceArgs;
    case: "enableMetatraceArgs";
  } | {
    /**
     * For TPM_RESET_TRACE_PROCESSOR.
     *
     * @generated from field: perfetto.protos.ResetTraceProcessorArgs reset_trace_processor_args = 107;
     */
    value: ResetTraceProcessorArgs;
    case: "resetTraceProcessorArgs";
  } | {
    /**
     * For TPM_REGISTER_SQL_PACKAGE.
     *
     * @generated from field: perfetto.protos.RegisterSqlPackageArgs register_sql_package_args = 108;
     */
    value: RegisterSqlPackageArgs;
    case: "registerSqlPackageArgs";
  } | {
    /**
     * TraceProcessorMethod response args.
     * For TPM_APPEND_TRACE_DATA.
     *
     * @generated from field: perfetto.protos.AppendTraceDataResult append_result = 201;
     */
    value: AppendTraceDataResult;
    case: "appendResult";
  } | {
    /**
     * For TPM_QUERY_STREAMING.
     *
     * @generated from field: perfetto.protos.QueryResult query_result = 203;
     */
    value: QueryResult;
    case: "queryResult";
  } | {
    /**
     * For TPM_COMPUTE_METRIC.
     *
     * @generated from field: perfetto.protos.ComputeMetricResult metric_result = 205;
     */
    value: ComputeMetricResult;
    case: "metricResult";
  } | {
    /**
     * For TPM_GET_METRIC_DESCRIPTORS.
     *
     * @generated from field: perfetto.protos.DescriptorSet metric_descriptors = 206;
     */
    value: DescriptorSet;
    case: "metricDescriptors";
  } | {
    /**
     * For TPM_DISABLE_AND_READ_METATRACE.
     *
     * @generated from field: perfetto.protos.DisableAndReadMetatraceResult metatrace = 209;
     */
    value: DisableAndReadMetatraceResult;
    case: "metatrace";
  } | {
    /**
     * For TPM_GET_STATUS.
     *
     * @generated from field: perfetto.protos.StatusResult status = 210;
     */
    value: StatusResult;
    case: "status";
  } | {
    /**
     * For TPM_REGISTER_SQL_PACKAGE.
     *
     * @generated from field: perfetto.protos.RegisterSqlPackageResult register_sql_package_result = 211;
     */
    value: RegisterSqlPackageResult;
    case: "registerSqlPackageResult";
  } | {
    /**
     * For TPM_FINALIZE_TRACE_DATA.
     *
     * @generated from field: perfetto.protos.FinalizeDataResult finalize_data_result = 212;
     */
    value: FinalizeDataResult;
    case: "finalizeDataResult";
  } | { case: undefined; value?: undefined };
};

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

/**
 * @generated from enum perfetto.protos.TraceProcessorRpc.TraceProcessorMethod
 */
export enum TraceProcessorRpc_TraceProcessorMethod {
  /**
   * @generated from enum value: TPM_UNSPECIFIED = 0;
   */
  TPM_UNSPECIFIED = 0,

  /**
   * @generated from enum value: TPM_APPEND_TRACE_DATA = 1;
   */
  TPM_APPEND_TRACE_DATA = 1,

  /**
   * @generated from enum value: TPM_FINALIZE_TRACE_DATA = 2;
   */
  TPM_FINALIZE_TRACE_DATA = 2,

  /**
   * @generated from enum value: TPM_QUERY_STREAMING = 3;
   */
  TPM_QUERY_STREAMING = 3,

  /**
   * Previously: TPM_QUERY_RAW_DEPRECATED
   *
   * @generated from enum value: TPM_COMPUTE_METRIC = 5;
   */
  TPM_COMPUTE_METRIC = 5,

  /**
   * @generated from enum value: TPM_GET_METRIC_DESCRIPTORS = 6;
   */
  TPM_GET_METRIC_DESCRIPTORS = 6,

  /**
   * @generated from enum value: TPM_RESTORE_INITIAL_TABLES = 7;
   */
  TPM_RESTORE_INITIAL_TABLES = 7,

  /**
   * @generated from enum value: TPM_ENABLE_METATRACE = 8;
   */
  TPM_ENABLE_METATRACE = 8,

  /**
   * @generated from enum value: TPM_DISABLE_AND_READ_METATRACE = 9;
   */
  TPM_DISABLE_AND_READ_METATRACE = 9,

  /**
   * @generated from enum value: TPM_GET_STATUS = 10;
   */
  TPM_GET_STATUS = 10,

  /**
   * @generated from enum value: TPM_RESET_TRACE_PROCESSOR = 11;
   */
  TPM_RESET_TRACE_PROCESSOR = 11,

  /**
   * @generated from enum value: TPM_REGISTER_SQL_PACKAGE = 13;
   */
  TPM_REGISTER_SQL_PACKAGE = 13,
}

/**
 * Describes the enum perfetto.protos.TraceProcessorRpc.TraceProcessorMethod.
 */
export const TraceProcessorRpc_TraceProcessorMethodSchema: GenEnum<TraceProcessorRpc_TraceProcessorMethod> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_processor_trace_processor, 1, 0);

/**
 * @generated from message perfetto.protos.AppendTraceDataResult
 */
export type AppendTraceDataResult = Message<"perfetto.protos.AppendTraceDataResult"> & {
  /**
   * @generated from field: optional int64 total_bytes_parsed = 1;
   */
  totalBytesParsed: bigint;

  /**
   * @generated from field: optional string error = 2;
   */
  error: string;
};

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

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

  /**
   * Optional string to tag this query with for performance diagnostic purposes.
   *
   * @generated from field: optional string tag = 3;
   */
  tag: string;
};

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

/**
 * Output for the /query endpoint.
 * Returns a query result set, grouping cells into batches. Batching allows a
 * more efficient encoding of results, at the same time allowing to return
 * O(M) results in a pipelined fashion, without full-memory buffering.
 * Batches are split when either a large number of cells (~thousands) is reached
 * or the string/blob payload becomes too large (~hundreds of KB).
 * Data is batched in cells, scanning results by row -> column. e.g. if a query
 * returns 3 columns and 2 rows, the cells will be emitted in this order:
 * R0C0, R0C1, R0C2, R1C0, R1C1, R1C2.
 *
 * @generated from message perfetto.protos.QueryResult
 */
export type QueryResult = Message<"perfetto.protos.QueryResult"> & {
  /**
   * This determines the number and names of columns.
   *
   * @generated from field: repeated string column_names = 1;
   */
  columnNames: string[];

  /**
   * If non-emty the query returned an error. Note that some cells might still
   * be present, if the error happened while iterating.
   *
   * @generated from field: optional string error = 2;
   */
  error: string;

  /**
   * @generated from field: repeated perfetto.protos.QueryResult.CellsBatch batch = 3;
   */
  batch: QueryResult_CellsBatch[];

  /**
   * The number of statements in the provided SQL.
   *
   * @generated from field: optional uint32 statement_count = 4;
   */
  statementCount: number;

  /**
   * The number of statements which produced output rows in the provided SQL.
   *
   * @generated from field: optional uint32 statement_with_output_count = 5;
   */
  statementWithOutputCount: number;

  /**
   * The last statement in the provided SQL.
   *
   * @generated from field: optional string last_statement_sql = 6;
   */
  lastStatementSql: string;
};

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

/**
 * A batch contains an array of cell headers, stating the type of each cell.
 * The payload of each cell is stored in the corresponding xxx_cells field
 * below (unless the cell is NULL).
 * So if |cells| contains: [VARINT, FLOAT64, VARINT, STRING], the results will
 * be available as:
 * [varint_cells[0], float64_cells[0], varint_cells[1], string_cells[0]].
 *
 * @generated from message perfetto.protos.QueryResult.CellsBatch
 */
export type QueryResult_CellsBatch = Message<"perfetto.protos.QueryResult.CellsBatch"> & {
  /**
   * @generated from field: repeated perfetto.protos.QueryResult.CellsBatch.CellType cells = 1 [packed = true];
   */
  cells: QueryResult_CellsBatch_CellType[];

  /**
   * @generated from field: repeated int64 varint_cells = 2 [packed = true];
   */
  varintCells: bigint[];

  /**
   * @generated from field: repeated double float64_cells = 3 [packed = true];
   */
  float64Cells: number[];

  /**
   * @generated from field: repeated bytes blob_cells = 4;
   */
  blobCells: Uint8Array[];

  /**
   * The string cells are concatenated in a single field. Each cell is
   * NUL-terminated. This is because JS incurs into a non-negligible overhead
   * when decoding strings and one decode + split('\0') is measurably faster
   * than decoding N strings. See goto.google.com/postmessage-benchmark .
   *
   * @generated from field: optional string string_cells = 5;
   */
  stringCells: string;

  /**
   * If true this is the last batch for the query result.
   *
   * @generated from field: optional bool is_last_batch = 6;
   */
  isLastBatch: boolean;
};

/**
 * Describes the message perfetto.protos.QueryResult.CellsBatch.
 * Use `create(QueryResult_CellsBatchSchema)` to create a new message.
 */
export const QueryResult_CellsBatchSchema: GenMessage<QueryResult_CellsBatch> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 4, 0);

/**
 * @generated from enum perfetto.protos.QueryResult.CellsBatch.CellType
 */
export enum QueryResult_CellsBatch_CellType {
  /**
   * @generated from enum value: CELL_INVALID = 0;
   */
  CELL_INVALID = 0,

  /**
   * @generated from enum value: CELL_NULL = 1;
   */
  CELL_NULL = 1,

  /**
   * @generated from enum value: CELL_VARINT = 2;
   */
  CELL_VARINT = 2,

  /**
   * @generated from enum value: CELL_FLOAT64 = 3;
   */
  CELL_FLOAT64 = 3,

  /**
   * @generated from enum value: CELL_STRING = 4;
   */
  CELL_STRING = 4,

  /**
   * @generated from enum value: CELL_BLOB = 5;
   */
  CELL_BLOB = 5,
}

/**
 * Describes the enum perfetto.protos.QueryResult.CellsBatch.CellType.
 */
export const QueryResult_CellsBatch_CellTypeSchema: GenEnum<QueryResult_CellsBatch_CellType> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_processor_trace_processor, 4, 0, 0);

/**
 * Input for the /status endpoint.
 *
 * @generated from message perfetto.protos.StatusArgs
 */
export type StatusArgs = Message<"perfetto.protos.StatusArgs"> & {
};

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

/**
 * Output for the /status endpoint.
 *
 * @generated from message perfetto.protos.StatusResult
 */
export type StatusResult = Message<"perfetto.protos.StatusResult"> & {
  /**
   * If present and not empty, a trace is already loaded already. This happens
   * when using the HTTP+RPC mode nad passing a trace file to the shell, via
   * trace_processor_shell -D trace_file.pftrace .
   *
   * @generated from field: optional string loaded_trace_name = 1;
   */
  loadedTraceName: string;

  /**
   * Typically something like "v11.0.123", but could be just "v11" or "unknown",
   * for binaries built from Bazel or other build configurations. This is for
   * human presentation only, don't attempt to parse and reason on it.
   *
   * @generated from field: optional string human_readable_version = 2;
   */
  humanReadableVersion: string;

  /**
   * The API version is incremented every time a change that the UI depends
   * on is introduced (e.g. adding a new table that the UI queries).
   *
   * @generated from field: optional int32 api_version = 3;
   */
  apiVersion: number;

  /**
   * Typically something like "v42.1-deadbeef0", but could be just
   * "v42", "v0.0", or unset for binaries built from Bazel or other
   * build configurations. This can be compared with equality to other
   * version codes to detect matched builds (for example to see if
   * trace_processor_shell and the UI were built at the same revision)
   * but you should not attempt to parse it as the format may change
   * without warning.
   *
   * @generated from field: optional string version_code = 4;
   */
  versionCode: string;
};

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

/**
 * Input for the /compute_metric endpoint.
 *
 * @generated from message perfetto.protos.ComputeMetricArgs
 */
export type ComputeMetricArgs = Message<"perfetto.protos.ComputeMetricArgs"> & {
  /**
   * @generated from field: repeated string metric_names = 1;
   */
  metricNames: string[];

  /**
   * @generated from field: optional perfetto.protos.ComputeMetricArgs.ResultFormat format = 2;
   */
  format: ComputeMetricArgs_ResultFormat;
};

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

/**
 * @generated from enum perfetto.protos.ComputeMetricArgs.ResultFormat
 */
export enum ComputeMetricArgs_ResultFormat {
  /**
   * @generated from enum value: BINARY_PROTOBUF = 0;
   */
  BINARY_PROTOBUF = 0,

  /**
   * @generated from enum value: TEXTPROTO = 1;
   */
  TEXTPROTO = 1,

  /**
   * @generated from enum value: JSON = 2;
   */
  JSON = 2,
}

/**
 * Describes the enum perfetto.protos.ComputeMetricArgs.ResultFormat.
 */
export const ComputeMetricArgs_ResultFormatSchema: GenEnum<ComputeMetricArgs_ResultFormat> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_processor_trace_processor, 7, 0);

/**
 * Output for the /compute_metric endpoint.
 *
 * @generated from message perfetto.protos.ComputeMetricResult
 */
export type ComputeMetricResult = Message<"perfetto.protos.ComputeMetricResult"> & {
  /**
   * @generated from oneof perfetto.protos.ComputeMetricResult.result
   */
  result: {
    /**
     * This is meant to contain a perfetto.protos.TraceMetrics. We're using
     * bytes instead of the actual type because we do not want to generate
     * protozero code for the metrics protos. We always encode/decode metrics
     * using a reflection based mechanism that does not require the compiled C++
     * code. This allows us to read in new protos at runtime.
     *
     * @generated from field: bytes metrics = 1;
     */
    value: Uint8Array;
    case: "metrics";
  } | {
    /**
     * A perfetto.protos.TraceMetrics formatted as prototext.
     *
     * @generated from field: string metrics_as_prototext = 3;
     */
    value: string;
    case: "metricsAsPrototext";
  } | {
    /**
     * A perfetto.protos.TraceMetrics formatted as json.
     *
     * @generated from field: string metrics_as_json = 4;
     */
    value: string;
    case: "metricsAsJson";
  } | { case: undefined; value?: undefined };

  /**
   * @generated from field: optional string error = 2;
   */
  error: string;
};

/**
 * Describes the message perfetto.protos.ComputeMetricResult.
 * Use `create(ComputeMetricResultSchema)` to create a new message.
 */
export const ComputeMetricResultSchema: GenMessage<ComputeMetricResult> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 8);

/**
 * Input for the /enable_metatrace endpoint.
 *
 * @generated from message perfetto.protos.EnableMetatraceArgs
 */
export type EnableMetatraceArgs = Message<"perfetto.protos.EnableMetatraceArgs"> & {
  /**
   * @generated from field: optional perfetto.protos.MetatraceCategories categories = 1;
   */
  categories: MetatraceCategories;
};

/**
 * Describes the message perfetto.protos.EnableMetatraceArgs.
 * Use `create(EnableMetatraceArgsSchema)` to create a new message.
 */
export const EnableMetatraceArgsSchema: GenMessage<EnableMetatraceArgs> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 9);

/**
 * Output for the /enable_metatrace endpoint.
 *
 * @generated from message perfetto.protos.EnableMetatraceResult
 */
export type EnableMetatraceResult = Message<"perfetto.protos.EnableMetatraceResult"> & {
};

/**
 * Describes the message perfetto.protos.EnableMetatraceResult.
 * Use `create(EnableMetatraceResultSchema)` to create a new message.
 */
export const EnableMetatraceResultSchema: GenMessage<EnableMetatraceResult> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 10);

/**
 * Input for the /disable_and_read_metatrace endpoint.
 *
 * @generated from message perfetto.protos.DisableAndReadMetatraceArgs
 */
export type DisableAndReadMetatraceArgs = Message<"perfetto.protos.DisableAndReadMetatraceArgs"> & {
};

/**
 * Describes the message perfetto.protos.DisableAndReadMetatraceArgs.
 * Use `create(DisableAndReadMetatraceArgsSchema)` to create a new message.
 */
export const DisableAndReadMetatraceArgsSchema: GenMessage<DisableAndReadMetatraceArgs> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 11);

/**
 * Output for the /disable_and_read_metatrace endpoint.
 *
 * @generated from message perfetto.protos.DisableAndReadMetatraceResult
 */
export type DisableAndReadMetatraceResult = Message<"perfetto.protos.DisableAndReadMetatraceResult"> & {
  /**
   * Bytes of perfetto.protos.Trace message. Stored as bytes
   * to avoid adding a dependency on trace.proto.
   *
   * @generated from field: optional bytes metatrace = 1;
   */
  metatrace: Uint8Array;

  /**
   * @generated from field: optional string error = 2;
   */
  error: string;
};

/**
 * Describes the message perfetto.protos.DisableAndReadMetatraceResult.
 * Use `create(DisableAndReadMetatraceResultSchema)` to create a new message.
 */
export const DisableAndReadMetatraceResultSchema: GenMessage<DisableAndReadMetatraceResult> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 12);

/**
 * Convenience wrapper for multiple descriptors, similar to FileDescriptorSet
 * in descriptor.proto.
 *
 * @generated from message perfetto.protos.DescriptorSet
 */
export type DescriptorSet = Message<"perfetto.protos.DescriptorSet"> & {
  /**
   * @generated from field: repeated perfetto.protos.DescriptorProto descriptors = 1;
   */
  descriptors: DescriptorProto[];
};

/**
 * Describes the message perfetto.protos.DescriptorSet.
 * Use `create(DescriptorSetSchema)` to create a new message.
 */
export const DescriptorSetSchema: GenMessage<DescriptorSet> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 13);

/**
 * Input for setting Trace Processor config. This method works only in the WASM
 * mode. trace_processor_shell supports configuration through command line
 * flags.
 *
 * @generated from message perfetto.protos.ResetTraceProcessorArgs
 */
export type ResetTraceProcessorArgs = Message<"perfetto.protos.ResetTraceProcessorArgs"> & {
  /**
   * Mirror of the corresponding perfetto::trace_processor::Config fields.
   *
   * @generated from field: optional perfetto.protos.ResetTraceProcessorArgs.DropTrackEventDataBefore drop_track_event_data_before = 1;
   */
  dropTrackEventDataBefore: ResetTraceProcessorArgs_DropTrackEventDataBefore;

  /**
   * @generated from field: optional bool ingest_ftrace_in_raw_table = 2;
   */
  ingestFtraceInRawTable: boolean;

  /**
   * @generated from field: optional bool analyze_trace_proto_content = 3;
   */
  analyzeTraceProtoContent: boolean;

  /**
   * @generated from field: optional bool ftrace_drop_until_all_cpus_valid = 4;
   */
  ftraceDropUntilAllCpusValid: boolean;

  /**
   * @generated from field: optional perfetto.protos.ResetTraceProcessorArgs.ParsingMode parsing_mode = 5;
   */
  parsingMode: ResetTraceProcessorArgs_ParsingMode;
};

/**
 * Describes the message perfetto.protos.ResetTraceProcessorArgs.
 * Use `create(ResetTraceProcessorArgsSchema)` to create a new message.
 */
export const ResetTraceProcessorArgsSchema: GenMessage<ResetTraceProcessorArgs> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 14);

/**
 * @generated from enum perfetto.protos.ResetTraceProcessorArgs.DropTrackEventDataBefore
 */
export enum ResetTraceProcessorArgs_DropTrackEventDataBefore {
  /**
   * @generated from enum value: NO_DROP = 0;
   */
  NO_DROP = 0,

  /**
   * @generated from enum value: TRACK_EVENT_RANGE_OF_INTEREST = 1;
   */
  TRACK_EVENT_RANGE_OF_INTEREST = 1,
}

/**
 * Describes the enum perfetto.protos.ResetTraceProcessorArgs.DropTrackEventDataBefore.
 */
export const ResetTraceProcessorArgs_DropTrackEventDataBeforeSchema: GenEnum<ResetTraceProcessorArgs_DropTrackEventDataBefore> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_processor_trace_processor, 14, 0);

/**
 * @generated from enum perfetto.protos.ResetTraceProcessorArgs.ParsingMode
 */
export enum ResetTraceProcessorArgs_ParsingMode {
  /**
   * @generated from enum value: DEFAULT = 0;
   */
  DEFAULT = 0,

  /**
   * @generated from enum value: TOKENIZE_ONLY = 1;
   */
  TOKENIZE_ONLY = 1,

  /**
   * @generated from enum value: TOKENIZE_AND_SORT = 2;
   */
  TOKENIZE_AND_SORT = 2,
}

/**
 * Describes the enum perfetto.protos.ResetTraceProcessorArgs.ParsingMode.
 */
export const ResetTraceProcessorArgs_ParsingModeSchema: GenEnum<ResetTraceProcessorArgs_ParsingMode> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_processor_trace_processor, 14, 1);

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

  /**
   * @generated from field: repeated perfetto.protos.RegisterSqlPackageArgs.Module modules = 2;
   */
  modules: RegisterSqlPackageArgs_Module[];

  /**
   * @generated from field: optional bool allow_override = 3;
   */
  allowOverride: boolean;
};

/**
 * Describes the message perfetto.protos.RegisterSqlPackageArgs.
 * Use `create(RegisterSqlPackageArgsSchema)` to create a new message.
 */
export const RegisterSqlPackageArgsSchema: GenMessage<RegisterSqlPackageArgs> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 15);

/**
 * @generated from message perfetto.protos.RegisterSqlPackageArgs.Module
 */
export type RegisterSqlPackageArgs_Module = Message<"perfetto.protos.RegisterSqlPackageArgs.Module"> & {
  /**
   * @generated from field: optional string name = 1;
   */
  name: string;

  /**
   * @generated from field: optional string sql = 2;
   */
  sql: string;
};

/**
 * Describes the message perfetto.protos.RegisterSqlPackageArgs.Module.
 * Use `create(RegisterSqlPackageArgs_ModuleSchema)` to create a new message.
 */
export const RegisterSqlPackageArgs_ModuleSchema: GenMessage<RegisterSqlPackageArgs_Module> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 15, 0);

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

/**
 * Describes the message perfetto.protos.RegisterSqlPackageResult.
 * Use `create(RegisterSqlPackageResultSchema)` to create a new message.
 */
export const RegisterSqlPackageResultSchema: GenMessage<RegisterSqlPackageResult> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 16);

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

/**
 * Describes the message perfetto.protos.FinalizeDataResult.
 * Use `create(FinalizeDataResultSchema)` to create a new message.
 */
export const FinalizeDataResultSchema: GenMessage<FinalizeDataResult> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_processor_trace_processor, 17);

/**
 * @generated from enum perfetto.protos.TraceProcessorApiVersion
 */
export enum TraceProcessorApiVersion {
  /**
   * This variable has been introduced in v15 and is used to deal with API
   * mismatches between UI and trace_processor_shell --httpd.
   *
   * Prior to API version 11 this was incremented every time a new
   * feature that the UI depended on was introduced (e.g. new tables,
   * new SQL operators, metrics that are required by the UI, etc).
   * This:
   * a. Tended to be forgotten
   * b. Still led to issues when the TP dropped *backwards*
   *    compatibility of a feature (since we checked TP >= UI
   *    TRACE_PROCESSOR_CURRENT_API_VERSION).
   * Now the UI attempts to redirect the user to the matched version
   * of the UI if one exists.
   * See also StatusResult.api_version (below).
   * Changes:
   * 7. Introduce GUESS_CPU_SIZE
   * 8. Add 'json' option to ComputeMetricArgs
   * 9. Add get_thread_state_summary_for_interval.
   * 10. Add 'slice_is_ancestor' to stdlib.
   * 11. Removal of experimental module from stdlib.
   * 12. Changed UI to be more aggresive about version matching.
   *     Added version_code.
   * 13. Added TPM_REGISTER_SQL_MODULE method.
   * 14. Added parsing mode option to RESET method.
   *
   * @generated from enum value: TRACE_PROCESSOR_CURRENT_API_VERSION = 14;
   */
  TRACE_PROCESSOR_CURRENT_API_VERSION = 14,
}

/**
 * Describes the enum perfetto.protos.TraceProcessorApiVersion.
 */
export const TraceProcessorApiVersionSchema: GenEnum<TraceProcessorApiVersion> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_trace_processor_trace_processor, 0);

