This series extends the kselftests for the vDSO library making sure: that
they compile correctly on non x86 platforms, that they can be cross
compiled and introducing new tests that verify the correctness of the
library.
The so extended vDSO kselftests have been verified on all the platforms
supported by the unified vDSO library [1].
The only new patch that this series introduces is the first one, patch 2 and
patch 3 have already been reviewed in past as part of other series [2] [3].
[1] https://lore.kernel.org/lkml/20190621095252.32307-1-vincenzo.frascino@arm.c…
[2] https://lore.kernel.org/lkml/20190621095252.32307-26-vincenzo.frascino@arm.…
[3] https://lore.kernel.org/lkml/20190523112116.19233-4-vincenzo.frascino@arm.c…
Changes:
--------
v2:
- Addressed review comments from Andy.
- Rebased on 5.7-rc3.
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Andy Lutomirski <luto(a)kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino(a)arm.com>
Vincenzo Frascino (4):
kselftest: Enable vDSO test on non x86 platforms
kselftest: Extend vDSO selftest
kselftest: Extend vDSO selftest to clock_getres
kselftest: Move test_vdso to the vDSO test suite
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/vDSO/Makefile | 16 +-
.../selftests/vDSO/vdso_clock_getres.c | 124 +++++++++
tools/testing/selftests/vDSO/vdso_config.h | 90 +++++++
.../vdso_correctness_test_x86.c} | 0
tools/testing/selftests/vDSO/vdso_full_test.c | 244 ++++++++++++++++++
tools/testing/selftests/x86/Makefile | 2 +-
7 files changed, 472 insertions(+), 5 deletions(-)
create mode 100644 tools/testing/selftests/vDSO/vdso_clock_getres.c
create mode 100644 tools/testing/selftests/vDSO/vdso_config.h
rename tools/testing/selftests/{x86/test_vdso.c => vDSO/vdso_correctness_test_x86.c} (100%)
create mode 100644 tools/testing/selftests/vDSO/vdso_full_test.c
--
2.25.2
When the required module for the test does not exist, use
exit_unsupported instead of exit_unresolved to indicate this test is
not supported.
By doing this we can make test behaviour in sync with the
irqsoff_tracer.tc test in preemptirq, which is also treating module
existence in this way. Moreover, the test won't exit with a non-zero
return value if the module does not exist.
Fixes: 646f01ccdd59 ("ftrace/selftest: Add tests to test register_ftrace_direct()")
Fixes: 4d23e9b4fd2e ("selftests/ftrace: Add trace_printk sample module test")
Fixes: 7bc026d6c032 ("selftests/ftrace: Add function filter on module testcase")
Fixes: af2a0750f374 ("selftests/ftrace: Improve kprobe on module testcase to load/unload module")
Signed-off-by: Po-Hsu Lin <po-hsu.lin(a)canonical.com>
---
tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc | 2 +-
tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc | 2 +-
tools/testing/selftests/ftrace/test.d/event/trace_printk.tc | 2 +-
tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc | 2 +-
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc b/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc
index d75a869..3d6189e 100644
--- a/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc
+++ b/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc
@@ -5,7 +5,7 @@
rmmod ftrace-direct ||:
if ! modprobe ftrace-direct ; then
echo "No ftrace-direct sample module - please make CONFIG_SAMPLE_FTRACE_DIRECT=m"
- exit_unresolved;
+ exit_unsupported;
fi
echo "Let the module run a little"
diff --git a/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc b/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc
index 801ecb6..3d0e3ca 100644
--- a/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc
+++ b/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc
@@ -5,7 +5,7 @@
rmmod ftrace-direct ||:
if ! modprobe ftrace-direct ; then
echo "No ftrace-direct sample module - please build with CONFIG_SAMPLE_FTRACE_DIRECT=m"
- exit_unresolved;
+ exit_unsupported;
fi
if [ ! -f kprobe_events ]; then
diff --git a/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc b/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc
index b02550b..dd8b10d 100644
--- a/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc
@@ -5,7 +5,7 @@
rmmod trace-printk ||:
if ! modprobe trace-printk ; then
echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=m"
- exit_unresolved;
+ exit_unsupported;
fi
echo "Waiting for irq work"
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc
index 1a4b4a4..26dc06a 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc
@@ -13,7 +13,7 @@ echo '*:mod:trace_printk' > set_ftrace_filter
if ! modprobe trace-printk ; then
echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=
m"
- exit_unresolved;
+ exit_unsupported;
fi
: "Wildcard should be resolved after loading module"
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
index d861bd7..4e07c69 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
@@ -8,7 +8,7 @@ rmmod trace-printk ||:
if ! modprobe trace-printk ; then
echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=
m"
- exit_unresolved;
+ exit_unsupported;
fi
MOD=trace_printk
--
2.7.4
When running the ftrace selftests, 2 failures and 6 unresolved
cases were observed. The failures can be avoided by setting
a sysctl prior to test execution (fixed in patch 1) and by
having unresolved cases not return 0 from ftracetest by default
since they indicate an absence of testing modules/programs
rather than ftrace issues (patch 2).
The latter are classified as "unresolved" tests, which operate
differently from "unsupported" tests. For unsupported tests,
we note the unsupported count but do not consider the tests
as having failed, whereas with unresolved the test run is
considered to have failed so returns "not ok" when run via
kselftest ("make -C tools/testing/selftest/ftrace run_tests").
Patch 2 aligns the unresolved behaviour with the unsupported;
by default, unresolved outcomes do not trigger overall failure,
but they can if --fail-unresolved is specified.
Changes since v1:
- updated patch 1 to use /proc path instead of sysctl (Masami)
- updated patch 2 to modify unresolved handling in ftracetest
rather than change individual unresolved -> unsupported (Masami)
Alan Maguire (2):
ftrace/selftests: workaround cgroup RT scheduling issues
ftrace/selftest: make unresolved cases cause failure if
--fail-unresolved set
tools/testing/selftests/ftrace/ftracetest | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
--
1.8.3.1
Hi Shuah,
Hope you're happy with this version that I only touch KVM's Makefile.
I attempted to build KVM selftests on a specified dir, unfortunately
neither "make O=/path/to/mydir TARGETS=kvm" in tools/testing/selftests, nor
"make OUTPUT=/path/to/mydir" in tools/testing/selftests/kvm work.
This series aims to fix them.
Patch 1 and Patch 3 are the fix patch, please see the seperate for details.
While Patch 2 is more or less an fix for the future issue, since it works
without Patch 2 currently.
Changes in v3:
- Drop all the patches that touch things out of KVM
- Create OUTPUT dir in KVM's Makefile
- Correct the INSTALL_HDR_PATH in KVM's Makefile
Changes in v2:
https://lore.kernel.org/kvm/20200325140133.103236-1-xiaoyao.li@intel.com/
- fix the no directory issue in lib.mk
- make kvm fixes seperate patch
- Add the patch to fix linux src tree not clean issue
v1:
https://lore.kernel.org/kvm/20200315093425.33600-1-xiaoyao.li@intel.com/
Xiaoyao Li (3):
kvm: selftests: Fix no directory error when OUTPUT specified
kvm: selftests: Use the right INSTALL_HDR_PATH when OUTPUT specified
and MAKELEVEL is 0
kvm: selftests: Fix header path when built from parent level with O
specified
tools/testing/selftests/kvm/Makefile | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--
2.20.1
From: Vincent Cheng <vincent.cheng.xh(a)renesas.com>
This series adds adjust phase to the PTP Hardware Clock device interface.
Some PTP hardware clocks have a write phase mode that has
a built-in hardware filtering capability. The write phase mode
utilizes a phase offset control word instead of a frequency offset
control word. Add adjust phase function to take advantage of this
capability.
Vincent Cheng (3):
ptp: Add adjphase function to support phase offset control.
ptp: Add adjust_phase to ptp_clock_caps capability.
ptp: ptp_clockmatrix: Add adjphase() to support PHC write phase mode.
drivers/ptp/ptp_chardev.c | 1 +
drivers/ptp/ptp_clock.c | 2 +
drivers/ptp/ptp_clockmatrix.c | 123 ++++++++++++++++++++++++++++++++++
drivers/ptp/ptp_clockmatrix.h | 11 ++-
include/linux/ptp_clock_kernel.h | 6 +-
include/uapi/linux/ptp_clock.h | 4 +-
tools/testing/selftests/ptp/testptp.c | 6 +-
7 files changed, 147 insertions(+), 6 deletions(-)
--
2.7.4
Hi Linus,
Please pull the following Kunit update for Linux 5.7-rc4.
This Kunit update for Linux 5.7-rc4 consists of a single fix to flush
the test summary to the console log without delay.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 8f3d9f354286745c751374f5f1fcafee6b3f3136:
Linux 5.7-rc1 (2020-04-12 12:35:55 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-kunit-5.7-rc4
for you to fetch changes up to 6cb1818798812fe7e2c8fe3f489ad1c86adfd6c4:
kunit: Add missing newline in summary message (2020-04-23 15:42:00 -0600)
----------------------------------------------------------------
linux-kselftest-kunit-5.7-rc4
This Kunit update for Linux 5.7-rc4 consists of a single fix to flush
the test summary to the console log without delay.
----------------------------------------------------------------
Marco Elver (1):
kunit: Add missing newline in summary message
lib/kunit/test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------
Hi Linus,
Please pull the following Kselftest update for Linux 5.7-rc4.
This kselftest update for Linux 5.7-rc4 consists of:
- ftrace test fixes to check for required filter files and kprobe args.
- Kselftest build/cross-build dependency check script to make it easier
for test ring admins/users to configure build systems correctly for
build/cross-build kselftests. Currently checks library dependencies.
- Checks if Kselftests can be built/cross-built on a system running
compile test on a trivial C file with LDLIBS specified for each
individual test in their Makefiles.
- Prints suggested target list for a system filtering out tests
failed the build dependency check from the TARGETS in Selftests
the main Makefile when optional -p is specified.
- Prints pass/fail dependency check for each tests/sub-test.
- Prints pass/fail targets and libraries.
- Default: runs dependency checks on all tests.
- Optional test name can be specified to check dependencies for it.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit b87080eab4c1377706c113fc9c0157f19ea8fed1:
selftests/ipc: Fix test failure seen after initial test run
(2020-04-14 10:24:28 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-5.7-rc4
for you to fetch changes up to f0c0d0cf590f71b2213b29a7ded2cde3d0a1a0ba:
selftests/ftrace: Check the first record for kprobe_args_type.tc
(2020-04-24 09:39:26 -0600)
----------------------------------------------------------------
linux-kselftest-5.7-rc4
This kselftest update for Linux 5.7-rc4 consists of:
- ftrace test fixes to check for required filter files and kprobe args.
- Kselftest build/cross-build dependency check script to make it easier
for test ring admins/users to configure build systems correctly for
build/cross-build kselftests. Currently checks library dependencies.
- Checks if Kselftests can be built/cross-built on a system running
compile test on a trivial C file with LDLIBS specified for each
individual test in their Makefiles.
- Prints suggested target list for a system filtering out tests
failed the build dependency check from the TARGETS in Selftests
the main Makefile when optional -p is specified.
- Prints pass/fail dependency check for each tests/sub-test.
- Prints pass/fail targets and libraries.
- Default: runs dependency checks on all tests.
- Optional test name can be specified to check dependencies for it.
----------------------------------------------------------------
Shuah Khan (1):
selftests: add build/cross-build dependency check script
Xiao Yang (2):
selftests/ftrace: Check required filter files before running test
selftests/ftrace: Check the first record for kprobe_args_type.tc
.../ftrace/test.d/ftrace/fgraph-filter-stack.tc | 5 +-
.../ftrace/test.d/ftrace/fgraph-filter.tc | 2 +
.../ftrace/test.d/ftrace/func-filter-glob.tc | 2 +
.../test.d/ftrace/func-filter-notrace-pid.tc | 5 +-
.../ftrace/test.d/ftrace/func-filter-pid.tc | 5 +-
.../ftrace/test.d/ftrace/func-filter-stacktrace.tc | 2 +-
.../ftrace/test.d/ftrace/func_event_triggers.tc | 5 +-
.../ftrace/test.d/ftrace/func_mod_trace.tc | 2 +-
.../ftrace/test.d/ftrace/func_profiler.tc | 5 +-
.../ftrace/test.d/ftrace/func_set_ftrace_file.tc | 5 +-
.../ftrace/test.d/ftrace/func_stack_tracer.tc | 2 +
.../test.d/ftrace/func_traceonoff_triggers.tc | 5 +-
tools/testing/selftests/ftrace/test.d/functions | 6 +
.../ftrace/test.d/kprobe/kprobe_args_type.tc | 2 +-
.../ftrace/test.d/kprobe/kprobe_ftrace.tc | 2 +
tools/testing/selftests/gpio/Makefile | 12 +-
tools/testing/selftests/intel_pstate/Makefile | 2 +-
tools/testing/selftests/kselftest_deps.sh | 272
+++++++++++++++++++++
tools/testing/selftests/memfd/Makefile | 14 +-
19 files changed, 315 insertions(+), 40 deletions(-)
create mode 100755 tools/testing/selftests/kselftest_deps.sh
----------------------------------------------------------------