[RFC PATCH 1/4 v2] ftracetest: Add clear_trace() helper to reset the trace file
From: Steven Rostedt
Date: Mon Nov 03 2014 - 16:29:03 EST
From: "Steven Rostedt (Red Hat)" <rostedt@xxxxxxxxxxx>
Created the file tools/testing/ftrace/test.d/functions that will
hold helper functions.
First function added was clear_trace() that is descriptive in its
name to show that "echo > trace" is clearing the trace file.
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
tools/testing/selftests/ftrace/ftracetest | 3 +++
tools/testing/selftests/ftrace/test.d/functions | 4 ++++
2 files changed, 7 insertions(+)
create mode 100644 tools/testing/selftests/ftrace/test.d/functions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index f15c0da07aca..c6381a9faf83 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -235,6 +235,9 @@ run_test() { # testfile
fi
}
+# load in the helper functions
+. $TEST_DIR/functions
+
# Main loop
for t in $TEST_CASES; do
run_test $t
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
new file mode 100644
index 000000000000..1aa9f2e9c40b
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -0,0 +1,4 @@
+
+clear_trace() { # reset trace output
+ echo > trace
+}
--
2.1.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/