From owner-freebsd-dtrace@FreeBSD.ORG Thu Jul 25 23:40:10 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E02BE609; Thu, 25 Jul 2013 23:40:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2D32797; Thu, 25 Jul 2013 23:40:10 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id a1so1274756qcx.11 for ; Thu, 25 Jul 2013 16:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=pNQYBW5tF0bnssTvDFlTNwJpNTSGAZGILqc7kX+kDIE=; b=M12TSOiW9xaYMq1q/Z5nl3fm5bBfZfISV3wTKlKVCPIHUX8fnyvNEqNssPvz+mWBsW ULzWIn56lgBx7zzE0rdWgLeR9Wl4P5H+VLHl39XreWjR5dXEXgKZZmdlDs7naRlHjw2N Pn6LgaP7KWW7LIo9WYEKWxelq35ewXisdbEFd+b85EvVX/5KgOjNJUP4GXBlaCmsH11k 4BE5e1aqewpATugYhMmrQrhT+Y94juyJQAUitZjnCB64JjOT5BOxAaAHOjqfUjx6qf6w BsRcSNbgkQRCaS8bydqVkTMD9yCNsZcMiGbKD4olOtwdf2xRSX4mdmXG0cCZxOCeE57J wEnQ== X-Received: by 10.49.36.8 with SMTP id m8mr7060616qej.57.1374795609709; Thu, 25 Jul 2013 16:40:09 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id i12sm36901952qej.1.2013.07.25.16.40.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 16:40:09 -0700 (PDT) Sender: Mark Johnston Date: Thu, 25 Jul 2013 19:40:04 -0400 From: markj@freebsd.org To: Andriy Gapon Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130725234004.GA78828@raichu> References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu> <20130714075634.GC2832@gmail.com> <20130722022811.GA14288@raichu> <51F14150.7000509@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F14150.7000509@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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: Thu, 25 Jul 2013 23:40:10 -0000 On Thu, Jul 25, 2013 at 06:16:32PM +0300, Andriy Gapon wrote: > on 22/07/2013 05:28 markj@freebsd.org said the following: > > http://people.freebsd.org/~markj/patches/sdt-module-info/20130721-sdt-module-info.diff > > Mark, > > this is a minor suggestion only partially related to your patch. > I think that it would be nice if module loading and unloading events were posted > via EVENTHANDLER(9) mechanism. Then instead of introducing yet more DTrace > related hooks in the kernel code, DTrace modules could just subscribe to those > events. Also, those events could be potentially useful to other consumers > beyond DTrace. > What do you think? I think that's nicer than what I did - I was mostly just following what illumos does. I did consider having some general mechanism for posting module load/unload events, but it's not clear that the hwpmc hooks could use it. The DTrace handlers need to be called with the linker lock exclusively held, and the unload handler needs to be called before linker_file_unload(), so this is at odds with the locations of the hwpmc hooks, and I decided not to bother with it. That said, I think it would be good to use EVENTHANDLER() even if hwpmc can't use it. Calling two DTrace hooks is ugly - originally I just had one, so it wasn't as bad. I'll post an updated patch soon. Thanks! -Mark