Skip to contentSkip to conversation

Kselftest update for Linux 5.7-rc4

GIT PULL Merged Shuah Khan 2 participants 2 messages Apr 30, 2020

Subsystems (3)
lore
Share & tools
lore

Shuah Khan

author maintainer
#0 lore raw

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

----------------------------------------------------------------

tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc +1 -4
index aefab0c66d54..f59853857ad2 100644
@@ -10,10 +10,7 @@ if ! grep -q function_graph available_tracers; then
     exit_unsupported
 fi
 
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is dynamic ftrace not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 do_reset() {
     if [ -e /proc/sys/kernel/stack_tracer_enabled ]; then
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc +2 -0
index c8a5209f2119..d610f47edd90 100644
@@ -9,6 +9,8 @@ if ! grep -q function_graph available_tracers; then
     exit_unsupported
 fi
 
+check_filter_file set_ftrace_filter
+
 fail() { # msg
     echo $1
     exit_fail
tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc +2 -0
index f4e92afab14b..28936f434ee5 100644
@@ -9,6 +9,8 @@ if ! grep -q function available_tracers; then
     exit_unsupported
 fi
 
+check_filter_file set_ftrace_filter
+
 disable_tracing
 clear_trace
 
tools/testing/selftests/ftrace/test.d/ftrace/func-filter-notrace-pid.tc +1 -4
index 8aa46a2ea133..71db68a7975f 100644
@@ -15,10 +15,7 @@ if [ ! -f set_ftrace_notrace_pid ]; then
     exit_unsupported
 fi
 
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is function tracer not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 do_function_fork=1
 
tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc +1 -4
index f2ee1e889e13..d58403c4b7cd 100644
@@ -16,10 +16,7 @@ if [ ! -f set_ftrace_pid ]; then
     exit_unsupported
 fi
 
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is function tracer not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 do_function_fork=1
 
tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc +1 -1
index 1a52f2883fe0..b2aff786c1a2 100644
@@ -3,7 +3,7 @@
 # description: ftrace - stacktrace filter command
 # flags: instance
 
-[ ! -f set_ftrace_filter ] && exit_unsupported
+check_filter_file set_ftrace_filter
 
 echo _do_fork:stacktrace >> set_ftrace_filter
 
tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +1 -4
index ca2ffd7957f9..e9b1fd534e96 100644
@@ -11,10 +11,7 @@
 #
 
 # The triggers are set within the set_ftrace_filter file
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is dynamic ftrace not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 do_reset() {
     reset_ftrace_filter
tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc +1 -1
index 9330c873f9fe..1a4b4a442d33 100644
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0
 # description: ftrace - function trace on module
 
-[ ! -f set_ftrace_filter ] && exit_unsupported
+check_filter_file set_ftrace_filter
 
 : "mod: allows to filter a non exist function"
 echo 'non_exist_func:mod:non_exist_module' > set_ftrace_filter
tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc +1 -4
index dfbae637c60c..a3dadb6b93b4 100644
@@ -18,10 +18,7 @@ if ! grep -q function_graph available_tracers; then
     exit_unsupported;
 fi
 
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is dynamic ftrace not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 if [ ! -f function_profile_enabled ]; then
     echo "function_profile_enabled not found, function profiling enabled?"
tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +1 -4
index 51f6e6146bd9..70bad441fa7d 100644
@@ -10,10 +10,7 @@
 #
 
 # The triggers are set within the set_ftrace_filter file
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is dynamic ftrace not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 fail() { # mesg
     echo $1
tools/testing/selftests/ftrace/test.d/ftrace/func_stack_tracer.tc +2 -0
index b414f0e3c646..51e9e80bc0e6 100644
@@ -8,6 +8,8 @@ if [ ! -f stack_trace ]; then
   exit_unsupported
 fi
 
+check_filter_file stack_trace_filter
+
 echo > stack_trace_filter
 echo 0 > stack_max_size
 echo 1 > /proc/sys/kernel/stack_tracer_enabled
tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc +1 -4
index 1947387fe976..3ed173f2944a 100644
@@ -11,10 +11,7 @@
 #
 
 # The triggers are set within the set_ftrace_filter file
-if [ ! -f set_ftrace_filter ]; then
-    echo "set_ftrace_filter not found? Is dynamic ftrace not set?"
-    exit_unsupported
-fi
+check_filter_file set_ftrace_filter
 
 fail() { # mesg
     echo $1
tools/testing/selftests/ftrace/test.d/functions +6 -0
index 5d4550591ff9..61a3c7e2634d 100644
@@ -1,3 +1,9 @@
+check_filter_file() { # check filter file introduced by dynamic ftrace
+    if [ ! -f "$1" ]; then
+        echo "$1 not found? Is dynamic ftrace not set?"
+        exit_unsupported
+    fi
+}
 
 clear_trace() { # reset trace output
     echo > trace
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc +1 -1
index 1bcb67dcae26..81490ecaaa92 100644
@@ -38,7 +38,7 @@ for width in 64 32 16 8; do
   echo 0 > events/kprobes/testprobe/enable
 
   : "Confirm the arguments is recorded in given types correctly"
-  ARGS=`grep "testprobe" trace | sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'`
+  ARGS=`grep "testprobe" trace | head -n 1 | sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'`
   check_types $ARGS $width
 
   : "Clear event for next loop"
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc +2 -0
index 7650a82db3f5..df5072815b87 100644
@@ -5,6 +5,8 @@
 [ -f kprobe_events ] || exit_unsupported # this is configurable
 grep "function" available_tracers || exit_unsupported # this is configurable
 
+check_filter_file set_ftrace_filter
+
 # prepare
 echo nop > current_tracer
 echo _do_fork > set_ftrace_filter
tools/testing/selftests/gpio/Makefile +6 -6
index 0bb80619db58..32bdc978a711 100644
@@ -1,13 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0
 
-MOUNT_CFLAGS := $(shell pkg-config --cflags mount 2>/dev/null)
-MOUNT_LDLIBS := $(shell pkg-config --libs mount 2>/dev/null)
-ifeq ($(MOUNT_LDLIBS),)
-MOUNT_LDLIBS := -lmount -I/usr/include/libmount
+VAR_CFLAGS := $(shell pkg-config --cflags mount 2>/dev/null)
+VAR_LDLIBS := $(shell pkg-config --libs mount 2>/dev/null)
+ifeq ($(VAR_LDLIBS),)
+VAR_LDLIBS := -lmount -I/usr/include/libmount
 endif
 
-CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(MOUNT_CFLAGS)
-LDLIBS += $(MOUNT_LDLIBS)
+CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(VAR_CFLAGS)
+LDLIBS += $(VAR_LDLIBS)
 
 TEST_PROGS := gpio-mockup.sh
 TEST_FILES := gpio-mockup-sysfs.sh
tools/testing/selftests/intel_pstate/Makefile +1 -1
index 7340fd6a9a9f..39f0fa2a8fd6 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
-LDLIBS := $(LDLIBS) -lm
+LDLIBS += -lm
 
 uname_M := $(shell uname -m 2>/dev/null || echo not)
 ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
tools/testing/selftests/kselftest_deps.sh new file +272 -0

272 lines not on this page · raw message

tools/testing/selftests/memfd/Makefile +12 -2
index 187b14cad00c..4da8b565fa32 100644
@@ -8,11 +8,21 @@ TEST_GEN_PROGS := memfd_test
 TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
 TEST_GEN_FILES := fuse_test fuse_mnt
 
-fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
+VAR_CFLAGS := $(shell pkg-config fuse --cflags 2>/dev/null)
+ifeq ($(VAR_CFLAGS),)
+VAR_CFLAGS := -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse
+endif
+
+VAR_LDLIBS := $(shell pkg-config fuse --libs 2>/dev/null)
+ifeq ($(VAR_LDLIBS),)
+VAR_LDLIBS := -lfuse -pthread
+endif
+
+fuse_mnt.o: CFLAGS += $(VAR_CFLAGS)
 
 include ../lib.mk
 
-$(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs)
+$(OUTPUT)/fuse_mnt: LDLIBS += $(VAR_LDLIBS)
 
 $(OUTPUT)/memfd_test: memfd_test.c common.c
 $(OUTPUT)/fuse_test: fuse_test.c common.c
merge bot Merged
#1 lore raw
The pull request you sent on Thu, 30 Apr 2020 11:59:00 -0600:

The pull request you sent on Thu, 30 Apr 2020 11:59:00 -0600:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-5.7-rc4

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/75ec0ba2acf45cc31b5b59e00106a55494c62209

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker