mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-09 19:39:56 +00:00
commit986dec18bbupstream. Mixed indentation levels in the lists of options in bpftool's documentation produces some unexpected results. For the "bpftool" man page, it prints a warning: $ make -C bpftool.8 GEN bpftool.8 <stdin>:26: (ERROR/3) Unexpected indentation. For other pages, there is no warning, but it results in a line break appearing in the option lists in the generated man pages. RST paragraphs should have a uniform indentation level. Let's fix it. Fixes:c07ba629df("tools: bpftool: Update and synchronise option list in doc and help msg") Fixes:8cc8c6357c("tools: bpftool: Document and add bash completion for -L, -B options") Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20211110114632.24537-5-quentin@isovalent.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
110 lines
2.8 KiB
ReStructuredText
110 lines
2.8 KiB
ReStructuredText
================
|
|
bpftool-link
|
|
================
|
|
-------------------------------------------------------------------------------
|
|
tool for inspection and simple manipulation of eBPF links
|
|
-------------------------------------------------------------------------------
|
|
|
|
:Manual section: 8
|
|
|
|
SYNOPSIS
|
|
========
|
|
|
|
**bpftool** [*OPTIONS*] **link** *COMMAND*
|
|
|
|
*OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } |
|
|
{ **-f** | **--bpffs** } | { **-n** | **--nomount** } }
|
|
|
|
*COMMANDS* := { **show** | **list** | **pin** | **help** }
|
|
|
|
LINK COMMANDS
|
|
=============
|
|
|
|
| **bpftool** **link { show | list }** [*LINK*]
|
|
| **bpftool** **link pin** *LINK* *FILE*
|
|
| **bpftool** **link detach** *LINK*
|
|
| **bpftool** **link help**
|
|
|
|
|
| *LINK* := { **id** *LINK_ID* | **pinned** *FILE* }
|
|
|
|
|
|
DESCRIPTION
|
|
===========
|
|
**bpftool link { show | list }** [*LINK*]
|
|
Show information about active links. If *LINK* is
|
|
specified show information only about given link,
|
|
otherwise list all links currently active on the system.
|
|
|
|
Output will start with link ID followed by link type and
|
|
zero or more named attributes, some of which depend on type
|
|
of link.
|
|
|
|
Since Linux 5.8 bpftool is able to discover information about
|
|
processes that hold open file descriptors (FDs) against BPF
|
|
links. On such kernels bpftool will automatically emit this
|
|
information as well.
|
|
|
|
**bpftool link pin** *LINK* *FILE*
|
|
Pin link *LINK* as *FILE*.
|
|
|
|
Note: *FILE* must be located in *bpffs* mount. It must not
|
|
contain a dot character ('.'), which is reserved for future
|
|
extensions of *bpffs*.
|
|
|
|
**bpftool link detach** *LINK*
|
|
Force-detach link *LINK*. BPF link and its underlying BPF
|
|
program will stay valid, but they will be detached from the
|
|
respective BPF hook and BPF link will transition into
|
|
a defunct state until last open file descriptor for that
|
|
link is closed.
|
|
|
|
**bpftool link help**
|
|
Print short help message.
|
|
|
|
OPTIONS
|
|
=======
|
|
.. include:: common_options.rst
|
|
|
|
-f, --bpffs
|
|
When showing BPF links, show file names of pinned
|
|
links.
|
|
|
|
-n, --nomount
|
|
Do not automatically attempt to mount any virtual file system
|
|
(such as tracefs or BPF virtual file system) when necessary.
|
|
|
|
EXAMPLES
|
|
========
|
|
**# bpftool link show**
|
|
|
|
::
|
|
|
|
10: cgroup prog 25
|
|
cgroup_id 614 attach_type egress
|
|
pids test_progs(223)
|
|
|
|
**# bpftool --json --pretty link show**
|
|
|
|
::
|
|
|
|
[{
|
|
"type": "cgroup",
|
|
"prog_id": 25,
|
|
"cgroup_id": 614,
|
|
"attach_type": "egress",
|
|
"pids": [{
|
|
"pid": 223,
|
|
"comm": "test_progs"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
|
|
|
| **# bpftool link pin id 10 /sys/fs/bpf/link**
|
|
| **# ls -l /sys/fs/bpf/**
|
|
|
|
::
|
|
|
|
-rw------- 1 root root 0 Apr 23 21:39 link
|