1// Copyright (C) 2025 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15import {CounterOptions} from '../../components/tracks/base_counter_track'; 16import {TopLevelTrackGroup, TrackGroupSchema} from './types'; 17 18type CounterMode = CounterOptions['yMode']; 19 20interface CounterTrackTypeSchema { 21 type: string; 22 topLevelGroup: TopLevelTrackGroup; 23 group: string | TrackGroupSchema | undefined; 24 shareYAxis?: true; 25 mode?: CounterMode; 26} 27 28export const COUNTER_TRACK_SCHEMAS: ReadonlyArray<CounterTrackTypeSchema> = [ 29 { 30 type: 'acpm_cooling_device_counter', 31 topLevelGroup: 'THERMALS', 32 group: 'ACPM Cooling Devices', 33 }, 34 { 35 type: 'acpm_thermal_temperature', 36 topLevelGroup: 'THERMALS', 37 group: 'ACPM Temperature', 38 }, 39 { 40 type: 'android_energy_estimation_breakdown_per_uid', 41 topLevelGroup: 'POWER', 42 group: 'Android Energy Estimates (per uid)', 43 }, 44 { 45 type: 'android_energy_estimation_breakdown', 46 topLevelGroup: 'POWER', 47 group: 'Android Energy Estimates', 48 }, 49 { 50 type: 'atrace_counter', 51 topLevelGroup: 'PROCESS', 52 group: undefined, 53 }, 54 { 55 type: 'battery_counter', 56 topLevelGroup: 'POWER', 57 group: 'Battery Counters', 58 }, 59 { 60 type: 'battery_stats', 61 topLevelGroup: 'POWER', 62 group: 'Battery Stats', 63 }, 64 { 65 type: 'bcl_irq', 66 topLevelGroup: undefined, 67 group: 'BCL IRQ', 68 }, 69 { 70 type: 'block_io', 71 topLevelGroup: 'IO', 72 group: 'Block IO', 73 }, 74 { 75 type: 'buddyinfo', 76 topLevelGroup: 'MEMORY', 77 group: 'Buddyinfo', 78 }, 79 { 80 type: 'chrome_process_stats', 81 topLevelGroup: 'PROCESS', 82 group: undefined, 83 }, 84 { 85 type: 'clock_frequency', 86 topLevelGroup: 'HARDWARE', 87 group: 'Clock Frequency', 88 }, 89 { 90 type: 'clock_state', 91 topLevelGroup: 'HARDWARE', 92 group: 'Clock State', 93 }, 94 { 95 type: 'cooling_device_counter', 96 topLevelGroup: 'THERMALS', 97 group: 'Cooling Devices', 98 }, 99 { 100 type: 'cpu_capacity', 101 topLevelGroup: 'CPU', 102 group: 'CPU Capacity', 103 }, 104 { 105 type: 'cpu_frequency_throttle', 106 topLevelGroup: 'CPU', 107 group: 'CPU Frequency Throttling', 108 }, 109 { 110 type: 'cpu_max_frequency_limit', 111 topLevelGroup: 'CPU', 112 group: 'CPU Max Frequency', 113 }, 114 { 115 type: 'cpu_min_frequency_limit', 116 topLevelGroup: 'CPU', 117 group: 'CPU Min Frequency', 118 }, 119 { 120 type: 'cpu_nr_running', 121 topLevelGroup: 'CPU', 122 group: 'CPU Number Running', 123 }, 124 { 125 type: 'cpu_utilization', 126 topLevelGroup: 'CPU', 127 group: 'CPU Utilization', 128 }, 129 { 130 type: 'cpustat', 131 topLevelGroup: 'CPU', 132 group: 'CPU Stat', 133 }, 134 { 135 type: 'cros_ec_sensorhub_data', 136 topLevelGroup: 'HARDWARE', 137 group: 'ChromeOS EC Sensorhub', 138 }, 139 { 140 type: 'diskstat', 141 topLevelGroup: 'IO', 142 group: 'Diskstat', 143 }, 144 { 145 type: 'entity_state', 146 topLevelGroup: 'POWER', 147 group: 'Entity Residency', 148 shareYAxis: true, 149 mode: 'rate', 150 }, 151 { 152 type: 'f2fs_iostat_latency', 153 topLevelGroup: 'IO', 154 group: 'F2FS IOStat Latency', 155 }, 156 { 157 type: 'f2fs_iostat', 158 topLevelGroup: 'IO', 159 group: 'F2FS IOStat', 160 }, 161 { 162 type: 'fastrpc_change', 163 topLevelGroup: 'PROCESS', 164 group: 'Fastrpc', 165 }, 166 { 167 type: 'fastrpc', 168 topLevelGroup: 'HARDWARE', 169 group: 'Fastrpc', 170 }, 171 { 172 type: 'fuchsia_counter', 173 topLevelGroup: 'PROCESS', 174 group: undefined, 175 }, 176 { 177 type: 'gpu_counter', 178 topLevelGroup: 'GPU', 179 group: 'GPU Counters', 180 }, 181 { 182 type: 'gpu_memory', 183 topLevelGroup: 'GPU', 184 group: undefined, 185 }, 186 { 187 type: 'ion_change', 188 topLevelGroup: 'THREAD', 189 group: undefined, 190 }, 191 { 192 type: 'ion', 193 topLevelGroup: 'MEMORY', 194 group: undefined, 195 }, 196 { 197 type: 'json_counter_thread_fallback', 198 topLevelGroup: 'THREAD', 199 group: undefined, 200 }, 201 { 202 type: 'json_counter', 203 topLevelGroup: 'PROCESS', 204 group: undefined, 205 }, 206 { 207 type: 'linux_device_frequency', 208 topLevelGroup: 'HARDWARE', 209 group: 'Linux Device Frequency', 210 }, 211 { 212 type: 'linux_rpm', 213 topLevelGroup: 'HARDWARE', 214 group: 'Linux RPM', 215 }, 216 { 217 type: 'meminfo', 218 topLevelGroup: 'MEMORY', 219 group: 'Meminfo', 220 }, 221 { 222 type: 'metatrace_counter', 223 topLevelGroup: 'THREAD', 224 group: undefined, 225 }, 226 { 227 type: 'mm_event_thread_fallback', 228 topLevelGroup: 'THREAD', 229 group: 'MM Event', 230 }, 231 { 232 type: 'mm_event', 233 topLevelGroup: 'PROCESS', 234 group: 'MM Event', 235 }, 236 { 237 type: 'net_kfree_skb', 238 topLevelGroup: 'NETWORK', 239 group: 'Network Packet Frees', 240 }, 241 { 242 type: 'net_receive', 243 topLevelGroup: 'NETWORK', 244 group: 'Network Receive', 245 mode: 'rate', 246 }, 247 { 248 type: 'net_transmit', 249 topLevelGroup: 'NETWORK', 250 group: 'Network Send', 251 mode: 'rate', 252 }, 253 { 254 type: 'num_forks', 255 topLevelGroup: 'SYSTEM', 256 group: undefined, 257 }, 258 { 259 type: 'num_irq_total', 260 topLevelGroup: 'SYSTEM', 261 group: undefined, 262 }, 263 { 264 type: 'num_irq', 265 topLevelGroup: 'SYSTEM', 266 group: 'IRQ Count', 267 }, 268 { 269 type: 'num_softirq_total', 270 topLevelGroup: 'SYSTEM', 271 group: undefined, 272 }, 273 { 274 type: 'num_softirq', 275 topLevelGroup: 'SYSTEM', 276 group: 'Softirq Count', 277 }, 278 { 279 type: 'oom_score_adj_thread_fallback', 280 topLevelGroup: 'THREAD', 281 group: undefined, 282 }, 283 { 284 type: 'oom_score_adj', 285 topLevelGroup: 'PROCESS', 286 group: undefined, 287 }, 288 { 289 type: 'pixel_cpm_counters', 290 topLevelGroup: 'HARDWARE', 291 group: 'CPM Counters', 292 }, 293 { 294 type: 'power_rails', 295 group: 'Power Rails', 296 topLevelGroup: 'POWER', 297 shareYAxis: true, 298 mode: 'rate', 299 }, 300 { 301 type: 'proc_stat_runtime', 302 topLevelGroup: 'PROCESS', 303 group: undefined, 304 }, 305 { 306 type: 'process_gpu_memory', 307 topLevelGroup: 'PROCESS', 308 group: undefined, 309 }, 310 { 311 type: 'process_memory_thread_fallback', 312 topLevelGroup: 'THREAD', 313 group: undefined, 314 }, 315 { 316 type: 'process_memory', 317 topLevelGroup: 'PROCESS', 318 group: undefined, 319 }, 320 { 321 type: 'psi', 322 group: 'PSI', 323 topLevelGroup: 'SYSTEM', 324 mode: 'rate', 325 }, 326 { 327 type: 'screen_state', 328 topLevelGroup: 'SYSTEM', 329 group: 'Screen State', 330 }, 331 { 332 type: 'smaps', 333 topLevelGroup: 'PROCESS', 334 group: undefined, 335 }, 336 { 337 type: 'sysprop_counter', 338 topLevelGroup: 'SYSTEM', 339 group: undefined, 340 }, 341 { 342 type: 'thermal_temperature_sys', 343 topLevelGroup: 'THERMALS', 344 group: 'Temperature (/sys)', 345 }, 346 { 347 type: 'thermal_temperature', 348 topLevelGroup: 'THERMALS', 349 group: 'Temperature', 350 }, 351 { 352 type: 'ufs_clkgating', 353 topLevelGroup: 'IO', 354 group: undefined, 355 }, 356 { 357 type: 'ufs_command_count', 358 topLevelGroup: 'IO', 359 group: undefined, 360 }, 361 { 362 type: 'virtgpu_latency', 363 topLevelGroup: 'GPU', 364 group: 'Virtgpu Latency', 365 }, 366 { 367 type: 'virtgpu_num_free', 368 topLevelGroup: 'GPU', 369 group: 'Virtgpu num_free', 370 }, 371 { 372 type: 'vmstat', 373 topLevelGroup: 'MEMORY', 374 group: 'vmstat', 375 }, 376 { 377 type: 'vulkan_device_mem_allocation', 378 topLevelGroup: 'GPU', 379 group: 'Vulkan Allocations', 380 }, 381 { 382 type: 'vulkan_device_mem_bind', 383 topLevelGroup: 'GPU', 384 group: 'Vulkan Binds', 385 }, 386 { 387 type: 'vulkan_driver_mem', 388 topLevelGroup: 'GPU', 389 group: 'Vulkan Driver Memory', 390 }, 391 { 392 type: 'battery_status', 393 topLevelGroup: 'POWER', 394 group: undefined, 395 }, 396 { 397 type: 'battery_plugged_status', 398 topLevelGroup: 'POWER', 399 group: undefined, 400 }, 401 { 402 type: 'ion', 403 topLevelGroup: 'MEMORY', 404 group: undefined, 405 }, 406 { 407 type: 'ion_change', 408 topLevelGroup: 'MEMORY', 409 group: undefined, 410 }, 411 { 412 type: 'android_dma_heap_change', 413 topLevelGroup: 'THREAD', 414 group: undefined, 415 }, 416]; 417