All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: move static old_tracer to trace_iterator
Date: Sat, 30 Jan 2010 23:47:55 +0100	[thread overview]
Message-ID: <20100130224754.GL5675@nowhere> (raw)
In-Reply-To: <4B5E998D.9070603@cn.fujitsu.com>

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@cn.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?


      reply	other threads:[~2010-01-30 22:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26  7:28 [PATCH] tracing: move static old_tracer to trace_iterator Lai Jiangshan
2010-01-30 22:47 ` Frederic Weisbecker [this message]

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=20100130224754.GL5675@nowhere \
    --to=fweisbec@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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.