Re: [PATCH bpf-next v8 04/11] bpf: support fsession for bpf_session_is_return
From: Alexei Starovoitov <hidden>
Date: 2026-01-10 02:40:35
Also in:
bpf, lkml
From: Alexei Starovoitov <hidden>
Date: 2026-01-10 02:40:35
Also in:
bpf, lkml
On Wed, Jan 7, 2026 at 6:25 PM Menglong Dong [off-list ref] wrote:
+ } else if (func_id == special_kfunc_list[KF_bpf_session_is_return]) {
+ if (prog->expected_attach_type == BPF_TRACE_FSESSION)
+ addr = (unsigned long)bpf_fsession_is_return;...
+bool bpf_fsession_is_return(void *ctx)
+{
+ /* This helper call is inlined by verifier. */
+ return !!(((u64 *)ctx)[-1] & (1 << BPF_TRAMP_M_IS_RETURN));
+}
+Why do this specialization and introduce a global function that will never be called, since it will be inlined anyway? Remove the first hunk and make the 2nd a comment instead of a real function?