1-- 2-- Copyright 2023 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 17-- Events when CPU entered hypervisor. 18CREATE PERFETTO VIEW pkvm_hypervisor_events ( 19 -- Id of the corresponding slice in slices table. 20 slice_id JOINID(slice.id), 21 -- CPU that entered hypervisor. 22 cpu LONG, 23 -- Timestamp when CPU entered hypervisor. 24 ts TIMESTAMP, 25 -- How much time CPU spent in hypervisor. 26 dur DURATION, 27 -- Reason for entering hypervisor (e.g. host_hcall, host_mem_abort), or NULL if unknown. 28 reason STRING 29) AS 30SELECT 31 slices.id AS slice_id, 32 cpu_track.cpu AS cpu, 33 slices.ts AS ts, 34 slices.dur AS dur, 35 extract_arg(slices.arg_set_id, 'hyp_enter_reason') AS reason 36FROM slices 37JOIN cpu_track 38 ON cpu_track.id = slices.track_id 39WHERE 40 slices.category = 'pkvm_hyp'; 41