perf test: S390 does not support watchpoints in test 22
authorThomas Richter <tmricht@linux.ibm.com>
Fri, 28 Sep 2018 10:53:35 +0000 (12:53 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Oct 2018 17:23:44 +0000 (14:23 -0300)
S390 does not support the perf_event_open system call for
attribute type PERF_TYPE_BREAKPOINT. This results in test
failure for test 22:

  [root@s8360046 perf]# ./perf test 22
  22: Watchpoint                                :
  22.1: Read Only Watchpoint                    : FAILED!
  22.2: Write Only Watchpoint                   : FAILED!
  22.3: Read / Write Watchpoint                 : FAILED!
  22.4: Modify Watchpoint                       : FAILED!
  [root@s8360046 perf]#

Add s390 support to avoid these tests being executed on
s390 platform:

  [root@s8360046 perf]# ./perf test 22
  [root@s8360046 perf]# ./perf test -v 22
  22: Watchpoint                                : Disabled
  [root@s8360046 perf]#

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/20180928105335.67179-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/builtin-test.c
tools/perf/tests/tests.h
tools/perf/tests/wp.c

index 54ca7d87236f2e95b69292522a2906f292655298..12c09e0ece7105425f123bc8a81f4d61455e47ba 100644 (file)
@@ -123,6 +123,7 @@ static struct test generic_tests[] = {
        {
                .desc = "Watchpoint",
                .func = test__wp,
+               .is_supported = test__wp_is_supported,
                .subtest = {
                        .skip_if_fail   = false,
                        .get_nr         = test__wp_subtest_get_nr,
index 8e26a4148f30e250508f7c146e3509ae6a8bbe96..b82f55fcc2943d6d042d943d663bbafdd5c6f553 100644 (file)
@@ -109,6 +109,7 @@ int test__unit_number__scnprint(struct test *test, int subtest);
 int test__mem2node(struct test *t, int subtest);
 
 bool test__bp_signal_is_supported(void);
+bool test__wp_is_supported(void);
 
 #if defined(__arm__) || defined(__aarch64__)
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
index 017a99317f941c5371f4d3f4a6aaf2b90771d638..f89e6806557b2aa39ca56a6055cd88d948922722 100644 (file)
@@ -227,3 +227,15 @@ int test__wp(struct test *test __maybe_unused, int i)
 
        return !wp_testcase_table[i].target_func() ? TEST_OK : TEST_FAIL;
 }
+
+/* The s390 so far does not have support for
+ * instruction breakpoint using the perf_event_open() system call.
+ */
+bool test__wp_is_supported(void)
+{
+#if defined(__s390x__)
+       return false;
+#else
+       return true;
+#endif
+}