From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14960 invoked by alias); 11 Jul 2007 04:31:19 -0000 Received: (qmail 14953 invoked by uid 22791); 11 Jul 2007 04:31:19 -0000 X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e3.ny.us.ibm.com (HELO e3.ny.us.ibm.com) (32.97.182.143) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Jul 2007 04:31:17 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l6B3RSx6020842 for ; Tue, 10 Jul 2007 23:27:28 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l6B4VCql485382 for ; Wed, 11 Jul 2007 00:31:12 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l6B4VCAe028446 for ; Wed, 11 Jul 2007 00:31:12 -0400 Received: from thinktux.in.ibm.com ([9.124.31.32]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l6B4VAOq028385; Wed, 11 Jul 2007 00:31:11 -0400 Received: from thinktux.in.ibm.com (localhost.localdomain [127.0.0.1]) by thinktux.in.ibm.com (Postfix) with ESMTP id 98050E78DE; Wed, 11 Jul 2007 10:03:01 +0530 (IST) Received: (from ananth@localhost) by thinktux.in.ibm.com (8.13.1/8.13.1/Submit) id l6B4X1IV013929; Wed, 11 Jul 2007 10:03:01 +0530 Date: Wed, 11 Jul 2007 04:31:00 -0000 From: Ananth N Mavinakayanahalli To: Maynard Johnson Cc: "Frank Ch. Eigler" , Dave Nomura , systemtap@sourceware.org, Maynard Johnson , James Keniston Subject: Re: proposed instruction trace support in SystemTap Message-ID: <20070711043301.GA10589@in.ibm.com> Reply-To: ananth@in.ibm.com References: <4689826A.9040902@us.ibm.com> <4693CC29.8090700@us.ibm.com> <4693F2C3.6060905@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4693F2C3.6060905@us.ibm.com> User-Agent: Mutt/1.5.11 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00086.txt.bz2 On Tue, Jul 10, 2007 at 03:57:39PM -0500, Maynard Johnson wrote: > Frank Ch. Eigler wrote: > > >Dave Nomura writes: > > > > > [snip] > > > >>>Is this sort of thing done/doable in kernel space also, or just on > >>>user-space threads? Is there an existing kernel API for management of > >>>these registers/fields? > > > > > >>[...] There is basically one single instruction trap handler that > >>the stap translator will generate with logic to figure out what > >>handler code to run [...] > > > > > >The "existing kernel API" is the key issue here. How exactly does one > >activate single-stepping traps on each of the interesting > >architectures, and on multiple different kernel generations (RHEL)? > >How does one hook into the handling system correctly (avoiding > >interference to other consumers of trap data like gdb, uprobes)? > I responded to some of these questions in my previous reply. As for > avoiding interference with other consumers of trap data, this is not > handled in the current implementation and is TBD for the SystemTap > proposal. We'll investigate how other tools are handling this. As for > kernel debuggers, that's a pretty murky picture. AFAIK, there isn't a > common kernel debugger that's in mainline. PPC64 has xmon -- don't know > about other arch's. We'll take a look at uprobes source to see how it > handles this issue, but I'm not sure where to get source from. Is it at > http://sourceware.org/systemtap/kprobes/index.html? Kprobes and xmon on powerpc use the same trap variant instruction. A scheme is in place to pass on traps that aren't caused due to kprobes. This is done using the notifier infrastructure in kernel... see kprobes_exceptions_notify(). If kprobes gets notified of a trap caused due to an xmon breakpoint, it'll just retury NOTIFY_DONE indicating that it didn't find an entry corresponding to the trap address in its table and hence is meant for some other consumer - xmon or any other interested tool. The notifier mechanism then invokes the next interested party in the chain (if one is registered). Ananth