[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6S7BcblAHO4nQTf@hirez.programming.kicks-ass.net>
Date: Thu, 22 Dec 2022 21:16:05 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
Song Liu <songliubraving@...com>, Jiri Olsa <jolsa@...nel.org>,
Martin KaFai Lau <kafai@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Hao Luo <haoluo@...gle.com>,
Stanislav Fomichev <sdf@...gle.com>,
LKML <linux-kernel@...r.kernel.org>, bpf@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH bpf-next 1/2] bpf/perf: Call perf_prepare_sample() before
bpf_prog_run()
On Thu, Dec 22, 2022 at 09:34:42AM -0800, Namhyung Kim wrote:
> Sorry about that. Let me rephrase it like below:
>
> With bpf_cast_to_kern_ctx(), BPF programs attached to a perf event
> can access perf sample data directly from the ctx.
This is the bpf_prog_run() in bpf_overflow_handler(), right?
> But the perf sample
> data is not fully prepared at this point, and some fields can have invalid
> uninitialized values. So it needs to call perf_prepare_sample() before
> calling the BPF overflow handler.
It never was, why is it a problem now?
> But just calling perf_prepare_sample() can be costly when the BPF
So you potentially call it twice now, how's that useful?
Powered by blists - more mailing lists