]>
Commit | Line | Data |
---|---|---|
86de78d2 MCC |
1 | .. SPDX-License-Identifier: GPL-2.0 |
2 | ||
99d56196 BL |
3 | .. _perf_index: |
4 | ||
86de78d2 | 5 | ===================== |
a9bf3130 AM |
6 | Perf Event Attributes |
7 | ===================== | |
8 | ||
86de78d2 MCC |
9 | :Author: Andrew Murray <andrew.murray@arm.com> |
10 | :Date: 2019-03-06 | |
a9bf3130 AM |
11 | |
12 | exclude_user | |
13 | ------------ | |
14 | ||
15 | This attribute excludes userspace. | |
16 | ||
17 | Userspace always runs at EL0 and thus this attribute will exclude EL0. | |
18 | ||
19 | ||
20 | exclude_kernel | |
21 | -------------- | |
22 | ||
23 | This attribute excludes the kernel. | |
24 | ||
25 | The kernel runs at EL2 with VHE and EL1 without. Guest kernels always run | |
26 | at EL1. | |
27 | ||
28 | For the host this attribute will exclude EL1 and additionally EL2 on a VHE | |
29 | system. | |
30 | ||
31 | For the guest this attribute will exclude EL1. Please note that EL2 is | |
32 | never counted within a guest. | |
33 | ||
34 | ||
35 | exclude_hv | |
36 | ---------- | |
37 | ||
38 | This attribute excludes the hypervisor. | |
39 | ||
40 | For a VHE host this attribute is ignored as we consider the host kernel to | |
41 | be the hypervisor. | |
42 | ||
43 | For a non-VHE host this attribute will exclude EL2 as we consider the | |
44 | hypervisor to be any code that runs at EL2 which is predominantly used for | |
45 | guest/host transitions. | |
46 | ||
47 | For the guest this attribute has no effect. Please note that EL2 is | |
48 | never counted within a guest. | |
49 | ||
50 | ||
51 | exclude_host / exclude_guest | |
52 | ---------------------------- | |
53 | ||
54 | These attributes exclude the KVM host and guest, respectively. | |
55 | ||
56 | The KVM host may run at EL0 (userspace), EL1 (non-VHE kernel) and EL2 (VHE | |
57 | kernel or non-VHE hypervisor). | |
58 | ||
59 | The KVM guest may run at EL0 (userspace) and EL1 (kernel). | |
60 | ||
61 | Due to the overlapping exception levels between host and guests we cannot | |
62 | exclusively rely on the PMU's hardware exception filtering - therefore we | |
63 | must enable/disable counting on the entry and exit to the guest. This is | |
64 | performed differently on VHE and non-VHE systems. | |
65 | ||
66 | For non-VHE systems we exclude EL2 for exclude_host - upon entering and | |
67 | exiting the guest we disable/enable the event as appropriate based on the | |
68 | exclude_host and exclude_guest attributes. | |
69 | ||
70 | For VHE systems we exclude EL1 for exclude_guest and exclude both EL0,EL2 | |
71 | for exclude_host. Upon entering and exiting the guest we modify the event | |
72 | to include/exclude EL0 as appropriate based on the exclude_host and | |
73 | exclude_guest attributes. | |
74 | ||
75 | The statements above also apply when these attributes are used within a | |
76 | non-VHE guest however please note that EL2 is never counted within a guest. | |
77 | ||
78 | ||
79 | Accuracy | |
80 | -------- | |
81 | ||
82 | On non-VHE hosts we enable/disable counters on the entry/exit of host/guest | |
83 | transition at EL2 - however there is a period of time between | |
84 | enabling/disabling the counters and entering/exiting the guest. We are | |
85 | able to eliminate counters counting host events on the boundaries of guest | |
86 | entry/exit when counting guest events by filtering out EL2 for | |
87 | exclude_host. However when using !exclude_hv there is a small blackout | |
88 | window at the guest entry/exit where host events are not captured. | |
89 | ||
90 | On VHE systems there are no blackout windows. |