Re: [PATCH 1/5] alpha/perf: pass PERFMON_CMD_LOGGING_ALL to the logging options call
From: Magnus Lindholm
Date: Thu Oct 29 2026 - 13:38:53 EST
Hi Matt,
On Wed, Oct 28, 2026 at 7:09 PM Matt Turner <mattst88@xxxxxxxxx> wrote:
>
> alpha_pmu_enable() passes EV67_PCTR_MODE_AGGREGATE to
> PERFMON_CMD_LOGGING_OPTIONS. That constant is the counting mode bit for
> PCTR_CTL, which belongs in the PERFMON_CMD_DESIRED_EVENTS argument. The
> logging options call takes a flag in bit 0 where 0 means "count all
> processes". It works only because EV67_PCTR_MODE_AGGREGATE happens to be
> 0.
>
> Add a name for that argument and pass it instead. No functional change.
>
> Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
> ---
> arch/alpha/include/asm/wrperfmon.h | 2 ++
> arch/alpha/kernel/perf_event.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/alpha/include/asm/wrperfmon.h b/arch/alpha/include/asm/wrperfmon.h
> index c97b82a1f7db..1fa9bc813263 100644
> --- a/arch/alpha/include/asm/wrperfmon.h
> +++ b/arch/alpha/include/asm/wrperfmon.h
> @@ -23,6 +23,8 @@
> #define PERFMON_CMD_I_STAT 8
> #define PERFMON_CMD_PMPC 9
>
> +/* PERFMON_CMD_LOGGING_OPTIONS arguments */
> +#define PERFMON_CMD_LOGGING_ALL 0
The Alpha Architecture Reference Manual, Table E-18 (page E-24),
describes bit 0 as:
"set = log all processes"
"clear = log only selected processes"
That appears opposite to the changelog's description of zero as
"count all processes". Is the manual incorrect for the PALcode
implementation we use?
This preserves the existing value, so there is no functional change,
but a short explanation would help reconcile the name and changelog
with the manual.
>
> /* EV5/EV56/PCA56 Counters */
> #define EV5_PCTR_0 (1UL<<0)
> diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c
> index a3eaab094ece..2d9383425357 100644
> --- a/arch/alpha/kernel/perf_event.c
> +++ b/arch/alpha/kernel/perf_event.c
> @@ -728,7 +728,7 @@ static void alpha_pmu_enable(struct pmu *pmu)
> maybe_change_configuration(cpuc);
>
> /* Start counting the desired events. */
> - wrperfmon(PERFMON_CMD_LOGGING_OPTIONS, EV67_PCTR_MODE_AGGREGATE);
> + wrperfmon(PERFMON_CMD_LOGGING_OPTIONS, PERFMON_CMD_LOGGING_ALL);
> wrperfmon(PERFMON_CMD_DESIRED_EVENTS, cpuc->config);
> wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask);
> }
>
> --
> 2.55.0
>
WIll test this all later on my ES40
Magnus