Re: [PATCH] bpf: Use an UNUSED id for bpf_session_cookie without FPROBE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 29, 2024 at 5:44 AM Sebastian Andrzej Siewior
<bigeasy@xxxxxxxxxxxxx> wrote:
>
> bpf_session_cookie() is only available with CONFIG_FPROBE=y leading to
> an unresolved symbol otherwise.
>
> Use BTF_ID_UNUSED instead of bpf_session_cookie for CONFIG_FPROBE=n.
>
> Fixes: 5c919acef8514 ("bpf: Add support for kprobe session cookie")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  kernel/bpf/verifier.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 77da1f438becc..436f72bfcb9b9 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -11124,7 +11124,11 @@ BTF_ID(func, bpf_iter_css_task_new)
>  #else
>  BTF_ID_UNUSED
>  #endif
> +#ifdef CONFIG_FPROBE
>  BTF_ID(func, bpf_session_cookie)
> +#else
> +BTF_ID_UNUSED
> +#endif

Instead of this fix..
Jiri,
maybe remove ifdef CONFIG_FPROBE hiding of this kfunc
in kernel/tace/bpf_trace.c ?
The less ifdef-s the better. imo





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux