public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/6866] New: Extend stp_symbol_snprintf for user space
@ 2008-09-02 10:12 mjw at redhat dot com
  2008-09-02 10:15 ` [Bug runtime/6866] " mjw at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mjw at redhat dot com @ 2008-09-02 10:12 UTC (permalink / raw)
  To: systemtap

Currently stp_symbol_snprintf (and _stp_func_print, _stp_symbol_print) in
runtime/sym.c only reliably work for kernel symbols. There is a little support
for printing (static) user space executable symbols when running stap with -d
for the executable you are interested in. But that only kind of works by accident.

An executable given through -d is currently treated in main.cxx as "just"
another kernel module which is added to the systemtap_session.unwindsym_modules
vector. translate.cxx then outputs the _stp_symbol[] for a _stp_section in the
"fake" _stp_module for the binary in the stap-symbols.h file.

All the stp_symbol functions call _stp_kallsyms_lookup() which finds the closest
section and associated module, which, if the given address happens to be in user
space, will find the address associated with a user space symbol for the
executable _stp_module entry. Note that this only really works for one
executable given, so is unreliably when multiple executables can queried in a
probe. See bug #6580 comment #1 for an example of when this (kind of) works.

To make this work reliably one has to associate the _stp_module entry
(_stp_symbol table) of the executable given with -d to the actual/current
process active during the probe. Then when calling _stp_kallsyms_lookup() one
can check whether the given address is in user space and do the lookup in the
right symbol table.

The most likely candidate for this mapping would be the _stp_tf_vma_entry struct
 so we can query __stp_tf_get_vma_entry() for the current task and requested
address to get the correct symbol table. The association would be done on
__stp_tf_add_vma when the vma is file based and matches the executable
_stp_module name field.

This assumes each such executable module has just one section with symbols.
Which I assume is correct since for executables with shared libraries we would
supply each .so separately.

-- 
           Summary: Extend stp_symbol_snprintf for user space
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: mjw at redhat dot com


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

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

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

* [Bug runtime/6866] Extend stp_symbol_snprintf for user space
  2008-09-02 10:12 [Bug runtime/6866] New: Extend stp_symbol_snprintf for user space mjw at redhat dot com
@ 2008-09-02 10:15 ` mjw at redhat dot com
  2008-09-02 15:04 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mjw at redhat dot com @ 2008-09-02 10:15 UTC (permalink / raw)
  To: systemtap



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |6580
              nThis|                            |


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

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

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

* [Bug runtime/6866] Extend stp_symbol_snprintf for user space
  2008-09-02 10:12 [Bug runtime/6866] New: Extend stp_symbol_snprintf for user space mjw at redhat dot com
  2008-09-02 10:15 ` [Bug runtime/6866] " mjw at redhat dot com
@ 2008-09-02 15:04 ` fche at redhat dot com
  2008-09-03 17:07 ` mjw at redhat dot com
  2009-03-27 16:16 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fche at redhat dot com @ 2008-09-02 15:04 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-09-02 15:03 -------
At the same time, __stp_relocate() needs to learn how
to search the same table for actual relocation base
information for userspace binaries.


-- 


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

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

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

* [Bug runtime/6866] Extend stp_symbol_snprintf for user space
  2008-09-02 10:12 [Bug runtime/6866] New: Extend stp_symbol_snprintf for user space mjw at redhat dot com
  2008-09-02 10:15 ` [Bug runtime/6866] " mjw at redhat dot com
  2008-09-02 15:04 ` fche at redhat dot com
@ 2008-09-03 17:07 ` mjw at redhat dot com
  2009-03-27 16:16 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: mjw at redhat dot com @ 2008-09-03 17:07 UTC (permalink / raw)
  To: systemtap



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |5635
              nThis|                            |
         AssignedTo|systemtap at sources dot    |mjw at redhat dot com
                   |redhat dot com              |
             Status|NEW                         |ASSIGNED


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

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

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

* [Bug runtime/6866] Extend stp_symbol_snprintf for user space
  2008-09-02 10:12 [Bug runtime/6866] New: Extend stp_symbol_snprintf for user space mjw at redhat dot com
                   ` (2 preceding siblings ...)
  2008-09-03 17:07 ` mjw at redhat dot com
@ 2009-03-27 16:16 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fche at redhat dot com @ 2009-03-27 16:16 UTC (permalink / raw)
  To: systemtap



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |10010
              nThis|                            |


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

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

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

end of thread, other threads:[~2009-03-27 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-02 10:12 [Bug runtime/6866] New: Extend stp_symbol_snprintf for user space mjw at redhat dot com
2008-09-02 10:15 ` [Bug runtime/6866] " mjw at redhat dot com
2008-09-02 15:04 ` fche at redhat dot com
2008-09-03 17:07 ` mjw at redhat dot com
2009-03-27 16:16 ` fche 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).