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 16INCLUDE PERFETTO MODULE memory.linux.general; 17 18-- Counter for GPU memory per process with duration. 19CREATE PERFETTO TABLE memory_gpu_per_process( 20 -- Timestamp 21 ts INT, 22 -- Duration 23 dur INT, 24 -- Upid of the process 25 upid INT, 26 -- GPU memory 27 gpu_memory INT 28) AS 29SELECT 30 ts, 31 dur, 32 upid, 33 cast_int!(value) AS gpu_memory 34FROM _all_counters_per_process 35WHERE name = 'GPU Memory';