[PATH 3/3] User space probes-single-stepping-out-of-line-take4

bibo mao bibo_mao@linux.intel.com
Thu Mar 23 01:58:00 GMT 2006


Prasanna,
 > +	spin_lock_irqsave(&uprobe_lock, ucb->flags);
 > +	/* preemption is disabled, remains disabled
 > +	 * untill we single step on original instruction.
 > +	 */
 > +	preempt_disable();
when single step executing probed application instruction, local irq and 
  preempt are both disabled, I have two questions:
1) If probe point is about execv/exit, which will change VMA space of 
probed process, then what is next IP pointer after single stepping.
2) Some system call like read/wait will sleep by itself, but irq/preempt 
    are both disabled, there will be problem if application sleep.

thanks
bibo,mao

Prasanna S Panchamukhi wrote:
> This patch provides a mechanism for probe handling and
> executing the user-specified handlers.
> 
> Each userspace probe is uniquely identified by the combination of
> inode and offset, hence during registeration the inode and offset
> combination is added to uprobes hash table. Initially when
> breakpoint instruction is hit, the uprobes hash table is looked up
> for matching inode and offset. The pre_handlers are called in
> sequence if multiple probes are registered. Similar to kprobes,
> uprobes also adopts to single step out-of-line, so that probe miss in
> SMP environment can be avoided. But for userspace probes, instruction
> copied into kernel address space cannot be single stepped, hence the
> instruction must be copied to user address space. The solution is to
> find free space in the current process address space and then copy the
> original instruction and single step that instruction.
> 
> User processes use stack space to store local variables, agruments and
> return values. Normally the stack space either below or above the
> stack pointer indicates the free stack space.



More information about the Systemtap mailing list