Re: [PATCH V5 1/8] perf/x86/intel/uncore: customized event_read for client IMC uncore

From: Thomas Gleixner
Date: Thu Jan 18 2018 - 04:37:01 EST


On Mon, 15 Jan 2018, kan.liang@xxxxxxxxx wrote:

> From: Kan Liang <Kan.liang@xxxxxxxxx>
>
> There are two free running counters for client IMC uncore. The custom
> event_init() function hardcode their index to 'UNCORE_PMC_IDX_FIXED' and
> 'UNCORE_PMC_IDX_FIXED + 1'. To support the 'UNCORE_PMC_IDX_FIXED + 1'
> case, the generic uncore_perf_event_update is obscurely hacked.
> The code quality issue will bring problem when new counter index is
> introduced into generic code. For example, free running counter index.
>
> Introduce customized event_read function for client IMC uncore.
> The customized function is exactly copied from previous generic
> uncore_pmu_event_read.
> The 'UNCORE_PMC_IDX_FIXED + 1' case will be isolated for client IMC
> uncore only.
>
> Signed-off-by: Kan Liang <Kan.liang@xxxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>