<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/bpf/bpftool/map_perf_ring.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-06-20T18:13:03Z</updated>
<entry>
<title>bpftool: Use appropriate permissions for map access</title>
<updated>2025-06-20T18:13:03Z</updated>
<author>
<name>Slava Imameev</name>
</author>
<published>2025-06-20T15:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d32179e8c2583f1613f7bc9710612091c3c038d8'/>
<id>urn:sha1:d32179e8c2583f1613f7bc9710612091c3c038d8</id>
<content type='text'>
Modify several functions in tools/bpf/bpftool/common.c to allow
specification of requested access for file descriptors, such as
read-only access.

Update bpftool to request only read access for maps when write
access is not required. This fixes errors when reading from maps
that are protected from modification via security_bpf_map.

Signed-off-by: Slava Imameev &lt;slava.imameev@crowdstrike.com&gt;
Reviewed-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/r/20250620151812.13952-1-slava.imameev@crowdstrike.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Using the right format specifiers</title>
<updated>2025-03-17T20:50:56Z</updated>
<author>
<name>Jiayuan Chen</name>
</author>
<published>2025-03-11T11:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3775be3417cc3243b0df0492bd308559dcf0560b'/>
<id>urn:sha1:3775be3417cc3243b0df0492bd308559dcf0560b</id>
<content type='text'>
Fixed some formatting specifiers errors, such as using %d for int and %u
for unsigned int, as well as other byte-length types.

Perform type cast using the type derived from the data type itself, for
example, if it's originally an int, it will be cast to unsigned int if
forced to unsigned.

Signed-off-by: Jiayuan Chen &lt;jiayuan.chen@linux.dev&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20250311112809.81901-3-jiayuan.chen@linux.dev
</content>
</entry>
<entry>
<title>bpftool: Fix error message of strerror</title>
<updated>2022-09-30T22:40:46Z</updated>
<author>
<name>Tianyi Liu</name>
</author>
<published>2022-09-28T08:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ca2fb497440a3c8294f9df0ce7b2c3c9a1c5875'/>
<id>urn:sha1:3ca2fb497440a3c8294f9df0ce7b2c3c9a1c5875</id>
<content type='text'>
strerror() expects a positive errno, however variable err will never be
positive when an error occurs. This causes bpftool to output too many
"unknown error", even a simple "file not exist" error can not get an
accurate message.

This patch fixed all "strerror(err)" patterns in bpftool.
Specially in btf.c#L823, hashmap__append() is an internal function of
libbpf and will not change errno, so there's a little difference.
Some libbpf_get_error() calls are kept for return values.

Changes since v1: https://lore.kernel.org/bpf/SY4P282MB1084B61CD8671DFA395AA8579D539@SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM/
Check directly for NULL values instead of calling libbpf_get_error().

Signed-off-by: Tianyi Liu &lt;i.pear@outlook.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/SY4P282MB1084AD9CD84A920F08DF83E29D549@SY4P282MB1084.AUSP282.PROD.OUTLOOK.COM
</content>
</entry>
<entry>
<title>bpftool: Remove unused struct event_ring_info</title>
<updated>2022-09-30T21:09:05Z</updated>
<author>
<name>Yuan Can</name>
</author>
<published>2022-09-28T09:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f95a479797dc2c65fdf2809a7c388e7a9e2bc853'/>
<id>urn:sha1:f95a479797dc2c65fdf2809a7c388e7a9e2bc853</id>
<content type='text'>
After commit 9b190f185d2f ("tools/bpftool: switch map event_pipe to
libbpf's perf_buffer"), struct event_ring_info is not used any more and
can be removed as well.

Signed-off-by: Yuan Can &lt;yuancan@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220928090440.79637-3-yuancan@huawei.com
</content>
</entry>
<entry>
<title>bpftool: Update btf_dump__new() and perf_buffer__new_raw() calls</title>
<updated>2021-11-12T00:54:06Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-11-11T05:36:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=164b04f27fbd769f57905dfddd2a8953974eeef4'/>
<id>urn:sha1:164b04f27fbd769f57905dfddd2a8953974eeef4</id>
<content type='text'>
Use v1.0-compatible variants of btf_dump and perf_buffer "constructors".
This is also a demonstration of reusing struct perf_buffer_raw_opts as
OPTS-style option struct for new perf_buffer__new_raw() API.

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/20211111053624.190580-10-andrii@kernel.org
</content>
</entry>
<entry>
<title>bpftool: Remove useless #include to &lt;perf-sys.h&gt; from map_perf_ring.c</title>
<updated>2021-10-20T17:47:39Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2021-10-20T09:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=efc36d6c642a753c2880d97b8e8c3c7cfaf64ad1'/>
<id>urn:sha1:efc36d6c642a753c2880d97b8e8c3c7cfaf64ad1</id>
<content type='text'>
The header is no longer needed since the event_pipe implementation
was updated to rely on libbpf's perf_buffer. This makes bpftool free of
dependencies to perf files, and we can update the Makefile accordingly.

Fixes: 9b190f185d2f ("tools/bpftool: switch map event_pipe to libbpf's perf_buffer")
Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211020094826.16046-1-quentin@isovalent.com
</content>
</entry>
<entry>
<title>tools, bpftool: Poison and replace kernel integer typedefs</title>
<updated>2020-05-11T19:20:46Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2020-05-11T16:15:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e7e034e88e8e22cb14765c86da92416017e45b8'/>
<id>urn:sha1:6e7e034e88e8e22cb14765c86da92416017e45b8</id>
<content type='text'>
Replace the use of kernel-only integer typedefs (u8, u32, etc.) by their
user space counterpart (__u8, __u32, etc.).

Similarly to what libbpf does, poison the typedefs to avoid introducing
them again in the future.

Signed-off-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200511161536.29853-2-quentin@isovalent.com
</content>
</entry>
<entry>
<title>bpftool: Use consistent include paths for libbpf</title>
<updated>2020-01-21T00:37:45Z</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
</author>
<published>2020-01-20T13:06:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=229c3b47b794e7257744224b21a95d3d9938d00a'/>
<id>urn:sha1:229c3b47b794e7257744224b21a95d3d9938d00a</id>
<content type='text'>
Fix bpftool to include libbpf header files with the bpf/ prefix, to be
consistent with external users of the library. Also ensure that all
includes of exported libbpf header files (those that are exported on 'make
install' of the library) use bracketed includes instead of quoted.

To make sure no new files are introduced that doesn't include the bpf/
prefix in its include, remove tools/lib/bpf from the include path entirely,
and use tools/lib instead.

Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir")
Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.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/157952560684.1683545.4765181397974997027.stgit@toke.dk
</content>
</entry>
<entry>
<title>tools: bpftool: fix arguments for p_err() in do_event_pipe()</title>
<updated>2019-08-16T05:06:46Z</updated>
<author>
<name>Quentin Monnet</name>
</author>
<published>2019-08-15T14:32:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9def249dc8409ffc1f5a1d7195f1c462f2b49c07'/>
<id>urn:sha1:9def249dc8409ffc1f5a1d7195f1c462f2b49c07</id>
<content type='text'>
The last argument passed to some calls to the p_err() functions is not
correct, it should be "*argv" instead of "**argv". This may lead to a
segmentation fault error if CPU IDs or indices from the command line
cannot be parsed correctly. Let's fix this.

Fixes: f412eed9dfde ("tools: bpftool: add simple perf event output reader")
Signed-off-by: Quentin Monnet &lt;quentin.monnet@netronome.com&gt;
Reviewed-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/bpftool: switch map event_pipe to libbpf's perf_buffer</title>
<updated>2019-07-08T13:35:43Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2019-07-06T18:06:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9b190f185d2f6d65b4c16074db0c4eafa32c7ae1'/>
<id>urn:sha1:9b190f185d2f6d65b4c16074db0c4eafa32c7ae1</id>
<content type='text'>
Switch event_pipe implementation to rely on new libbpf perf buffer API
(it's raw low-level variant).

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
</feed>
