This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How to know address of invoked function
- From: Mark Wielaard <mjw at redhat dot com>
- To: domenico dot dileo at unina dot it
- Cc: systemtap at sourceware dot org
- Date: Tue, 07 Aug 2012 14:56:41 +0200
- Subject: Re: How to know address of invoked function
- References: <20120807131017.41561ap3fymurxcp@inbox.unina.it>
On Tue, 2012-08-07 at 13:10 +0200, domenico.dileo@unina.it wrote:
> With the following code
> probe kernel.function("*mm/*.c").call{
> printf ("%s %s",thread_indent(1), probefunc())
>
> }
> I can trace all the functions called by mm.
> The resulting output is something like:
> ->do_obj_copy
> ->kmalloc
> ...
> I would like to have for each called function also it is address (
> the address stored in the PC) for instance,
> -> do_obj_copy c091379
The addr() function will give you the PC address of the probe point (in
kernel space, use uaddr() for the user address):
http://sourceware.org/systemtap/tapsets/API-addr.html
So try something like:
probe kernel.function("*@mm/*.c").call {
printf ("%s %s@%p",thread_indent(1), probefunc(), addr())
}
Cheers,
Mark