diff mbox series

UBUNTU: SAUCE: ubuntu_kernel_selftests: skip ftrace unit test 'Kprobe event user-memory access' on ppc64|s390

Message ID 20200326162707.95067-1-paolo.pisati@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: ubuntu_kernel_selftests: skip ftrace unit test 'Kprobe event user-memory access' on ppc64|s390 | expand

Commit Message

Paolo Pisati March 26, 2020, 4:27 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1869227

Ftrace 'Kprobe event user-memory access' test constantly fails on ppc64:

ftrace/test.d/kprobe/kprobe_args_user.tc:
...
grep -q '\$arg<N>' README || exit_unresolved # depends on arch
...

the above README file is '/sys/kernel/tracing/README' and that
grep line fails since '\$arg<N>' is only available if:

kernel/trace/trace.c:
#ifdef CONFIG_HAVE_FUNCTION_ARG_ACCESS_API
        "\t           $stack<index>, $stack, $retval, $comm, $arg<N>,\n"
#else
        "\t           $stack<index>, $stack, $retval, $comm,\n"
#endif

and HAVE_FUNCTION_ARG_ACCESS_API is true only on architectures that
supports the API needed to access function arguments from pt_regs,
declared in asm/ptrace.h.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 ubuntu_kernel_selftests/ubuntu_kernel_selftests.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Po-Hsu Lin March 30, 2020, 10:10 a.m. UTC | #1
Looking good, do you have a plan to upstream corresponding changes to the upstream kernel?
To allow this job to determine if it can be executed on different arches.

And you can add a [autotest-client-tests] or [ACT] to the title, it will be easier to catch.

Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>

Applied and pushed.
Thanks
diff mbox series

Patch

diff --git a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
index aa5f9430..cb1a4d4b 100644
--- a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
+++ b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
@@ -154,6 +154,16 @@  class ubuntu_kernel_selftests(test.test):
                 'kprobe/probepoint.tc',
                 'kprobe/kprobe_module.tc',
             ]
+
+            #
+            # Ftrace 'Kprobe event user-memory access' test depends on
+            # HAVE_FUNCTION_ARG_ACCESS_API, but ppc64 doesn't support it:
+            # disable it to avoid an unresolved result (and thus a failure).
+            #
+            arch = platform.processor()
+            if arch in ['ppc64le', 's390x']:
+                filenames.append('kprobe/kprobe_args_user.tc')
+
             for fn in filenames:
                 fn = 'linux/tools/testing/selftests/ftrace/test.d/' + fn
                 if os.path.exists(fn):