How to know address of invoked function

domenico.dileo@unina.it domenico.dileo@unina.it
Tue Aug 7 11:08:00 GMT 2012


Hello,
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

To this end, I tried to modify the code of probefunc in the  
context-symbols.stp.
I added the line
_stp_print_addr(CONTEXT->ri->rp->u.vaddr, STP_SYM_FULL, NULL)

before the last "}" in the probefunc's code

I tried to understand how to do it by looking at
the backtrace function which prints the address of the invoked functions.

I can't see any address printed, apparently the _stp_print_addr has no  
effects,
the output remains unchanged.
Maybe it is also useful to know that after I modify the context-symbol file,
I just save it and call stap (with my input script). Should I recompile stap
or perform other actions after modifying a tapset file? or I should
change the probefunc in another way?
Thank you in advance


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



More information about the Systemtap mailing list