Re: [PATCH bpf-next v1] bpftool: Add support for custom BTF path in prog load/loadall

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

 



On Mon, May 12, 2025 at 8:59 PM Jiayuan Chen <jiayuan.chen@xxxxxxxxx> wrote:
>
> This patch exposes the btf_custom_path feature to bpftool, allowing users
> to specify a custom BTF file when loading BPF programs using prog load or
> prog loadall commands. This feature is already supported by libbpf, and
> this patch makes it accessible through the bpftool command-line interface.
>
> Signed-off-by: Jiayuan Chen <jiayuan.chen@xxxxxxxxx>
> ---
>  tools/bpf/bpftool/prog.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
> index f010295350be..63f84e765b34 100644
> --- a/tools/bpf/bpftool/prog.c
> +++ b/tools/bpf/bpftool/prog.c
> @@ -1681,8 +1681,17 @@ static int load_with_options(int argc, char **argv, bool first_prog_only)
>                 } else if (is_prefix(*argv, "autoattach")) {
>                         auto_attach = true;
>                         NEXT_ARG();
> +               } else if (is_prefix(*argv, "custom_btf")) {
> +                       NEXT_ARG();
> +
> +                       if (!REQ_ARGS(1))
> +                               goto err_free_reuse_maps;
> +
> +                       open_opts.btf_custom_path = GET_ARG();

I don't see a use case yet.
What exactly is the scenario where it's useful ?





[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