linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: rubisher <rubisher@scarlet.be>
Cc: Grant Grundler <grundler@parisc-linux.org>,
	linux-parisc <linux-parisc@vger.kernel.org>
Subject: Re: How to grab begining/end functions' address? [Wa: 'Trace patches test' ]
Date: Sun, 17 Feb 2008 07:17:43 -0700	[thread overview]
Message-ID: <20080217141742.GC21012@parisc-linux.org> (raw)
In-Reply-To: <47B811EC.3080707@scarlet.be>

On Sun, Feb 17, 2008 at 10:52:28AM +0000, rubisher wrote:
> Has far as the gcc builtin instrument-functions doesn't work as I expected, 
> I would like to grab manually the address of the functions' begin and end 
> like something:
> void foo(){
> foo_start:
> 	printk ("%s() start at %p.\n, __FUNCTION__, 
> 	???ADDRESS_OF???(foo_start);
> [snip]
> foo_end:
> 	printk ("%s() start at %p.\n, __FUNCTION__, 
> 	???ADDRESS_OF???(foo_end);
> };
> 
> It seems to me that I read it something like this in the past but no means 
> to remember how to do it.

The kernel already has code to do this -- look at the stack backtraces.
They show addresses, function names and length of the function.  Start
by looking at BUG() and trace through to find out how the kernel does
this.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

      reply	other threads:[~2008-02-17 14:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 13:35 'Trace patches test' [Was: ccio_clear_io_tlb() and __raw_write() more question?] rubisher
2008-01-23  7:13 ` Grant Grundler
2008-02-17 10:52   ` How to grab begining/end functions' address? [Wa: 'Trace patches test' ] rubisher
2008-02-17 14:17     ` Matthew Wilcox [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=20080217141742.GC21012@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=grundler@parisc-linux.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=rubisher@scarlet.be \
    /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 NNTP newsgroup(s).