aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/Documentation/bpftool-prog.rst
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-06-19 16:17:03 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-06-22 17:01:49 -0700
commit075c776658190681d2bf9997306f871d6c8a9b36 (patch)
tree4f2cf6abf36ea9c8a85be8b1164976ca5320ae0e /tools/bpf/bpftool/Documentation/bpftool-prog.rst
parenttools/bpftool: Show info for processes holding BPF map/prog/link/btf FDs (diff)
downloadlinux-dev-075c776658190681d2bf9997306f871d6c8a9b36.tar.xz
linux-dev-075c776658190681d2bf9997306f871d6c8a9b36.zip
tools/bpftool: Add documentation and sample output for process info
Add statements about bpftool being able to discover process info, holding reference to BPF map, prog, link, or BTF. Show example output as well. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20200619231703.738941-10-andriin@fb.com
Diffstat (limited to '')
-rw-r--r--tools/bpf/bpftool/Documentation/bpftool-prog.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
index 2b254959d488..412ea3d9bf7f 100644
--- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
@@ -75,6 +75,11 @@ DESCRIPTION
program run. Activation or deactivation of the feature is
performed via the **kernel.bpf_stats_enabled** sysctl knob.
+ Since Linux 5.8 bpftool is able to discover information about
+ processes that hold open file descriptors (FDs) against BPF
+ programs. On such kernels bpftool will automatically emit this
+ information as well.
+
**bpftool prog dump xlated** *PROG* [{ **file** *FILE* | **opcodes** | **visual** | **linum** }]
Dump eBPF instructions of the programs from the kernel. By
default, eBPF will be disassembled and printed to standard
@@ -243,6 +248,7 @@ EXAMPLES
10: xdp name some_prog tag 005a3d2123620c8b gpl run_time_ns 81632 run_cnt 10
loaded_at 2017-09-29T20:11:00+0000 uid 0
xlated 528B jited 370B memlock 4096B map_ids 10
+ pids systemd(1)
**# bpftool --json --pretty prog show**
@@ -262,6 +268,11 @@ EXAMPLES
"bytes_jited": 370,
"bytes_memlock": 4096,
"map_ids": [10
+ ],
+ "pids": [{
+ "pid": 1,
+ "comm": "systemd"
+ }
]
}
]