[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100130224754.GL5675@nowhere>
Date: Sat, 30 Jan 2010 23:47:55 +0100
From: Frederic Weisbecker <fweisbec@...il.com>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: move static old_tracer to trace_iterator
On Tue, Jan 26, 2010 at 03:28:13PM +0800, Lai Jiangshan wrote:
>
> static old_tracer is global for all processes.
>
> So there is a potential bug when:
> current_trace and static old_tracer are changed by other processes,
> current_trace and static old_tracer are match with each other.
> but *iter->trace and *current_trace are not match.
>
> This patch move old_tracer to trace_iterator, and make it not global.
>
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
We should actually get rid of old_tracer and have iter->trace
to be a pointer so that the check can be summarized with
if (iter->trace != current_trace)
I don't exactly recall why we've made iter->trace a copy
of the current_trace. I remember I did it this uglyness,
but I don't remember exactly why. Probably for bad reasons
that should be fixed another way.
Ok, having a deeper look, I think it was because some tracers
implement callbacks whereas others may not, so the
simple:
if (iter->trace->splice_read)
ret = iter->trace->splice_read(...)
would be racy if we weren't copying current_trace.
To fix this, I would rather try to ensure every tracers
have stub callbacks for those unimplemented. This is going
to be much proper than this dance between current_tracer,
old_tracer and iter->trace.
What do you think?
--
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