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