File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -431,6 +431,17 @@ static int smmu_pmu_event_init(struct perf_event *event)
431
431
return - EINVAL ;
432
432
}
433
433
434
+ /*
435
+ * Ensure all events are on the same cpu so all events are in the
436
+ * same cpu context, to avoid races on pmu_enable etc.
437
+ */
438
+ event -> cpu = smmu_pmu -> on_cpu ;
439
+
440
+ hwc -> idx = -1 ;
441
+
442
+ if (event -> group_leader == event )
443
+ return 0 ;
444
+
434
445
for_each_sibling_event (sibling , event -> group_leader ) {
435
446
if (is_software_event (sibling ))
436
447
continue ;
@@ -442,14 +453,6 @@ static int smmu_pmu_event_init(struct perf_event *event)
442
453
return - EINVAL ;
443
454
}
444
455
445
- hwc -> idx = -1 ;
446
-
447
- /*
448
- * Ensure all events are on the same cpu so all events are in the
449
- * same cpu context, to avoid races on pmu_enable etc.
450
- */
451
- event -> cpu = smmu_pmu -> on_cpu ;
452
-
453
456
return 0 ;
454
457
}
455
458
You can’t perform that action at this time.
0 commit comments