<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/tools/lib/bpf/bpf.c, branch docs-5.13</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-5.13</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-5.13'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2020-12-04T01:38:21+00:00</updated>
<entry>
<title>libbpf: Support attachment of BPF tracing programs to kernel modules</title>
<updated>2020-12-04T01:38:21+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2020-12-03T20:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=91abb4a6d79df6c4dcd86d85632df53c8cca2dcf'/>
<id>urn:sha1:91abb4a6d79df6c4dcd86d85632df53c8cca2dcf</id>
<content type='text'>
Teach libbpf to search for BTF types in kernel modules for tracing BPF
programs. This allows attachment of raw_tp/fentry/fexit/fmod_ret/etc BPF
program types to tracepoints and functions in kernel modules.

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/20201203204634.1325171-13-andrii@kernel.org
</content>
</entry>
<entry>
<title>libbpf: Factor out low-level BPF program loading helper</title>
<updated>2020-12-04T01:38:21+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2020-12-03T20:46:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6aef10a481a3f42c8021fe410e07440c0d71a5fc'/>
<id>urn:sha1:6aef10a481a3f42c8021fe410e07440c0d71a5fc</id>
<content type='text'>
Refactor low-level API for BPF program loading to not rely on public API
types. This allows painless extension without constant efforts to cleverly not
break backwards compatibility.

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/20201203204634.1325171-12-andrii@kernel.org
</content>
</entry>
<entry>
<title>libbpf: Cap retries in sys_bpf_prog_load</title>
<updated>2020-12-03T20:01:18+00:00</updated>
<author>
<name>Stanislav Fomichev</name>
<email>sdf@google.com</email>
</author>
<published>2020-12-02T23:13:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d6d418bd8f92aaa4c7c26d606188147c2ee0dae9'/>
<id>urn:sha1:d6d418bd8f92aaa4c7c26d606188147c2ee0dae9</id>
<content type='text'>
I've seen a situation, where a process that's under pprof constantly
generates SIGPROF which prevents program loading indefinitely.
The right thing to do probably is to disable signals in the upper
layers while loading, but it still would be nice to get some error from
libbpf instead of an endless loop.

Let's add some small retry limit to the program loading:
try loading the program 5 (arbitrary) times and give up.

v2:
* 10 -&gt; 5 retires (Andrii Nakryiko)

Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&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/20201202231332.3923644-1-sdf@google.com
</content>
</entry>
<entry>
<title>libbpf: Add support for freplace attachment in bpf_link_create</title>
<updated>2020-09-29T20:09:24+00:00</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
<email>toke@redhat.com</email>
</author>
<published>2020-09-29T12:45:53+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a535909142bf2a6f3a95cabbb8b38ce3860c4807'/>
<id>urn:sha1:a535909142bf2a6f3a95cabbb8b38ce3860c4807</id>
<content type='text'>
This adds support for supplying a target btf ID for the bpf_link_create()
operation, and adds a new bpf_program__attach_freplace() high-level API for
attaching freplace functions with a target.

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/160138355387.48470.18026176785351166890.stgit@toke.dk
</content>
</entry>
<entry>
<title>libbpf: Remove assumption of single contiguous memory for BTF data</title>
<updated>2020-09-29T00:27:31+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-09-26T01:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b86042478fa083d87f1b67047e788d70b8c81eef'/>
<id>urn:sha1:b86042478fa083d87f1b67047e788d70b8c81eef</id>
<content type='text'>
Refactor internals of struct btf to remove assumptions that BTF header, type
data, and string data are layed out contiguously in a memory in a single
memory allocation. Now we have three separate pointers pointing to the start
of each respective are: header, types, strings. In the next patches, these
pointers will be re-assigned to point to independently allocated memory areas,
if BTF needs to be modified.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20200926011357.2366158-3-andriin@fb.com
</content>
</entry>
<entry>
<title>libbpf: Support test run of raw tracepoint programs</title>
<updated>2020-09-28T19:52:36+00:00</updated>
<author>
<name>Song Liu</name>
<email>songliubraving@fb.com</email>
</author>
<published>2020-09-25T20:54:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=88f7fe7233244101fa5b7786e2e298bf27fe1375'/>
<id>urn:sha1:88f7fe7233244101fa5b7786e2e298bf27fe1375</id>
<content type='text'>
Add bpf_prog_test_run_opts() with support of new fields in bpf_attr.test,
namely, flags and cpu. Also extend _opts operations to support outputs via
opts.

Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200925205432.1777-3-songliubraving@fb.com
</content>
</entry>
<entry>
<title>libbpf: Add BPF_PROG_BIND_MAP syscall and use it on .rodata section</title>
<updated>2020-09-16T01:28:27+00:00</updated>
<author>
<name>YiFei Zhu</name>
<email>zhuyifei@google.com</email>
</author>
<published>2020-09-15T23:45:41+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5d23328dccd93c47e2719cb9d2ae303c235d277d'/>
<id>urn:sha1:5d23328dccd93c47e2719cb9d2ae303c235d277d</id>
<content type='text'>
The patch adds a simple wrapper bpf_prog_bind_map around the syscall.
When the libbpf tries to load a program, it will probe the kernel for
the support of this syscall and unconditionally bind .rodata section
to the program.

Signed-off-by: YiFei Zhu &lt;zhuyifei@google.com&gt;
Signed-off-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: YiFei Zhu &lt;zhuyifei1999@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20200915234543.3220146-4-sdf@google.com
</content>
</entry>
<entry>
<title>libbpf: Centralize poisoning and poison reallocarray()</title>
<updated>2020-08-19T01:38:25+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-08-19T01:36:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=85367030a6c7ef3373347cf816c698995074f6f0'/>
<id>urn:sha1:85367030a6c7ef3373347cf816c698995074f6f0</id>
<content type='text'>
Most of libbpf source files already include libbpf_internal.h, so it's a good
place to centralize identifier poisoning. So move kernel integer type
poisoning there. And also add reallocarray to a poison list to prevent
accidental use of it. libbpf_reallocarray() should be used universally
instead.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200819013607.3607269-4-andriin@fb.com
</content>
</entry>
<entry>
<title>tools/bpf: Support new uapi for map element bpf iterator</title>
<updated>2020-08-06T23:39:14+00:00</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2020-08-05T05:50:58+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=74fc097de327b37e8fe3ff580ce7ffaa7c1740dd'/>
<id>urn:sha1:74fc097de327b37e8fe3ff580ce7ffaa7c1740dd</id>
<content type='text'>
Previous commit adjusted kernel uapi for map
element bpf iterator. This patch adjusted libbpf API
due to uapi change. bpftool and bpf_iter selftests
are also changed accordingly.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20200805055058.1457623-1-yhs@fb.com
</content>
</entry>
<entry>
<title>libbpf: Add bpf_link detach APIs</title>
<updated>2020-08-02T03:38:28+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-07-31T18:28:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2e49527e52486dac910460b1b3f6fce6e21c6b48'/>
<id>urn:sha1:2e49527e52486dac910460b1b3f6fce6e21c6b48</id>
<content type='text'>
Add low-level bpf_link_detach() API. Also add higher-level bpf_link__detach()
one.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20200731182830.286260-3-andriin@fb.com
</content>
</entry>
</feed>
