• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
18--
19-- @column slice_id       Id of the corresponding slice in slices table.
20-- @column cpu            CPU that entered hypervisor.
21-- @column ts             Timestamp when CPU entered hypervisor (in nanoseconds).
22-- @column dur            How much time CPU spent in hypervisor (in nanoseconds).
23-- @column reason         Reason for entering hypervisor (e.g. host_hcall, host_mem_abort), or NULL if unknown.
24CREATE VIEW pkvm_hypervisor_events AS
25SELECT
26  slices.id as slice_id,
27  cpu_track.cpu as cpu,
28  slices.ts as ts,
29  slices.dur as dur,
30  EXTRACT_ARG(slices.arg_set_id, 'hyp_enter_reason') as reason
31FROM slices
32JOIN cpu_track ON cpu_track.id = slices.track_id
33WHERE
34  slices.category = 'pkvm_hyp'
35