Re: [PATCH v3 1/4] perf/core,x86: introduce sync_task_ctx() method at struct pmu

From: Peter Zijlstra
Date: Mon Oct 21 2019 - 06:27:17 EST


On Fri, Oct 18, 2019 at 12:42:44PM +0300, Alexey Budankov wrote:
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index 61448c19a132..60bf17af69f0 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -409,6 +409,13 @@ struct pmu {
> */
> size_t task_ctx_size;
>
> + /*
> + * PMU specific parts of task perf event context (i.e. ctx->task_ctx_data)
> + * can be synchronized using this function. See Intel LBR callstack support
> + * implementation and Perf core context switch handling callbacks for usage
> + * examples.

You're forgetting to mark this: Optional

> + */

> + void (*sync_task_ctx) (void *one, void *another);

The traditional argment names for context switching functions are prev
and next.