[PATCH] drivers/perf: arm_pmu: Show PMU version on boot

Will Deacon will at kernel.org
Tue Sep 1 12:16:45 EDT 2020


On Wed, Aug 26, 2020 at 02:42:26PM +0800, Shaokun Zhang wrote:
> 在 2020/8/22 0:03, Will Deacon 写道:
> > On Thu, Jul 30, 2020 at 06:47:21PM +0800, Shaokun Zhang wrote:
> >> The @pmuver field has been initialized and can tell the PMU version.
> >> Let's show it on boot and the user obtains this information directly.
> >>
> >> Cc: Will Deacon <will at kernel.org>
> >> Cc: Mark Rutland <mark.rutland at arm.com>
> >> Signed-off-by: Shaokun Zhang <zhangshaokun at hisilicon.com>
> >> ---
> >>  drivers/perf/arm_pmu.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> >> index df352b334ea7..36f7fad7ba5a 100644
> >> --- a/drivers/perf/arm_pmu.c
> >> +++ b/drivers/perf/arm_pmu.c
> >> @@ -870,8 +870,8 @@ int armpmu_register(struct arm_pmu *pmu)
> >>  	if (!__oprofile_cpu_pmu)
> >>  		__oprofile_cpu_pmu = pmu;
> >>  
> >> -	pr_info("enabled with %s PMU driver, %d counters available\n",
> >> -		pmu->name, pmu->num_events);
> >> +	pr_info("enabled with %s PMU driver, %d counters available, version is %d\n",
> >> +		pmu->name, pmu->num_events, pmu->pmuver);
> > 
> > Hmm. I'm suspicious about this. Who is using this, and what for? We're
> 
> Since Arm ARM has extended PMU version for Armv8.1/8.4/8.5 with different PMUver in
> ID_AA64DFR0_EL1, someone who does the performance profiling may care the number of
> counter and want to know the supported PMU version. Because some events or features
> are related to PMU version, Like events corresponding to PMCEID0/1_EL0[32:63] or if
> anyone be told PMMIR_EL1 to ZERO, he can check the PMU version directly from the boot
> log information.

What do you mean by "may care the number of counter"? The number of counters
is independent of the PMU version and shouldn't really be of interest to
userspace anyway, should it? Or are you referring to something else?

As for whether events are supported or not, we already expose that on a
per-event basis, and I think we should continue to do that.

So overall, I still don't see the value in exposing this.

Will



More information about the linux-arm-kernel mailing list