This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to know address of invoked function


Thank you Mark, you were very helpful
Just to know a bit more on systemtap, does it make sense what I was trying to do?
I will also take a look at addr() implementation...


Quoting Mark Wielaard <mjw@redhat.com>:

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





Domenico Di Leo, PhD student, Universitï degli Studi di Napoli Federico II Ph: +39 081 676770 Fax: +39 081 676574 Web: http://wpage.unina.it/domenico.dileo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]