[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26838c8a-d8d3-51df-ba27-b2a27ecdbcaa@isovalent.com>
Date: Fri, 30 Sep 2022 17:27:09 +0100
From: Quentin Monnet <quentin@...valent.com>
To: Wang Yufen <wangyufen@...wei.com>, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, martin.lau@...ux.dev,
song@...nel.org, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...gle.com, haoluo@...gle.com,
jolsa@...nel.org, davem@...emloft.net, kuba@...nel.org,
hawk@...nel.org, nathan@...nel.org, ndesaulniers@...gle.com,
trix@...hat.com
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [bpf-next v7 2/3] bpftool: Update doc (add autoattach to prog
load)
Tue Sep 27 2022 12:21:15 GMT+0100 ~ Wang Yufen <wangyufen@...wei.com>
> Add autoattach optional to prog load|loadall for supporting
> one-step load-attach-pin_link.
>
> Signed-off-by: Wang Yufen <wangyufen@...wei.com>
> ---
> tools/bpf/bpftool/Documentation/bpftool-prog.rst | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
> index eb1b2a2..b81d3d9 100644
> --- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst
> +++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
> @@ -31,7 +31,7 @@ PROG COMMANDS
> | **bpftool** **prog dump xlated** *PROG* [{**file** *FILE* | **opcodes** | **visual** | **linum**}]
> | **bpftool** **prog dump jited** *PROG* [{**file** *FILE* | **opcodes** | **linum**}]
> | **bpftool** **prog pin** *PROG* *FILE*
> -| **bpftool** **prog** { **load** | **loadall** } *OBJ* *PATH* [**type** *TYPE*] [**map** {**idx** *IDX* | **name** *NAME*} *MAP*] [**dev** *NAME*] [**pinmaps** *MAP_DIR*]
> +| **bpftool** **prog** { **load** | **loadall** } *OBJ* *PATH* [**type** *TYPE*] [**map** {**idx** *IDX* | **name** *NAME*} *MAP*] [**dev** *NAME*] [**pinmaps** *MAP_DIR*] [**autoattach**]
> | **bpftool** **prog attach** *PROG* *ATTACH_TYPE* [*MAP*]
> | **bpftool** **prog detach** *PROG* *ATTACH_TYPE* [*MAP*]
> | **bpftool** **prog tracelog**
> @@ -131,7 +131,7 @@ DESCRIPTION
> contain a dot character ('.'), which is reserved for future
> extensions of *bpffs*.
>
> - **bpftool prog { load | loadall }** *OBJ* *PATH* [**type** *TYPE*] [**map** {**idx** *IDX* | **name** *NAME*} *MAP*] [**dev** *NAME*] [**pinmaps** *MAP_DIR*]
> + **bpftool prog { load | loadall }** *OBJ* *PATH* [**type** *TYPE*] [**map** {**idx** *IDX* | **name** *NAME*} *MAP*] [**dev** *NAME*] [**pinmaps** *MAP_DIR*] [**autoattach**]
> Load bpf program(s) from binary *OBJ* and pin as *PATH*.
> **bpftool prog load** pins only the first program from the
> *OBJ* as *PATH*. **bpftool prog loadall** pins all programs
> @@ -150,6 +150,19 @@ DESCRIPTION
> Optional **pinmaps** argument can be provided to pin all
> maps under *MAP_DIR* directory.
>
> + If **autoattach** is specified program will be attached
> + before pin. In that case, only the link (representing the
> + program attached to its hook) is pinned, not the program as
> + such, so the path won't show in "**bpftool prog show -f**",
Nit: no need for double-quotes, the ** markup is enough.
> + only show in "**bpftool link show -f**". Also, this only works
> + when bpftool (libbpf) is able to infer all necessary information
> + from the objectfile, in particular, it's not supported for all
s/objectfile/object file/
> + program types. If the *OBJ* contains multiple programs and
> + *loadall* is used, if the program A in these programs does not
**loadall** (keyword)
> + support auto-attachi, will skip program A(do no operation on
auto-attach
> + program A), print a info message such as "Program A does not
> + support autoattach", and continue to autoattach the next program.
continue to auto-attach
> +
> Note: *PATH* must be located in *bpffs* mount. It must not
> contain a dot character ('.'), which is reserved for future
> extensions of *bpffs*.
Powered by blists - more mailing lists