<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/bpf/bpftool/Documentation, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=master</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2026-04-12T19:42:38Z</updated>
<entry>
<title>bpftool: add missing fsession to the usage and docs of bpftool</title>
<updated>2026-04-12T19:42:38Z</updated>
<author>
<name>Menglong Dong</name>
<email>menglong8.dong@gmail.com</email>
</author>
<published>2026-04-12T06:03:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0e16ac716186086478836758dfb5c5df62520db'/>
<id>urn:sha1:f0e16ac716186086478836758dfb5c5df62520db</id>
<content type='text'>
Add the fsession attach type to the usage of bpftool in do_help().
Meanwhile, add it to the bash-completion and bpftool-prog.rst too.

Acked-by: Leon Hwang &lt;leon.hwang@linux.dev&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Signed-off-by: Menglong Dong &lt;dongml2@chinatelecom.cn&gt;
Link: https://lore.kernel.org/r/20260412060346.142007-4-dongml2@chinatelecom.cn
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Support merging multiple module BTFs in btf dump</title>
<updated>2026-03-05T23:03:02Z</updated>
<author>
<name>Josef Bacik</name>
<email>josef@toxicpanda.com</email>
</author>
<published>2026-03-04T20:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d8d5c0151148b0194e8bbba66eb56d4d9cab94cd'/>
<id>urn:sha1:d8d5c0151148b0194e8bbba66eb56d4d9cab94cd</id>
<content type='text'>
Add support for specifying multiple file sources in 'bpftool btf dump'
to generate a single C header containing types from vmlinux plus
multiple kernel modules:

  bpftool btf dump file /sys/kernel/btf/mod1 file /sys/kernel/btf/mod2 format c

This is useful for BPF programs that need to access types defined in
kernel modules. Previously this required a separate bpftool invocation
for each module, producing separate headers that could not be combined
due to overlapping vmlinux type definitions.

The implementation collects all file paths, then for the multi-file
case creates an empty split BTF on the vmlinux base and iteratively
merges each module's types into it via btf__add_btf(). The single-file
code path is preserved exactly to avoid any regression risk.

Auto-detection of vmlinux as the base BTF from sysfs paths works as
before. If vmlinux itself appears in the file list it is skipped with
a warning since its types are already provided by the base.

Assisted-by: Claude:claude-opus-4-6

Signed-off-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Link: https://lore.kernel.org/bpf/b19c2760ffe48cec546dd3810d237f8cad20d606.1772657690.git.josef@toxicpanda.com
</content>
</entry>
<entry>
<title>bpftool: Add 'prepend' option for tcx attach to insert at chain start</title>
<updated>2026-01-16T22:51:23Z</updated>
<author>
<name>Gyutae Bae</name>
<email>gyutae.bae@navercorp.com</email>
</author>
<published>2026-01-12T03:45:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=999b2395e3c32273dec98f811f0ab5c8a7441850'/>
<id>urn:sha1:999b2395e3c32273dec98f811f0ab5c8a7441850</id>
<content type='text'>
Add support for the 'prepend' option when attaching tcx_ingress and
tcx_egress programs. This option allows inserting a BPF program at
the beginning of the TCX chain instead of appending it at the end.

The implementation uses BPF_F_BEFORE flag which automatically inserts
the program at the beginning of the chain when no relative reference
is specified.

This change includes:
- Modify do_attach_tcx() to support prepend insertion using BPF_F_BEFORE
- Update documentation to describe the new 'prepend' option
- Add bash completion support for the 'prepend' option on tcx attach types
- Add example usage in the documentation
- Add validation to reject 'overwrite' for non-XDP attach types

The 'prepend' option is only valid for tcx_ingress and tcx_egress attach
types. For XDP attach types, the existing 'overwrite' option remains
available.

Example usage:
  # bpftool net attach tcx_ingress name tc_prog dev lo prepend

This feature is useful when the order of program execution in the TCX
chain matters and users need to ensure certain programs run first.

Co-developed-by: Siwan Kim &lt;siwan.kim@navercorp.com&gt;
Signed-off-by: Siwan Kim &lt;siwan.kim@navercorp.com&gt;
Signed-off-by: Gyutae Bae &lt;gyutae.bae@navercorp.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20260112034516.22723-1-gyutae.opensource@navercorp.com
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after 6.18-rc5+</title>
<updated>2025-11-15T01:43:41Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@kernel.org</email>
</author>
<published>2025-11-15T01:43:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e47b68bda4de6a848a8b6c79316542326a8fb3ca'/>
<id>urn:sha1:e47b68bda4de6a848a8b6c79316542326a8fb3ca</id>
<content type='text'>
Cross-merge BPF and other fixes after downstream PR.

Minor conflict in kernel/bpf/helpers.c

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Recognize insn_array map type</title>
<updated>2025-11-06T01:31:25Z</updated>
<author>
<name>Anton Protopopov</name>
<email>a.s.protopopov@gmail.com</email>
</author>
<published>2025-11-05T09:04:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18a187bf258421b3d7c0ba32b2e1fde2fdf0f112'/>
<id>urn:sha1:18a187bf258421b3d7c0ba32b2e1fde2fdf0f112</id>
<content type='text'>
Teach bpftool to recognize instruction array map type.

Signed-off-by: Anton Protopopov &lt;a.s.protopopov@gmail.com&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/r/20251105090410.1250500-3-a.s.protopopov@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf: add _impl suffix for bpf_stream_vprintk() kfunc</title>
<updated>2025-11-05T01:50:25Z</updated>
<author>
<name>Mykyta Yatsenko</name>
<email>yatsenko@meta.com</email>
</author>
<published>2025-11-04T22:54:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=137cc92ffe2e71705fce112656a460d924934ebe'/>
<id>urn:sha1:137cc92ffe2e71705fce112656a460d924934ebe</id>
<content type='text'>
Rename bpf_stream_vprintk() to bpf_stream_vprintk_impl().

This makes bpf_stream_vprintk() follow the already established "_impl"
suffix-based naming convention for kfuncs with the bpf_prog_aux
argument provided by the verifier implicitly. This convention will be
taken advantage of with the upcoming KF_IMPLICIT_ARGS feature to
preserve backwards compatibility to BPF programs.

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Link: https://lore.kernel.org/r/20251104-implv2-v3-2-4772b9ae0e06@meta.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Ihor Solodrai &lt;ihor.solodrai@linux.dev&gt;
</content>
</entry>
<entry>
<title>bpftool: Add support for signing BPF programs</title>
<updated>2025-09-23T02:17:55Z</updated>
<author>
<name>KP Singh</name>
<email>kpsingh@kernel.org</email>
</author>
<published>2025-09-21T16:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40863f4d6ef2c34bb00dd1070dfaf9d5f27a497e'/>
<id>urn:sha1:40863f4d6ef2c34bb00dd1070dfaf9d5f27a497e</id>
<content type='text'>
Two modes of operation being added:

Add two modes of operation:

* For prog load, allow signing a program immediately before loading. This
  is essential for command-line testing and administration.

      bpftool prog load -S -k &lt;private_key&gt; -i &lt;identity_cert&gt; fentry_test.bpf.o

* For gen skeleton, embed a pre-generated signature into the C skeleton
  file. This supports the use of signed programs in compiled applications.

      bpftool gen skeleton -S -k &lt;private_key&gt; -i &lt;identity_cert&gt; fentry_test.bpf.o

Generation of the loader program and its metadata map is implemented in
libbpf (bpf_obj__gen_loader). bpftool generates a skeleton that loads
the program and automates the required steps: freezing the map, creating
an exclusive map, loading, and running. Users can use standard libbpf
APIs directly or integrate loader program generation into their own
toolchains.

Signed-off-by: KP Singh &lt;kpsingh@kernel.org&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/r/20250921160120.9711-5-kpsingh@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Add bpftool-token manpage</title>
<updated>2025-08-02T01:03:23Z</updated>
<author>
<name>Tao Chen</name>
<email>chen.dylane@linux.dev</email>
</author>
<published>2025-07-23T14:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b7f6400849162b918020c5d10d5b7f378afbf470'/>
<id>urn:sha1:b7f6400849162b918020c5d10d5b7f378afbf470</id>
<content type='text'>
Add bpftool-token manpage with information and examples of token-related
commands.

Suggested-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Signed-off-by: Tao Chen &lt;chen.dylane@linux.dev&gt;
Link: https://lore.kernel.org/r/20250723144442.1427943-2-chen.dylane@linux.dev
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Add support for dumping streams</title>
<updated>2025-07-04T02:30:07Z</updated>
<author>
<name>Kumar Kartikeya Dwivedi</name>
<email>memxor@gmail.com</email>
</author>
<published>2025-07-03T20:48:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=876f5ebd58a9ac42f48a7ead3d5b274a314e0ace'/>
<id>urn:sha1:876f5ebd58a9ac42f48a7ead3d5b274a314e0ace</id>
<content type='text'>
Add support for printing the BPF stream contents of a program in
bpftool. The new bpftool prog tracelog command is extended to take
stdout and stderr arguments, and then the prog specification.

The bpf_prog_stream_read() API added in previous patch is simply reused
to grab data and then it is dumped to the respective file. The stdout
data is sent to stdout, and stderr is printed to stderr.

Cc: Quentin Monnet &lt;qmo@kernel.org&gt;
Signed-off-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Link: https://lore.kernel.org/r/20250703204818.925464-12-memxor@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Add support for custom BTF path in prog load/loadall</title>
<updated>2025-05-27T17:31:20Z</updated>
<author>
<name>Jiayuan Chen</name>
<email>jiayuan.chen@linux.dev</email>
</author>
<published>2025-05-16T14:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1ae7a84ed85317b12a3395470f0cfcc900b2a61a'/>
<id>urn:sha1:1ae7a84ed85317b12a3395470f0cfcc900b2a61a</id>
<content type='text'>
This patch exposes the btf_custom_path feature to bpftool, allowing users
to specify a custom BTF file when loading BPF programs using prog load or
prog loadall commands.

The argument 'btf_custom_path' in libbpf is used for those kernels that
don't have CONFIG_DEBUG_INFO_BTF enabled but still want to perform CO-RE
relocations.

Suggested-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Signed-off-by: Jiayuan Chen &lt;jiayuan.chen@linux.dev&gt;
Link: https://lore.kernel.org/r/20250516144708.298652-1-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
