1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
use io;
use c_enumc_enum;
use bindings;
use crate;
use crateBuilder;
used_in_docs!;
static MSR_TYPE: CachedPmuType = new;
c_enum!
/// A perf event providing access to a subset of the model-specific registers
/// (MSRs) on x86 CPUs.
///
/// The exact MSRs that are available on any given system depend on the system
/// CPU. The kernel exposes the available event types for the current
/// system under `/sys/bus/event_source/devices/msr/events`. You can use the
/// files in that folder to check if an MSR event is supported. Alternatively,
/// you can just try and build the counter, either will work.
///
/// The full list of MSR IDs that are supported can be seen [in the linux
/// source][0]. [`MsrId`] aims to be comprehensive but may not be up to date.
///
/// # Note
/// MSR events do not support filtering based on user-space vs kernel-space. You
/// will need to set [`exclude_kernel(false)`][exk] and
/// [`exclude_hv(false)`][exhv] or else you will get errors when calling
/// [`Builder::build`].
///
/// [0]: https://github.com/torvalds/linux/blob/master/arch/x86/events/msr.c
/// [exk]: crate::Builder::exclude_kernel
/// [exhv]: crate::Builder::exclude_hv