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: [PATH 3/3] User space probes-single-stepping-out-of-line-take4


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.


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