<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/bpf/bpftool/Documentation, branch linux-5.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-25T14:18:32Z</updated>
<entry>
<title>bpftool: Add sock_release help info for cgroup attach/prog load command</title>
<updated>2021-05-25T14:18:32Z</updated>
<author>
<name>Liu Jian</name>
</author>
<published>2021-05-25T01:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8deba8547e39f26440101164a3bbc2899c5b305'/>
<id>urn:sha1:a8deba8547e39f26440101164a3bbc2899c5b305</id>
<content type='text'>
The help information was not added at the time when the function got added.
Fix this and add the missing information to its cli, documentation and bash
completion.

Fixes: db94cc0b4805 ("bpftool: Add support for BPF_CGROUP_INET_SOCK_RELEASE")
Signed-off-by: Liu Jian &lt;liujian56@huawei.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20210525014139.323859-1-liujian56@huawei.com
</content>
</entry>
<entry>
<title>bpftool: Add `gen object` command to perform BPF static linking</title>
<updated>2021-03-18T23:14:23Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-03-18T19:40:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d80b2fcbe0a023619e0fc73112f2a02c2662f6ab'/>
<id>urn:sha1:d80b2fcbe0a023619e0fc73112f2a02c2662f6ab</id>
<content type='text'>
Add `bpftool gen object &lt;output-file&gt; &lt;input_file&gt;...` command to statically
link multiple BPF ELF object files into a single output BPF ELF object file.

This patch also updates bash completions and man page. Man page gets a short
section on `gen object` command, but also updates the skeleton example to show
off workflow for BPF application with two .bpf.c files, compiled individually
with Clang, then resulting object files are linked together with `gen object`,
and then final object file is used to generate usable BPF skeleton. This
should help new users understand realistic workflow w.r.t. compiling
mutli-file BPF application.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20210318194036.3521577-10-andrii@kernel.org
</content>
</entry>
<entry>
<title>bpftool: Add ability to specify custom skeleton object name</title>
<updated>2021-03-18T23:14:23Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-03-18T19:40:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c41226654550b0a8aa75e91ce0a1cdb6ce2316ee'/>
<id>urn:sha1:c41226654550b0a8aa75e91ce0a1cdb6ce2316ee</id>
<content type='text'>
Add optional name OBJECT_NAME parameter to `gen skeleton` command to override
default object name, normally derived from input file name. This allows much
more flexibility during build time.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210318194036.3521577-9-andrii@kernel.org
</content>
</entry>
<entry>
<title>tools/bpf: Remove bpf-helpers from bpftool docs</title>
<updated>2021-03-05T02:39:45Z</updated>
<author>
<name>Joe Stringer</name>
</author>
<published>2021-03-02T17:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a01d935b2e0916d32cb567f90c32a0c4eb46993c'/>
<id>urn:sha1:a01d935b2e0916d32cb567f90c32a0c4eb46993c</id>
<content type='text'>
This logic is used for validating the manual pages from selftests, so
move the infra under tools/testing/selftests/bpf/ and rely on selftests
for validation rather than tying it into the bpftool build.

Signed-off-by: Joe Stringer &lt;joe@cilium.io&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20210302171947.2268128-12-joe@cilium.io
</content>
</entry>
<entry>
<title>bpftool: Add support for task local storage</title>
<updated>2020-11-06T16:08:37Z</updated>
<author>
<name>KP Singh</name>
</author>
<published>2020-11-06T10:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=864ab0616dccf14e51618a24acc7cf23ddd2b98a'/>
<id>urn:sha1:864ab0616dccf14e51618a24acc7cf23ddd2b98a</id>
<content type='text'>
Updates the binary to handle the BPF_MAP_TYPE_TASK_STORAGE as
"task_storage" for printing and parsing. Also updates the documentation
and bash completion

Signed-off-by: KP Singh &lt;kpsingh@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/20201106103747.2780972-5-kpsingh@chromium.org
</content>
</entry>
<entry>
<title>bpftool: Fix build failure</title>
<updated>2020-09-15T01:47:57Z</updated>
<author>
<name>Yonghong Song</name>
</author>
<published>2020-09-14T18:31:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63bea244fee23f31a4379769ef09e30365bb74b7'/>
<id>urn:sha1:63bea244fee23f31a4379769ef09e30365bb74b7</id>
<content type='text'>
When building bpf selftests like
  make -C tools/testing/selftests/bpf -j20
I hit the following errors:
  ...
  GEN      /net-next/tools/testing/selftests/bpf/tools/build/bpftool/Documentation/bpftool-gen.8
  &lt;stdin&gt;:75: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:71: (WARNING/2) Literal block ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:85: (WARNING/2) Literal block ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:57: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:66: (WARNING/2) Literal block ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:109: (WARNING/2) Literal block ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:175: (WARNING/2) Literal block ends without a blank line; unexpected unindent.
  &lt;stdin&gt;:273: (WARNING/2) Literal block ends without a blank line; unexpected unindent.
  make[1]: *** [/net-next/tools/testing/selftests/bpf/tools/build/bpftool/Documentation/bpftool-perf.8] Error 12
  make[1]: *** Waiting for unfinished jobs....
  make[1]: *** [/net-next/tools/testing/selftests/bpf/tools/build/bpftool/Documentation/bpftool-iter.8] Error 12
  make[1]: *** [/net-next/tools/testing/selftests/bpf/tools/build/bpftool/Documentation/bpftool-struct_ops.8] Error 12
  ...

I am using:
  -bash-4.4$ rst2man --version
  rst2man (Docutils 0.11 [repository], Python 2.7.5, on linux2)
  -bash-4.4$

The Makefile generated final .rst file (e.g., bpftool-cgroup.rst) looks like
  ...
      ID       AttachType      AttachFlags     Name
  \n SEE ALSO\n========\n\t**bpf**\ (2),\n\t**bpf-helpers**\
  (7),\n\t**bpftool**\ (8),\n\t**bpftool-btf**\
  (8),\n\t**bpftool-feature**\ (8),\n\t**bpftool-gen**\
  (8),\n\t**bpftool-iter**\ (8),\n\t**bpftool-link**\
  (8),\n\t**bpftool-map**\ (8),\n\t**bpftool-net**\
  (8),\n\t**bpftool-perf**\ (8),\n\t**bpftool-prog**\
  (8),\n\t**bpftool-struct_ops**\ (8)\n

The rst2man generated .8 file looks like
Literal block ends without a blank line; unexpected unindent.
 .sp
 n SEEALSOn========nt**bpf**(2),nt**bpf\-helpers**(7),nt**bpftool**(8),nt**bpftool\-btf**(8),nt**
 bpftool\-feature**(8),nt**bpftool\-gen**(8),nt**bpftool\-iter**(8),nt**bpftool\-link**(8),nt**
 bpftool\-map**(8),nt**bpftool\-net**(8),nt**bpftool\-perf**(8),nt**bpftool\-prog**(8),nt**
 bpftool\-struct_ops**(8)n

Looks like that particular version of rst2man prefers to have actual new line
instead of \n.

Since `echo -e` may not be available in some environment, let us use `printf`.
Format string "%b" is used for `printf` to ensure all escape characters are
interpretted properly.

Fixes: 18841da98100 ("tools: bpftool: Automate generation for "SEE ALSO" sections in man pages")
Suggested-by: Andrii Nakryiko &lt;andrii.nakryiko@gmail.com&gt;
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Cc: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20200914183110.999906-1-yhs@fb.com
</content>
</entry>
<entry>
<title>tools: bpftool: Automate generation for "SEE ALSO" sections in man pages</title>
<updated>2020-09-11T03:10:45Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2020-09-10T20:39:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18841da98100c936990ac9013d55bf6b40e1f609'/>
<id>urn:sha1:18841da98100c936990ac9013d55bf6b40e1f609</id>
<content type='text'>
The "SEE ALSO" sections of bpftool's manual pages refer to bpf(2),
bpf-helpers(7), then all existing bpftool man pages (save the current
one).

This leads to nearly-identical lists being duplicated in all manual
pages. Ideally, when a new page is created, all lists should be updated
accordingly, but this has led to omissions and inconsistencies multiple
times in the past.

Let's take it out of the RST files and generate the "SEE ALSO" sections
automatically in the Makefile when generating the man pages. The lists
are not really useful in the RST anyway because all other pages are
available in the same directory.

v3:
- Fix conflict with a previous patchset that introduced RST2MAN_OPTS
  variable passed to rst2man.

v2:
- Use "echo -n" instead of "printf" in Makefile, to avoid any risk of
  passing a format string directly to the command.

Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200910203935.25304-1-quentin@isovalent.com
</content>
</entry>
<entry>
<title>tools: bpftool: Add "inner_map" to "bpftool map create" outer maps</title>
<updated>2020-09-11T00:29:21Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2020-09-10T10:26:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3b9626f09d429788d929c9b9000a069fcfc056e'/>
<id>urn:sha1:e3b9626f09d429788d929c9b9000a069fcfc056e</id>
<content type='text'>
There is no support for creating maps of types array-of-map or
hash-of-map in bpftool. This is because the kernel needs an inner_map_fd
to collect metadata on the inner maps to be supported by the new map,
but bpftool does not provide a way to pass this file descriptor.

Add a new optional "inner_map" keyword that can be used to pass a
reference to a map, retrieve a fd to that map, and pass it as the
inner_map_fd.

Add related documentation and bash completion. Note that we can
reference the inner map by its name, meaning we can have several times
the keyword "name" with different meanings (mandatory outer map name,
and possibly a name to use to find the inner_map_fd). The bash
completion will offer it just once, and will not suggest "name" on the
following command:

    # bpftool map create /sys/fs/bpf/my_outer_map type hash_of_maps \
        inner_map name my_inner_map [TAB]

Fixing that specific case seems too convoluted. Completion will work as
expected, however, if the outer map name comes first and the "inner_map
name ..." is passed second.

Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200910102652.10509-4-quentin@isovalent.com
</content>
</entry>
<entry>
<title>tools: bpftool: Include common options from separate file</title>
<updated>2020-09-10T18:16:46Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2020-09-09T16:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f28ef96d7b04a76575a020a9da4f92358abe68c6'/>
<id>urn:sha1:f28ef96d7b04a76575a020a9da4f92358abe68c6</id>
<content type='text'>
Nearly all man pages for bpftool have the same common set of option
flags (--help, --version, --json, --pretty, --debug). The description is
duplicated across all the pages, which is more difficult to maintain if
the description of an option changes. It may also be confusing to sort
out what options are not "common" and should not be copied when creating
new manual pages.

Let's move the description for those common options to a separate file,
which is included with a RST directive when generating the man pages.

Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200909162500.17010-3-quentin@isovalent.com
</content>
</entry>
<entry>
<title>tools: bpftool: Print optional built-in features along with version</title>
<updated>2020-09-10T18:16:46Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2020-09-09T16:24:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82b8cf0acc7bfe7b247e5ddc4417f6146d74c0b8'/>
<id>urn:sha1:82b8cf0acc7bfe7b247e5ddc4417f6146d74c0b8</id>
<content type='text'>
Bpftool has a number of features that can be included or left aside
during compilation. This includes:

- Support for libbfd, providing the disassembler for JIT-compiled
  programs.
- Support for BPF skeletons, used for profiling programs or iterating on
  the PIDs of processes associated with BPF objects.

In order to make it easy for users to understand what features were
compiled for a given bpftool binary, print the status of the two
features above when showing the version number for bpftool ("bpftool -V"
or "bpftool version"). Document this in the main manual page. Example
invocations:

    $ bpftool version
    ./bpftool v5.9.0-rc1
    features: libbfd, skeletons

    $ bpftool -p version
    {
        "version": "5.9.0-rc1",
        "features": {
            "libbfd": true,
            "skeletons": true
        }
    }

Some other parameters are optional at compilation
("DISASM_FOUR_ARGS_SIGNATURE", LIBCAP support) but they do not impact
significantly bpftool's behaviour from a user's point of view, so their
status is not reported.

Available commands and supported program types depend on the version
number, and are therefore not reported either. Note that they are
already available, albeit without JSON, via bpftool's help messages.

v3:
- Use a simple list instead of boolean values for plain output.

v2:
- Fix JSON (object instead or array for the features).

Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200909162500.17010-2-quentin@isovalent.com
</content>
</entry>
</feed>
