summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2016-11-15 23:31:21 +0300
committerKees Cook <keescook@chromium.org>2016-11-16 03:34:30 +0300
commit7a0032f50472c740e35e849366572c124087a346 (patch)
tree71437b89bfbfdb396be31dd14ae77f685e9757be /fs/pstore
parentd032ae8921ea792c1e6b2abb44022b2403f651f6 (diff)
downloadlinux-7a0032f50472c740e35e849366572c124087a346.tar.xz
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>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ftrace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c
index 31548cc09e7b..899d0ba0bd6c 100644
--- a/fs/pstore/ftrace.c
+++ b/fs/pstore/ftrace.c
@@ -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);