public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Jim Keniston <jkenisto@us.ibm.com>
To: David Smith <dsmith@redhat.com>
Cc: Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com>,
	        systemtap@sources.redhat.com
Subject: Re: [PATCH v2] Tracepoint Tapset for Memory Subsystem
Date: Mon, 28 Sep 2009 18:12:00 -0000	[thread overview]
Message-ID: <1254161548.5107.14.camel@localhost.localdomain> (raw)
In-Reply-To: <4ABD17B5.6080500@redhat.com>


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...

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

  parent reply	other threads:[~2009-09-28 18:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-19  5:01 [PATCH] " Rajasekhar Duddu
2009-09-22 17:39 ` David Smith
2009-09-22 21:23   ` Frank Ch. Eigler
2009-09-22 22:05     ` David Smith
2009-09-24 18:08       ` [PATCH v2] " Rajasekhar Duddu
2009-09-25 19:19         ` David Smith
2009-09-25 20:07           ` Frank Ch. Eigler
2009-09-28 18:12           ` Jim Keniston [this message]
2009-09-29  8:58             ` K.Prasad
2009-09-25 21:50         ` Josh Stone
2009-09-30 10:12           ` Rajasekhar Duddu
2009-10-02 15:14             ` [PATCH v3] " Rajasekhar Duddu
2009-10-06 19:01               ` Frank Ch. Eigler
2009-10-07 13:07                 ` Rajasekhar Duddu
2009-10-07 19:51                   ` Frank Ch. Eigler
2009-10-09 17:08                     ` Rajasekhar Duddu
2009-10-09 17:38                       ` Frank Ch. Eigler
2009-10-14  8:32                         ` Rajasekhar Duddu

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=1254161548.5107.14.camel@localhost.localdomain \
    --to=jkenisto@us.ibm.com \
    --cc=dsmith@redhat.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).