public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/16589] New: Use elfutils libdw dwarf_getlocations () to pick better probe point to access vars
@ 2014-02-14 22:30 mjw at redhat dot com
  2014-02-19 21:08 ` [Bug translator/16589] " jlebon at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: mjw at redhat dot com @ 2014-02-14 22:30 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16589

            Bug ID: 16589
           Summary: Use elfutils libdw dwarf_getlocations () to pick
                    better probe point to access vars
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: mjw at redhat dot com

elfutils 0.157 comes with a new function dwarf_getlocations () that enumerate
the locations ranges and descriptions covered by a given attribute. This could
help in situations like the following (seen on some ppc64 kernel probes):

semantic error: not accessible at this address [man error::dwarf]
(0xc0000000002091e4, dieoffset: 0x104eb65): identifier '$p'
at /usr/local/share/systemtap/tapset/linux/memory.stp:245:12

That DIE is:

 [104eb65]        formal_parameter
                 abstract_origin      (ref4) [104a651]
                 location             (sec_offset) location list [57cc07]

The origin is:

 [104a651]      formal_parameter
               name                 (string) "p"
               decl_file            (data1) 7
               decl_line            (data2) 402
               type                 (ref4) [103f972]

It is an argument of the inlined_subroutine at [104eb0e] with as origin
[104a644] which is:

 [104a644]    subprogram
             external             (flag_present) Yes
             name                 (strp) "oom_kill_process"
             decl_file            (data1) 7
             decl_line            (data2) 402
             prototyped           (flag_present) Yes
             inline               (data1) inlined (1)

It is inlined a couple of times in that CU.

The location list [57cc07] says:

 [57cc07]  +0x00000000002091ec..+0x0000000000209234 [   0] reg3
           +0x00000000002092d0..+0x00000000002092d4 [   0] reg3
           +0x00000000002092d4..+0x00000000002092db [   0] reg9
           +0x0000000000209360..+0x000000000020937f [   0] reg3

we are trying to get the location at 2091e4, which is a little before
the first range.

So one thing that we could possibly do in these situations where GCC didn't
produce a location expression at the address we are interested in is to
use the dwarf_getlocations () function to try to pick a better probe point at
an address where there is a location entry defined.

The only thing making that slight more difficult is that we detect this issue
fairly late, so it might take a bit of work to retry the probe at a different
address. And we would have to check/warn the address is still close to where
the user would have liked it.

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

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

* [Bug translator/16589] Use elfutils libdw dwarf_getlocations () to pick better probe point to access vars
  2014-02-14 22:30 [Bug translator/16589] New: Use elfutils libdw dwarf_getlocations () to pick better probe point to access vars mjw at redhat dot com
@ 2014-02-19 21:08 ` jlebon at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: jlebon at redhat dot com @ 2014-02-19 21:08 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16589

Jonathan Lebon <jlebon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jlebon at redhat dot com

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

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

end of thread, other threads:[~2014-02-19 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 22:30 [Bug translator/16589] New: Use elfutils libdw dwarf_getlocations () to pick better probe point to access vars mjw at redhat dot com
2014-02-19 21:08 ` [Bug translator/16589] " jlebon 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).