bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: [PATCH bpf-next v2 3/3] selftests/bpf: Add subtest usdt_multispec_fail with adjustable BPF_USDT_MAX_SPEC_CNT
Date: Sun, 15 Jun 2025 11:54:01 -0700	[thread overview]
Message-ID: <20250615185401.2757703-1-yonghong.song@linux.dev> (raw)
In-Reply-To: <20250615185345.2756663-1-yonghong.song@linux.dev>

Add udst_multispec_fail subtest. For arm64/clang20 build, the
BPF_USDT_MAX_SPEC_CNT is set to 2. Otherwise, the BPF_USDT_MAX_SPEC_CNT
remains the default value 256. This resolved the previous test failure.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
 tools/testing/selftests/bpf/prog_tests/usdt.c          |  7 ++++---
 .../selftests/bpf/progs/test_usdt_multispec_fail.c     | 10 ++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_usdt_multispec_fail.c

diff --git a/tools/testing/selftests/bpf/prog_tests/usdt.c b/tools/testing/selftests/bpf/prog_tests/usdt.c
index dc29ef94312a..cc7f38b03a96 100644
--- a/tools/testing/selftests/bpf/prog_tests/usdt.c
+++ b/tools/testing/selftests/bpf/prog_tests/usdt.c
@@ -7,6 +7,7 @@
 
 #include "test_usdt.skel.h"
 #include "test_urandom_usdt.skel.h"
+#include "test_usdt_multispec_fail.skel.h"
 
 int lets_test_this(int);
 
@@ -305,10 +306,10 @@ static void subtest_multispec_usdt(void)
 static void subtest_multispec_fail_usdt(void)
 {
 	LIBBPF_OPTS(bpf_usdt_opts, opts);
-	struct test_usdt *skel;
+	struct test_usdt_multispec_fail *skel;
 	int err;
 
-	skel = test_usdt__open_and_load();
+	skel = test_usdt_multispec_fail__open_and_load();
 	if (!ASSERT_OK_PTR(skel, "skel_open"))
 		return;
 
@@ -322,7 +323,7 @@ static void subtest_multispec_fail_usdt(void)
 	ASSERT_EQ(err, -E2BIG, "usdt_300_attach_err");
 
 cleanup:
-	test_usdt__destroy(skel);
+	test_usdt_multispec_fail__destroy(skel);
 }
 
 static FILE *urand_spawn(int *pid)
diff --git a/tools/testing/selftests/bpf/progs/test_usdt_multispec_fail.c b/tools/testing/selftests/bpf/progs/test_usdt_multispec_fail.c
new file mode 100644
index 000000000000..4cca3d8d45fb
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/test_usdt_multispec_fail.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
+
+#if defined(__clang__) && defined(__TARGET_ARCH_arm64)
+#define BPF_USDT_MAX_SPEC_CNT 2
+#endif
+
+int my_pid;
+
+#include "test_usdt_multispec.inc.h"
-- 
2.47.1


      parent reply	other threads:[~2025-06-15 18:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-15 18:53 [PATCH bpf-next v2 0/3] selftests/bpf: Fix usdt/multispec failure with arm64/clang20 Yonghong Song
2025-06-15 18:53 ` [PATCH bpf-next v2 1/3] selftests/bpf: Refactor the failed assertion to another subtest Yonghong Song
2025-06-16  8:33   ` Jiri Olsa
2025-06-16 15:48     ` Yonghong Song
2025-06-16 22:00   ` Andrii Nakryiko
2025-06-18  4:36     ` Yonghong Song
2025-06-24 15:36       ` Andrii Nakryiko
2025-06-24 16:15         ` Yonghong Song
2025-06-24 19:48           ` Andrii Nakryiko
2025-06-24 20:21             ` Yonghong Song
2025-06-15 18:53 ` [PATCH bpf-next v2 2/3] selftests/bpf: Add test_usdt_multispec.inc.h for sharing between multiple progs Yonghong Song
2025-06-15 18:54 ` Yonghong Song [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250615185401.2757703-1-yonghong.song@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).