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

syntax = "proto2";

package perfetto.protos;

// Information about GPUs on the device.
message GpuInfo {
  // Information about a single GPU.
  message Gpu {
    // GPU name (e.g., "NVIDIA A100", "Adreno 740").
    // Used by the Perfetto UI as the display label for GPU tracks (e.g.,
    // "NVIDIA A100 Frequency" instead of "GPU 0 Frequency"). If multiple GPUs
    // share the same name, consider appending an index to distinguish them
    // (e.g., "NVIDIA A100 #0", "NVIDIA A100 #1").
    optional string name = 1;

    // GPU vendor string (e.g., "NVIDIA", "AMD", "Qualcomm").
    optional string vendor = 2;

    // GPU model/product identifier.
    optional string model = 3;

    // GPU architecture (e.g., "Ampere", "RDNA 3", "Adreno").
    optional string architecture = 4;

    // 16-byte device UUID when available.
    optional bytes uuid = 5;

    // PCI bus location (domain:bus:device.function, e.g., "0000:01:00.0").
    optional string pci_bdf = 7;

    // Arbitrary key-value pairs for vendor-specific info
    // (driver version, memory size, compute capability, clock speeds, etc.).
    message KeyValue {
      optional string key = 1;
      optional string value = 2;
    }
    repeated KeyValue extra_info = 6;
  }

  // Describes available GPUs, one entry per GPU. The index in the list
  // corresponds to the gpu_id used elsewhere in the trace.
  repeated Gpu gpus = 1;
}
