[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1338407068.13348.312.camel@gandalf.stny.rr.com>
Date: Wed, 30 May 2012 15:44:28 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Anton Vorontsov <anton.vorontsov@...aro.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kees Cook <keescook@...omium.org>,
Colin Cross <ccross@...roid.com>,
Tony Luck <tony.luck@...el.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>, Arnd Bergmann <arnd@...db.de>,
John Stultz <john.stultz@...aro.org>,
Shuah Khan <shuahkhan@...il.com>, arve@...roid.com,
Rebecca Schultz Zavin <rebecca@...roid.com>,
Jesper Juhl <jj@...osbits.net>,
Randy Dunlap <rdunlap@...otime.net>,
Stephen Boyd <sboyd@...eaurora.org>,
Thomas Meyer <thomas@...3r.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Marco Stornelli <marco.stornelli@...il.com>,
WANG Cong <xiyou.wangcong@...il.com>,
linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
linaro-kernel@...ts.linaro.org, patches@...aro.org,
kernel-team@...roid.com
Subject: Re: [PATCH 1/5] tracing: Fix initialization failure path in
tracing_set_tracer()
On Sat, 2012-05-26 at 06:39 -0700, Anton Vorontsov wrote:
> If tracer->init() fails, current code will leave current_tracer pointing
> to an unusable tracer, which at best makes 'current_tracer' report
> inaccurate value.
>
> Fix the issue by pointing current_tracer to nop tracer, and only update
> current_tracer with the new one after all the initialization succeeds.
>
Hmm, I'll look at this in more detail. This may be something I pull now.
(for 3.6).
-- Steve
> Signed-off-by: Anton Vorontsov <anton.vorontsov@...aro.org>
> ---
> kernel/trace/trace.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 68032c6..5cf7e67 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -3172,10 +3172,10 @@ static int tracing_set_tracer(const char *buf)
> }
> destroy_trace_option_files(topts);
>
> - current_trace = t;
> + current_trace = &nop_trace;
>
> - topts = create_trace_option_files(current_trace);
> - if (current_trace->use_max_tr) {
> + topts = create_trace_option_files(t);
> + if (t->use_max_tr) {
> int cpu;
> /* we need to make per cpu buffer sizes equivalent */
> for_each_tracing_cpu(cpu) {
> @@ -3195,6 +3195,7 @@ static int tracing_set_tracer(const char *buf)
> goto out;
> }
>
> + current_trace = t;
> trace_branch_enable(tr);
> out:
> mutex_unlock(&trace_types_lock);
--
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