2019-10-19 08:04:03

by Leo Yan

[permalink] [raw]
Subject: [PATCH v1 2/3] perf tests bp_account: Add dedicated checking helper is_supported()

Arm architecture supports the breakpoint accounting but it doesn't
support breakpoint overflow signal handling. The current code uses the
same checking helper, thus it disables both testings (bp_account and
bp_signal) for arm platform.

For handling two testings separately, this patch adds a dedicated
checking helper is_supported() for breakpoint accounting testing, thus
it allows supporting breakpoint accounting testing on arm platform; the
old helper test__bp_signal_is_supported() is only used to checking for
breakpoint overflow signal testing.

Signed-off-by: Leo Yan <[email protected]>
---
tools/perf/tests/bp_account.c | 16 ++++++++++++++++
tools/perf/tests/builtin-test.c | 2 +-
tools/perf/tests/tests.h | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c
index 52ff7a462670..d0b935356274 100644
--- a/tools/perf/tests/bp_account.c
+++ b/tools/perf/tests/bp_account.c
@@ -188,3 +188,19 @@ int test__bp_accounting(struct test *test __maybe_unused, int subtest __maybe_un

return bp_accounting(wp_cnt, share);
}
+
+bool test__bp_account_is_supported(void)
+{
+ /*
+ * PowerPC and S390 do not support creation of instruction
+ * breakpoints using the perf_event interface.
+ *
+ * Just disable the test for these architectures until these
+ * issues are resolved.
+ */
+#if defined(__powerpc__) || defined(__s390x__)
+ return false;
+#else
+ return true;
+#endif
+}
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 55774baffc2a..8b286e9b7549 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -121,7 +121,7 @@ static struct test generic_tests[] = {
{
.desc = "Breakpoint accounting",
.func = test__bp_accounting,
- .is_supported = test__bp_signal_is_supported,
+ .is_supported = test__bp_account_is_supported,
},
{
.desc = "Watchpoint",
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 72912eb473cb..9837b6e93023 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -111,6 +111,7 @@ int test__map_groups__merge_in(struct test *t, int subtest);
int test__time_utils(struct test *t, int subtest);

bool test__bp_signal_is_supported(void);
+bool test__bp_account_is_supported(void);
bool test__wp_is_supported(void);

#if defined(__arm__) || defined(__aarch64__)
--
2.17.1


2019-10-19 09:00:13

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] perf tests bp_account: Add dedicated checking helper is_supported()

Em Fri, Oct 18, 2019 at 04:55:30PM +0800, Leo Yan escreveu:
> Arm architecture supports the breakpoint accounting but it doesn't
> support breakpoint overflow signal handling. The current code uses the
> same checking helper, thus it disables both testings (bp_account and
> bp_signal) for arm platform.
>
> For handling two testings separately, this patch adds a dedicated
> checking helper is_supported() for breakpoint accounting testing, thus
> it allows supporting breakpoint accounting testing on arm platform; the
> old helper test__bp_signal_is_supported() is only used to checking for
> breakpoint overflow signal testing.

Looks sensible,

Applied, thanks.

- Arnaldo

> Signed-off-by: Leo Yan <[email protected]>
> ---
> tools/perf/tests/bp_account.c | 16 ++++++++++++++++
> tools/perf/tests/builtin-test.c | 2 +-
> tools/perf/tests/tests.h | 1 +
> 3 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c
> index 52ff7a462670..d0b935356274 100644
> --- a/tools/perf/tests/bp_account.c
> +++ b/tools/perf/tests/bp_account.c
> @@ -188,3 +188,19 @@ int test__bp_accounting(struct test *test __maybe_unused, int subtest __maybe_un
>
> return bp_accounting(wp_cnt, share);
> }
> +
> +bool test__bp_account_is_supported(void)
> +{
> + /*
> + * PowerPC and S390 do not support creation of instruction
> + * breakpoints using the perf_event interface.
> + *
> + * Just disable the test for these architectures until these
> + * issues are resolved.
> + */
> +#if defined(__powerpc__) || defined(__s390x__)
> + return false;
> +#else
> + return true;
> +#endif
> +}
> diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> index 55774baffc2a..8b286e9b7549 100644
> --- a/tools/perf/tests/builtin-test.c
> +++ b/tools/perf/tests/builtin-test.c
> @@ -121,7 +121,7 @@ static struct test generic_tests[] = {
> {
> .desc = "Breakpoint accounting",
> .func = test__bp_accounting,
> - .is_supported = test__bp_signal_is_supported,
> + .is_supported = test__bp_account_is_supported,
> },
> {
> .desc = "Watchpoint",
> diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
> index 72912eb473cb..9837b6e93023 100644
> --- a/tools/perf/tests/tests.h
> +++ b/tools/perf/tests/tests.h
> @@ -111,6 +111,7 @@ int test__map_groups__merge_in(struct test *t, int subtest);
> int test__time_utils(struct test *t, int subtest);
>
> bool test__bp_signal_is_supported(void);
> +bool test__bp_account_is_supported(void);
> bool test__wp_is_supported(void);
>
> #if defined(__arm__) || defined(__aarch64__)
> --
> 2.17.1

--

- Arnaldo

Subject: [tip: perf/core] perf tests bp_account: Add dedicated checking helper is_supported()

The following commit has been merged into the perf/core branch of tip:

Commit-ID: e533eadf6596451880f518949cbb964dbd6189ae
Gitweb: https://git.kernel.org/tip/e533eadf6596451880f518949cbb964dbd6189ae
Author: Leo Yan <[email protected]>
AuthorDate: Fri, 18 Oct 2019 16:55:30 +08:00
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Sat, 19 Oct 2019 15:35:01 -03:00

perf tests bp_account: Add dedicated checking helper is_supported()

The arm architecture supports breakpoint accounting but it doesn't
support breakpoint overflow signal handling. The current code uses the
same checking helper, thus it disables both testings (bp_account and
bp_signal) for arm platform.

For handling two testings separately, this patch adds a dedicated
checking helper is_supported() for breakpoint accounting testing, thus
it allows supporting breakpoint accounting testing on arm platform; the
old helper test__bp_signal_is_supported() is only used to checking for
breakpoint overflow signal testing.

Signed-off-by: Leo Yan <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Brajeswar Ghosh <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Michael Petlan <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Song Liu <[email protected]>
Cc: Souptick Joarder <[email protected]>
Cc: Will Deacon <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/tests/bp_account.c | 16 ++++++++++++++++
tools/perf/tests/builtin-test.c | 2 +-
tools/perf/tests/tests.h | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c
index 52ff7a4..d0b9353 100644
--- a/tools/perf/tests/bp_account.c
+++ b/tools/perf/tests/bp_account.c
@@ -188,3 +188,19 @@ int test__bp_accounting(struct test *test __maybe_unused, int subtest __maybe_un

return bp_accounting(wp_cnt, share);
}
+
+bool test__bp_account_is_supported(void)
+{
+ /*
+ * PowerPC and S390 do not support creation of instruction
+ * breakpoints using the perf_event interface.
+ *
+ * Just disable the test for these architectures until these
+ * issues are resolved.
+ */
+#if defined(__powerpc__) || defined(__s390x__)
+ return false;
+#else
+ return true;
+#endif
+}
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 55774ba..8b286e9 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -121,7 +121,7 @@ static struct test generic_tests[] = {
{
.desc = "Breakpoint accounting",
.func = test__bp_accounting,
- .is_supported = test__bp_signal_is_supported,
+ .is_supported = test__bp_account_is_supported,
},
{
.desc = "Watchpoint",
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 72912eb..9837b6e 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -111,6 +111,7 @@ int test__map_groups__merge_in(struct test *t, int subtest);
int test__time_utils(struct test *t, int subtest);

bool test__bp_signal_is_supported(void);
+bool test__bp_account_is_supported(void);
bool test__wp_is_supported(void);

#if defined(__arm__) || defined(__aarch64__)