[PATCH v3 09/10] perf test: Introduce DEFINE_SUITE_EXCLUSIVE()

Ravi Bangoria posted 10 patches 1 year ago
There is a newer version of this series
[PATCH v3 09/10] perf test: Introduce DEFINE_SUITE_EXCLUSIVE()
Posted by Ravi Bangoria 1 year ago
A variant of DEFINE_SUITE() but sets ->exclusive bit for the test so the
test will be executed sequentially.

Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
---
 tools/perf/tests/tests.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index cb58b43aa063..8aea344536b8 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -81,6 +81,16 @@ struct test_suite {
 		.test_cases = tests__##_name,		\
 	}
 
+#define DEFINE_SUITE_EXCLUSIVE(description, _name)	\
+	struct test_case tests__##_name[] = {           \
+		TEST_CASE_EXCLUSIVE(description, _name),\
+		{	.name = NULL, }			\
+	};						\
+	struct test_suite suite__##_name = {		\
+		.desc = description,			\
+		.test_cases = tests__##_name,		\
+	}
+
 /* Tests */
 DECLARE_SUITE(vmlinux_matches_kallsyms);
 DECLARE_SUITE(openat_syscall_event);
-- 
2.43.0
Re: [PATCH v3 09/10] perf test: Introduce DEFINE_SUITE_EXCLUSIVE()
Posted by Arnaldo Carvalho de Melo 1 year ago
On Tue, Dec 10, 2024 at 09:34:48AM +0000, Ravi Bangoria wrote:
> A variant of DEFINE_SUITE() but sets ->exclusive bit for the test so the
> test will be executed sequentially.

Cherry picking this one as I need it for some other work.

Ian Rogers pointed me while reviewing.

- Arnaldo
 
> Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
> ---
>  tools/perf/tests/tests.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
> index cb58b43aa063..8aea344536b8 100644
> --- a/tools/perf/tests/tests.h
> +++ b/tools/perf/tests/tests.h
> @@ -81,6 +81,16 @@ struct test_suite {
>  		.test_cases = tests__##_name,		\
>  	}
>  
> +#define DEFINE_SUITE_EXCLUSIVE(description, _name)	\
> +	struct test_case tests__##_name[] = {           \
> +		TEST_CASE_EXCLUSIVE(description, _name),\
> +		{	.name = NULL, }			\
> +	};						\
> +	struct test_suite suite__##_name = {		\
> +		.desc = description,			\
> +		.test_cases = tests__##_name,		\
> +	}
> +
>  /* Tests */
>  DECLARE_SUITE(vmlinux_matches_kallsyms);
>  DECLARE_SUITE(openat_syscall_event);
> -- 
> 2.43.0