[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0610061015140.13066@gandalf.stny.rr.com>
Date: Fri, 6 Oct 2006 10:23:19 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: "Frank Ch. Eigler" <fche@...hat.com>
cc: Vara Prasad <prasadav@...ibm.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Ingo Molnar <mingo@...e.hu>, Paul Mundt <lethal@...ux-sh.org>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
linux-kernel <linux-kernel@...r.kernel.org>,
Jes Sorensen <jes@....com>, Andrew Morton <akpm@...l.org>,
Tom Zanussi <zanussi@...ibm.com>,
Richard J Moore <richardj_moore@...ibm.com>,
Michel Dagenais <michel.dagenais@...ymtl.ca>,
Christoph Hellwig <hch@...radead.org>,
Greg Kroah-Hartman <gregkh@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
William Cohen <wcohen@...hat.com>,
"Martin J. Bligh" <mbligh@...igh.org>,
systemtap <systemtap@...rceware.org>
Subject: Re: tracepoint maintainance models
On Fri, 6 Oct 2006, Frank Ch. Eigler wrote:
> Hi -
>
> On Fri, Oct 06, 2006 at 01:33:11AM -0400, Steven Rostedt wrote:
> > Coming into this really late, and I'm still behind in reading this and
> > related threads, but I want to throw this idea out, and it's getting
> > late.
> > [...]
> > #define MARK(label, var) \
> > asm ("debug_" #label ":\n" \
> > ".section .data\n" \
> > #label "_" #var ": xor %0,%0\n" \
> > ".previous" : : "r"(var))
> > [...]
> > $ gcc -O2 -o mark mark.c
> > $ ./mark
> > func y is in reg B at 0x80483ce
> > [...]
>
> Clever.
>
> > Now the question is, isn't MARK() in this code a non intrusive marker?
>
> Not quite. The assembly code forces gcc to materialize the data that
> it might already have inlined, and to borrow a register for the
> duration. It's still a neat idea though.
Thanks!
You're right, it is intrusive in a way that it does modify the way gcc can
optimize that section of code. But what I like about this idea, is that
it allows for us to tell gcc that we want this variable inside a register,
and then gcc can do that for us and still optimize around that. We put no
more constraints on the code, except that we want some value in a
register at some given point of execution. This should only be done for
local variables that are not easily captured in a probe.
Of course with i386's limit on registers, it can put a little strain if we
want more than one variable. But x86_64 will soon be the norm, and the
added registers should help out a lot.
-- Steve
-
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