Skip to content

Commit 45cea72

Browse files
ThinkerYzu1Alexei Starovoitov
authored andcommitted
bpftool: Update doc to explain struct_ops register subcommand.
The "struct_ops register" subcommand now allows for an optional *LINK_DIR* to be included. This specifies the directory path where bpftool will pin struct_ops links with the same name as their corresponding map names. Signed-off-by: Kui-Feng Lee <[email protected]> Reviewed-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 0232b78 commit 45cea72

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/bpf/bpftool/Documentation/bpftool-struct_ops.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ STRUCT_OPS COMMANDS
2626

2727
| **bpftool** **struct_ops { show | list }** [*STRUCT_OPS_MAP*]
2828
| **bpftool** **struct_ops dump** [*STRUCT_OPS_MAP*]
29-
| **bpftool** **struct_ops register** *OBJ*
29+
| **bpftool** **struct_ops register** *OBJ* [*LINK_DIR*]
3030
| **bpftool** **struct_ops unregister** *STRUCT_OPS_MAP*
3131
| **bpftool** **struct_ops help**
3232
|
@@ -51,10 +51,14 @@ DESCRIPTION
5151
for the given struct_ops. Otherwise, it dumps all struct_ops
5252
currently existing in the system.
5353

54-
**bpftool struct_ops register** *OBJ*
54+
**bpftool struct_ops register** *OBJ* [*LINK_DIR*]
5555
Register bpf struct_ops from *OBJ*. All struct_ops under
56-
the ELF section ".struct_ops" will be registered to
57-
its kernel subsystem.
56+
the ELF section ".struct_ops" and ".struct_ops.link" will
57+
be registered to its kernel subsystem. For each
58+
struct_ops in the ".struct_ops.link" section, a link
59+
will be created. You can give *LINK_DIR* to provide a
60+
directory path where these links will be pinned with the
61+
same name as their corresponding map name.
5862

5963
**bpftool struct_ops unregister** *STRUCT_OPS_MAP*
6064
Unregister the *STRUCT_OPS_MAP* from the kernel subsystem.

0 commit comments

Comments
 (0)