<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/tools/bpf, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/tools/bpf?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/tools/bpf?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-05-13T23:07:53Z</updated>
<entry>
<title>bpftool: Use sysfs vmlinux when dumping BTF by ID</title>
<updated>2022-05-13T23:07:53Z</updated>
<author>
<name>Larysa Zaremba</name>
<email>larysa.zaremba@intel.com</email>
</author>
<published>2022-05-13T12:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=418fbe82578e2889dcc2c0ae4d367ea4e28dd05c'/>
<id>urn:sha1:418fbe82578e2889dcc2c0ae4d367ea4e28dd05c</id>
<content type='text'>
Currently, dumping almost all BTFs specified by id requires
using the -B option to pass the base BTF. For kernel module
BTFs the vmlinux BTF sysfs path should work.

This patch simplifies dumping by ID usage by loading
vmlinux BTF from sysfs as base, if base BTF was not specified
and the ID corresponds to a kernel module BTF.

Signed-off-by: Larysa Zaremba &lt;larysa.zaremba@intel.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Alexander Lobakin &lt;alexandr.lobakin@intel.com&gt;
Link: https://lore.kernel.org/bpf/20220513121743.12411-1-larysa.zaremba@intel.com
</content>
</entry>
<entry>
<title>bpf, x86: Generate trampolines from bpf_tramp_links</title>
<updated>2022-05-11T00:50:40Z</updated>
<author>
<name>Kui-Feng Lee</name>
<email>kuifeng@fb.com</email>
</author>
<published>2022-05-10T20:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f7e0beaf39d3868dc700d4954b26cf8443c5d423'/>
<id>urn:sha1:f7e0beaf39d3868dc700d4954b26cf8443c5d423</id>
<content type='text'>
Replace struct bpf_tramp_progs with struct bpf_tramp_links to collect
struct bpf_tramp_link(s) for a trampoline.  struct bpf_tramp_link
extends bpf_link to act as a linked list node.

arch_prepare_bpf_trampoline() accepts a struct bpf_tramp_links to
collects all bpf_tramp_link(s) that a trampoline should call.

Change BPF trampoline and bpf_struct_ops to pass bpf_tramp_links
instead of bpf_tramp_progs.

Signed-off-by: Kui-Feng Lee &lt;kuifeng@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220510205923.3206889-2-kuifeng@fb.com
</content>
</entry>
<entry>
<title>bpftool: bpf_link_get_from_fd support for LSM programs in lskel</title>
<updated>2022-05-10T17:42:08Z</updated>
<author>
<name>KP Singh</name>
<email>kpsingh@kernel.org</email>
</author>
<published>2022-05-09T21:49:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bd2331b3757f5b2ab4aafc591b55fa2a592abf7c'/>
<id>urn:sha1:bd2331b3757f5b2ab4aafc591b55fa2a592abf7c</id>
<content type='text'>
bpf_link_get_from_fd currently returns a NULL fd for LSM programs.
LSM programs are similar to tracing programs and can also use
skel_raw_tracepoint_open.

Signed-off-by: KP Singh &lt;kpsingh@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220509214905.3754984-1-kpsingh@kernel.org
</content>
</entry>
<entry>
<title>bpftool: Declare generator name</title>
<updated>2022-05-10T00:42:53Z</updated>
<author>
<name>Jason Wang</name>
<email>jasowang@redhat.com</email>
</author>
<published>2022-05-09T09:02:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=56c3e749d08a041454f5d75273c24d16240f26dc'/>
<id>urn:sha1:56c3e749d08a041454f5d75273c24d16240f26dc</id>
<content type='text'>
Most code generators declare its name so did this for bfptool.

Signed-off-by: Jason Wang &lt;jasowang@redhat.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220509090247.5457-1-jasowang@redhat.com
</content>
</entry>
<entry>
<title>bpftool: Output message if no helpers found in feature probing</title>
<updated>2022-05-10T00:16:05Z</updated>
<author>
<name>Milan Landaverde</name>
<email>milan@mdaverde.com</email>
</author>
<published>2022-05-04T16:13:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b06a92a18d4651c983c60d83935a76b2d47d85e0'/>
<id>urn:sha1:b06a92a18d4651c983c60d83935a76b2d47d85e0</id>
<content type='text'>
Currently in libbpf, we have hardcoded program types that are not
supported for helper function probing (e.g. tracing, ext, lsm).
Due to this (and other legitimate failures), bpftool feature probe returns
empty for those program type helper functions.

Instead of implying to the user that there are no helper functions
available for a program type, we output a message to the user explaining
that helper function probing failed for that program type.

Signed-off-by: Milan Landaverde &lt;milan@mdaverde.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220504161356.3497972-3-milan@mdaverde.com
</content>
</entry>
<entry>
<title>bpftool: Adjust for error codes from libbpf probes</title>
<updated>2022-05-10T00:16:05Z</updated>
<author>
<name>Milan Landaverde</name>
<email>milan@mdaverde.com</email>
</author>
<published>2022-05-04T16:13:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6d9f63b9df5ed7ffe10ac70025f408d28b3dd260'/>
<id>urn:sha1:6d9f63b9df5ed7ffe10ac70025f408d28b3dd260</id>
<content type='text'>
Originally [1], libbpf's (now deprecated) probe functions returned a bool
to acknowledge support but the new APIs return an int with a possible
negative error code to reflect probe failure. This change decides for
bpftool to declare maps and helpers are not available on probe failures.

[1]: https://lore.kernel.org/bpf/20220202225916.3313522-3-andrii@kernel.org/

Signed-off-by: Milan Landaverde &lt;milan@mdaverde.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220504161356.3497972-2-milan@mdaverde.com
</content>
</entry>
<entry>
<title>bpftool, musl compat: Replace sys/fcntl.h by fcntl.h</title>
<updated>2022-04-25T21:24:28Z</updated>
<author>
<name>Dominique Martinet</name>
<email>asmadeus@codewreck.org</email>
</author>
<published>2022-04-24T05:10:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=246bdfa52f33ecfa52546ed67287de4eab165b2e'/>
<id>urn:sha1:246bdfa52f33ecfa52546ed67287de4eab165b2e</id>
<content type='text'>
musl does not like including sys/fcntl.h directly:

    [...]
    1 | #warning redirecting incorrect #include &lt;sys/fcntl.h&gt; to &lt;fcntl.h&gt;
    [...]

Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20220424051022.2619648-5-asmadeus@codewreck.org
</content>
</entry>
<entry>
<title>bpftool, musl compat: Replace nftw with FTW_ACTIONRETVAL</title>
<updated>2022-04-25T21:24:16Z</updated>
<author>
<name>Dominique Martinet</name>
<email>asmadeus@codewreck.org</email>
</author>
<published>2022-04-24T05:10:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=93bc2e9e943d20a51473a49009db3243de6e098d'/>
<id>urn:sha1:93bc2e9e943d20a51473a49009db3243de6e098d</id>
<content type='text'>
musl nftw implementation does not support FTW_ACTIONRETVAL. There have been
multiple attempts at pushing the feature in musl upstream, but it has been
refused or ignored all the times:

  https://www.openwall.com/lists/musl/2021/03/26/1
  https://www.openwall.com/lists/musl/2022/01/22/1

In this case we only care about /proc/&lt;pid&gt;/fd/&lt;fd&gt;, so it's not too difficult
to reimplement directly instead, and the new implementation makes 'bpftool perf'
slightly faster because it doesn't needlessly stat/readdir unneeded directories
(54ms -&gt; 13ms on my machine).

Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20220424051022.2619648-4-asmadeus@codewreck.org
</content>
</entry>
<entry>
<title>tools/runqslower: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK</title>
<updated>2022-04-11T03:17:16Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2022-04-09T12:59:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=451b5fbc2c56f19f39be4c9e11b3420a0c5f5d3d'/>
<id>urn:sha1:451b5fbc2c56f19f39be4c9e11b3420a0c5f5d3d</id>
<content type='text'>
Explicitly set libbpf 1.0 API mode, then we can avoid using the deprecated
RLIMIT_MEMLOCK.

Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220409125958.92629-5-laoar.shao@gmail.com
</content>
</entry>
<entry>
<title>bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK</title>
<updated>2022-04-11T03:17:16Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2022-04-09T12:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a777e18f1bcd32528ff5dfd10a6629b655b05eb8'/>
<id>urn:sha1:a777e18f1bcd32528ff5dfd10a6629b655b05eb8</id>
<content type='text'>
We have switched to memcg-based memory accouting and thus the rlimit is
not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in
libbpf for backward compatibility, so we can use it instead now.

libbpf_set_strict_mode always return 0, so we don't need to check whether
the return value is 0 or not.

Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220409125958.92629-4-laoar.shao@gmail.com
</content>
</entry>
</feed>
