Re: [Patch v6 10/22] perf/x86: Enable XMM Register Sampling for Non-PEBS Events
From: Mi, Dapeng
Date: Wed Feb 25 2026 - 01:14:00 EST
On 2/25/2026 11:14 AM, Chang S. Bae wrote:
> On 2/24/2026 5:36 PM, Mi, Dapeng wrote:
>> E.g., there is the generic x86 event enabling function
>> x86_pmu_enable_event()
> Again that's in the header file, which looks okay to me.
>
> Now looking at the file, core.c
>
> get_possible_counter_mask()
> reserve_pmc_hardware()
> release_pmc_hardware()
> set_ext_hw_attr()
> precise_br_compat()
> add_nr_metric_event()
> collect_event()
> ...
>
> Then all of them violate that naming convention?
>
> There is also another pattern assigning x86_pmu_xxx() to function
> pointers in struct pmu. Certainly this xsaving function itself isn't the
> case.
IMO, the functions mentioned above serve as auxiliary functions and are not
directly tied to the core PMU functionalities such as event enabling,
disabling, counting, and sampling... It would be fine to not add the prefix.
Currently, there are no strict naming conventions for functions in perf, so
I can't say which one must be right or better. But at least from my side, I
believe the function x86_pmu_sample_extended_regs() does more than just
wrap a xsaves instruction. It performs the complete sampling process for
extended registers, including parsing the extended register mask, executing
the xsaves instruction, and updating the perf_regs pointers based on the
data obtained from xsaves. Thus, it is not a simple auxiliary function.
Additionally, x86_pmu_sample_xregs() is already concise, and further
shortening seems unnecessary. Thanks.
>
>
>
>