OSDN Git Service

ftrace/selftest: Add tests to test register_ftrace_direct()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 8 Nov 2019 17:19:14 +0000 (12:19 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 13 Nov 2019 14:36:49 +0000 (09:36 -0500)
commit646f01ccdd59f989f0a1866d2b3503e1855358d8
tree43ff72733bc74a70358ca823462f8979e13ed1b4
parentb06457c83af669bb9ef71f5b84a3132657dce8a1
ftrace/selftest: Add tests to test register_ftrace_direct()

Add two test cases that test the new ftrace direct functionality if the
ftrace-direct sample module is available. One test case tests against each
available tracer (function, function_graph, mmiotrace, etc), and the other
test tests against a kprobe at the same location as the direct caller. Both
tests follow the same pattern of testing combinations:

  enable test (either the tracer or the kprobe)
  load direct function module
  unload direct function module
  disable test

  enable test
  load direct function module
  disable test
  unload direct function module

  load direct function module
  enable test
  disable test
  unload direct function module

  load direct function module
  enable test
  unload direct function module
  disable test

As most the bugs in development happened with various ways of enabling or
disabling the direct calls with function tracer in one of these
combinations.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc [new file with mode: 0644]
tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc [new file with mode: 0644]