From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Jiri Olsa <jolsa@redhat.com>
Subject: [for-next][PATCH 09/18] ftrace: Add rcu_unsafe_filter_functions file
Date: Wed, 04 Sep 2013 10:36:01 -0400 [thread overview]
Message-ID: <20130904143701.776155629@goodmis.org> (raw)
In-Reply-To: 20130904143552.456506259@goodmis.org
[-- Attachment #1: 0008-ftrace-Add-rcu_unsafe_filter_functions-file.patch --]
[-- Type: text/plain, Size: 2865 bytes --]
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
Since the RCU unsafe functions are no longer displayed by the
available_filter_functions, we still need a way to see these
functions in order to trace them. Create a new file that lists
the functions that were declared RCU unsafe.
Cc: Jiri Olsa <jolsa@redhat.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/linux/ftrace.h | 1 +
kernel/trace/ftrace.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 4709264..4752764 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -412,6 +412,7 @@ enum {
FTRACE_ITER_HASH = (1 << 4),
FTRACE_ITER_ENABLED = (1 << 5),
FTRACE_ITER_NO_UNSAFE = (1 << 6),
+ FTRACE_ITER_UNSAFE_ONLY = (1 << 7),
};
void arch_ftrace_update_code(int command);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index df46e93..d78f2cb 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2662,6 +2662,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
((iter->flags & FTRACE_ITER_ENABLED) &&
!(rec->flags & FTRACE_FL_ENABLED)) ||
+ ((iter->flags & FTRACE_ITER_UNSAFE_ONLY) &&
+ !ftrace_lookup_ip(ftrace_unsafe_rcu, rec->ip)) ||
+
((iter->flags & FTRACE_ITER_NO_UNSAFE) &&
ftrace_lookup_ip(ftrace_unsafe_rcu, rec->ip))) {
@@ -2799,6 +2802,24 @@ ftrace_avail_open(struct inode *inode, struct file *file)
}
static int
+ftrace_rcu_unsafe_open(struct inode *inode, struct file *file)
+{
+ struct ftrace_iterator *iter;
+
+ if (unlikely(ftrace_disabled))
+ return -ENODEV;
+
+ iter = __seq_open_private(file, &show_ftrace_seq_ops, sizeof(*iter));
+ if (iter) {
+ iter->pg = ftrace_pages_start;
+ iter->flags = FTRACE_ITER_UNSAFE_ONLY;
+ iter->ops = &global_ops;
+ }
+
+ return iter ? 0 : -ENOMEM;
+}
+
+static int
ftrace_enabled_open(struct inode *inode, struct file *file)
{
struct ftrace_iterator *iter;
@@ -3850,6 +3871,13 @@ static const struct file_operations ftrace_avail_fops = {
.release = seq_release_private,
};
+static const struct file_operations ftrace_rcu_unsafe_fops = {
+ .open = ftrace_rcu_unsafe_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
static const struct file_operations ftrace_enabled_fops = {
.open = ftrace_enabled_open,
.read = seq_read,
@@ -4086,6 +4114,9 @@ static __init int ftrace_init_dyn_debugfs(struct dentry *d_tracer)
trace_create_file("available_filter_functions", 0444,
d_tracer, NULL, &ftrace_avail_fops);
+ trace_create_file("rcu_unsafe_filter_functions", 0444,
+ d_tracer, NULL, &ftrace_rcu_unsafe_fops);
+
trace_create_file("enabled_functions", 0444,
d_tracer, NULL, &ftrace_enabled_fops);
--
1.7.10.4
next prev parent reply other threads:[~2013-09-04 14:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-04 14:35 [for-next][PATCH 00/18] ftrace/rcu: Handle unsafe RCU functions and ftrace callbacks Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 01/18] tracing: Make tracing_cpumask available for all instances Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 02/18] ftrace: Fix a slight race in modifying what function callback gets traced Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 03/18] ftrace/rcu: Do not trace debug_lockdep_rcu_enabled() Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 04/18] ftrace: Add hash list to save RCU unsafe functions Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 05/18] ftrace: Do not set ftrace records for unsafe RCU when not allowed Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 06/18] ftrace: Set ftrace internal function tracing RCU safe Steven Rostedt
2013-09-04 14:35 ` [for-next][PATCH 07/18] ftrace: Add test for ops against unsafe RCU functions in callback Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 08/18] ftrace: Do not display non safe RCU functions in available_filter_functions Steven Rostedt
2013-09-04 14:36 ` Steven Rostedt [this message]
2013-09-04 14:36 ` [for-next][PATCH 10/18] ftrace: Add selftest to check if RCU unsafe functions are filtered properly Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 11/18] ftrace: Create a RCU unsafe checker Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 12/18] ftrace: Add infrastructure to stop RCU unsafe checker from checking Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 13/18] ftrace: Disable RCU unsafe checker when function graph is enabled Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 14/18] ftrace: Disable the RCU unsafe checker when irqsoff " Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 15/18] ftrace/lockdep: Have the RCU lockdep splat show what function triggered Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 16/18] ftrace/rcu: Mark functions that are RCU unsafe Steven Rostedt
2013-09-04 16:43 ` Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 17/18] ftrace/cpuidle/x86: " Steven Rostedt
2013-09-04 14:36 ` [for-next][PATCH 18/18] ftrace: Print a message when the rcu checker is disabled Steven Rostedt
2013-09-04 18:27 ` [for-next][PATCH 00/18] ftrace/rcu: Handle unsafe RCU functions and ftrace callbacks 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=20130904143701.776155629@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox