This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Initial stap support for inode-based uprobes
- From: Mark Wielaard <mjw at redhat dot com>
- To: David Smith <dsmith at redhat dot com>
- Cc: Josh Stone <jistone at redhat dot com>, systemtap at sourceware dot org, Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- Date: Thu, 17 Nov 2011 10:52:14 +0100
- Subject: Re: Initial stap support for inode-based uprobes
- References: <4DD5DEAA.3050908@redhat.com> <4EC3F556.4010902@redhat.com>
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