[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130831194506.GL3871@linux.vnet.ibm.com>
Date: Sat, 31 Aug 2013 12:45:06 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Olsa <jolsa@...hat.com>
Subject: Re: [RFC][PATCH 04/18 v2] ftrace: Add test for ops against unsafe
RCU functions in callback
On Sat, Aug 31, 2013 at 01:11:21AM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
>
> When more than one ftrace_ops is registered, the list function is
> is used to call all registered functions. It uses the filter and
> notrace hashes from the ftrace_ops to determine if the corresponding
> callback should be called or not.
>
> Currently, it does not take into account for RCU unsafe functions.
> If multiple functions are registered, and an RCU safe callback is
> used on a RCU unsafe function, and the RCU unsafe callback says to
> trace all functions, it will end up tracing this RCU unsafe function
> and still suffer the problems when using RCU when RCU tracing is
> off.
>
> Add a test to the multiple ops list function to test if the ops in
> question can use an RCU unsafe function or not, and if the function
> being traced happens to be an RCU unsafe function.
>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> ---
> kernel/trace/ftrace.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index a45deaa..06504b2 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1480,7 +1480,9 @@ ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs)
> if ((ftrace_hash_empty(filter_hash) ||
> ftrace_lookup_ip(filter_hash, ip)) &&
> (ftrace_hash_empty(notrace_hash) ||
> - !ftrace_lookup_ip(notrace_hash, ip)))
> + !ftrace_lookup_ip(notrace_hash, ip)) &&
> + (ops->flags & FTRACE_OPS_FL_RCU_SAFE ||
> + !ftrace_lookup_ip(ftrace_unsafe_rcu, ip)))
> ret = 1;
> else
> ret = 0;
> --
> 1.7.10.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists