1BPFTOOL-STRUCT_OPS(8)                                    BPFTOOL-STRUCT_OPS(8)
2
3
4

NAME

6       bpftool-struct_ops   -   tool   to  register/unregister/introspect  BPF
7       struct_ops
8

SYNOPSIS

10          bpftool [OPTIONS] struct_ops COMMAND
11
12          OPTIONS := { { -j | --json } [{ -p | --pretty }] | { -d | --debug  }
13          | { -l | --legacy } }
14
15          COMMANDS := { show | list | dump | register | unregister | help }
16

STRUCT_OPS COMMANDS

18       bpftool struct_ops { show | list } [STRUCT_OPS_MAP]
19       bpftool struct_ops dump [STRUCT_OPS_MAP]
20       bpftool struct_ops register OBJ
21       bpftool struct_ops unregister STRUCT_OPS_MAP
22       bpftool struct_ops help
23
24       STRUCT_OPS_MAP := { id STRUCT_OPS_MAP_ID | name STRUCT_OPS_MAP_NAME }
25       OBJ := /a/file/of/bpf_struct_ops.o
26
27

DESCRIPTION

29          bpftool struct_ops { show | list } [STRUCT_OPS_MAP]
30                 Show  brief  information  about the struct_ops in the system.
31                 If STRUCT_OPS_MAP is specified, it shows information only for
32                 the  given  struct_ops.   Otherwise,  it lists all struct_ops
33                 currently existing in the system.
34
35                 Output will start with struct_ops map ID, followed by its map
36                 name and its struct_ops's kernel type.
37
38          bpftool struct_ops dump [STRUCT_OPS_MAP]
39                 Dump  details information about the struct_ops in the system.
40                 If STRUCT_OPS_MAP is specified, it dumps information only for
41                 the  given  struct_ops.   Otherwise,  it dumps all struct_ops
42                 currently existing in the system.
43
44          bpftool struct_ops register OBJ
45                 Register bpf struct_ops from OBJ.  All struct_ops  under  the
46                 ELF  section  ".struct_ops"  will be registered to its kernel
47                 subsystem.
48
49          bpftool struct_ops unregister STRUCT_OPS_MAP
50                 Unregister the STRUCT_OPS_MAP from the kernel subsystem.
51
52          bpftool struct_ops help
53                 Print short help message.
54

OPTIONS

56          -h, --help
57                 Print short help message (similar to bpftool help).
58
59          -V, --version
60                 Print bpftool's version number (similar to bpftool  version),
61                 the  number  of  the libbpf version in use, and optional fea‐
62                 tures that were included when bpftool was compiled.  Optional
63                 features include linking against libbfd to provide the disas‐
64                 sembler for JIT-ted programs (bpftool prog  dump  jited)  and
65                 usage  of BPF skeletons (some features like bpftool prog pro‐
66                 file or showing pids associated to BPF objects  may  rely  on
67                 it).
68
69          -j, --json
70                 Generate  JSON output. For commands that cannot produce JSON,
71                 this 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
81          -l, --legacy
82                 Use legacy libbpf mode which has more relaxed BPF program re‐
83                 quirements.  By default, bpftool has more strict requirements
84                 about section names, changes pinning logic and  doesn't  sup‐
85                 port some of the older non-BTF map declarations.
86
87                 See
88                 https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0
89                 for details.
90

EXAMPLES

92       # bpftool struct_ops show
93
94          100: dctcp           tcp_congestion_ops
95          105: cubic           tcp_congestion_ops
96
97       # bpftool struct_ops unregister id 105
98
99          Unregistered tcp_congestion_ops cubic id 105
100
101       # bpftool struct_ops register bpf_cubic.o
102
103          Registered tcp_congestion_ops cubic id 110
104

SEE ALSO

106          bpf(2),       bpf-helpers(7),       bpftool(8),      bpftool-btf(8),
107          bpftool-cgroup(8),        bpftool-feature(8),        bpftool-gen(8),
108          bpftool-iter(8),  bpftool-link(8),  bpftool-map(8),  bpftool-net(8),
109          bpftool-perf(8), bpftool-prog(8)
110
111
112
113
114                                                         BPFTOOL-STRUCT_OPS(8)
Impressum