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]

[Bug translator/5916] Exploit kretprobe entry_handler + data pouch?


------- Additional Comments From dsmith at redhat dot com  2008-03-11 21:38 -------
I can describe how the current translator-generated code caches entry-time data
for use in return probes.  Let's say your script looks like this:

  probe kernel.function("foo").return {
    print($foo_arg1)
  }

The translator sees you want to access an argument in a return probe.  So, it
synthesizes an entry probe to cache the data and also rewrites your return
probe.  Your script would end up looking something like the following example.
(Note that this is a bit simplified - there is also some recursion support which
doesn't really matter in this discussion.)

  probe kernel.function("foo") {
    _dwarf_tvar_foo[tid()] = $foo_arg1
  }
  probe kernel.function("foo").return {
    print(_dwarf_tvar_foo[tid()])
  }

This approach is simple, but has drawbacks (as you've noted in bug #5899).  The
main drawback is that the data is cached upon function entry, so the return
probe doesn't see the current value.

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


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

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


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