//
// Copyright (C) 2017 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/ipc/producer_port.proto (package perfetto.protos, syntax proto2)
/* eslint-disable */

import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
import type { CommitDataRequestSchema } from "../common/commit_data_request_pb";
import { file_protos_perfetto_common_commit_data_request } from "../common/commit_data_request_pb";
import type { DataSourceConfig } from "../config/data_source_config_pb";
import { file_protos_perfetto_config_data_source_config } from "../config/data_source_config_pb";
import type { DataSourceDescriptor } from "../common/data_source_descriptor_pb";
import { file_protos_perfetto_common_data_source_descriptor } from "../common/data_source_descriptor_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/ipc/producer_port.proto.
 */
export const file_protos_perfetto_ipc_producer_port: GenFile = /*@__PURE__*/
  fileDesc("Cidwcm90b3MvcGVyZmV0dG8vaXBjL3Byb2R1Y2VyX3BvcnQucHJvdG8SD3BlcmZldHRvLnByb3RvcyKrAwobSW5pdGlhbGl6ZUNvbm5lY3Rpb25SZXF1ZXN0EioKInNoYXJlZF9tZW1vcnlfcGFnZV9zaXplX2hpbnRfYnl0ZXMYASABKA0SJQodc2hhcmVkX21lbW9yeV9zaXplX2hpbnRfYnl0ZXMYAiABKA0SFQoNcHJvZHVjZXJfbmFtZRgDIAEoCRJfChFzbWJfc2NyYXBpbmdfbW9kZRgEIAEoDjJELnBlcmZldHRvLnByb3Rvcy5Jbml0aWFsaXplQ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uTm90aWZ5RGF0YVNvdXJjZVN0b3BwZWRSZXF1ZXN0GjAucGVyZmV0dG8ucHJvdG9zLk5vdGlmeURhdGFTb3VyY2VTdG9wcGVkUmVzcG9uc2UiABJpChBBY3RpdmF0ZVRyaWdnZXJzEigucGVyZmV0dG8ucHJvdG9zLkFjdGl2YXRlVHJpZ2dlcnNSZXF1ZXN0GikucGVyZmV0dG8ucHJvdG9zLkFjdGl2YXRlVHJpZ2dlcnNSZXNwb25zZSIAEkUKBFN5bmMSHC5wZXJmZXR0by5wcm90b3MuU3luY1JlcXVlc3QaHS5wZXJmZXR0by5wcm90b3MuU3luY1Jlc3BvbnNlIgASaQoQVXBkYXRlRGF0YVNvdXJjZRIoLnBlcmZldHRvLnByb3Rvcy5VcGRhdGVEYXRhU291cmNlUmVxdWVzdBopLnBlcmZldHRvLnByb3Rvcy5VcGRhdGVEYXRhU291cmNlUmVzcG9uc2UiAA", [file_protos_perfetto_common_commit_data_request, file_protos_perfetto_config_data_source_config, file_protos_perfetto_common_data_source_descriptor]);

/**
 * Arguments for rpc InitializeConnection().
 *
 * @generated from message perfetto.protos.InitializeConnectionRequest
 */
export type InitializeConnectionRequest = Message<"perfetto.protos.InitializeConnectionRequest"> & {
  /**
   * Optional. Provides a hint to the tracing service about the suggested size
   * of the shared memory buffer pages. The service is not required to respect
   * this if it has already another value in the configuration or if the hint
   * is unreasonably large. Must be an integer multiple of 4096. See tradeoff
   * considerations in shared_memory_abi.h.
   *
   * @generated from field: optional uint32 shared_memory_page_size_hint_bytes = 1;
   */
  sharedMemoryPageSizeHintBytes: number;

  /**
   * Optional. Provides a hint to the tracing service about the suggested size
   * of the shared memory buffer. The service is not required to respect this
   * and might return a smaller buffer.
   *
   * @generated from field: optional uint32 shared_memory_size_hint_bytes = 2;
   */
  sharedMemorySizeHintBytes: number;

  /**
   * Required to match the producer config set by the service to the correct
   * producer.
   *
   * @generated from field: optional string producer_name = 3;
   */
  producerName: string;

  /**
   * If provided, overrides the service's SMB scraping setting for the producer.
   *
   * @generated from field: optional perfetto.protos.InitializeConnectionRequest.ProducerSMBScrapingMode smb_scraping_mode = 4;
   */
  smbScrapingMode: InitializeConnectionRequest_ProducerSMBScrapingMode;

  /**
   * Since Android R, this request can also transport an FD for the producer's
   * shared memory buffer, if allocated by the producer (e.g. for startup
   * tracing). In this case, |shared_memory_page_size_hint_bytes| is a required
   * field, and describes the SMB's page size. Note that the service may not
   * accept this SMB (e.g. because it is too old or its size / page size are
   * invalid) and instead allocate a new SMB which is provided in the
   * SetupTracing response. See TracingService::ConnectProducer() and
   * |using_shmem_provided_by_producer| in InitializeConnectionResponse.
   *
   * @generated from field: optional bool producer_provided_shmem = 6;
   */
  producerProvidedShmem: boolean;

  /**
   * 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 that is used to build the code and the repo (standalone
   * vs AOSP). This is intended for human debugging only.
   *
   * @generated from field: optional string sdk_version = 8;
   */
  sdkVersion: string;

  /**
   * On Windows, when producer_provided_shmem = true, the client creates a named
   * SHM region and passes the name (an unguessable token) back to the service.
   * Introduced in v13.
   *
   * @generated from field: optional string shm_key_windows = 7;
   */
  shmKeyWindows: string;
};

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

/**
 * @generated from enum perfetto.protos.InitializeConnectionRequest.ProducerSMBScrapingMode
 */
export enum InitializeConnectionRequest_ProducerSMBScrapingMode {
  /**
   * Use the service's default setting for SMB scraping.
   *
   * @generated from enum value: SMB_SCRAPING_UNSPECIFIED = 0;
   */
  SMB_SCRAPING_UNSPECIFIED = 0,

  /**
   * Enable scraping of uncommitted chunks from the producer's shared memory
   * buffer.
   *
   * @generated from enum value: SMB_SCRAPING_ENABLED = 1;
   */
  SMB_SCRAPING_ENABLED = 1,

  /**
   * Disable scraping of uncommitted chunks from the producer's shared memory
   * buffer.
   *
   * @generated from enum value: SMB_SCRAPING_DISABLED = 2;
   */
  SMB_SCRAPING_DISABLED = 2,
}

/**
 * Describes the enum perfetto.protos.InitializeConnectionRequest.ProducerSMBScrapingMode.
 */
export const InitializeConnectionRequest_ProducerSMBScrapingModeSchema: GenEnum<InitializeConnectionRequest_ProducerSMBScrapingMode> = /*@__PURE__*/
  enumDesc(file_protos_perfetto_ipc_producer_port, 0, 0);

/**
 * @generated from message perfetto.protos.InitializeConnectionResponse
 */
export type InitializeConnectionResponse = Message<"perfetto.protos.InitializeConnectionResponse"> & {
  /**
   * Indicates whether the service accepted the SMB provided by the producer in
   * InitializeConnectionRequest (if any). If false, the shared memory buffer FD
   * will provided by the service via the SetupTracing async command.
   *
   * @generated from field: optional bool using_shmem_provided_by_producer = 1;
   */
  usingShmemProvidedByProducer: boolean;

  /**
   * Indicates to the producer that the service allows direct SMB patching of
   * chunks that have not yet been committed to it.
   * This field has been introduced in Android S.
   *
   * @generated from field: optional bool direct_smb_patching_supported = 2;
   */
  directSmbPatchingSupported: boolean;

  /**
   * Indicates whether the service would like to use SMB emulation for the
   * connection, and request the client to send chunk data over the socket e.g.
   * for remote connection from a VM guest.
   *
   * @generated from field: optional bool use_shmem_emulation = 3;
   */
  useShmemEmulation: boolean;
};

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

/**
 * @generated from message perfetto.protos.RegisterDataSourceRequest
 */
export type RegisterDataSourceRequest = Message<"perfetto.protos.RegisterDataSourceRequest"> & {
  /**
   * @generated from field: optional perfetto.protos.DataSourceDescriptor data_source_descriptor = 1;
   */
  dataSourceDescriptor?: DataSourceDescriptor;
};

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

/**
 * @generated from message perfetto.protos.RegisterDataSourceResponse
 */
export type RegisterDataSourceResponse = Message<"perfetto.protos.RegisterDataSourceResponse"> & {
  /**
   * Only set in case of errors, when |data_source_id| == 0.
   *
   * @generated from field: optional string error = 1;
   */
  error: string;
};

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

/**
 * @generated from message perfetto.protos.UpdateDataSourceRequest
 */
export type UpdateDataSourceRequest = Message<"perfetto.protos.UpdateDataSourceRequest"> & {
  /**
   * The new data_source_descriptor.{id, name} must match {id, name} of a
   * data source previously registered via RegisterDataSource().
   *
   * @generated from field: optional perfetto.protos.DataSourceDescriptor data_source_descriptor = 1;
   */
  dataSourceDescriptor?: DataSourceDescriptor;
};

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

/**
 * @generated from message perfetto.protos.UpdateDataSourceResponse
 */
export type UpdateDataSourceResponse = Message<"perfetto.protos.UpdateDataSourceResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.UnregisterDataSourceRequest
 */
export type UnregisterDataSourceRequest = Message<"perfetto.protos.UnregisterDataSourceRequest"> & {
  /**
   * The name of the data source to unregister, as previously passed in
   * |RegisterDataSourceRequest.name|.
   *
   * @generated from field: optional string data_source_name = 1;
   */
  dataSourceName: string;
};

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

/**
 * @generated from message perfetto.protos.UnregisterDataSourceResponse
 */
export type UnregisterDataSourceResponse = Message<"perfetto.protos.UnregisterDataSourceResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.RegisterTraceWriterRequest
 */
export type RegisterTraceWriterRequest = Message<"perfetto.protos.RegisterTraceWriterRequest"> & {
  /**
   * The ID of a producer's trace writer.
   *
   * @generated from field: optional uint32 trace_writer_id = 1;
   */
  traceWriterId: number;

  /**
   * The ID of the target buffer that the trace writer commits its chunks to.
   *
   * @generated from field: optional uint32 target_buffer = 2;
   */
  targetBuffer: number;
};

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

/**
 * @generated from message perfetto.protos.RegisterTraceWriterResponse
 */
export type RegisterTraceWriterResponse = Message<"perfetto.protos.RegisterTraceWriterResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.UnregisterTraceWriterRequest
 */
export type UnregisterTraceWriterRequest = Message<"perfetto.protos.UnregisterTraceWriterRequest"> & {
  /**
   * The ID of a producer's trace writer.
   *
   * @generated from field: optional uint32 trace_writer_id = 1;
   */
  traceWriterId: number;
};

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

/**
 * @generated from message perfetto.protos.UnregisterTraceWriterResponse
 */
export type UnregisterTraceWriterResponse = Message<"perfetto.protos.UnregisterTraceWriterResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.CommitDataResponse
 */
export type CommitDataResponse = Message<"perfetto.protos.CommitDataResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.NotifyDataSourceStartedRequest
 */
export type NotifyDataSourceStartedRequest = Message<"perfetto.protos.NotifyDataSourceStartedRequest"> & {
  /**
   * ID of the data source that has successfully started.
   *
   * @generated from field: optional uint64 data_source_id = 1;
   */
  dataSourceId: bigint;
};

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

/**
 * @generated from message perfetto.protos.NotifyDataSourceStartedResponse
 */
export type NotifyDataSourceStartedResponse = Message<"perfetto.protos.NotifyDataSourceStartedResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.NotifyDataSourceStoppedRequest
 */
export type NotifyDataSourceStoppedRequest = Message<"perfetto.protos.NotifyDataSourceStoppedRequest"> & {
  /**
   * ID of the data source that has successfully stopped.
   *
   * @generated from field: optional uint64 data_source_id = 1;
   */
  dataSourceId: bigint;
};

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

/**
 * @generated from message perfetto.protos.NotifyDataSourceStoppedResponse
 */
export type NotifyDataSourceStoppedResponse = Message<"perfetto.protos.NotifyDataSourceStoppedResponse"> & {
};

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

/**
 * @generated from message perfetto.protos.ActivateTriggersRequest
 */
export type ActivateTriggersRequest = Message<"perfetto.protos.ActivateTriggersRequest"> & {
  /**
   * @generated from field: repeated string trigger_names = 1;
   */
  triggerNames: string[];
};

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

/**
 * @generated from message perfetto.protos.ActivateTriggersResponse
 */
export type ActivateTriggersResponse = Message<"perfetto.protos.ActivateTriggersResponse"> & {
};

/**
 * Describes the message perfetto.protos.ActivateTriggersResponse.
 * Use `create(ActivateTriggersResponseSchema)` to create a new message.
 */
export const ActivateTriggersResponseSchema: GenMessage<ActivateTriggersResponse> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 18);

/**
 * @generated from message perfetto.protos.GetAsyncCommandRequest
 */
export type GetAsyncCommandRequest = Message<"perfetto.protos.GetAsyncCommandRequest"> & {
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandRequest.
 * Use `create(GetAsyncCommandRequestSchema)` to create a new message.
 */
export const GetAsyncCommandRequestSchema: GenMessage<GetAsyncCommandRequest> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 19);

/**
 * @generated from message perfetto.protos.GetAsyncCommandResponse
 */
export type GetAsyncCommandResponse = Message<"perfetto.protos.GetAsyncCommandResponse"> & {
  /**
   * Next id: 8.
   *
   * @generated from oneof perfetto.protos.GetAsyncCommandResponse.cmd
   */
  cmd: {
    /**
     * @generated from field: perfetto.protos.GetAsyncCommandResponse.SetupTracing setup_tracing = 3;
     */
    value: GetAsyncCommandResponse_SetupTracing;
    case: "setupTracing";
  } | {
    /**
     * @generated from field: perfetto.protos.GetAsyncCommandResponse.SetupDataSource setup_data_source = 6;
     */
    value: GetAsyncCommandResponse_SetupDataSource;
    case: "setupDataSource";
  } | {
    /**
     * @generated from field: perfetto.protos.GetAsyncCommandResponse.StartDataSource start_data_source = 1;
     */
    value: GetAsyncCommandResponse_StartDataSource;
    case: "startDataSource";
  } | {
    /**
     * @generated from field: perfetto.protos.GetAsyncCommandResponse.StopDataSource stop_data_source = 2;
     */
    value: GetAsyncCommandResponse_StopDataSource;
    case: "stopDataSource";
  } | {
    /**
     * id == 4 was teardown_tracing, never implemented.
     *
     * @generated from field: perfetto.protos.GetAsyncCommandResponse.Flush flush = 5;
     */
    value: GetAsyncCommandResponse_Flush;
    case: "flush";
  } | {
    /**
     * @generated from field: perfetto.protos.GetAsyncCommandResponse.ClearIncrementalState clear_incremental_state = 7;
     */
    value: GetAsyncCommandResponse_ClearIncrementalState;
    case: "clearIncrementalState";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.
 * Use `create(GetAsyncCommandResponseSchema)` to create a new message.
 */
export const GetAsyncCommandResponseSchema: GenMessage<GetAsyncCommandResponse> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20);

/**
 * Called after SetupTracing and before StartDataSource.
 * This message was introduced in Android Q.
 *
 * @generated from message perfetto.protos.GetAsyncCommandResponse.SetupDataSource
 */
export type GetAsyncCommandResponse_SetupDataSource = Message<"perfetto.protos.GetAsyncCommandResponse.SetupDataSource"> & {
  /**
   * @generated from field: optional uint64 new_instance_id = 1;
   */
  newInstanceId: bigint;

  /**
   * @generated from field: optional perfetto.protos.DataSourceConfig config = 2;
   */
  config?: DataSourceConfig;
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.SetupDataSource.
 * Use `create(GetAsyncCommandResponse_SetupDataSourceSchema)` to create a new message.
 */
export const GetAsyncCommandResponse_SetupDataSourceSchema: GenMessage<GetAsyncCommandResponse_SetupDataSource> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20, 0);

/**
 * @generated from message perfetto.protos.GetAsyncCommandResponse.StartDataSource
 */
export type GetAsyncCommandResponse_StartDataSource = Message<"perfetto.protos.GetAsyncCommandResponse.StartDataSource"> & {
  /**
   * @generated from field: optional uint64 new_instance_id = 1;
   */
  newInstanceId: bigint;

  /**
   * For backwards compat reasons (with Android P), the config passed here
   * is identical to the one passed to SetupDataSource.config.
   *
   * @generated from field: optional perfetto.protos.DataSourceConfig config = 2;
   */
  config?: DataSourceConfig;
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.StartDataSource.
 * Use `create(GetAsyncCommandResponse_StartDataSourceSchema)` to create a new message.
 */
export const GetAsyncCommandResponse_StartDataSourceSchema: GenMessage<GetAsyncCommandResponse_StartDataSource> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20, 1);

/**
 * @generated from message perfetto.protos.GetAsyncCommandResponse.StopDataSource
 */
export type GetAsyncCommandResponse_StopDataSource = Message<"perfetto.protos.GetAsyncCommandResponse.StopDataSource"> & {
  /**
   * @generated from field: optional uint64 instance_id = 1;
   */
  instanceId: bigint;
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.StopDataSource.
 * Use `create(GetAsyncCommandResponse_StopDataSourceSchema)` to create a new message.
 */
export const GetAsyncCommandResponse_StopDataSourceSchema: GenMessage<GetAsyncCommandResponse_StopDataSource> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20, 2);

/**
 * On Android/Linux/Mac this message also transports the file descriptor for
 * the shared memory buffer (not a proto field).
 *
 * @generated from message perfetto.protos.GetAsyncCommandResponse.SetupTracing
 */
export type GetAsyncCommandResponse_SetupTracing = Message<"perfetto.protos.GetAsyncCommandResponse.SetupTracing"> & {
  /**
   * @generated from field: optional uint32 shared_buffer_page_size_kb = 1;
   */
  sharedBufferPageSizeKb: number;

  /**
   * On Windows, instead, we pass the name (an unguessable token) of a shared
   * memory region that can be attached by the other process by name.
   * Introduced in v13.
   *
   * @generated from field: optional string shm_key_windows = 2;
   */
  shmKeyWindows: string;
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.SetupTracing.
 * Use `create(GetAsyncCommandResponse_SetupTracingSchema)` to create a new message.
 */
export const GetAsyncCommandResponse_SetupTracingSchema: GenMessage<GetAsyncCommandResponse_SetupTracing> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20, 3);

/**
 * @generated from message perfetto.protos.GetAsyncCommandResponse.Flush
 */
export type GetAsyncCommandResponse_Flush = Message<"perfetto.protos.GetAsyncCommandResponse.Flush"> & {
  /**
   * The instance id (i.e. StartDataSource.new_instance_id) of the data
   * sources to flush.
   *
   * @generated from field: repeated uint64 data_source_ids = 1;
   */
  dataSourceIds: bigint[];

  /**
   * A monotonic counter generated by the service. The producer is simply
   * expected to copy this value back into the CommitDataRequest, so the
   * service can tell when the data for this flush has been committed.
   *
   * @generated from field: optional uint64 request_id = 2;
   */
  requestId: bigint;

  /**
   * More details such as flush reason and originator. Introduced in v38 / V.
   * See FlushFlags in include/perfetto/ext/tracing/core/flush_flags.h.
   *
   * @generated from field: optional uint64 flags = 3;
   */
  flags: bigint;
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.Flush.
 * Use `create(GetAsyncCommandResponse_FlushSchema)` to create a new message.
 */
export const GetAsyncCommandResponse_FlushSchema: GenMessage<GetAsyncCommandResponse_Flush> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20, 4);

/**
 * Instructs the given data sources to stop referring to any trace contents
 * emitted so far. Sent only to active data sources that set
 * |handles_incremental_state_clear| in their DataSourceDescriptor.
 *
 * Added to perfetto tree in May 2019.
 *
 * @generated from message perfetto.protos.GetAsyncCommandResponse.ClearIncrementalState
 */
export type GetAsyncCommandResponse_ClearIncrementalState = Message<"perfetto.protos.GetAsyncCommandResponse.ClearIncrementalState"> & {
  /**
   * The instance id (i.e. StartDataSource.new_instance_id) of the data
   * sources that should clear their incremental state.
   *
   * @generated from field: repeated uint64 data_source_ids = 1;
   */
  dataSourceIds: bigint[];
};

/**
 * Describes the message perfetto.protos.GetAsyncCommandResponse.ClearIncrementalState.
 * Use `create(GetAsyncCommandResponse_ClearIncrementalStateSchema)` to create a new message.
 */
export const GetAsyncCommandResponse_ClearIncrementalStateSchema: GenMessage<GetAsyncCommandResponse_ClearIncrementalState> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 20, 5);

/**
 * Arguments for rpc Sync().
 *
 * @generated from message perfetto.protos.SyncRequest
 */
export type SyncRequest = Message<"perfetto.protos.SyncRequest"> & {
};

/**
 * Describes the message perfetto.protos.SyncRequest.
 * Use `create(SyncRequestSchema)` to create a new message.
 */
export const SyncRequestSchema: GenMessage<SyncRequest> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 21);

/**
 * @generated from message perfetto.protos.SyncResponse
 */
export type SyncResponse = Message<"perfetto.protos.SyncResponse"> & {
};

/**
 * Describes the message perfetto.protos.SyncResponse.
 * Use `create(SyncResponseSchema)` to create a new message.
 */
export const SyncResponseSchema: GenMessage<SyncResponse> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_ipc_producer_port, 22);

/**
 * IPC interface definition for the producer port of the tracing service.
 *
 * @generated from service perfetto.protos.ProducerPort
 */
export const ProducerPort: GenService<{
  /**
   * Called once only after establishing the connection with the Service.
   * The service replies sending the shared memory file descriptor in reply.
   *
   * @generated from rpc perfetto.protos.ProducerPort.InitializeConnection
   */
  initializeConnection: {
    methodKind: "unary";
    input: typeof InitializeConnectionRequestSchema;
    output: typeof InitializeConnectionResponseSchema;
  },
  /**
   * Advertises a new data source.
   *
   * @generated from rpc perfetto.protos.ProducerPort.RegisterDataSource
   */
  registerDataSource: {
    methodKind: "unary";
    input: typeof RegisterDataSourceRequestSchema;
    output: typeof RegisterDataSourceResponseSchema;
  },
  /**
   * Unregisters a previously registered data source.
   *
   * @generated from rpc perfetto.protos.ProducerPort.UnregisterDataSource
   */
  unregisterDataSource: {
    methodKind: "unary";
    input: typeof UnregisterDataSourceRequestSchema;
    output: typeof UnregisterDataSourceResponseSchema;
  },
  /**
   * Sent by the client to request the service to:
   * 1) Move some chunks from the shmem buffer into the logging buffer.
   * 2) Patch the content of some chunks previously moved.
   * 3) Acknowledge a Flush() request.
   *
   * @generated from rpc perfetto.protos.ProducerPort.CommitData
   */
  commitData: {
    methodKind: "unary";
    input: typeof CommitDataRequestSchema;
    output: typeof CommitDataResponseSchema;
  },
  /**
   * This is a backchannel to get asynchronous commands / notifications back
   * from the Service.
   *
   * @generated from rpc perfetto.protos.ProducerPort.GetAsyncCommand
   */
  getAsyncCommand: {
    methodKind: "server_streaming";
    input: typeof GetAsyncCommandRequestSchema;
    output: typeof GetAsyncCommandResponseSchema;
  },
  /**
   * Associates a trace writer with its target buffer.
   *
   * @generated from rpc perfetto.protos.ProducerPort.RegisterTraceWriter
   */
  registerTraceWriter: {
    methodKind: "unary";
    input: typeof RegisterTraceWriterRequestSchema;
    output: typeof RegisterTraceWriterResponseSchema;
  },
  /**
   * Removes a trace writer association previously added by
   * RegisterTraceWriter.
   *
   * @generated from rpc perfetto.protos.ProducerPort.UnregisterTraceWriter
   */
  unregisterTraceWriter: {
    methodKind: "unary";
    input: typeof UnregisterTraceWriterRequestSchema;
    output: typeof UnregisterTraceWriterResponseSchema;
  },
  /**
   * Sent by the client in response to a StartDataSource message, when a data
   * source is successfully started. This is expected only for data sources that
   * set the DataSourceDescriptor.will_notify_on_start flag when registering.
   *
   * @generated from rpc perfetto.protos.ProducerPort.NotifyDataSourceStarted
   */
  notifyDataSourceStarted: {
    methodKind: "unary";
    input: typeof NotifyDataSourceStartedRequestSchema;
    output: typeof NotifyDataSourceStartedResponseSchema;
  },
  /**
   * Sent by the client in response to a StopDataSource message, when a data
   * source is successfully stopped. This is expected only for data sources that
   * set the DataSourceDescriptor.will_notify_on_stop flag when registering.
   *
   * @generated from rpc perfetto.protos.ProducerPort.NotifyDataSourceStopped
   */
  notifyDataSourceStopped: {
    methodKind: "unary";
    input: typeof NotifyDataSourceStoppedRequestSchema;
    output: typeof NotifyDataSourceStoppedResponseSchema;
  },
  /**
   * Sent by the client to request the service to:
   * 1) Find all sessions which define these triggers
   * 2) Perform an action as defined in those sessions configs.
   *
   * @generated from rpc perfetto.protos.ProducerPort.ActivateTriggers
   */
  activateTriggers: {
    methodKind: "unary";
    input: typeof ActivateTriggersRequestSchema;
    output: typeof ActivateTriggersResponseSchema;
  },
  /**
   * This is used to linearize the producer with the service and to guarantee
   * that all IPCs prior to this call have been seen and processed by the
   * service. Example:
   *   - RegisterDataSource(A)
   *   - RegisterDataSource(B)
   *   - Sync()
   * When the Sync() response is received, the producer is guaranteed that the
   * service has seen both data source registrations.
   *
   * @generated from rpc perfetto.protos.ProducerPort.Sync
   */
  sync: {
    methodKind: "unary";
    input: typeof SyncRequestSchema;
    output: typeof SyncResponseSchema;
  },
  /**
   * Updates the data source descriptor for an already-registered data source.
   * This can be used to update the list of features supported.
   * Only the data source with a matching data_source_descriptor.id is updated.
   * The data_source_descriptor.name cannot be changed.
   *
   * @generated from rpc perfetto.protos.ProducerPort.UpdateDataSource
   */
  updateDataSource: {
    methodKind: "unary";
    input: typeof UpdateDataSourceRequestSchema;
    output: typeof UpdateDataSourceResponseSchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_protos_perfetto_ipc_producer_port, 0);

