@@ -551,7 +551,7 @@ static int pmu_alias_terms(struct perf_pmu_alias *alias,
551
551
* Uncore PMUs have a "cpumask" file under sysfs. CPU PMUs (e.g. on arm/arm64)
552
552
* may have a "cpus" file.
553
553
*/
554
- static struct perf_cpu_map * pmu_cpumask (int dirfd , const char * name )
554
+ static struct perf_cpu_map * pmu_cpumask (int dirfd , const char * name , bool is_core )
555
555
{
556
556
struct perf_cpu_map * cpus ;
557
557
const char * templates [] = {
@@ -575,7 +575,8 @@ static struct perf_cpu_map *pmu_cpumask(int dirfd, const char *name)
575
575
return cpus ;
576
576
}
577
577
578
- return !strcmp (name , "cpu" ) ? perf_cpu_map__get (cpu_map__online ()) : NULL ;
578
+ /* Nothing found, for core PMUs assume this means all CPUs. */
579
+ return is_core ? perf_cpu_map__get (cpu_map__online ()) : NULL ;
579
580
}
580
581
581
582
static bool pmu_is_uncore (int dirfd , const char * name )
@@ -886,7 +887,8 @@ struct perf_pmu *perf_pmu__lookup(struct list_head *pmus, int dirfd, const char
886
887
if (!pmu )
887
888
return NULL ;
888
889
889
- pmu -> cpus = pmu_cpumask (dirfd , name );
890
+ pmu -> is_core = is_pmu_core (name );
891
+ pmu -> cpus = pmu_cpumask (dirfd , name , pmu -> is_core );
890
892
pmu -> name = strdup (name );
891
893
if (!pmu -> name )
892
894
goto err ;
@@ -903,7 +905,6 @@ struct perf_pmu *perf_pmu__lookup(struct list_head *pmus, int dirfd, const char
903
905
}
904
906
905
907
pmu -> type = type ;
906
- pmu -> is_core = is_pmu_core (name );
907
908
pmu -> is_uncore = pmu_is_uncore (dirfd , name );
908
909
if (pmu -> is_uncore )
909
910
pmu -> id = pmu_id (name );
0 commit comments