Re: [PATCH v2 14/26] selftests/resctrl: Convert perf related globals to locals

From: Reinette Chatre
Date: Tue Nov 28 2023 - 17:15:59 EST


Hi Ilpo,

On 11/20/2023 3:13 AM, Ilpo Järvinen wrote:
> Perf related variables pea_llc_miss, pe_read, and pe_fd are globals in
> cache.c.
>
> Convert them to locals for better scoping and make pea_llc_miss simpler
> by renaming it to pea. Make close(pe_fd) handling easier to understand
> by doing it inside cat_val().
>
> Make also sizeof()s use safer way to determine the right struct.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
> ---

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette