This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] Linux Kernel Markers 0.14 for 2.6.17
- From: Mathieu Desnoyers <compudj at krystal dot dyndns dot org>
- To: Jeremy Fitzhardinge <jeremy at goop dot org>
- Cc: Martin Bligh <mbligh at google dot com>, "Frank Ch. Eigler" <fche at redhat dot com>, Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, prasanna at in dot ibm dot com, Andrew Morton <akpm at osdl dot org>, Ingo Molnar <mingo at elte dot hu>, Paul Mundt <lethal at linux-sh dot org>, linux-kernel <linux-kernel at vger dot kernel dot org>, Jes Sorensen <jes at sgi dot com>, Tom Zanussi <zanussi at us dot ibm dot com>, Richard J Moore <richardj_moore at uk dot ibm dot com>, Michel Dagenais <michel dot dagenais at polymtl dot ca>, Christoph Hellwig <hch at infradead dot org>, Greg Kroah-Hartman <gregkh at suse dot de>, Thomas Gleixner <tglx at linutronix dot de>, William Cohen <wcohen at redhat dot com>, ltt-dev at shafik dot org, systemtap at sources dot redhat dot com, Alan Cox <alan at lxorguk dot ukuu dot org dot uk>, Karim Yaghmour <karim at opersys dot com>, Pavel Machek <pavel at suse dot cz>, Joe Perches <joe at perches dot com>, "Randy.Dunlap" <rdunlap at xenotime dot net>, "Jose R. Santos" <jrs at us dot ibm dot com>
- Date: Tue, 26 Sep 2006 18:27:58 -0400
- Subject: Re: [PATCH] Linux Kernel Markers 0.14 for 2.6.17
- References: <20060926220604.GA30396@Krystal> <4519A58A.7070302@goop.org>
* Jeremy Fitzhardinge (jeremy@goop.org) wrote:
> Mathieu Desnoyers wrote:
> >Hi,
> >
> >Constructing on Jeremy Fitzhardinge's comments about gcc optimizations, I
> >rewrote (once more) the markers mechanism so that the optimized mode does
> >not
> >jump between two different inline asm. Instead, the optimized version uses
> >a
> >load immediate (in assembly) that will be used by a test to decide of a
> >branch
> >(in C).
> >
>
> I should have spelled out my point a bit more. If you've got a flag
> you're just testing, couldn't you just do:
>
> if (__mark_enabled_##name)
> (*__mark_func)(...);
>
> and do without the asms or the section?
>
Because a supplementary memory read is added on the critical path with a normal
flag test. The assembly can provide an immediate value without any need of
memory read from the data section.
To change the behavior of the program, I just have to change the immediate value
in the movb instruction.
However, the non-optimized generic version does exactly this : it simply tests a
flag loaded from memory. It can be very useful on embedded systems where the
code is in read-only memory.
Regards,
Mathieu
OpenPGP public key: http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68