File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -829,23 +829,26 @@ bool evsel__name_is(struct evsel *evsel, const char *name)
829
829
830
830
const char * evsel__group_pmu_name (const struct evsel * evsel )
831
831
{
832
- const struct evsel * leader ;
832
+ struct evsel * leader , * pos ;
833
833
834
834
/* If the pmu_name is set use it. pmu_name isn't set for CPU and software events. */
835
835
if (evsel -> pmu_name )
836
836
return evsel -> pmu_name ;
837
837
/*
838
838
* Software events may be in a group with other uncore PMU events. Use
839
- * the pmu_name of the group leader to avoid breaking the software event
840
- * out of the group.
839
+ * the pmu_name of the first non-software event to avoid breaking the
840
+ * software event out of the group.
841
841
*
842
842
* Aux event leaders, like intel_pt, expect a group with events from
843
843
* other PMUs, so substitute the AUX event's PMU in this case.
844
844
*/
845
845
leader = evsel__leader (evsel );
846
- if ((evsel -> core .attr .type == PERF_TYPE_SOFTWARE || evsel__is_aux_event (leader )) &&
847
- leader -> pmu_name ) {
848
- return leader -> pmu_name ;
846
+ if (evsel -> core .attr .type == PERF_TYPE_SOFTWARE || evsel__is_aux_event (leader )) {
847
+ /* Starting with the leader, find the first event with a named PMU. */
848
+ for_each_group_evsel (pos , leader ) {
849
+ if (pos -> pmu_name )
850
+ return pos -> pmu_name ;
851
+ }
849
852
}
850
853
851
854
return "cpu" ;
You can’t perform that action at this time.
0 commit comments