summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2019-06-19 11:09:05 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-08-31 12:19:39 -0400
commit7f5291da4b15ad0ebc0965af41a1a2e3f04c3f08 (patch)
treed2c80a5cf28d7294ee5842f8b7196175944ae26a /tools
parent3e662c54a15c4c4409c45e6133107a3107796a96 (diff)
selftests/ftrace: Add syntax error test for multiprobe
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/ftrace/test.d/functions2
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc10
2 files changed, 11 insertions, 1 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 1d96c5f7e402..86986c4bba54 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -115,7 +115,7 @@ ftrace_errlog_check() { # err-prefix command-with-error-pos-by-^ command-file
115 command=$(echo "$2" | tr -d ^) 115 command=$(echo "$2" | tr -d ^)
116 echo "Test command: $command" 116 echo "Test command: $command"
117 echo > error_log 117 echo > error_log
118 (! echo "$command" > "$3" ) 2> /dev/null 118 (! echo "$command" >> "$3" ) 2> /dev/null
119 grep "$1: error:" -A 3 error_log 119 grep "$1: error:" -A 3 error_log
120 N=$(tail -n 1 error_log | wc -c) 120 N=$(tail -n 1 error_log | wc -c)
121 # " Command: " and "^\n" => 13 121 # " Command: " and "^\n" => 13
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
index aa59944bcace..39ef7ac1f51c 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
@@ -87,4 +87,14 @@ case $(uname -m) in
87 ;; 87 ;;
88esac 88esac
89 89
90# multiprobe errors
91if grep -q "Create/append/" README && grep -q "imm-value" README; then
92echo 'p:kprobes/testevent _do_fork' > kprobe_events
93check_error '^r:kprobes/testevent do_exit' # DIFF_PROBE_TYPE
94echo 'p:kprobes/testevent _do_fork abcd=\1' > kprobe_events
95check_error 'p:kprobes/testevent _do_fork ^bcd=\1' # DIFF_ARG_TYPE
96check_error 'p:kprobes/testevent _do_fork ^abcd=\1:u8' # DIFF_ARG_TYPE
97check_error 'p:kprobes/testevent _do_fork ^abcd=\"foo"' # DIFF_ARG_TYPE
98fi
99
90exit 0 100exit 0