]> Gentwo Git Trees - linux/.git/commit
libbpf: Fix USDT SIB argument handling causing unrecognized register error
authorJiawei Zhao <phoenix500526@163.com>
Wed, 27 Aug 2025 05:31:27 +0000 (05:31 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 27 Aug 2025 22:44:25 +0000 (15:44 -0700)
commit758acb9ccfdbf854b55abaceaf1f3f229cde3d19
treeb44a050d506fa84513fb09457144b03e9f6f4f29
parentd3abefe897408718799ae3bd06295b89b870a38e
libbpf: Fix USDT SIB argument handling causing unrecognized register error

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 <phoenix500526@163.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250827053128.1301287-2-phoenix500526@163.com
tools/lib/bpf/usdt.bpf.h
tools/lib/bpf/usdt.c