[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250619133823.GG1613376@noisy.programming.kicks-ass.net>
Date: Thu, 19 Jun 2025 15:38:23 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Liang, Kan" <kan.liang@...ux.intel.com>
Cc: "Mi, Dapeng" <dapeng1.mi@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>, mingo@...hat.com,
acme@...nel.org, namhyung@...nel.org, tglx@...utronix.de,
dave.hansen@...ux.intel.com, irogers@...gle.com,
adrian.hunter@...el.com, jolsa@...nel.org,
alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
ak@...ux.intel.com, zide.chen@...el.com
Subject: Re: [RFC PATCH 00/12] Support vector and more extended registers in
perf
On Thu, Jun 19, 2025 at 07:11:23AM -0400, Liang, Kan wrote:
> @@ -543,6 +544,24 @@ struct perf_event_attr {
> __u64 sig_data;
>
> __u64 config3; /* extension of config2 */
> +
> +
> + /*
> + * Defines set of SIMD registers to dump on samples.
> + * The sample_simd_req_enabled !=0 implies the
> + * set of SIMD registers is used to config all SIMD registers.
> + * If !sample_simd_req_enabled, sample_regs_XXX may be used to
> + * config some SIMD registers on X86.
> + */
> + union {
> + __u16 sample_simd_reg_enabled;
> + __u16 sample_simd_pred_reg_qwords;
> + };
> + __u16 sample_simd_pred_reg_intr;
> + __u16 sample_simd_pred_reg_user;
This limits things to max 16 predicate registers. ARM will fully fill
that with present hardware.
> + __u16 sample_simd_reg_qwords;
> + __u64 sample_simd_reg_intr;
> + __u64 sample_simd_reg_user;
I would perhaps make this vec_reg.
> };
>
> /*
> @@ -1016,7 +1035,15 @@ enum perf_event_type {
> * } && PERF_SAMPLE_BRANCH_STACK
> *
> * { u64 abi; # enum perf_sample_regs_abi
> - * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
> + * u64 regs[weight(mask)];
> + * struct {
> + * u16 nr_vectors;
> + * u16 vector_qwords;
> + * u16 nr_pred;
> + * u16 pred_qwords;
> + * u64 data[nr_vectors * vector_qwords + nr_pred * pred_qwords];
> + * } && sample_simd_reg_enabled
Instead of using sample_simd_reg_enabled here I would perhaps extend
perf_sample_regs_abi. The current abi word is woefully underused.
Also, realistically, what you want to look at here is:
sample_simd_{pred,vec}_reg_user;
If those are empty, there will be no registers.
> + * } && PERF_SAMPLE_REGS_USER
> *
> * { u64 size;
> * char data[size];
Powered by blists - more mailing lists