mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
pstore: Use global ftrace filters for function trace filtering
Currently, pstore doesn't have any filters setup for function tracing. This has the associated overhead and may not be useful for users looking for tracing specific set of functions. ftrace's regular function trace filtering is done writing to tracing/set_ftrace_filter however this is not available if not requested. In order to be able to use this feature, the support to request global filtering introduced earlier in the series should be requested before registering the ftrace ops. Here we do the same. Signed-off-by: Joel Fernandes <joelaf@google.com> Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
d032ae8921
commit
7a0032f504
@ -75,10 +75,13 @@ static ssize_t pstore_ftrace_knob_write(struct file *f, const char __user *buf,
|
||||
if (!on ^ pstore_ftrace_enabled)
|
||||
goto out;
|
||||
|
||||
if (on)
|
||||
if (on) {
|
||||
ftrace_ops_set_global_filter(&pstore_ftrace_ops);
|
||||
ret = register_ftrace_function(&pstore_ftrace_ops);
|
||||
else
|
||||
} else {
|
||||
ret = unregister_ftrace_function(&pstore_ftrace_ops);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
pr_err("%s: unable to %sregister ftrace ops: %zd\n",
|
||||
__func__, on ? "" : "un", ret);
|
||||
|
Loading…
Reference in New Issue
Block a user