# Re: \[V2 2/4\] tools/perf: Refactor the code definition of perf reg extended mask in tools side header file

- From: Michael Ellerman \<mpe@ellerman.id.au\>
- Date: 2021-10-01 11:30:40 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2021/10/9524572
- Thread: https://ratatoskr.run/linuxppc-dev/2021/09/9524560/t.md

```text
Daniel Axtens [ref] 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
```
