return str;
}
-/*
- * PMU CORE devices have different name other than cpu in sysfs on some
- * platforms.
- * Looking for possible sysfs files to identify the arm core device.
+/**
+ * is_sysfs_pmu_core() - PMU CORE devices have different name other than cpu in
+ * sysfs on some platforms like ARM or Intel hybrid. Looking for
+ * possible the cpus file in sysfs files to identify whether this is a
+ * core device.
+ * @name: The PMU name such as "cpu_atom".
*/
-static int is_arm_pmu_core(const char *name)
+static int is_sysfs_pmu_core(const char *name)
{
char path[PATH_MAX];
struct pmu_add_cpu_aliases_map_data data = {
.head = head,
.name = pmu->name,
- .cpu_name = is_arm_pmu_core(pmu->name) ? pmu->name : "cpu",
+ .cpu_name = is_sysfs_pmu_core(pmu->name) ? pmu->name : "cpu",
.pmu = pmu,
};
bool is_pmu_core(const char *name)
{
- return !strcmp(name, "cpu") || is_arm_pmu_core(name);
+ return !strcmp(name, "cpu") || is_sysfs_pmu_core(name);
+}
+
+bool is_pmu_hybrid(const char *name)
+{
+ return !strcmp(name, "cpu_atom") || !strcmp(name, "cpu_core");
}
bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
{
- return is_pmu_core(pmu->name) || perf_pmu__is_hybrid(pmu->name);
+ return is_pmu_core(pmu->name);
}
bool perf_pmu__supports_wildcard_numeric(const struct perf_pmu *pmu)
{
- return is_pmu_core(pmu->name) || perf_pmu__is_hybrid(pmu->name);
+ return is_pmu_core(pmu->name);
}
bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu)
{
- return !perf_pmu__is_hybrid(pmu->name);
+ return !is_pmu_hybrid(pmu->name);
}
static bool pmu_alias_is_duplicate(struct sevent *alias_a,
pmu = NULL;
j = 0;
while ((pmu = perf_pmu__scan(pmu)) != NULL) {
- bool is_cpu = is_pmu_core(pmu->name) || perf_pmu__is_hybrid(pmu->name);
+ bool is_cpu = is_pmu_core(pmu->name);
list_for_each_entry(event, &pmu->aliases, list) {
aliases[j].event = event;