From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Andrew Morton <akpm@linux-foundation.org>,
Namhyung Kim <namhyung@kernel.org>
Subject: [PATCH 2/6] ftracetest: Add functions file that holds helper functions
Date: Tue, 11 Nov 2014 16:41:29 -0500 [thread overview]
Message-ID: <20141111214206.647185045@goodmis.org> (raw)
In-Reply-To: 20141111214127.196849367@goodmis.org
[-- Attachment #1: 0002-ftracetest-Add-functions-file-that-holds-helper-func.patch --]
[-- Type: text/plain, Size: 2094 bytes --]
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
Created the file tools/testing/ftrace/test.d/functions that will
hold helper functions.
Current helper functions include:
Add clear_trace() helper to reset the trace file
Used as a descriptive name to show that "echo > trace" is clearing
the trace file.
Add disable/enable_tracing() helper calls
Add calls that disable and enable tracing respectively by echoing
0 or 1 into tracing_on.
Add helper reset_tracer() function
Add a helper function reset_tracer() that will clear the current_tracer
(echo nop > current_tracer).
Link: http://lkml.kernel.org/r/20141103212737.696365174@goodmis.org
Link: http://lkml.kernel.org/r/20141104153028.465517119@goodmis.org
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/selftests/ftrace/ftracetest | 3 +++
tools/testing/selftests/ftrace/test.d/functions | 16 ++++++++++++++++
2 files changed, 19 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..5d8cd06d920f
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -0,0 +1,16 @@
+
+clear_trace() { # reset trace output
+ echo > trace
+}
+
+disable_tracing() { # stop trace recording
+ echo 0 > tracing_on
+}
+
+enable_tracing() { # start trace recording
+ echo 1 > tracing_on
+}
+
+reset_tracer() { # reset the current tracer
+ echo nop > current_tracer
+}
--
2.1.1
next prev parent reply other threads:[~2014-11-11 21:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-11 21:41 [PATCH 0/6] ftracetest: Updates for 3.19 Steven Rostedt
2014-11-11 21:41 ` [PATCH 1/6] ftracetest: Sort testcases Steven Rostedt
2014-11-11 21:41 ` Steven Rostedt [this message]
2014-11-11 21:41 ` [PATCH 3/6] ftracetest: Add a couple of ftrace test cases Steven Rostedt
2014-11-11 21:41 ` [PATCH 4/6] ftracetest: Use logfile name supported by busyboxs mktemp Steven Rostedt
2014-11-11 21:41 ` [PATCH 5/6] ftracetest: Clear trace buffer after running kprobe testcases Steven Rostedt
2014-11-11 21:41 ` [PATCH 6/6] ftracetest: Add basic event tracing test cases Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141111214206.647185045@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox