File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,9 @@ mutable struct EventGroup
192
192
193
193
function EventGroup (types:: Vector{EventType} ;
194
194
warn_unsupported = true ,
195
- userspace_only = true
195
+ userspace_only = true ,
196
+ pinned = false ,
197
+ exclusive = false ,
196
198
)
197
199
my_types = EventType[]
198
200
group = new (- 1 , Cint[], EventType[])
@@ -203,12 +205,24 @@ mutable struct EventGroup
203
205
attr. size = sizeof (perf_event_attr)
204
206
attr. config = evt_type. event
205
207
attr. sample_period_or_freq = 0
206
- if userspace_only
207
- attr. flags = (1 << 5 ) # exclude kernel
208
- end
208
+ attr. flags = 0
209
+ # first attribute becomes group leader
209
210
if group. leader_fd == - 1
210
211
attr. flags |= (1 << 0 ) # start disabled
211
212
end
213
+ if pinned
214
+ attr. flags |= (1 << 2 )
215
+ end
216
+ if exclusive
217
+ attr. flags |= (1 << 3 )
218
+ end
219
+ # (1 << 4) exclude_user
220
+ if userspace_only
221
+ attr. flags |= (1 << 5 ) # exclude kernel
222
+ end
223
+ # (1 << 6) exclude hypervisor
224
+ # (1 << 7) exclude idle
225
+
212
226
attr. read_format =
213
227
PERF_FORMAT_GROUP |
214
228
PERF_FORMAT_TOTAL_TIME_ENABLED |
You can’t perform that action at this time.
0 commit comments