//
// Copyright (C) 2020 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/metrics/android/gpu_metric.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/metrics/android/gpu_metric.proto.
 */
export const file_protos_perfetto_metrics_android_gpu_metric: GenFile = /*@__PURE__*/
  fileDesc("CjBwcm90b3MvcGVyZmV0dG8vbWV0cmljcy9hbmRyb2lkL2dwdV9tZXRyaWMucHJvdG8SD3BlcmZldHRvLnByb3RvcyKWBAoQQW5kcm9pZEdwdU1ldHJpYxI8Cglwcm9jZXNzZXMYASADKAsyKS5wZXJmZXR0by5wcm90b3MuQW5kcm9pZEdwdU1ldHJpYy5Qcm9jZXNzEg8KB21lbV9tYXgYAiABKAMSDwoHbWVtX21pbhgDIAEoAxIPCgdtZW1fYXZnGAQgASgDEkcKDGZyZXFfbWV0cmljcxgFIAMoCzIxLnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkR3B1TWV0cmljLkZyZXF1ZW5jeU1ldHJpYxpKCgdQcm9jZXNzEgwKBG5hbWUYASABKAkSDwoHbWVtX21heBgCIAEoAxIPCgdtZW1fbWluGAMgASgDEg8KB21lbV9hdmcYBCABKAMa+wEKD0ZyZXF1ZW5jeU1ldHJpYxIOCgZncHVfaWQYASABKA0SEAoIZnJlcV9tYXgYAiABKAMSEAoIZnJlcV9taW4YAyABKAMSEAoIZnJlcV9hdmcYBCABKAESWQoKdXNlZF9mcmVxcxgFIAMoCzJFLnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkR3B1TWV0cmljLkZyZXF1ZW5jeU1ldHJpYy5NZXRyaWNzUGVyRnJlcXVlbmN5GkcKE01ldHJpY3NQZXJGcmVxdWVuY3kSDAoEZnJlcRgBIAEoAxIOCgZkdXJfbXMYAiABKAESEgoKcGVyY2VudGFnZRgDIAEoAQ");

/**
 * @generated from message perfetto.protos.AndroidGpuMetric
 */
export type AndroidGpuMetric = Message<"perfetto.protos.AndroidGpuMetric"> & {
  /**
   * GPU metric for processes using GPU.
   *
   * @generated from field: repeated perfetto.protos.AndroidGpuMetric.Process processes = 1;
   */
  processes: AndroidGpuMetric_Process[];

  /**
   * max/min/avg GPU memory used by the entire system.
   *
   * @generated from field: optional int64 mem_max = 2;
   */
  memMax: bigint;

  /**
   * @generated from field: optional int64 mem_min = 3;
   */
  memMin: bigint;

  /**
   * @generated from field: optional int64 mem_avg = 4;
   */
  memAvg: bigint;

  /**
   * GPU frequency metric for each gpu_id
   *
   * @generated from field: repeated perfetto.protos.AndroidGpuMetric.FrequencyMetric freq_metrics = 5;
   */
  freqMetrics: AndroidGpuMetric_FrequencyMetric[];
};

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

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

  /**
   * max/min/avg GPU memory used by this process.
   *
   * @generated from field: optional int64 mem_max = 2;
   */
  memMax: bigint;

  /**
   * @generated from field: optional int64 mem_min = 3;
   */
  memMin: bigint;

  /**
   * @generated from field: optional int64 mem_avg = 4;
   */
  memAvg: bigint;
};

/**
 * Describes the message perfetto.protos.AndroidGpuMetric.Process.
 * Use `create(AndroidGpuMetric_ProcessSchema)` to create a new message.
 */
export const AndroidGpuMetric_ProcessSchema: GenMessage<AndroidGpuMetric_Process> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_gpu_metric, 0, 0);

/**
 * @generated from message perfetto.protos.AndroidGpuMetric.FrequencyMetric
 */
export type AndroidGpuMetric_FrequencyMetric = Message<"perfetto.protos.AndroidGpuMetric.FrequencyMetric"> & {
  /**
   * Identifier for GPU in a multi-gpu device.
   *
   * @generated from field: optional uint32 gpu_id = 1;
   */
  gpuId: number;

  /**
   * max/min/avg GPU frequency for this gpu_id
   * the calculation of avg is weighted by the duration of each frequency
   *
   * @generated from field: optional int64 freq_max = 2;
   */
  freqMax: bigint;

  /**
   * @generated from field: optional int64 freq_min = 3;
   */
  freqMin: bigint;

  /**
   * @generated from field: optional double freq_avg = 4;
   */
  freqAvg: number;

  /**
   * Metrics for each used GPU frequency
   *
   * @generated from field: repeated perfetto.protos.AndroidGpuMetric.FrequencyMetric.MetricsPerFrequency used_freqs = 5;
   */
  usedFreqs: AndroidGpuMetric_FrequencyMetric_MetricsPerFrequency[];
};

/**
 * Describes the message perfetto.protos.AndroidGpuMetric.FrequencyMetric.
 * Use `create(AndroidGpuMetric_FrequencyMetricSchema)` to create a new message.
 */
export const AndroidGpuMetric_FrequencyMetricSchema: GenMessage<AndroidGpuMetric_FrequencyMetric> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_gpu_metric, 0, 1);

/**
 * @generated from message perfetto.protos.AndroidGpuMetric.FrequencyMetric.MetricsPerFrequency
 */
export type AndroidGpuMetric_FrequencyMetric_MetricsPerFrequency = Message<"perfetto.protos.AndroidGpuMetric.FrequencyMetric.MetricsPerFrequency"> & {
  /**
   * Used frequency
   *
   * @generated from field: optional int64 freq = 1;
   */
  freq: bigint;

  /**
   * Total duration in ms when the state of GPU was in this frequency
   *
   * @generated from field: optional double dur_ms = 2;
   */
  durMs: number;

  /**
   * Percentage of duration in this frequency compared to all frequencies
   * in this gpu_id
   *
   * @generated from field: optional double percentage = 3;
   */
  percentage: number;
};

/**
 * Describes the message perfetto.protos.AndroidGpuMetric.FrequencyMetric.MetricsPerFrequency.
 * Use `create(AndroidGpuMetric_FrequencyMetric_MetricsPerFrequencySchema)` to create a new message.
 */
export const AndroidGpuMetric_FrequencyMetric_MetricsPerFrequencySchema: GenMessage<AndroidGpuMetric_FrequencyMetric_MetricsPerFrequency> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_gpu_metric, 0, 1, 0);

