public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/9792] New: probefunc() returns absolute address instead of the function name
@ 2009-01-27 11:04 kamalesh at linux dot vnet dot ibm dot com
  2009-01-31  7:42 ` [Bug translator/9792] " mjw at redhat dot com
  2009-02-01 15:57 ` mjw at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: kamalesh at linux dot vnet dot ibm dot com @ 2009-01-27 11:04 UTC (permalink / raw)
  To: systemtap

When running the make installcheck RUNTESTFLAGS="probefunc.exp" on the latest
systemtap sources, the probefunc() returns absolute address instead of the
function name.

# stap -V
SystemTap translator/driver (version 0.8/0.139 non-git sources)

Reverting the following commit, restores the behaviour of returning function name.

commit 7d9b821db6bc494417a57321b419c6b9481a2128
Author: Roland McGrath <roland@redhat.com>
Date:   Thu Dec 18 15:08:09 2008 -0800

    Fix last fix: ET_DYN addresses are taken as relative to MOD->low_addr.


global funcname
    probe kernel.statement(0xc000000000052aac).absolute {
        funcname = probefunc()
    }
    probe begin {
        log("systemtap starting probe")
    }
    probe end {
        log("systemtap ending probe")
        printf("%s\n", funcname)
    }

-- 
           Summary: probefunc() returns absolute address instead of the
                    function name
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: kamalesh at linux dot vnet dot ibm dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=9792

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug translator/9792] probefunc() returns absolute address instead of the function name
  2009-01-27 11:04 [Bug translator/9792] New: probefunc() returns absolute address instead of the function name kamalesh at linux dot vnet dot ibm dot com
@ 2009-01-31  7:42 ` mjw at redhat dot com
  2009-02-01 15:57 ` mjw at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2009-01-31  7:42 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2009-01-30 15:21 -------
Confirmed. A simpler reproducer is:
stap -e 'probe kernel.statement("resched_task") { log(probefunc()); exit(); }'

With elfutils 0.137 this will give:
resched_task
But with elfutils 0.138 this will give:
0xffffffff810310d1

Looking a bit more into this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|probefunc() returns absolute|probefunc() returns absolute
                   |address instead of the      |address instead of the
                   |function name               |function name


http://sourceware.org/bugzilla/show_bug.cgi?id=9792

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug translator/9792] probefunc() returns absolute address instead of the function name
  2009-01-27 11:04 [Bug translator/9792] New: probefunc() returns absolute address instead of the function name kamalesh at linux dot vnet dot ibm dot com
  2009-01-31  7:42 ` [Bug translator/9792] " mjw at redhat dot com
@ 2009-02-01 15:57 ` mjw at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2009-02-01 15:57 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2009-02-01 11:10 -------
The patch to elfutils in the description is indeed the culprit.
7d9b821d "Fix last fix: ET_DYN addresses are taken as relative to MOD->low_addr."

The problem that this fixes is that dwfl_module_relocate_address now returns an
actual relocated address for kernel symbol addresses relative to the "load
address" (since the kernel is ET_DYN). Previously it would just substract
main.bias (or even more wrongly debug.bias) both of which were always zero for
the kernel.

Luckily all we need is the address relative to _stext. So all we need to do is
make sure that the extra_offset we calculate based on the _stext address is also
relocated (currently we don't do this for the _stext address, but we do for all
sym.addr). That should work whether we use an elfutils with or without this bugfix.

Testing a patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roland at redhat dot com
         AssignedTo|systemtap at sources dot    |mjw at redhat dot com
                   |redhat dot com              |
             Status|NEW                         |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=9792

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-01 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-27 11:04 [Bug translator/9792] New: probefunc() returns absolute address instead of the function name kamalesh at linux dot vnet dot ibm dot com
2009-01-31  7:42 ` [Bug translator/9792] " mjw at redhat dot com
2009-02-01 15:57 ` mjw at redhat dot com

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