[V2 2/4] tools/perf: Refactor the code definition of perf reg extended mask in tools side header file
Michael Ellerman
mpe at ellerman.id.au
Fri Oct 1 21:29:57 AEST 2021
Daniel Axtens <dja at axtens.net> writes:
> Hi Athira,
>
>> PERF_REG_PMU_MASK_300 and PERF_REG_PMU_MASK_31 defines the mask
>> value for extended registers. Current definition of these mask values
>> uses hex constant and does not use registers by name, making it less
>> readable. Patch refactor the macro values in perf tools side header file
>> by or'ing together the actual register value constants.
>>
> This looks like a good simplification.
>
>> -/* Exclude MMCR3, SIER2, SIER3 for CPU_FTR_ARCH_300 */
>> -#define PERF_EXCLUDE_REG_EXT_300 (7ULL << PERF_REG_POWERPC_MMCR3)
>
> This file is uAPI - are we allowed to remove a define? Could a program
> built against these headers now fail to compile because we've removed it?
Yeah that's true.
In this case I think I'd rather we remove it though, because:
- it was never meant to be part of the uapi, it was just meant for use
in the construction of PERF_REG_PMU_MASK_300, and is no longer needed
for that.
- it's only been in the header since v5.12, so I think the chance of
anything using it is essentially zero.
cheers
More information about the Linuxppc-dev
mailing list