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

Ravi Bangoria
2022-08-02T06:17:46Z

[...]

> static void
> -ctx_sched_in(struct perf_event_context *ctx,
> - struct perf_cpu_context *cpuctx,
> - enum event_type_t event_type,
> +ctx_sched_in(struct perf_event_context *ctx, enum event_type_t event_type,
> struct task_struct *task)
> {
> + struct perf_cpu_context *cpuctx = this_cpu_ptr(&cpu_context);
> int is_active = ctx->is_active;
> u64 now;
>
> @@ -3818,6 +3905,7 @@ ctx_sched_in(struct perf_event_context *ctx,
> /* start ctx time */
> now = perf_clock();
> ctx->timestamp = now;
> + // XXX ctx->task =? task

Couldn't get this XXX, it's from your original patch. If you can recall, it
would be helpful.

> perf_cgroup_set_timestamp(task, ctx);
> }

Also, this hunk is under if (is_active ^ EVENT_TIME), which effectively is
(is_active != EVENT_TIME). I'm assuming it should be (is_active & EVENT_TIME)?

Thanks,
Ravi