Skip to content

Commit 7a0032f

Browse files
Joel Fernandeskees
authored andcommitted
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 <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent d032ae8 commit 7a0032f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/pstore/ftrace.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ static ssize_t pstore_ftrace_knob_write(struct file *f, const char __user *buf,
7575
if (!on ^ pstore_ftrace_enabled)
7676
goto out;
7777

78-
if (on)
78+
if (on) {
79+
ftrace_ops_set_global_filter(&pstore_ftrace_ops);
7980
ret = register_ftrace_function(&pstore_ftrace_ops);
80-
else
81+
} else {
8182
ret = unregister_ftrace_function(&pstore_ftrace_ops);
83+
}
84+
8285
if (ret) {
8386
pr_err("%s: unable to %sregister ftrace ops: %zd\n",
8487
__func__, on ? "" : "un", ret);

0 commit comments

Comments
 (0)