On Tue, Aug 26, 2025 at 10:31 PM Jiawei Zhao <[email protected]> wrote:
>
> When using GCC on x86-64 to compile an usdt prog with -O1 or higher
> optimization, the compiler will generate SIB addressing mode for global
> array, e.g. "1@-96(%rbp,%rax,8)".
>
> In this patch:
> - enrich subtest_basic_usdt test case to cover SIB addressing usdt argument
> spec
> handling logic
>
> Signed-off-by: Jiawei Zhao <[email protected]>
> ---
> tools/testing/selftests/bpf/prog_tests/usdt.c | 84 ++++++++++++++++++-
> tools/testing/selftests/bpf/progs/test_usdt.c | 31 +++++++
> 2 files changed, 113 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/usdt.c
> b/tools/testing/selftests/bpf/prog_tests/usdt.c
> index 9057e983cc54..9df2827991c7 100644
> --- a/tools/testing/selftests/bpf/prog_tests/usdt.c
> +++ b/tools/testing/selftests/bpf/prog_tests/usdt.c
> @@ -25,6 +25,7 @@ unsigned short test_usdt0_semaphore SEC(".probes");
> unsigned short test_usdt3_semaphore SEC(".probes");
> unsigned short test_usdt12_semaphore SEC(".probes");
>
> +
next time don't add random empty lines or unrelated formatting changes
(I fixed this up as well while applying)
> static void __always_inline trigger_func(int x) {
> long y = 42;
>
[...]