2021-11-15 22:58:42 +00:00
|
|
|
.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
|
|
|
|
2017-12-13 15:18:54 +00:00
|
|
|
================
|
|
|
|
bpftool-cgroup
|
|
|
|
================
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
tool for inspection and simple manipulation of eBPF progs
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
:Manual section: 8
|
|
|
|
|
bpftool: Update doc (use susbtitutions) and test_bpftool_synctypes.py
test_bpftool_synctypes.py helps detecting inconsistencies in bpftool
between the different list of types and options scattered in the
sources, the documentation, and the bash completion. For options that
apply to all bpftool commands, the script had a hardcoded list of
values, and would use them to check whether the man pages are
up-to-date. When writing the script, it felt acceptable to have this
list in order to avoid to open and parse bpftool's main.h every time,
and because the list of global options in bpftool doesn't change so
often.
However, this is prone to omissions, and we recently added a new
-l|--legacy option which was described in common_options.rst, but not
listed in the options summary of each manual page. The script did not
complain, because it keeps comparing the hardcoded list to the (now)
outdated list in the header file.
To address the issue, this commit brings the following changes:
- Options that are common to all bpftool commands (--json, --pretty, and
--debug) are moved to a dedicated file, and used in the definition of
a RST substitution. This substitution is used in the sources of all
the man pages.
- This list of common options is updated, with the addition of the new
-l|--legacy option.
- The script test_bpftool_synctypes.py is updated to compare:
- Options specific to a command, found in C files, for the
interactive help messages, with the same specific options from the
relevant man page for that command.
- Common options, checked just once: the list in main.h is
compared with the new list in substitutions.rst.
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211115225844.33943-3-quentin@isovalent.com
2021-11-15 22:58:43 +00:00
|
|
|
.. include:: substitutions.rst
|
|
|
|
|
2017-12-13 15:18:54 +00:00
|
|
|
SYNOPSIS
|
|
|
|
========
|
|
|
|
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
**bpftool** [*OPTIONS*] **cgroup** *COMMAND*
|
2017-12-13 15:18:54 +00:00
|
|
|
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
*OPTIONS* := { |COMMON_OPTIONS| | { **-f** | **--bpffs** } }
|
2017-12-13 15:18:54 +00:00
|
|
|
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
*COMMANDS* :=
|
|
|
|
{ **show** | **list** | **tree** | **attach** | **detach** | **help** }
|
2017-12-13 15:18:54 +00:00
|
|
|
|
2019-02-06 10:47:23 +09:00
|
|
|
CGROUP COMMANDS
|
|
|
|
===============
|
2017-12-13 15:18:54 +00:00
|
|
|
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
| **bpftool** **cgroup** { **show** | **list** } *CGROUP* [**effective**]
|
|
|
|
| **bpftool** **cgroup tree** [*CGROUP_ROOT*] [**effective**]
|
|
|
|
| **bpftool** **cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
|
|
|
|
| **bpftool** **cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
|
|
|
|
| **bpftool** **cgroup help**
|
2017-12-13 15:18:54 +00:00
|
|
|
|
|
2024-04-13 02:14:26 +01:00
|
|
|
| *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* | **name** *PROG_NAME* }
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
| *ATTACH_TYPE* := { **cgroup_inet_ingress** | **cgroup_inet_egress** |
|
|
|
|
| **cgroup_inet_sock_create** | **cgroup_sock_ops** |
|
|
|
|
| **cgroup_device** | **cgroup_inet4_bind** | **cgroup_inet6_bind** |
|
|
|
|
| **cgroup_inet4_post_bind** | **cgroup_inet6_post_bind** |
|
|
|
|
| **cgroup_inet4_connect** | **cgroup_inet6_connect** |
|
|
|
|
| **cgroup_unix_connect** | **cgroup_inet4_getpeername** |
|
|
|
|
| **cgroup_inet6_getpeername** | **cgroup_unix_getpeername** |
|
|
|
|
| **cgroup_inet4_getsockname** | **cgroup_inet6_getsockname** |
|
|
|
|
| **cgroup_unix_getsockname** | **cgroup_udp4_sendmsg** |
|
|
|
|
| **cgroup_udp6_sendmsg** | **cgroup_unix_sendmsg** |
|
|
|
|
| **cgroup_udp4_recvmsg** | **cgroup_udp6_recvmsg** |
|
|
|
|
| **cgroup_unix_recvmsg** | **cgroup_sysctl** |
|
|
|
|
| **cgroup_getsockopt** | **cgroup_setsockopt** |
|
|
|
|
| **cgroup_inet_sock_release** }
|
|
|
|
| *ATTACH_FLAGS* := { **multi** | **override** }
|
2017-12-13 15:18:54 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
===========
|
2024-03-31 21:03:45 +01:00
|
|
|
bpftool cgroup { show | list } *CGROUP* [effective]
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
List all programs attached to the cgroup *CGROUP*.
|
|
|
|
|
|
|
|
Output will start with program ID followed by attach type, attach flags and
|
|
|
|
program name.
|
|
|
|
|
|
|
|
If **effective** is specified retrieve effective programs that will execute
|
|
|
|
for events within a cgroup. This includes inherited along with attached
|
|
|
|
ones.
|
|
|
|
|
2024-03-31 21:03:45 +01:00
|
|
|
bpftool cgroup tree [*CGROUP_ROOT*] [effective]
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
Iterate over all cgroups in *CGROUP_ROOT* and list all attached programs.
|
|
|
|
If *CGROUP_ROOT* is not specified, bpftool uses cgroup v2 mountpoint.
|
|
|
|
|
|
|
|
The output is similar to the output of cgroup show/list commands: it starts
|
|
|
|
with absolute cgroup path, followed by program ID, attach type, attach
|
|
|
|
flags and program name.
|
|
|
|
|
|
|
|
If **effective** is specified retrieve effective programs that will execute
|
|
|
|
for events within a cgroup. This includes inherited along with attached
|
|
|
|
ones.
|
|
|
|
|
2024-03-31 21:03:45 +01:00
|
|
|
bpftool cgroup attach *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
Attach program *PROG* to the cgroup *CGROUP* with attach type *ATTACH_TYPE*
|
|
|
|
and optional *ATTACH_FLAGS*.
|
|
|
|
|
|
|
|
*ATTACH_FLAGS* can be one of: **override** if a sub-cgroup installs some
|
|
|
|
bpf program, the program in this cgroup yields to sub-cgroup program;
|
|
|
|
**multi** if a sub-cgroup installs some bpf program, that cgroup program
|
|
|
|
gets run in addition to the program in this cgroup.
|
|
|
|
|
|
|
|
Only one program is allowed to be attached to a cgroup with no attach flags
|
|
|
|
or the **override** flag. Attaching another program will release old
|
|
|
|
program and attach the new one.
|
|
|
|
|
|
|
|
Multiple programs are allowed to be attached to a cgroup with **multi**.
|
|
|
|
They are executed in FIFO order (those that were attached first, run
|
|
|
|
first).
|
|
|
|
|
|
|
|
Non-default *ATTACH_FLAGS* are supported by kernel version 4.14 and later.
|
|
|
|
|
2024-03-31 21:03:46 +01:00
|
|
|
*ATTACH_TYPE* can be one of:
|
|
|
|
|
|
|
|
- **ingress** ingress path of the inet socket (since 4.10)
|
|
|
|
- **egress** egress path of the inet socket (since 4.10)
|
|
|
|
- **sock_create** opening of an inet socket (since 4.10)
|
|
|
|
- **sock_ops** various socket operations (since 4.12)
|
|
|
|
- **device** device access (since 4.15)
|
|
|
|
- **bind4** call to bind(2) for an inet4 socket (since 4.17)
|
|
|
|
- **bind6** call to bind(2) for an inet6 socket (since 4.17)
|
|
|
|
- **post_bind4** return from bind(2) for an inet4 socket (since 4.17)
|
|
|
|
- **post_bind6** return from bind(2) for an inet6 socket (since 4.17)
|
|
|
|
- **connect4** call to connect(2) for an inet4 socket (since 4.17)
|
|
|
|
- **connect6** call to connect(2) for an inet6 socket (since 4.17)
|
|
|
|
- **connect_unix** call to connect(2) for a unix socket (since 6.7)
|
|
|
|
- **sendmsg4** call to sendto(2), sendmsg(2), sendmmsg(2) for an unconnected udp4 socket (since 4.18)
|
|
|
|
- **sendmsg6** call to sendto(2), sendmsg(2), sendmmsg(2) for an unconnected udp6 socket (since 4.18)
|
|
|
|
- **sendmsg_unix** call to sendto(2), sendmsg(2), sendmmsg(2) for an unconnected unix socket (since 6.7)
|
|
|
|
- **recvmsg4** call to recvfrom(2), recvmsg(2), recvmmsg(2) for an unconnected udp4 socket (since 5.2)
|
|
|
|
- **recvmsg6** call to recvfrom(2), recvmsg(2), recvmmsg(2) for an unconnected udp6 socket (since 5.2)
|
|
|
|
- **recvmsg_unix** call to recvfrom(2), recvmsg(2), recvmmsg(2) for an unconnected unix socket (since 6.7)
|
|
|
|
- **sysctl** sysctl access (since 5.2)
|
|
|
|
- **getsockopt** call to getsockopt (since 5.3)
|
|
|
|
- **setsockopt** call to setsockopt (since 5.3)
|
|
|
|
- **getpeername4** call to getpeername(2) for an inet4 socket (since 5.8)
|
|
|
|
- **getpeername6** call to getpeername(2) for an inet6 socket (since 5.8)
|
|
|
|
- **getpeername_unix** call to getpeername(2) for a unix socket (since 6.7)
|
|
|
|
- **getsockname4** call to getsockname(2) for an inet4 socket (since 5.8)
|
|
|
|
- **getsockname6** call to getsockname(2) for an inet6 socket (since 5.8)
|
|
|
|
- **getsockname_unix** call to getsockname(2) for a unix socket (since 6.7)
|
|
|
|
- **sock_release** closing a userspace inet socket (since 5.9)
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
|
2024-03-31 21:03:45 +01:00
|
|
|
bpftool cgroup detach *CGROUP* *ATTACH_TYPE* *PROG*
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
Detach *PROG* from the cgroup *CGROUP* and attach type *ATTACH_TYPE*.
|
|
|
|
|
2024-03-31 21:03:45 +01:00
|
|
|
bpftool prog help
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
Print short help message.
|
2017-12-13 15:18:54 +00:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
=======
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
.. include:: common_options.rst
|
2017-12-13 15:18:54 +00:00
|
|
|
|
bpftool: Use simpler indentation in source rST for documentation
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.
Let's fix bpftool's indentation in docs once and for all:
- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
description, and the "see also" section. As a result, all sections
start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.
There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.
[ Quentin: rebased on bpf-next, removed indent level for command
description and options, updated synopsis, command summary, and "see
also" sections. ]
Signed-off-by: Rameez Rehman <rameezrehman408@hotmail.com>
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240331200346.29118-2-qmo@kernel.org
2024-03-31 21:03:44 +01:00
|
|
|
-f, --bpffs
|
|
|
|
Show file names of pinned programs.
|
2017-12-13 15:18:54 +00:00
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
========
|
|
|
|
|
|
|
|
|
| **# mount -t bpf none /sys/fs/bpf/**
|
|
|
|
| **# mkdir /sys/fs/cgroup/test.slice**
|
|
|
|
| **# bpftool prog load ./device_cgroup.o /sys/fs/bpf/prog**
|
|
|
|
| **# bpftool cgroup attach /sys/fs/cgroup/test.slice/ device id 1 allow_multi**
|
|
|
|
|
|
|
|
**# bpftool cgroup list /sys/fs/cgroup/test.slice/**
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
ID AttachType AttachFlags Name
|
|
|
|
1 device allow_multi bpf_prog1
|
|
|
|
|
|
|
|
|
|
|
|
|
| **# bpftool cgroup detach /sys/fs/cgroup/test.slice/ device id 1**
|
|
|
|
| **# bpftool cgroup list /sys/fs/cgroup/test.slice/**
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
ID AttachType AttachFlags Name
|