diff options
author | Mark Rutland <[email protected]> | 2023-01-03 12:49:11 +0000 |
---|---|---|
committer | Steven Rostedt (Google) <[email protected]> | 2023-01-24 11:20:58 -0500 |
commit | 8be9fbd5345da52f4a74f7f81d55ff9fa0a2958e (patch) | |
tree | 5fed470d4c9dd30e60036b480e0d4dcd5e0bd622 /kernel/trace/trace_output.c | |
parent | 2241ab53cbb5cdb08a6b2d4688feb13971058f65 (diff) |
ftrace: Export ftrace_free_filter() to modules
Setting filters on an ftrace ops results in some memory being allocated
for the filter hashes, which must be freed before the ops can be freed.
This can be done by removing every individual element of the hash by
calling ftrace_set_filter_ip() or ftrace_set_filter_ips() with `remove`
set, but this is somewhat error prone as it's easy to forget to remove
an element.
Make it easier to clean this up by exporting ftrace_free_filter(), which
can be used to clean up all of the filter hashes after an ftrace_ops has
been unregistered.
Using this, fix the ftrace-direct* samples to free hashes prior to being
unloaded. All other code either removes individual filters explicitly or
is built-in and already calls ftrace_free_filter().
Link: https://lkml.kernel.org/r/[email protected]
Cc: [email protected]
Cc: Florent Revest <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Fixes: e1067a07cfbc ("ftrace/samples: Add module to test multi direct modify interface")
Fixes: 5fae941b9a6f ("ftrace/samples: Add multi direct interface test module")
Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
Reviewed-by: Steven Rostedt (Google) <[email protected]>
Signed-off-by: Mark Rutland <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'kernel/trace/trace_output.c')
0 files changed, 0 insertions, 0 deletions