Loading...
1.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2
3==================
4bpftool-struct_ops
5==================
6-------------------------------------------------------------------------------
7tool to register/unregister/introspect BPF struct_ops
8-------------------------------------------------------------------------------
9
10:Manual section: 8
11
12.. include:: substitutions.rst
13
14SYNOPSIS
15========
16
17**bpftool** [*OPTIONS*] **struct_ops** *COMMAND*
18
19*OPTIONS* := { |COMMON_OPTIONS| }
20
21*COMMANDS* :=
22{ **show** | **list** | **dump** | **register** | **unregister** | **help** }
23
24STRUCT_OPS COMMANDS
25===================
26
27| **bpftool** **struct_ops { show | list }** [*STRUCT_OPS_MAP*]
28| **bpftool** **struct_ops dump** [*STRUCT_OPS_MAP*]
29| **bpftool** **struct_ops register** *OBJ* [*LINK_DIR*]
30| **bpftool** **struct_ops unregister** *STRUCT_OPS_MAP*
31| **bpftool** **struct_ops help**
32|
33| *STRUCT_OPS_MAP* := { **id** *STRUCT_OPS_MAP_ID* | **name** *STRUCT_OPS_MAP_NAME* }
34| *OBJ* := /a/file/of/bpf_struct_ops.o
35
36
37DESCRIPTION
38===========
39bpftool struct_ops { show | list } [*STRUCT_OPS_MAP*]
40 Show brief information about the struct_ops in the system. If
41 *STRUCT_OPS_MAP* is specified, it shows information only for the given
42 struct_ops. Otherwise, it lists all struct_ops currently existing in the
43 system.
44
45 Output will start with struct_ops map ID, followed by its map name and its
46 struct_ops's kernel type.
47
48bpftool struct_ops dump [*STRUCT_OPS_MAP*]
49 Dump details information about the struct_ops in the system. If
50 *STRUCT_OPS_MAP* is specified, it dumps information only for the given
51 struct_ops. Otherwise, it dumps all struct_ops currently existing in the
52 system.
53
54bpftool struct_ops register *OBJ* [*LINK_DIR*]
55 Register bpf struct_ops from *OBJ*. All struct_ops under the ELF section
56 ".struct_ops" and ".struct_ops.link" will be registered to its kernel
57 subsystem. For each struct_ops in the ".struct_ops.link" section, a link
58 will be created. You can give *LINK_DIR* to provide a directory path where
59 these links will be pinned with the same name as their corresponding map
60 name.
61
62bpftool struct_ops unregister *STRUCT_OPS_MAP*
63 Unregister the *STRUCT_OPS_MAP* from the kernel subsystem.
64
65bpftool struct_ops help
66 Print short help message.
67
68OPTIONS
69=======
70.. include:: common_options.rst
71
72EXAMPLES
73========
74**# bpftool struct_ops show**
75
76::
77
78 100: dctcp tcp_congestion_ops
79 105: cubic tcp_congestion_ops
80
81**# bpftool struct_ops unregister id 105**
82
83::
84
85 Unregistered tcp_congestion_ops cubic id 105
86
87**# bpftool struct_ops register bpf_cubic.o**
88
89::
90
91 Registered tcp_congestion_ops cubic id 110
1==================
2bpftool-struct_ops
3==================
4-------------------------------------------------------------------------------
5tool to register/unregister/introspect BPF struct_ops
6-------------------------------------------------------------------------------
7
8:Manual section: 8
9
10SYNOPSIS
11========
12
13 **bpftool** [*OPTIONS*] **struct_ops** *COMMAND*
14
15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] }
16
17 *COMMANDS* :=
18 { **show** | **list** | **dump** | **register** | **unregister** | **help** }
19
20STRUCT_OPS COMMANDS
21===================
22
23| **bpftool** **struct_ops { show | list }** [*STRUCT_OPS_MAP*]
24| **bpftool** **struct_ops dump** [*STRUCT_OPS_MAP*]
25| **bpftool** **struct_ops register** *OBJ*
26| **bpftool** **struct_ops unregister** *STRUCT_OPS_MAP*
27| **bpftool** **struct_ops help**
28|
29| *STRUCT_OPS_MAP* := { **id** *STRUCT_OPS_MAP_ID* | **name** *STRUCT_OPS_MAP_NAME* }
30| *OBJ* := /a/file/of/bpf_struct_ops.o
31
32
33DESCRIPTION
34===========
35 **bpftool struct_ops { show | list }** [*STRUCT_OPS_MAP*]
36 Show brief information about the struct_ops in the system.
37 If *STRUCT_OPS_MAP* is specified, it shows information only
38 for the given struct_ops. Otherwise, it lists all struct_ops
39 currently existing in the system.
40
41 Output will start with struct_ops map ID, followed by its map
42 name and its struct_ops's kernel type.
43
44 **bpftool struct_ops dump** [*STRUCT_OPS_MAP*]
45 Dump details information about the struct_ops in the system.
46 If *STRUCT_OPS_MAP* is specified, it dumps information only
47 for the given struct_ops. Otherwise, it dumps all struct_ops
48 currently existing in the system.
49
50 **bpftool struct_ops register** *OBJ*
51 Register bpf struct_ops from *OBJ*. All struct_ops under
52 the ELF section ".struct_ops" will be registered to
53 its kernel subsystem.
54
55 **bpftool struct_ops unregister** *STRUCT_OPS_MAP*
56 Unregister the *STRUCT_OPS_MAP* from the kernel subsystem.
57
58 **bpftool struct_ops help**
59 Print short help message.
60
61OPTIONS
62=======
63 -h, --help
64 Print short generic help message (similar to **bpftool help**).
65
66 -V, --version
67 Print version number (similar to **bpftool version**).
68
69 -j, --json
70 Generate JSON output. For commands that cannot produce JSON, this
71 option has no effect.
72
73 -p, --pretty
74 Generate human-readable JSON output. Implies **-j**.
75
76 -d, --debug
77 Print all logs available, even debug-level information. This
78 includes logs from libbpf as well as from the verifier, when
79 attempting to load programs.
80
81EXAMPLES
82========
83**# bpftool struct_ops show**
84
85::
86
87 100: dctcp tcp_congestion_ops
88 105: cubic tcp_congestion_ops
89
90**# bpftool struct_ops unregister id 105**
91
92::
93
94 Unregistered tcp_congestion_ops cubic id 105
95
96**# bpftool struct_ops register bpf_cubic.o**
97
98::
99
100 Registered tcp_congestion_ops cubic id 110
101
102
103SEE ALSO
104========
105 **bpf**\ (2),
106 **bpf-helpers**\ (7),
107 **bpftool**\ (8),
108 **bpftool-btf**\ (8),
109 **bpftool-cgroup**\ (8),
110 **bpftool-feature**\ (8),
111 **bpftool-gen**\ (8),
112 **bpftool-iter**\ (8),
113 **bpftool-link**\ (8),
114 **bpftool-map**\ (8),
115 **bpftool-net**\ (8),
116 **bpftool-perf**\ (8),
117 **bpftool-prog**\ (8)