From: Joel Fernandes <joelaf@google.com>
To: linux-kernel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
Kees Cook <keescook@chromium.org>,
Joel Fernandes <joelaf@google.com>,
Anton Vorontsov <anton@enomsg.org>,
Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>
Subject: [PATCH 2/2] pstore: Use global ftrace filters for function trace filtering
Date: Wed, 19 Oct 2016 18:31:43 -0700 [thread overview]
Message-ID: <1476927103-21230-2-git-send-email-joelaf@google.com> (raw)
In-Reply-To: <1476927103-21230-1-git-send-email-joelaf@google.com>
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.
Inorder 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>
---
fs/pstore/ftrace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c
index 1c6cf86..bcdcbcd 100644
--- a/fs/pstore/ftrace.c
+++ b/fs/pstore/ftrace.c
@@ -74,10 +74,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);
--
2.7.4
next prev parent reply other threads:[~2016-10-20 1:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 1:31 [PATCH 1/2] ftrace: Provide API to use global filtering for ftrace ops Joel Fernandes
2016-10-20 1:31 ` Joel Fernandes [this message]
2016-11-14 18:56 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1476927103-21230-2-git-send-email-joelaf@google.com \
--to=joelaf@google.com \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.