ftrace: Let unregister_ftrace_direct_multi() call ftrace_free_filter()
authorFlorent Revest <revest@chromium.org>
Tue, 21 Mar 2023 14:04:18 +0000 (15:04 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 21 Mar 2023 17:42:11 +0000 (13:42 -0400)
commit59495740f79524bebe4ecb8097cf206f86587b25
tree868eeed4a0d0aa5a531e28fb26929ec8a14a7d8a
parente8d018dd0257f744ca50a729e3d042cf2ec9da65
ftrace: Let unregister_ftrace_direct_multi() call ftrace_free_filter()

A common pattern when using the ftrace_direct_multi API is to unregister
the ops and also immediately free its filter. We've noticed it's very
easy for users to miss calling ftrace_free_filter().

This adds a "free_filters" argument to unregister_ftrace_direct_multi()
to both remind the user they should free filters and also to make their
life easier.

Link: https://lkml.kernel.org/r/20230321140424.345218-2-revest@chromium.org
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Florent Revest <revest@chromium.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/linux/ftrace.h
kernel/bpf/trampoline.c
kernel/trace/ftrace.c
samples/ftrace/ftrace-direct-multi-modify.c
samples/ftrace/ftrace-direct-multi.c