ftracetest: Added tests for ftrace in the selftests directory
Steven Rostedt
maintainercover ftracetest: Added tests for ftrace in the selftests directory
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next
Head SHA1: 7cbfb5eed9832e7c3ae58a17078f62396e7b55f8
Masami Hiramatsu (3):
ftracetest: Initial commit for ftracetest
ftracetest: Add ftrace basic testcases
ftracetest: Add kprobe basic testcases
----
MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + tools/testing/selftests/ftrace/Makefile | 7 + tools/testing/selftests/ftrace/README | 45 ++++++ tools/testing/selftests/ftrace/ftracetest | 159 +++++++++++++++++++++ .../selftests/ftrace/test.d/00basic/basic1.tc | 3 + .../selftests/ftrace/test.d/00basic/basic2.tc | 6 + .../selftests/ftrace/test.d/00basic/basic3.tc | 8 ++ .../ftrace/test.d/kprobe/add_and_remove.tc | 11 ++ .../selftests/ftrace/test.d/kprobe/busy_check.tc | 14 ++ tools/testing/selftests/ftrace/test.d/template | 4 + 11 files changed, 259 insertions(+)
Steven Rostedt
maintainerPATCH 1/3 ftracetest: Initial commit for ftracetest
From: Masami Hiramatsu <[email protected]>
ftracetest is a collection of testcase shell-scripts for ftrace. To avoid regressions of ftrace, these testcases check correct ftrace behaviors. If someone would like to add any features on ftrace, the patch series should have at least one testcase for checking the new behavior.
--- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + tools/testing/selftests/ftrace/Makefile | 7 ++ tools/testing/selftests/ftrace/README | 45 +++++++ tools/testing/selftests/ftrace/ftracetest | 159 +++++++++++++++++++++++++ tools/testing/selftests/ftrace/test.d/template | 4 + 6 files changed, 217 insertions(+) create mode 100644 tools/testing/selftests/ftrace/Makefile create mode 100644 tools/testing/selftests/ftrace/README create mode 100755 tools/testing/selftests/ftrace/ftracetest create mode 100644 tools/testing/selftests/ftrace/test.d/template
MAINTAINERS +1 -0
@@ -9310,6 +9310,7 @@ F: include/*/ftrace.h F: include/linux/trace*.h F: include/trace/ F: kernel/trace/ +F: tools/testing/selftests/ftrace/ TRIVIAL PATCHES M: Jiri Kosina <[email protected]>
tools/testing/selftests/Makefile +1 -0
@@ -14,6 +14,7 @@ TARGETS += powerpc TARGETS += user TARGETS += sysctl TARGETS += firmware +TARGETS += ftrace TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplug
tools/testing/selftests/ftrace/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +all: + +run_tests: + @/bin/sh ./ftracetest || echo "ftrace selftests: [FAIL]" + +clean: + rm -rf logs/*
tools/testing/selftests/ftrace/README new file +45 -0
45 lines not on this page · raw message
tools/testing/selftests/ftrace/ftracetest new file +159 -0
159 lines not on this page · raw message
tools/testing/selftests/ftrace/test.d/template new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +# description: %HERE DESCRIBE WHAT THIS DOES% +# you have to add ".tc" extention for your testcase file +exit 0 # Return 0 if the test is passed, otherwise return !0
Signature · 1 line
2.0.1
Steven Rostedt
maintainerPATCH 2/3 ftracetest: Add ftrace basic testcases
In reply to Steven RostedtFrom: Masami Hiramatsu <[email protected]>
Add ftrace basic testcases. This just checks ftrace debugfs interface works as it is designed.
--- tools/testing/selftests/ftrace/test.d/00basic/basic1.tc | 3 +++ tools/testing/selftests/ftrace/test.d/00basic/basic2.tc | 6 ++++++ tools/testing/selftests/ftrace/test.d/00basic/basic3.tc | 8 ++++++++ 3 files changed, 17 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/basic1.tc create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/basic2.tc create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/basic3.tc
tools/testing/selftests/ftrace/test.d/00basic/basic1.tc new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh +# description: Basic trace file check +test -f README -a -f trace -a -f tracing_on -a -f trace_pipe
tools/testing/selftests/ftrace/test.d/00basic/basic2.tc new file +6 -0
@@ -0,0 +1,6 @@ +#!/bin/sh +# description: Basic test for tracers +for t in `cat available_tracers`; do + echo $t > current_tracer || exit 1 +done +echo nop > current_tracer
tools/testing/selftests/ftrace/test.d/00basic/basic3.tc new file +8 -0
@@ -0,0 +1,8 @@ +#!/bin/sh +# description: Basic trace clock test +[ -f trace_clock ] || exit 1 +for c in `cat trace_clock | tr -d \[\]`; do + echo $c > trace_clock || exit 1 + grep '\['$c'\]' trace_clock || exit 1 +done +echo local > trace_clock
Signature · 1 line
2.0.1
Steven Rostedt
maintainerPATCH 3/3 ftracetest: Add kprobe basic testcases
In reply to Steven RostedtFrom: Masami Hiramatsu <[email protected]>
Add basic testcases for kprobe dynamic events. This also shows that the ftracetest accepts sub-directory for new testcases.
--- .../selftests/ftrace/test.d/kprobe/add_and_remove.tc | 11 +++++++++++ tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc new file +11 -0
@@ -0,0 +1,11 @@ +#!/bin/sh +# description: Kprobe dynamic event - adding and removing + +[ -f kprobe_events ] || exit 1 + +echo 0 > events/enable || exit 1 +echo > kprobe_events || exit 1 +echo p:myevent do_fork > kprobe_events || exit 1 +grep myevent kprobe_events || exit 1 +[ -d events/kprobes/myevent ] || exit 1 +echo > kprobe_events
tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc new file +14 -0
@@ -0,0 +1,14 @@ +#!/bin/sh +# description: Kprobe dynamic event - busy event check + +[ -f kprobe_events ] || exit 1 + +echo 0 > events/enable || exit 1 +echo > kprobe_events || exit 1 +echo p:myevent do_fork > kprobe_events || exit 1 +[ -d events/kprobes/myevent ] || exit 1 +echo 1 > events/kprobes/myevent/enable || exit 1 +echo > kprobe_events && exit 1 # this must fail +echo 0 > events/kprobes/myevent/enable || exit 1 +echo > kprobe_events # this must succeed +
Signature · 1 line
2.0.1