Skip to contentSkip to conversation

drivers/perf/arm_pmu.c:932:24: error: implicit declaration of function 'topology_core_has_smt'; did you mean 'topology_core_cpumask'?

PATCH kernel test robot 2 participants 2 messages Nov 4, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf
head:   989b40b7578a2be7b0388522d33d751b257d59d9
commit: c3d78c34ad009a7cce57ae5b5c93e1bd03bb31a3 [1/8] perf: arm_pmuv3: Don't use PMCCNTR_EL0 on SMT cores
config: arm-randconfig-001-20251104 (https://download.01.org/0day-ci/archive/20251104/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/perf/arm_pmu.c: In function 'armpmu_register':

>> drivers/perf/arm_pmu.c:932:24: error: implicit declaration of function 'topology_core_has_smt'; did you mean 'topology_core_cpumask'? [-Wimplicit-function-declaration]
     932 |         pmu->has_smt = topology_core_has_smt(cpumask_first(&pmu->supported_cpus));
         |                        ^~~~~~~~~~~~~~~~~~~~~
         |                        topology_core_cpumask

vim +932 drivers/perf/arm_pmu.c

919
920 int armpmu_register(struct arm_pmu *pmu)
921 {
922 int ret;
923
924 ret = cpu_pmu_init(pmu);
925 if (ret)
926 return ret;
927
928 /*
929 * By this stage we know our supported CPUs on either DT/ACPI platforms,
930 * detect the SMT implementation.
931 */

 > 932		pmu->has_smt = topology_core_has_smt(cpumask_first(&pmu->supported_cpus));

933
934 if (!pmu->set_event_filter)
935 pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE;
936
937 ret = perf_pmu_register(&pmu->pmu, pmu->name, -1);
938 if (ret)
939 goto out_destroy;
940
941 pr_info("enabled with %s PMU driver, %d (%*pb) counters available%s\n",
942 pmu->name, bitmap_weight(pmu->cntr_mask, ARMPMU_MAX_HWEVENTS),
943 ARMPMU_MAX_HWEVENTS, &pmu->cntr_mask,
944 has_nmi ? ", using NMIs" : "");
945
946 kvm_host_pmu_init(pmu);
947
948 return 0;
949
950 out_destroy:
951 cpu_pmu_destroy(pmu);
952 return ret;
953 }
954

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 12 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf
head:   989b40b7578a2be7b0388522d33d751b257d59d9
commit: c3d78c34ad009a7cce57ae5b5c93e1bd03bb31a3 [1/8] perf: arm_pmuv3: Don't use PMCCNTR_EL0 on SMT cores
config: arm-randconfig-001-20251104 (https://download.01.org/0day-ci/archive/20251104/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 8 lines

All errors (new ones prefixed by >>):

drivers/perf/arm_pmu.c: In function 'armpmu_register':

Quoted 1 line
Quoted 1 line

drivers/perf/arm_pmu.c:932:24: error: implicit declaration of function 'topology_core_has_smt'; did you mean 'topology_core_cpumask'? [-Wimplicit-function-declaration]

     932 |         pmu->has_smt = topology_core_has_smt(cpumask_first(&pmu->supported_cpus));
         |                        ^~~~~~~~~~~~~~~~~~~~~
         |                        topology_core_cpumask

Checked the config used the issue is due to GENERIC_ARCH_TOPOLOGY not selected. unlike arm64 which selects GENERIC_ARCH_TOPOLOGY unconditionally, ARM select it only if ARM_CPU_TOPOLOGY is selected, which depends on SMP && CPU_V7. so this need to be protected by CONFIG_GENERIC_ARCH_TOPOLOGY, will send a fix.

Quoted 39 lines

vim +932 drivers/perf/arm_pmu.c

   919	
   920	int armpmu_register(struct arm_pmu *pmu)
   921	{
   922		int ret;
   923	
   924		ret = cpu_pmu_init(pmu);
   925		if (ret)
   926			return ret;
   927	
   928		/*
   929		 * By this stage we know our supported CPUs on either DT/ACPI platforms,
   930		 * detect the SMT implementation.
   931		 */
Quoted 1 line

932 pmu->has_smt = topology_core_has_smt(cpumask_first(&pmu->supported_cpus));

933
934 if (!pmu->set_event_filter)

   935			pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE;
   936	
   937		ret = perf_pmu_register(&pmu->pmu, pmu->name, -1);
   938		if (ret)
   939			goto out_destroy;
   940	
   941		pr_info("enabled with %s PMU driver, %d (%*pb) counters available%s\n",
   942			pmu->name, bitmap_weight(pmu->cntr_mask, ARMPMU_MAX_HWEVENTS),
   943			ARMPMU_MAX_HWEVENTS, &pmu->cntr_mask,
   944			has_nmi ? ", using NMIs" : "");
   945	
   946		kvm_host_pmu_init(pmu);
   947	
   948		return 0;
   949	
   950	out_destroy:
   951		cpu_pmu_destroy(pmu);
   952		return ret;
   953	}
   954