ftrace/samples: Add module to test multi direct modify interface
authorJiri Olsa <jolsa@redhat.com>
Mon, 6 Dec 2021 18:20:32 +0000 (19:20 +0100)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 9 Dec 2021 18:02:44 +0000 (13:02 -0500)
commite1067a07cfbc5a36abad3752fafe4c79e06db1bb
tree94d47183b6eae6f63d83a179728f99cc64b67ecf
parentfea3ffa48c6d42a11dca766c89284d22eaf5603f
ftrace/samples: Add module to test multi direct modify interface

Adding ftrace-direct-multi-modify.ko kernel module that uses
modify_ftrace_direct_multi API. The core functionality is taken
from ftrace-direct-modify.ko kernel module and changed to fit
multi direct interface.

The init function creates kthread that periodically calls
modify_ftrace_direct_multi to change the trampoline address
for the direct ftrace_ops. The ftrace trace_pipe then shows
trace from both trampolines.

Link: https://lkml.kernel.org/r/20211206182032.87248-4-jolsa@kernel.org
Cc: Ingo Molnar <mingo@redhat.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
samples/ftrace/Makefile
samples/ftrace/ftrace-direct-multi-modify.c [new file with mode: 0644]