summaryrefslogtreecommitdiff
path: root/samples/ftrace/ftrace-direct.c
diff options
context:
space:
mode:
authorFlorent Revest <revest@chromium.org>2023-03-21 17:04:19 +0300
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-21 20:42:12 +0300
commit23edf48309b14a201481b75fba049802eaf0baa6 (patch)
treee57ddfac1d8f16bfbaa9d846aa52ced3259166e7 /samples/ftrace/ftrace-direct.c
parent59495740f79524bebe4ecb8097cf206f86587b25 (diff)
downloadlinux-23edf48309b14a201481b75fba049802eaf0baa6.tar.xz
ftrace: Replace uses of _ftrace_direct APIs with _ftrace_direct_multi
The _multi API requires that users keep their own ops but can enforce that an op is only associated to one direct call. Link: https://lkml.kernel.org/r/20230321140424.345218-3-revest@chromium.org Signed-off-by: Florent Revest <revest@chromium.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'samples/ftrace/ftrace-direct.c')
-rw-r--r--samples/ftrace/ftrace-direct.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/samples/ftrace/ftrace-direct.c b/samples/ftrace/ftrace-direct.c
index 1d3d307ca33d..42ec9e39453b 100644
--- a/samples/ftrace/ftrace-direct.c
+++ b/samples/ftrace/ftrace-direct.c
@@ -63,21 +63,23 @@ asm (
#endif /* CONFIG_S390 */
+static struct ftrace_ops direct;
+
static int __init ftrace_direct_init(void)
{
- return register_ftrace_direct((unsigned long)wake_up_process,
- (unsigned long)my_tramp);
+ ftrace_set_filter_ip(&direct, (unsigned long) wake_up_process, 0, 0);
+
+ return register_ftrace_direct_multi(&direct, (unsigned long) my_tramp);
}
static void __exit ftrace_direct_exit(void)
{
- unregister_ftrace_direct((unsigned long)wake_up_process,
- (unsigned long)my_tramp);
+ unregister_ftrace_direct_multi(&direct, (unsigned long)my_tramp, true);
}
module_init(ftrace_direct_init);
module_exit(ftrace_direct_exit);
MODULE_AUTHOR("Steven Rostedt");
-MODULE_DESCRIPTION("Example use case of using register_ftrace_direct()");
+MODULE_DESCRIPTION("Example use case of using register_ftrace_direct_multi()");
MODULE_LICENSE("GPL");