Re: [RFC][PATCH] perf: Rewrite core context handling

From: Alexander Shishkin
Date: Wed Oct 17 2018 - 11:01:35 EST


Alexey Budankov <alexey.budankov@xxxxxxxxxxxxxxx> writes:

> Since it reduces to single cpu context (and single task context) at all times,
> ideally, it would probably be coded as simple as this:
>
> perf_rotate_context()
> {
> cpu = this_cpu_ptr(&cpu_context)
> for_every_pmu(pmu, cpu)
> for_every_event_ctx(event_ctx, pmu)
> rotate(event_ctx, pmu)
> }
>
> so rotate(event_ctx, pmu) would operate on common events objects semantics
> and memory layout, and PMU specific code handle SW/HW programming differences.

Ok, what's event_ctx and how does that simplify things?

Regards,
--
Alex