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]

Re: Initial stap support for inode-based uprobes


On Wed, 2011-11-16 at 11:39 -0600, David Smith wrote:
> > * Probe IP.  For many probe handlers, we try to set the pt_regs IP to
> > the actual breakpoint IP, but in this case we don't happen to even know
> > the virtualized address.  Uprobes itself uses uprobes_get_bkpt_addr() in
> > some instances, but that's not exposed for our use.

This is really architecture dependent, we just currently do it by
querying kprobes or uprobes where the breakpoint was set. On some
architectures (x86 at least) the PC gets munged during the breakpoint
processing (it is set after the breakpoint instruction on that
architecture), which causes some confusion for some of the runtime or
scripts which look at the REG_IP and see something different than they
expect (in the worst case the PC is just after the current function or
module). If you cannot get at the actual breakpoint address you will
need to resort to architecture specific code, that know the breakpoint
instruction used and how much the PC should be adjusted (normally the
width of the breakpoint instruction).

uprobe_stmt_num.exp and uprobe_uaddr.exp are the tests to look at. But
also tests that do unwinding rely on REG_IP being somewhat sane.

Cheers,

Mark


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