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 17SELECT RUN_METRIC('android/process_metadata.sql'); 18 19INCLUDE PERFETTO MODULE android.garbage_collection; 20INCLUDE PERFETTO MODULE android.suspend; 21 22DROP VIEW IF EXISTS android_garbage_collection_unagg_output; 23CREATE PERFETTO VIEW android_garbage_collection_unagg_output AS 24SELECT AndroidGarbageCollectionUnaggMetric( 25 'gc_events', ( 26 SELECT RepeatedField( 27 AndroidGarbageCollectionUnaggMetric_GarbageCollectionEvent( 28 'thread_name', thread_name, 29 'process_name', process_name, 30 'gc_type', gc_type, 31 'is_mark_compact', is_mark_compact, 32 'reclaimed_mb', reclaimed_mb, 33 'min_heap_mb', min_heap_mb, 34 'max_heap_mb', max_heap_mb, 35 'mb_per_ms_of_running_gc', reclaimed_mb/(gc_running_dur/1e6), 36 'mb_per_ms_of_wall_gc', reclaimed_mb/(gc_dur/1e6), 37 'gc_dur', gc_dur, 38 'gc_running_dur', gc_running_dur, 39 'gc_runnable_dur', gc_runnable_dur, 40 'gc_unint_io_dur', gc_unint_io_dur, 41 'gc_unint_non_io_dur', gc_unint_non_io_dur, 42 'gc_int_dur', gc_int_dur, 43 'gc_ts', gc_ts, 44 'tid', tid, 45 'pid', pid, 46 'gc_monotonic_dur', _extract_duration_without_suspend(gc_ts, gc_dur), 47 'process', metadata, 48 'gc_count', 1 49 )) 50 FROM android_garbage_collection_events 51 LEFT JOIN process_metadata using (upid) 52 ) 53); 54