public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "K.Prasad" <prasad@linux.vnet.ibm.com>
To: Jim Keniston <jkenisto@us.ibm.com>, "Frank Ch. Eigler" <fche@redhat.com>
Cc: SystemTap Mailing list <systemtap@sources.redhat.com>,
	        Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com>,
	        David Smith <dsmith@redhat.com>
Subject: Fw: Re: [PATCH v2] Tracepoint Tapset for Memory Subsystem
Date: Tue, 29 Sep 2009 09:06:00 -0000	[thread overview]
Message-ID: <20090929090615.GA9595@in.ibm.com> (raw)

Not sure why the names in the "To" field were dropped by my mail client.
Re-sending the mail again.

----- Forwarded message from "K.Prasad" <prasad@linux.vnet.ibm.com> -----

Date: Tue, 29 Sep 2009 14:28:17 +0530
From: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: David Smith <dsmith@redhat.com>,
	Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com>,
	systemtap@sources.redhat.com
Subject: Re: [PATCH v2] Tracepoint Tapset for Memory Subsystem
Reply-To: prasad@linux.vnet.ibm.com

On Mon, Sep 28, 2009 at 11:12:28AM -0700, Jim Keniston wrote:
> 
> On Fri, 2009-09-25 at 14:19 -0500, David Smith wrote:
> ...
> > 
> > Sorry to keep finding more things, but...
> > 
> > I'm a bit worried about your use of '__builtin_return_address()' here.
> > Jim Keniston reported on it back in 2005 in the following message, but
> > there isn't much context.
> > 
> > <http://sourceware.org/ml/systemtap/2005-q2/msg00242.html>
> > 
> > Jim, can you remember some context here?  Was the use of
> > '__builtin_return_address' considered good/bad/neutral?  We don't seem
> > to use it anywhere else.
> > 
> 
> In case anybody still cares...
>

Yes, your explanation actually helped!

> The context was that we had recently implemented kretprobes, and
> somebody pointed out that hijacking the return address would cause
> __builtin_return_address() to return the wrong value.  From my survey of
> the kernel, I concluded that "__builtin_return_address is used entirely
> for tracing (tracing that is disabled by default), profiling, and error
> reporting.  I couldn't find any case where normal operation of the OS
> would be affected."
> 
> Ironically, soon after that, kprobes itself started using
> __builtin_return_address().
> 
> Anyway, there was no controversy as to whether
> __builtin_return_address() was bad or good per se; it was simply
> recognized that it would return invalid results when called from a
> return-probed function.
> 
> Jim
> 

This means that __builtin_return_address() would return incorrect values
irrespective of whether it is used inside a kprobe or a tracepoint based
probe i.e. "kmem.kfree.kp" or "kmem.kfree.tp".

And since the tracepoints export them (through $call_site parameter),
I think we can continue to use them in the kprobe based fallback probe
too.

Thanks,
K.Prasad


----- End forwarded message -----

                 reply	other threads:[~2009-09-29  9:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090929090615.GA9595@in.ibm.com \
    --to=prasad@linux.vnet.ibm.com \
    --cc=dsmith@redhat.com \
    --cc=fche@redhat.com \
    --cc=jkenisto@us.ibm.com \
    --cc=rajduddu@linux.vnet.ibm.com \
    --cc=systemtap@sources.redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).