From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31202 invoked by alias); 23 Mar 2006 01:58:11 -0000 Received: (qmail 31192 invoked by uid 22791); 23 Mar 2006 01:58:10 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from fmr21.intel.com (HELO scsfmr001.sc.intel.com) (143.183.121.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Mar 2006 01:58:06 +0000 Received: from scsfmr101.sc.intel.com ([10.3.253.10]) by scsfmr001.sc.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id k2N1vp3N013882; Thu, 23 Mar 2006 01:57:51 GMT Received: from [10.239.13.78] (maobb.sh.intel.com [10.239.13.78]) by scsfmr101.sc.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with ESMTP id k2N1pnvS021028; Thu, 23 Mar 2006 01:51:50 GMT Message-ID: <4421FE59.4070009@linux.intel.com> Date: Thu, 23 Mar 2006 01:58:00 -0000 From: bibo mao User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: prasanna@in.ibm.com CC: systemtap@sources.redhat.com Subject: Re: [PATH 3/3] User space probes-single-stepping-out-of-line-take4 References: <20060315060456.GA6376@in.ibm.com> <20060315060552.GA20823@in.ibm.com> <20060315060648.GB20823@in.ibm.com> In-Reply-To: <20060315060648.GB20823@in.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.52 on 10.3.253.10 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00860.txt.bz2 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.