1/* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19package perfetto.protos; 20 21// Description of GPU counters. 22// This message is sent by a GPU counter producer to specify the counters 23// available in the hardware. 24message GpuCounterDescriptor { 25 // Logical groups for a counter. This is used in the UI to present the 26 // related counters together. 27 enum GpuCounterGroup { 28 UNCLASSIFIED = 0; 29 SYSTEM = 1; 30 VERTICES = 2; 31 FRAGMENTS = 3; 32 PRIMITIVES = 4; 33 // Includes counters relating to caching and bandwidth. 34 MEMORY = 5; 35 COMPUTE = 6; 36 } 37 38 message GpuCounterSpec { 39 optional uint32 counter_id = 1; 40 optional string name = 2; 41 optional string description = 3; 42 // MeasureUnit unit (deprecated) 43 reserved 4; 44 oneof peak_value { 45 int64 int_peak_value = 5; 46 double double_peak_value = 6; 47 } 48 repeated MeasureUnit numerator_units = 7; 49 repeated MeasureUnit denominator_units = 8; 50 optional bool select_by_default = 9; 51 repeated GpuCounterGroup groups = 10; 52 } 53 repeated GpuCounterSpec specs = 1; 54 55 // Allow producer to group counters into block to represent counter islands. 56 // A capacity may be specified to indicate the number of counters that can be 57 // enable simultaneously in that block. 58 message GpuCounterBlock { 59 // required. Unique ID for the counter group. 60 optional uint32 block_id = 1; 61 // optional. Number of counters supported by the block. No limit if unset. 62 optional uint32 block_capacity = 2; 63 // optional. Name of block. 64 optional string name = 3; 65 // optional. Description for the block. 66 optional string description = 4; 67 // list of counters that are part of the block. 68 repeated uint32 counter_ids = 5; 69 } 70 repeated GpuCounterBlock blocks = 2; 71 72 // optional. Minimum sampling period supported by the producer in 73 // nanoseconds. 74 optional uint64 min_sampling_period_ns = 3; 75 76 // optional. Maximum sampling period supported by the producer in 77 // nanoseconds. 78 optional uint64 max_sampling_period_ns = 4; 79 80 // optional. The producer supports counter sampling by instrumenting the 81 // command buffer. 82 optional bool supports_instrumented_sampling = 5; 83 84 // next id: 41 85 enum MeasureUnit { 86 NONE = 0; 87 88 BIT = 1; 89 KILOBIT = 2; 90 MEGABIT = 3; 91 GIGABIT = 4; 92 TERABIT = 5; 93 PETABIT = 6; 94 95 BYTE = 7; 96 KILOBYTE = 8; 97 MEGABYTE = 9; 98 GIGABYTE = 10; 99 TERABYTE = 11; 100 PETABYTE = 12; 101 102 HERTZ = 13; 103 KILOHERTZ = 14; 104 MEGAHERTZ = 15; 105 GIGAHERTZ = 16; 106 TERAHERTZ = 17; 107 PETAHERTZ = 18; 108 109 NANOSECOND = 19; 110 MICROSECOND = 20; 111 MILLISECOND = 21; 112 SECOND = 22; 113 MINUTE = 23; 114 HOUR = 24; 115 116 VERTEX = 25; 117 PIXEL = 26; 118 TRIANGLE = 27; 119 PRIMITIVE = 38; 120 FRAGMENT = 39; 121 122 MILLIWATT = 28; 123 WATT = 29; 124 KILOWATT = 30; 125 126 JOULE = 31; 127 VOLT = 32; 128 AMPERE = 33; 129 130 CELSIUS = 34; 131 FAHRENHEIT = 35; 132 KELVIN = 36; 133 134 // Values should be out of 100. 135 PERCENT = 37; 136 137 INSTRUCTION = 40; 138 } 139} 140