<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/lib/bpf/usdt.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-11-17T10:10:38Z</updated>
<entry>
<title>tools: Remove s390 compat support</title>
<updated>2025-11-17T10:10:38Z</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-11-10T18:54:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=169ebcbb90829bec0429ff9f6012a0313169e45f'/>
<id>urn:sha1:169ebcbb90829bec0429ff9f6012a0313169e45f</id>
<content type='text'>
Remove s390 compat support from everything within tools, since s390 compat
support will be removed from the kernel.

Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt; # tools/nolibc selftests/nolibc
Reviewed-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt; # selftests/vDSO
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt; # bpf bits
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>libbpf: move libbpf_errstr() into libbpf_utils.c</title>
<updated>2025-10-01T22:27:25Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2025-10-01T17:13:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c68b6fdc3600466e3c265bad34d099eb8c5280f1'/>
<id>urn:sha1:c68b6fdc3600466e3c265bad34d099eb8c5280f1</id>
<content type='text'>
Get rid of str_err.{c,h} by moving implementation of libbpf_errstr()
into libbpf_utils.c and declarations into libbpf_internal.h.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/r/20251001171326.3883055-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
</content>
</entry>
<entry>
<title>libbpf: Remove unused args in parse_usdt_note</title>
<updated>2025-09-04T18:35:44Z</updated>
<author>
<name>Jiawei Zhao</name>
<email>phoenix500526@163.com</email>
</author>
<published>2025-09-04T03:05:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b338cf849ec82a3063119c9902c5ae21bc9dccb1'/>
<id>urn:sha1:b338cf849ec82a3063119c9902c5ae21bc9dccb1</id>
<content type='text'>
Remove unused 'elf' and 'path' parameters from parse_usdt_note function
signature. These parameters are not referenced within the function body
and only add unnecessary complexity.

The function only requires the note header, data buffer, offsets, and
output structure to perform USDT note parsing.

Update function declaration, definition, and the single call site in
collect_usdt_targets() to match the simplified signature.

This is a safe internal cleanup as parse_usdt_note is a static function.

Signed-off-by: Jiawei Zhao &lt;phoenix500526@163.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Link: https://lore.kernel.org/bpf/20250904030525.1932293-1-phoenix500526@163.com
</content>
</entry>
<entry>
<title>libbpf: Fix USDT SIB argument handling causing unrecognized register error</title>
<updated>2025-08-27T22:44:25Z</updated>
<author>
<name>Jiawei Zhao</name>
<email>phoenix500526@163.com</email>
</author>
<published>2025-08-27T05:31:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=758acb9ccfdbf854b55abaceaf1f3f229cde3d19'/>
<id>urn:sha1:758acb9ccfdbf854b55abaceaf1f3f229cde3d19</id>
<content type='text'>
On x86-64, USDT arguments can be specified using Scale-Index-Base (SIB)
addressing, e.g. "1@-96(%rbp,%rax,8)". The current USDT implementation
in libbpf cannot parse this format, causing `bpf_program__attach_usdt()`
to fail with -ENOENT (unrecognized register).

This patch fixes this by implementing the necessary changes:
- add correct handling for SIB-addressed arguments in `bpf_usdt_arg`.
- add adaptive support to `__bpf_usdt_arg_type` and
  `__bpf_usdt_arg_spec` to represent SIB addressing parameters.

Signed-off-by: Jiawei Zhao &lt;phoenix500526@163.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20250827053128.1301287-2-phoenix500526@163.com
</content>
</entry>
<entry>
<title>libbpf: Correct some typos and syntax issues in usdt doc</title>
<updated>2025-06-05T18:45:48Z</updated>
<author>
<name>Jiawei Zhao</name>
<email>Phoenix500526@163.com</email>
</author>
<published>2025-05-31T09:51:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=919319b4edfa2c7f82f98cac570354075ad79196'/>
<id>urn:sha1:919319b4edfa2c7f82f98cac570354075ad79196</id>
<content type='text'>
Fix some incorrect words, such as "and" -&gt; "an", "it's" -&gt; "its".  Fix
some grammar issues, such as removing redundant "will", "would
complicated" -&gt; "would complicate".

Signed-off-by: Jiawei Zhao &lt;Phoenix500526@163.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20250531095111.57824-1-Phoenix500526@163.com
</content>
</entry>
<entry>
<title>libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing</title>
<updated>2024-12-02T16:41:17Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2024-11-21T22:45:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=98ebe5ef6f5c4517ba92fb3e56f95827ebea83fd'/>
<id>urn:sha1:98ebe5ef6f5c4517ba92fb3e56f95827ebea83fd</id>
<content type='text'>
USDT ELF note optionally can record an offset of .stapsdt.base, which is
used to make adjustments to USDT target attach address. Currently,
libbpf will do this address adjustment unconditionally if it finds
.stapsdt.base ELF section in target binary. But there is a corner case
where .stapsdt.base ELF section is present, but specific USDT note
doesn't reference it. In such case, libbpf will basically just add base
address and end up with absolutely incorrect USDT target address.

This adjustment has to be done only if both .stapsdt.sema section is
present and USDT note is recording a reference to it.

Fixes: 74cc6311cec9 ("libbpf: Add USDT notes parsing and resolution logic")
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/r/20241121224558.796110-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Stringify errno in log messages in the remaining code</title>
<updated>2024-11-12T04:29:45Z</updated>
<author>
<name>Mykyta Yatsenko</name>
<email>yatsenko@meta.com</email>
</author>
<published>2024-11-11T21:29:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4ce16ddd71054b1e47a65f8af5e3af6b64908e46'/>
<id>urn:sha1:4ce16ddd71054b1e47a65f8af5e3af6b64908e46</id>
<content type='text'>
Convert numeric error codes into the string representations in log
messages in the rest of libbpf source files.

Signed-off-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20241111212919.368971-5-mykyta.yatsenko5@gmail.com
</content>
</entry>
<entry>
<title>libbpf: Add uprobe multi link support to bpf_program__attach_usdt</title>
<updated>2023-08-21T22:51:26Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2023-08-09T08:34:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5902da6d8a523ed468ea1f28e001c7d5f30c042d'/>
<id>urn:sha1:5902da6d8a523ed468ea1f28e001c7d5f30c042d</id>
<content type='text'>
Adding support for usdt_manager_attach_usdt to use uprobe_multi
link to attach to usdt probes.

The uprobe_multi support is detected before the usdt program is
loaded and its expected_attach_type is set accordingly.

If uprobe_multi support is detected the usdt_manager_attach_usdt
gathers uprobes info and calls bpf_program__attach_uprobe to
create all needed uprobes.

If uprobe_multi support is not detected the old behaviour stays.

Also adding usdt.s program section for sleepable usdt probes.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/r/20230809083440.3209381-18-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Add elf_open/elf_close functions</title>
<updated>2023-08-21T22:51:26Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2023-08-09T08:34:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f90eb70d4489ea6fa6f3a7638aa614e15ad7181f'/>
<id>urn:sha1:f90eb70d4489ea6fa6f3a7638aa614e15ad7181f</id>
<content type='text'>
Adding elf_open/elf_close functions and using it in
elf_find_func_offset_from_file function. It will be
used in following changes to save some common code.

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/r/20230809083440.3209381-10-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Fix realloc API handling in zero-sized edge cases</title>
<updated>2023-07-11T07:32:00Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2023-07-11T02:41:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8a0260dbf6553c969248b6530cafadac46562f47'/>
<id>urn:sha1:8a0260dbf6553c969248b6530cafadac46562f47</id>
<content type='text'>
realloc() and reallocarray() can either return NULL or a special
non-NULL pointer, if their size argument is zero. This requires a bit
more care to handle NULL-as-valid-result situation differently from
NULL-as-error case. This has caused real issues before ([0]), and just
recently bit again in production when performing bpf_program__attach_usdt().

This patch fixes 4 places that do or potentially could suffer from this
mishandling of NULL, including the reported USDT-related one.

There are many other places where realloc()/reallocarray() is used and
NULL is always treated as an error value, but all those have guarantees
that their size is always non-zero, so those spot don't need any extra
handling.

  [0] d08ab82f59d5 ("libbpf: Fix double-free when linker processes empty sections")

Fixes: 999783c8bbda ("libbpf: Wire up spec management and other arch-independent USDT logic")
Fixes: b63b3c490eee ("libbpf: Add bpf_program__set_insns function")
Fixes: 697f104db8a6 ("libbpf: Support custom SEC() handlers")
Fixes: b12688267280 ("libbpf: Change the order of data and text relocations.")
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20230711024150.1566433-1-andrii@kernel.org
</content>
</entry>
</feed>
