README 2.5 KB

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