From owner-freebsd-dtrace@FreeBSD.ORG Sat Jul 6 12:59:01 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6002EF2B; Sat, 6 Jul 2013 12:59:01 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 3924A1731; Sat, 6 Jul 2013 12:59:00 +0000 (UTC) Received: from pool-96-250-5-62.nycmny.fios.verizon.net ([96.250.5.62]:64078 helo=minion.home) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UvS4p-0002Oz-Vb; Sat, 06 Jul 2013 08:59:00 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: [RFC] reworking FreeBSD's SDT implementation From: George Neville-Neil In-Reply-To: <20130705032536.GA1570@charmander> Date: Sat, 6 Jul 2013 08:58:59 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <1BF6D495-5C7E-4FC3-B5A7-BB47C3D2D7F8@freebsd.org> References: <20130703041023.GA82673@raichu> <20130705032536.GA1570@charmander> To: Mark Johnston X-Mailer: Apple Mail (2.1508) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 12:59:01 -0000 On Jul 4, 2013, at 23:25 , Mark Johnston wrote: > On Wed, Jul 03, 2013 at 12:10:23AM -0400, Mark Johnston wrote: >> Hello, >>=20 >> There are a few problems with the way SDT is currently implemented in >> FreeBSD. First, the DTrace framework isn't notified when modules are >> unloaded, so any probes created by these modules are never destroyed >> (this problem isn't specific to SDT though, FBT probes have the same >> problem). Second, there is currently nothing preventing one from >> unloading a module while some of its SDT probes are enabled; doing = this >> will generally cause a panic. Finally, providers are "tied" to = modules >> in the sense that dtrace_unregister() is called on each provider >> declared in a module when that module is unloaded. This is inflexible = - >> probes already have a "module" field to indicate which module they're >> defined in, and it would restrict the implementation of, say, a >> hypothetical GEOM or netgraph provider, which would probably contain >> some common probes for each GEOM or netgraph module. Plus a panic = will >> occur if a probe from one module is enabled and a second module >> declaring the provider of the probe is unloaded. >>=20 >> I have a patch at [1] which tries to solve all of these problems. It >> more or less completely reworks FreeBSD's SDT implementation = (currently >> contained in kern/kern_sdt.c and cddl/dev/sdt/sdt.c) and changes a >> number of things: >>=20 >> [...] >>=20 >> I'm also writing a man page for the SDT macros so that there's some >> guidance on how to create SDT probes and providers. >=20 > I've copied a draft SDT man page below. Any > suggestions/corrections/comments/criticisms are most welcome. >=20 > I would also like to have man pages for individual providers, but this > is a start. :) Hello Mark, Sorry to take to long to reply. I think your approach to SDTs is sound = and we should move forward with that, in particular as you say it brings us closer to = the implementation ideas in Solaris. I will try to test your patch on HEAD today and let = you know if I have any problems with it. In the meantime feel free to test and commit it = on your own, don't wait for me. The man page also looks good. Best, George