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]

pr6866 (symbols for user space) branch


Hi,

I added a pr6866 branch to git that contains some of my code for getting
http://sourceware.org/bugzilla/show_bug.cgi?id=6866 (Extend
stp_symbol_snprintf for user space) resolved. Which is a requirement for
user space backtraces (how boring are backtraces with only addresses and
no symbol names).

It isn't really ready yet, which is why I put it on a branch and not on
the trunk (sorry, it is just one commit, since I wasn't really using git
to track changes, I will from now on do more incremental changes there).

The branch currently has one simple testcase for resolving the address
of a symbol from the main executable and glibc
(testsuite/systemtap.context/usymbols.exp). This works by enabling task
finder vma tracking, associating any found vma entries with the
corresponding module, adding a new symbolname function (is that a good
name?) to context-symbols.stp that passes the current task to
stp_symbol_snprintf() which uses the vma tables to find the right module
to resolve the symbol against.

There are a couple of cheats in the current implementation (aka, stuff I
am working on):

- The testcase only works for x86_64.
  This is because I tried to be too smart, I'll rewrite the testcase to
  use its own library and register addresses from them instead if trying
  to trick glibc into exposing its internal addresses to the kernel. It
  also needs some more/larger testing with stuff like dynamically loaded
  libraries.
- The testcase needs to do some extra work parsing the output of ldd,
  and then resolving the libraries to their absolute canonical file
  names, passing the to stap with -d to get the symbol table in and make
  matching the vma paths to the module paths (relative paths and/or
  paths/files with symlinks cannot be mapped). This should all be
  automated for the user. I thought there was already a PR for this,
  but cannot find it.
- The testcase cheats by adding an (empty) process probe to get the task
  finder to initialize. It should enable the task finder whenever user
  space symbol resolution is requested. (It does already only do vma
  tracking when needed.)
- This currently only works for the stp_symbol_snprintf() function in
  sym.c and it cheats a little by just getting the first section and
  forcing it to the vma vm_start address if it is .dynamic instead of
  doing some smart relocation thing. I will extend it to cover all other
  ways of symbol resolution/printing there.

To follow the branch, git pull, and do something like:
git checkout --track -b pr6866 origin/pr6866

Cheers,

Mark


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