Re: [PATCH bpf-next 2/2] bpf: allow kfuncs within normal tracepoint programs

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

 



On Wed, Aug 14, 2024 at 4:58 PM JP Kobryn <inwardvessel@xxxxxxxxx> wrote:
>
> Account for normal tracepoint programs by associating them with the kfunc
> tracing hook. This allows kfuncs to be called within tracepoint programs.
>
> Signed-off-by: JP Kobryn <inwardvessel@xxxxxxxxx>
> ---
>  kernel/bpf/btf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 520f49f422fe..8b844d6fd041 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -8303,6 +8303,7 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type)
>                 return BTF_KFUNC_HOOK_TC;
>         case BPF_PROG_TYPE_STRUCT_OPS:
>                 return BTF_KFUNC_HOOK_STRUCT_OPS;
> +       case BPF_PROG_TYPE_TRACEPOINT:
>         case BPF_PROG_TYPE_TRACING:
>         case BPF_PROG_TYPE_LSM:
>                 return BTF_KFUNC_HOOK_TRACING;
> --
> 2.46.0
>

I'm not 100% sure it's ok to map TRACEPOINT prog type to HOOK_TRACING.
But assuming it is, shouldn't we then also do the same for KPROBE and
PERF_EVENT programs?

Either way, please consider Eduard's suggestion about changing patch
order and switching to TEST_LOADER approach.

pw-bot: cr





[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