Skip to content

Commit

Permalink
selftests/ftrace: Add syntax error test for multiprobe
Browse files Browse the repository at this point in the history
Add syntax error test cases for multiprobe appending
errors.

Link: http://lkml.kernel.org/r/156095694541.28024.11918630805148623119.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Masami Hiramatsu authored and Steven Rostedt (VMware) committed Aug 31, 2019
1 parent 3e662c5 commit 7f5291d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/ftrace/test.d/functions
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ftrace_errlog_check() { # err-prefix command-with-error-pos-by-^ command-file
command=$(echo "$2" | tr -d ^)
echo "Test command: $command"
echo > error_log
(! echo "$command" > "$3" ) 2> /dev/null
(! echo "$command" >> "$3" ) 2> /dev/null
grep "$1: error:" -A 3 error_log
N=$(tail -n 1 error_log | wc -c)
# " Command: " and "^\n" => 13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,14 @@ case $(uname -m) in
;;
esac

# multiprobe errors
if grep -q "Create/append/" README && grep -q "imm-value" README; then
echo 'p:kprobes/testevent _do_fork' > kprobe_events
check_error '^r:kprobes/testevent do_exit' # DIFF_PROBE_TYPE
echo 'p:kprobes/testevent _do_fork abcd=\1' > kprobe_events
check_error 'p:kprobes/testevent _do_fork ^bcd=\1' # DIFF_ARG_TYPE
check_error 'p:kprobes/testevent _do_fork ^abcd=\1:u8' # DIFF_ARG_TYPE
check_error 'p:kprobes/testevent _do_fork ^abcd=\"foo"' # DIFF_ARG_TYPE
fi

exit 0

0 comments on commit 7f5291d

Please sign in to comment.