aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:21:53 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:36 -0600
commitc21ceceae94dc22f5b42c8174efa4597a0c990de (patch)
tree6a1e29a8f20770b7b664ea51a4864ef3cdc3885c /tools/testing/selftests/ftrace
parentselftests/ftrace: Add trace_printk sample module test (diff)
downloadlinux-dev-c21ceceae94dc22f5b42c8174efa4597a0c990de.tar.xz
linux-dev-c21ceceae94dc22f5b42c8174efa4597a0c990de.zip
selftests/ftrace: Add ringbuffer size changing testcase
Add a testcase for changing ringbuffer size. This tests not only ringbuffer size but also tests the imbalance per-cpu buffer size change too. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing/selftests/ftrace')
-rw-r--r--tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_size.tc22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_size.tc b/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_size.tc
new file mode 100644
index 000000000000..ab70f0077c35
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_size.tc
@@ -0,0 +1,22 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: Change the ringbuffer size
+# flags: instance
+
+rb_size_test() {
+ORIG=`cat buffer_size_kb`
+
+expr $ORIG / 2 > buffer_size_kb
+
+expr $ORIG \* 2 > buffer_size_kb
+
+echo $ORIG > buffer_size_kb
+}
+
+rb_size_test
+
+: "If per-cpu buffer is supported, imbalance it"
+if [ -d per_cpu/cpu0 ]; then
+ cd per_cpu/cpu0
+ rb_size_test
+fi