hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst
....@@ -17,11 +17,11 @@
1717 *COMMANDS* :=
1818 { **show** | **list** | **tree** | **attach** | **detach** | **help** }
1919
20
-MAP COMMANDS
21
-=============
20
+CGROUP COMMANDS
21
+===============
2222
23
-| **bpftool** **cgroup { show | list }** *CGROUP*
24
-| **bpftool** **cgroup tree** [*CGROUP_ROOT*]
23
+| **bpftool** **cgroup** { **show** | **list** } *CGROUP* [**effective**]
24
+| **bpftool** **cgroup tree** [*CGROUP_ROOT*] [**effective**]
2525 | **bpftool** **cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
2626 | **bpftool** **cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
2727 | **bpftool** **cgroup help**
....@@ -29,18 +29,24 @@
2929 | *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* }
3030 | *ATTACH_TYPE* := { **ingress** | **egress** | **sock_create** | **sock_ops** | **device** |
3131 | **bind4** | **bind6** | **post_bind4** | **post_bind6** | **connect4** | **connect6** |
32
-| **sendmsg4** | **sendmsg6** }
32
+| **getpeername4** | **getpeername6** | **getsockname4** | **getsockname6** | **sendmsg4** |
33
+| **sendmsg6** | **recvmsg4** | **recvmsg6** | **sysctl** | **getsockopt** | **setsockopt** |
34
+| **sock_release** }
3335 | *ATTACH_FLAGS* := { **multi** | **override** }
3436
3537 DESCRIPTION
3638 ===========
37
- **bpftool cgroup { show | list }** *CGROUP*
39
+ **bpftool cgroup { show | list }** *CGROUP* [**effective**]
3840 List all programs attached to the cgroup *CGROUP*.
3941
4042 Output will start with program ID followed by attach type,
4143 attach flags and program name.
4244
43
- **bpftool cgroup tree** [*CGROUP_ROOT*]
45
+ If **effective** is specified retrieve effective programs that
46
+ will execute for events within a cgroup. This includes
47
+ inherited along with attached ones.
48
+
49
+ **bpftool cgroup tree** [*CGROUP_ROOT*] [**effective**]
4450 Iterate over all cgroups in *CGROUP_ROOT* and list all
4551 attached programs. If *CGROUP_ROOT* is not specified,
4652 bpftool uses cgroup v2 mountpoint.
....@@ -48,6 +54,10 @@
4854 The output is similar to the output of cgroup show/list
4955 commands: it starts with absolute cgroup path, followed by
5056 program ID, attach type, attach flags and program name.
57
+
58
+ If **effective** is specified retrieve effective programs that
59
+ will execute for events within a cgroup. This includes
60
+ inherited along with attached ones.
5161
5262 **bpftool cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
5363 Attach program *PROG* to the cgroup *CGROUP* with attach type
....@@ -85,7 +95,19 @@
8595 **sendmsg4** call to sendto(2), sendmsg(2), sendmmsg(2) for an
8696 unconnected udp4 socket (since 4.18);
8797 **sendmsg6** call to sendto(2), sendmsg(2), sendmmsg(2) for an
88
- unconnected udp6 socket (since 4.18).
98
+ unconnected udp6 socket (since 4.18);
99
+ **recvmsg4** call to recvfrom(2), recvmsg(2), recvmmsg(2) for
100
+ an unconnected udp4 socket (since 5.2);
101
+ **recvmsg6** call to recvfrom(2), recvmsg(2), recvmmsg(2) for
102
+ an unconnected udp6 socket (since 5.2);
103
+ **sysctl** sysctl access (since 5.2);
104
+ **getsockopt** call to getsockopt (since 5.3);
105
+ **setsockopt** call to setsockopt (since 5.3);
106
+ **getpeername4** call to getpeername(2) for an inet4 socket (since 5.8);
107
+ **getpeername6** call to getpeername(2) for an inet6 socket (since 5.8);
108
+ **getsockname4** call to getsockname(2) for an inet4 socket (since 5.8);
109
+ **getsockname6** call to getsockname(2) for an inet6 socket (since 5.8).
110
+ **sock_release** closing an userspace inet socket (since 5.9).
89111
90112 **bpftool cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
91113 Detach *PROG* from the cgroup *CGROUP* and attach type
....@@ -96,18 +118,7 @@
96118
97119 OPTIONS
98120 =======
99
- -h, --help
100
- Print short generic help message (similar to **bpftool help**).
101
-
102
- -v, --version
103
- Print version number (similar to **bpftool version**).
104
-
105
- -j, --json
106
- Generate JSON output. For commands that cannot produce JSON, this
107
- option has no effect.
108
-
109
- -p, --pretty
110
- Generate human-readable JSON output. Implies **-j**.
121
+ .. include:: common_options.rst
111122
112123 -f, --bpffs
113124 Show file names of pinned programs.
....@@ -134,7 +145,3 @@
134145 ::
135146
136147 ID AttachType AttachFlags Name
137
-
138
-SEE ALSO
139
-========
140
- **bpftool**\ (8), **bpftool-prog**\ (8), **bpftool-map**\ (8)