[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40cb834c2e034dc991a6b0c8140608dcd2e9e5fb.camel@gmail.com>
Date: Tue, 11 Feb 2025 16:14:52 -0800
From: Eduard Zingerman <eddyz87@...il.com>
To: Kumar Kartikeya Dwivedi <memxor@...il.com>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>, Peter Zijlstra
<peterz@...radead.org>, Will Deacon <will@...nel.org>, Waiman Long
<llong@...hat.com>, Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko
<andrii@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, Martin KaFai
Lau <martin.lau@...nel.org>, "Paul E. McKenney" <paulmck@...nel.org>,
Tejun Heo <tj@...nel.org>, Barret Rhoden <brho@...gle.com>, Josh Don
<joshdon@...gle.com>, Dohyun Kim <dohyunkim@...gle.com>,
linux-arm-kernel@...ts.infradead.org, kernel-team@...a.com
Subject: Re: [PATCH bpf-next v2 26/26] selftests/bpf: Add tests for
rqspinlock
On Thu, 2025-02-06 at 02:54 -0800, Kumar Kartikeya Dwivedi wrote:
[...]
> +void test_res_spin_lock(void)
> +{
> + if (test__start_subtest("res_spin_lock_success"))
> + test_res_spin_lock_success();
> + if (test__start_subtest("res_spin_lock_failure"))
> + test_res_spin_lock_failure();
> +}
Such organization makes it impossible to select sub-tests from
res_spin_lock_failure using ./test_progs -t.
I suggest doing something like below:
@@ -6,7 +6,7 @@
#include "res_spin_lock.skel.h"
#include "res_spin_lock_fail.skel.h"
-static void test_res_spin_lock_failure(void)
+void test_res_spin_lock_failure(void)
{
RUN_TESTS(res_spin_lock_fail);
}
@@ -30,7 +30,7 @@ static void *spin_lock_thread(void *arg)
pthread_exit(arg);
}
-static void test_res_spin_lock_success(void)
+void test_res_spin_lock_success(void)
{
LIBBPF_OPTS(bpf_test_run_opts, topts,
.data_in = &pkt_v4,
@@ -89,11 +89,3 @@ static void test_res_spin_lock_success(void)
res_spin_lock__destroy(skel);
return;
}
-
-void test_res_spin_lock(void)
-{
- if (test__start_subtest("res_spin_lock_success"))
- test_res_spin_lock_success();
- if (test__start_subtest("res_spin_lock_failure"))
- test_res_spin_lock_failure();
-}
[...]
Powered by blists - more mailing lists