Skip to content

Commit 82f4f3e

Browse files
mhiramatrostedt
authored andcommitted
selftests/ftrace: Add snapshot and tracing_on test case
Add a testcase for checking snapshot and tracing_on relationship. This ensures that the snapshotting doesn't affect current tracing on/off settings. Link: http://lkml.kernel.org/r/153149932412.11274.15289227592627901488.stgit@devbox Cc: Tom Zanussi <[email protected]> Cc: Hiraku Toyooka <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Shuah Khan <[email protected]> Cc: [email protected] Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 73c8d89 commit 82f4f3e

File tree

1 file changed

+28
-0
lines changed
  • tools/testing/selftests/ftrace/test.d/00basic

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
# description: Snapshot and tracing setting
3+
# flags: instance
4+
5+
[ ! -f snapshot ] && exit_unsupported
6+
7+
echo "Set tracing off"
8+
echo 0 > tracing_on
9+
10+
echo "Allocate and take a snapshot"
11+
echo 1 > snapshot
12+
13+
# Since trace buffer is empty, snapshot is also empty, but allocated
14+
grep -q "Snapshot is allocated" snapshot
15+
16+
echo "Ensure keep tracing off"
17+
test `cat tracing_on` -eq 0
18+
19+
echo "Set tracing on"
20+
echo 1 > tracing_on
21+
22+
echo "Take a snapshot again"
23+
echo 1 > snapshot
24+
25+
echo "Ensure keep tracing on"
26+
test `cat tracing_on` -eq 1
27+
28+
exit 0

0 commit comments

Comments
 (0)