<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/lib/bpf/libbpf.h, branch v5.4.151</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.4.151</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.4.151'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-08-07T21:43:49+00:00</updated>
<entry>
<title>libbpf: implement BPF CO-RE offset relocation algorithm</title>
<updated>2019-08-07T21:43:49+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-08-07T21:39:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ddc7c3042614e273044f698d2beab25cc3842d45'/>
<id>urn:sha1:ddc7c3042614e273044f698d2beab25cc3842d45</id>
<content type='text'>
This patch implements the core logic for BPF CO-RE offsets relocations.
Every instruction that needs to be relocated has corresponding
bpf_offset_reloc as part of BTF.ext. Relocations are performed by trying
to match recorded "local" relocation spec against potentially many
compatible "target" types, creating corresponding spec. Details of the
algorithm are noted in corresponding comments in the code.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: return previous print callback from libbpf_set_print</title>
<updated>2019-07-28T05:36:19+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-28T03:25:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e87fd8bae44c3eaa6205c9c81419e773896dc157'/>
<id>urn:sha1:e87fd8bae44c3eaa6205c9c81419e773896dc157</id>
<content type='text'>
By returning previously set print callback from libbpf_set_print, it's
possible to restore it, eventually. This is useful when running many
independent test with one default print function, but overriding log
verbosity for particular subset of tests.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: add perf buffer API</title>
<updated>2019-07-08T13:35:43+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-06T18:06:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb84b8224655309e7d38f989e426b82a4543f115'/>
<id>urn:sha1:fb84b8224655309e7d38f989e426b82a4543f115</id>
<content type='text'>
BPF_MAP_TYPE_PERF_EVENT_ARRAY map is often used to send data from BPF program
to user space for additional processing. libbpf already has very low-level API
to read single CPU perf buffer, bpf_perf_event_read_simple(), but it's hard to
use and requires a lot of code to set everything up. This patch adds
perf_buffer abstraction on top of it, abstracting setting up and polling
per-CPU logic into simple and convenient API, similar to what BCC provides.

perf_buffer__new() sets up per-CPU ring buffers and updates corresponding BPF
map entries. It accepts two user-provided callbacks: one for handling raw
samples and one for get notifications of lost samples due to buffer overflow.

perf_buffer__new_raw() is similar, but provides more control over how
perf events are set up (by accepting user-provided perf_event_attr), how
they are handled (perf_event_header pointer is passed directly to
user-provided callback), and on which CPUs ring buffers are created
(it's possible to provide a list of CPUs and corresponding map keys to
update). This API allows advanced users fuller control.

perf_buffer__poll() is used to fetch ring buffer data across all CPUs,
utilizing epoll instance.

perf_buffer__free() does corresponding clean up and unsets FDs from BPF map.

All APIs are not thread-safe. User should ensure proper locking/coordination if
used in multi-threaded set up.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>libbpf: add raw tracepoint attach API</title>
<updated>2019-07-05T20:37:30+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-01T23:59:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84bf5e1f4f174fc4f06bc747dafa1a7cfa4e9a67'/>
<id>urn:sha1:84bf5e1f4f174fc4f06bc747dafa1a7cfa4e9a67</id>
<content type='text'>
Add a wrapper utilizing bpf_link "infrastructure" to allow attaching BPF
programs to raw tracepoints.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>libbpf: add tracepoint attach API</title>
<updated>2019-07-05T20:37:30+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-01T23:58:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6de59c17f111b3efc701c95b438e46245c4aeb1'/>
<id>urn:sha1:f6de59c17f111b3efc701c95b438e46245c4aeb1</id>
<content type='text'>
Allow attaching BPF programs to kernel tracepoint BPF hooks specified by
category and name.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>libbpf: add kprobe/uprobe attach API</title>
<updated>2019-07-05T20:37:30+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-01T23:58:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b26500274767bacbe571c75926fee2489f91ba28'/>
<id>urn:sha1:b26500274767bacbe571c75926fee2489f91ba28</id>
<content type='text'>
Add ability to attach to kernel and user probes and retprobes.
Implementation depends on perf event support for kprobes/uprobes.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Reviewed-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>libbpf: add ability to attach/detach BPF program to perf event</title>
<updated>2019-07-05T20:37:30+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-01T23:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=63f2f5ee856ba9db751123bc5519be099a3849a7'/>
<id>urn:sha1:63f2f5ee856ba9db751123bc5519be099a3849a7</id>
<content type='text'>
bpf_program__attach_perf_event allows to attach BPF program to existing
perf event hook, providing most generic and most low-level way to attach BPF
programs. It returns struct bpf_link, which should be passed to
bpf_link__destroy to detach and free resources, associated with a link.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Reviewed-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>libbpf: introduce concept of bpf_link</title>
<updated>2019-07-05T20:37:30+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-07-01T23:58:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c2e9efc26f389effc86e9b4d41f85d101f17629'/>
<id>urn:sha1:1c2e9efc26f389effc86e9b4d41f85d101f17629</id>
<content type='text'>
bpf_link is an abstraction of an association of a BPF program and one of
many possible BPF attachment points (hooks). This allows to have uniform
interface for detaching BPF programs regardless of the nature of link
and how it was created. Details of creation and setting up of a specific
bpf_link is handled by corresponding attachment methods
(bpf_program__attach_xxx) added in subsequent commits. Once successfully
created, bpf_link has to be eventually destroyed with
bpf_link__destroy(), at which point BPF program is disassociated from
a hook and all the relevant resources are freed.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>libbpf: constify getter APIs</title>
<updated>2019-06-19T00:21:02+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-06-17T22:48:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a324aae32fa9bfdd03e89078e20ebcbd7737fda5'/>
<id>urn:sha1:a324aae32fa9bfdd03e89078e20ebcbd7737fda5</id>
<content type='text'>
Add const qualifiers to bpf_object/bpf_program/bpf_map arguments for
getter APIs. There is no need for them to not be const pointers.

Verified that

make -C tools/lib/bpf
make -C tools/testing/selftests/bpf
make -C tools/perf

all build without warnings.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>bpf: add a new API libbpf_num_possible_cpus()</title>
<updated>2019-06-11T08:36:02+00:00</updated>
<author>
<name>Hechao Li</name>
<email>hechaol@fb.com</email>
</author>
<published>2019-06-11T00:56:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6446b3155521aab37f5a2b99ac264803ea7dced8'/>
<id>urn:sha1:6446b3155521aab37f5a2b99ac264803ea7dced8</id>
<content type='text'>
Adding a new API libbpf_num_possible_cpus() that helps user with
per-CPU map operations.

Signed-off-by: Hechao Li &lt;hechaol@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
</feed>
