diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-05-13 10:37:03 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-05-13 22:07:48 +0200 |
commit | 0d2d2648931bdb1a629bf0df4e339e6a326a6136 (patch) | |
tree | 794ec3af364948b2f7e88e0ed82b6d00d62fa564 /tools/testing/selftests/bpf | |
parent | selftests/bpf: Convert some selftests to high-level BPF map APIs (diff) | |
download | linux-dev-0d2d2648931bdb1a629bf0df4e339e6a326a6136.tar.xz linux-dev-0d2d2648931bdb1a629bf0df4e339e6a326a6136.zip |
selftests/bpf: Fix usdt_400 test case
usdt_400 test case relies on compiler using the same arg spec for
usdt_400 USDT. This assumption breaks with Clang (Clang generates
different arg specs with varying offsets relative to %rbp), so simplify
this further and hard-code the constant which will guarantee that arg
spec is the same across all 400 inlinings.
Fixes: 630301b0d59d ("selftests/bpf: Add basic USDT selftests")
Reported-by: Mykola Lysenko <mykolal@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220513173703.89271-1-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/usdt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/usdt.c b/tools/testing/selftests/bpf/prog_tests/usdt.c index a71f51bdc08d..5f733d50b0d7 100644 --- a/tools/testing/selftests/bpf/prog_tests/usdt.c +++ b/tools/testing/selftests/bpf/prog_tests/usdt.c @@ -190,9 +190,7 @@ __weak void trigger_300_usdts(void) static void __always_inline f400(int x __attribute__((unused))) { - static int y; - - STAP_PROBE1(test, usdt_400, y++); + STAP_PROBE1(test, usdt_400, 400); } /* this time we have 400 different USDT call sites, but they have uniform @@ -299,7 +297,7 @@ static void subtest_multispec_usdt(void) trigger_400_usdts(); ASSERT_EQ(bss->usdt_100_called, 400, "usdt_400_called"); - ASSERT_EQ(bss->usdt_100_sum, 399 * 400 / 2, "usdt_400_sum"); + ASSERT_EQ(bss->usdt_100_sum, 400 * 400, "usdt_400_sum"); cleanup: test_usdt__destroy(skel); |