On Mon, 2009-08-03 at 12:19 +0530, Srikar Dronamraju wrote:
> > ...
> > > 
> > > and the corresponding function call graph was:
> > > 
> > >   3854 zsh(1350): uprobe_report_signal action=0x0 
> > > engine=0xffff88003ac36078 tsk=0xffff880037d0a470 regs=0xffff880059097f58 
> > > info
> > >   3867 zsh(1350):  utrace_attach_pid pid=0xffff880078e8d680 flags=0x1 
> > > ops=0xffffffff81443be0 data=0x0 
> > >   3881 zsh(1350):   utrace_attach_task target=0xffff880037d0a470 
> > > flags=0x1 ops=0xffffffff81443be0 data=0x0 
> > >   3890 zsh(1350):    matching_engine utrace=0xffff880037d0aad8 flags=0x1 
> > > ops=0xffffffff81443be0 data=0x0 
> > >   3901 zsh(1350):    matching_engine return=0xffff880078d190f0 
> > >   3907 zsh(1350):   utrace_attach_task return=0xffff880078d190f0 
> > >   3914 zsh(1350):   put_task_struct t=0xffff880037d0a470 
> > >   3918 zsh(1350):   put_task_struct 
> > >   3923 zsh(1350):  utrace_attach_pid return=0xffff880078d190f0 
> > 
> > I can't think of why utrace_attach_pid() would get called here.
> 
> utrace_attach_pid is from xol_get_area(). So its clear that this was the
> first time uprobe_report_signal was called. Also the call to
> uretprobe_set_trampoline (below) confirms that this was the first time
> uprobe_report_signal was called. 

Yes, indeed.

...
> 
> 
> So as per my analysis, gdb_utrace_report_signal was called, followed by
> uprobe_report_signal. Since gdb_utrace_report_signal requested for
> UTRACE_STOP as resume action for SIGTRAP, the thread got stopped.
> uprobes was waiting for either the singlestep to occur (or the process to
> exit/exec or some other event) before it could signal the process to be
> quiesced. 

Uprobes attempts to handle this situation.  Before returning
(UTRACE_SINGLESTEP | UTRACE_SIGNAL_IGN), uprobe_report_signal()
registers to be notified of quiesce events.  If report_signal for some
other engine (e.g., gdbstub's) requests a UTRACE_STOP, that'll override
uprobe_report_signal()'s UTRACE_SINGLESTEP.  But uprobe_report_quiesce()
should get called as a result and re-assert UTRACE_SINGLESTEP.  Assuming
gdbstub's report_quiesce callback eventually returns something other
than UTRACE_STOP, the UTRACE_SINGLESTEP should take effect.

That was my thinking, anyway.  I can't guarantee that it actually works
that way.

> 
...
> 
> --
> Thanks and Regards
> Srikar

Jim

Reply via email to