1-- 2-- Copyright 2024 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-- https://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 17INCLUDE PERFETTO MODULE counters.intervals; 18 19-- GPU frequency counter per GPU. 20CREATE PERFETTO TABLE android_gpu_frequency ( 21 -- Timestamp 22 ts TIMESTAMP, 23 -- Duration 24 dur DURATION, 25 -- GPU id. Joinable with `gpu_counter_track.gpu_id`. 26 gpu_id LONG, 27 -- GPU frequency 28 gpu_freq LONG 29) AS 30SELECT 31 ts, 32 dur, 33 gpu_id, 34 cast_int!(value) AS gpu_freq 35FROM counter_leading_intervals!(( 36 SELECT c.* 37 FROM counter c 38 JOIN gpu_counter_track t 39 ON t.id = c.track_id AND t.name = 'gpufreq' 40 WHERE gpu_id IS NOT NULL 41)) 42JOIN gpu_counter_track AS t 43 ON t.id = track_id; 44