3 This is a collection of testcases for ftrace tracing feature in the Linux
4 kernel. Since ftrace exports interfaces via the debugfs, we just need
5 shell scripts for testing. Feel free to add new test cases.
7 Running the ftrace testcases
8 ============================
10 At first, you need to be the root user to run this script.
15 To run specific testcases:
17 # ./ftracetest test.d/basic3.tc
19 Or you can also run testcases under given directory:
21 # ./ftracetest test.d/kprobe/
23 Contributing new testcases
24 ==========================
26 Copy test.d/template to your testcase (whose filename must have *.tc
27 extension) and rewrite the test description line.
29 * The working directory of the script is <debugfs>/tracing/.
31 * Take care with side effects as the tests are run with root privilege.
33 * The tests should not run for a long period of time (more than 1 min.)
34 These are to be unit tests.
36 * You can add a directory for your testcases under test.d/ if needed.
38 * The test cases should run on dash (busybox shell) for testing on
39 minimal cross-build environments.
41 * Note that the tests are run with "set -e" (errexit) option. If any
42 command fails, the test will be terminated immediately.
44 * The tests can return some result codes instead of pass or fail by
45 using exit_unresolved, exit_untested, exit_unsupported and exit_xfail.
50 Ftracetest supports following result codes.
52 * PASS: The test succeeded as expected. The test which exits with 0 is
53 counted as passed test.
55 * FAIL: The test failed, but was expected to succeed. The test which exits
56 with !0 is counted as failed test.
58 * UNRESOLVED: The test produced unclear or intermidiate results.
59 for example, the test was interrupted
60 or the test depends on a previous test, which failed.
61 or the test was set up incorrectly
62 The test which is in above situation, must call exit_unresolved.
64 * UNTESTED: The test was not run, currently just a placeholder.
65 In this case, the test must call exit_untested.
67 * UNSUPPORTED: The test failed because of lack of feature.
68 In this case, the test must call exit_unsupported.
70 * XFAIL: The test failed, and was expected to fail.
71 To return XFAIL, call exit_xfail from the test.
73 There are some sample test scripts for result code under samples/.
74 You can also run samples as below:
76 # ./ftracetest samples/
81 * Fancy colored output :)