Commit 27c27605 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-5.8-rc2' of...

Merge tag 'linux-kselftest-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest cleanups from Shuah Khan:

 - ftrace "requires:" list for simplifying and unifying requirement
   checks for each test case, adding "requires:" line instead of
   checking required ftrace interfaces in each test case.

 - a minor spelling correction patch

* tag 'linux-kselftest-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/ftrace: Support ":README" suffix for requires
  selftests/ftrace: Support ":tracer" suffix for requires
  selftests/ftrace: Convert check_filter_file() with requires list
  selftests/ftrace: Convert required interface checks into requires list
  selftests/ftrace: Add "requires:" list support
  selftests/ftrace: Return unsupported for the unconfigured features
  selftests/ftrace: Allow ":" in description
  tools: testing: ftrace: trigger: fix spelling mistake
parents 5481fc6e 1b8eec51
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -263,10 +263,16 @@ CASENO=0

testcase() { # testfile
  CASENO=$((CASENO+1))
  desc=`grep "^#[ \t]*description:" $1 | cut -f2 -d:`
  desc=`grep "^#[ \t]*description:" $1 | cut -f2- -d:`
  prlog -n "[$CASENO]$INSTANCE$desc"
}

checkreq() { # testfile
  requires=`grep "^#[ \t]*requires:" $1 | cut -f2- -d:`
  # Use eval to pass quoted-patterns correctly.
  eval check_requires "$requires"
}

test_on_instance() { # testfile
  grep -q "^#[ \t]*flags:.*instance" $1
}
@@ -356,7 +362,8 @@ trap 'SIG_RESULT=$XFAIL' $SIG_XFAIL

__run_test() { # testfile
  # setup PID and PPID, $$ is not updated.
  (cd $TRACING_DIR; read PID _ < /proc/self/stat; set -e; set -x; initialize_ftrace; . $1)
  (cd $TRACING_DIR; read PID _ < /proc/self/stat; set -e; set -x;
   checkreq $1; initialize_ftrace; . $1)
  [ $? -ne 0 ] && kill -s $SIG_FAIL $SIG_PID
}

+1 −2
Original line number Diff line number Diff line
#!/bin/sh
# description: Snapshot and tracing setting
# requires: snapshot
# flags: instance

[ ! -f snapshot ] && exit_unsupported

echo "Set tracing off"
echo 0 > tracing_on

+1 −2
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: trace_pipe and trace_marker
# requires: trace_marker
# flags: instance

[ ! -f trace_marker ] && exit_unsupported

echo "test input 1" > trace_marker

: "trace interface never consume the ring buffer"
+1 −5
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Test ftrace direct functions against kprobes
# requires: kprobe_events

rmmod ftrace-direct ||:
if ! modprobe ftrace-direct ; then
@@ -8,11 +9,6 @@ if ! modprobe ftrace-direct ; then
  exit_unresolved;
fi

if [ ! -f kprobe_events ]; then
	echo "No kprobe_events file -please build CONFIG_KPROBE_EVENTS"
	exit_unresolved;
fi

echo "Let the module run a little"
sleep 1

+1 −5
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - add/remove kprobe events

[ -f dynamic_events ] || exit_unsupported

grep -q "place: \[<module>:\]<symbol>" README || exit_unsupported
grep -q "place (kretprobe): \[<module>:\]<symbol>" README || exit_unsupported
# requires: dynamic_events "place: [<module>:]<symbol>":README "place (kretprobe): [<module>:]<symbol>":README

echo 0 > events/enable
echo > dynamic_events
Loading