return "unknown";
}
+const char *evsel__group_pmu_name(const struct evsel *evsel)
+{
+ const struct evsel *leader;
+
+ /* If the pmu_name is set use it. pmu_name isn't set for CPU and software events. */
+ if (evsel->pmu_name)
+ return evsel->pmu_name;
+ /*
+ * Software events may be in a group with other uncore PMU events. Use
+ * the pmu_name of the group leader to avoid breaking the software event
+ * out of the group.
+ *
+ * Aux event leaders, like intel_pt, expect a group with events from
+ * other PMUs, so substitute the AUX event's PMU in this case.
+ */
+ leader = evsel__leader(evsel);
+ if ((evsel->core.attr.type == PERF_TYPE_SOFTWARE || evsel__is_aux_event(leader)) &&
+ leader->pmu_name) {
+ return leader->pmu_name;
+ }
+
+ return "cpu";
+}
+
const char *evsel__metric_id(const struct evsel *evsel)
{
if (evsel->metric_id)
int __evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, char *bf, size_t size);
const char *evsel__name(struct evsel *evsel);
+const char *evsel__group_pmu_name(const struct evsel *evsel);
const char *evsel__metric_id(const struct evsel *evsel);
static inline bool evsel__is_tool(const struct evsel *evsel)