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