mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 13:13:57 +08:00
selftests/ftrace: Add more tests for removing of function probes
Al Viro discovered a bug in the removing of function probes where if it had a '*' at the beginning, it would fail to find any matches. That is, because it reset the glob search string to the the initial string with a "MATCH_END" type, instead of skipping the wildcard "*" it included it, where it would not match any functions because "*" was being treated as a normal character and not a wildcard one. Link: http://lkml.kernel.org/r/20180127031706.GE13338@ZenIV.linux.org.uk Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
97fe22adf3
commit
878cb3fb06
@ -128,6 +128,43 @@ if check_set_ftrace_filter "$FUNC1" "$FUNC2" ; then
|
||||
fail "Expected $FUNC1 and $FUNC2"
|
||||
fi
|
||||
|
||||
test_actual() { # Compares $TMPDIR/expected with set_ftrace_filter
|
||||
cat set_ftrace_filter | grep -v '#' | cut -d' ' -f1 | cut -d':' -f1 | sort -u > $TMPDIR/actual
|
||||
DIFF=`diff $TMPDIR/actual $TMPDIR/expected`
|
||||
test -z "$DIFF"
|
||||
}
|
||||
|
||||
# Set traceoff trigger for all fuctions with "lock" in their name
|
||||
cat available_filter_functions | cut -d' ' -f1 | grep 'lock' | sort -u > $TMPDIR/expected
|
||||
echo '*lock*:traceoff' > set_ftrace_filter
|
||||
test_actual
|
||||
|
||||
# now remove all with 'try' in it, and end with lock
|
||||
grep -v 'try.*lock$' $TMPDIR/expected > $TMPDIR/expected2
|
||||
mv $TMPDIR/expected2 $TMPDIR/expected
|
||||
echo '!*try*lock:traceoff' >> set_ftrace_filter
|
||||
test_actual
|
||||
|
||||
# remove all that start with "m" and end with "lock"
|
||||
grep -v '^m.*lock$' $TMPDIR/expected > $TMPDIR/expected2
|
||||
mv $TMPDIR/expected2 $TMPDIR/expected
|
||||
echo '!m*lock:traceoff' >> set_ftrace_filter
|
||||
test_actual
|
||||
|
||||
# remove all that start with "c" and have "unlock"
|
||||
grep -v '^c.*unlock' $TMPDIR/expected > $TMPDIR/expected2
|
||||
mv $TMPDIR/expected2 $TMPDIR/expected
|
||||
echo '!c*unlock*:traceoff' >> set_ftrace_filter
|
||||
test_actual
|
||||
|
||||
# clear all the rest
|
||||
> $TMPDIR/expected
|
||||
echo '!*:traceoff' >> set_ftrace_filter
|
||||
test_actual
|
||||
|
||||
rm $TMPDIR/expected
|
||||
rm $TMPDIR/actual
|
||||
|
||||
do_reset
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user