Commit 1b8eec51 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Shuah Khan
Browse files

selftests/ftrace: Support ":README" suffix for requires



Add ":README" suffix support for the requires list, so that
the testcase can list up the required string for README file
to the requires list.

Note that the required string is treated as a fixed string,
instead of regular expression. Also, the testcase can specify
a string containing spaces with quotes. E.g.

# requires: "place: [<module>:]<symbol>":README

Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: default avatarTom Zanussi <zanussi@kernel.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 305c8388
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -269,7 +269,8 @@ testcase() { # testfile

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

test_on_instance() { # testfile
+1 −4
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - add/remove kprobe events
# requires: dynamic_events

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
+1 −3
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - add/remove synthetic events
# requires: dynamic_events

grep -q "s:\[synthetic/\]" README || exit_unsupported
# requires: dynamic_events "s:[synthetic/]":README

echo 0 > events/enable
echo > dynamic_events
+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - selective clear (compatibility)
# requires: dynamic_events kprobe_events synthetic_events

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

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

echo 0 > events/enable
echo > dynamic_events
+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - generic clear event
# requires: dynamic_events

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

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

echo 0 > events/enable
echo > dynamic_events
Loading