From owner-freebsd-dtrace@FreeBSD.ORG Mon Jul 22 02:28:34 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3279116D; Mon, 22 Jul 2013 02:28:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F19641D26; Mon, 22 Jul 2013 02:28:33 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id 9so14070238iec.33 for ; Sun, 21 Jul 2013 19:28:33 -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=a0rXZdXy3p2G/LQoaYZj2v+uu0jN3zrj9IgSnDWGzPg=; b=WbizQ/EeiwbQhs+fewlj/doRLpvDbnOML90k0NygCcWNBtdIfykJCM1Ey5AXaQP5PK Qpep4yqsv+twiUCkaGCEBfcR+c3HvCGyAXr5nO45WX/4dU8eTXZrhxziSyPpuumKhdiK PjLdPBr0yPxWYWZOOzuAg2hI/Lpo7bxsXe5kWkhulDbWRgEQHyWaXOzeIun2EB7QH0xC sul0EpNqeyZfLeq/BrXQ8dA48TNaK5k+USMylj/HUdw+KpcvcyQwdnplNlX/dzOR5jgk 3K+5YcsRg3LKZqsQ3IuNKs5aWitj2I1nSohEHkZqfS3n+Mg14uWb8XJag76AYyZ+2xQj HN3Q== X-Received: by 10.43.137.65 with SMTP id in1mr7875109icc.103.1374460113081; Sun, 21 Jul 2013 19:28:33 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id z15sm12440047igp.0.2013.07.21.19.28.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Jul 2013 19:28:32 -0700 (PDT) Sender: Mark Johnston Date: Sun, 21 Jul 2013 22:28:25 -0400 From: markj@freebsd.org To: Mikolaj Golub Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130722022811.GA14288@raichu> References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu> <20130714075634.GC2832@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130714075634.GC2832@gmail.com> 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: Mon, 22 Jul 2013 02:28:34 -0000 On Sun, Jul 14, 2013 at 10:56:34AM +0300, Mikolaj Golub wrote: > On Sat, Jul 13, 2013 at 07:42:00PM -0400, Mark Johnston wrote: > > > Thanks for pointing this out - I've fixed these problems in the > > following diff: > > > > http://people.freebsd.org/~markj/patches/sdt-module-info/20130713-sdt-module-info.diff > > > > It turns out that we typedef modctl_t to struct linker_file, so I don't > > need to have separate cases for defined(sun) and !defined(sun) in a few > > places. > > Then in dtrace.h: > > -extern void (*dtrace_modload)(modctl_t *); > -extern void (*dtrace_modunload)(modctl_t *); > +extern void (*dtrace_modload)(struct linker_file *); > +extern int (*dtrace_modunload)(struct linker_file *); > > you might also want to return modctl_t back? I suppose > dtrace_modunload also requires '#if defined(sun)' here. > > Also, is there some reason you choose to return 1 on modunload > failure? Usually we return -1 on error, it would be nice to follow the > convention. > > In sdt_disable(), before decreasing nenabled, it might be useful to > add an assertion that nenabled is not going to reach negative value. Thanks for the comments, and sorry for the slow reply. I uploaded a new patch containing changes for all the suggestions above: http://people.freebsd.org/~markj/patches/sdt-module-info/20130721-sdt-module-info.diff -Mark