From owner-freebsd-dtrace@FreeBSD.ORG Sun Jul 14 07:56:40 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 15EE7191; Sun, 14 Jul 2013 07:56:40 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 656228B2; Sun, 14 Jul 2013 07:56:39 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id r10so8665133lbi.34 for ; Sun, 14 Jul 2013 00:56:38 -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=uBnIMN37vdOEWM8L4Upuydh3Dy2QzQcUeMnqWPCUASs=; b=LTZoNEscocAQ6wvsq38BEw3xT8t1ySPGnH3yPxNsyMtd8HMM4B8gtSdZpARciqfMht +ziLpPaME3FfMooLWxqDaPi918AeeGiKgdidUkpLGPPdkOZM/gjSDhYkoQQMGV++YS2x GPucrnVOVbKkFRFUtpMofLM7PX26VxStASZTgcgleD6PVb+Q7IsTeUidygFzM+2/4EnA nw3sjKMfR4Rg2x1GXDkNbMpr9JEZT07V5+d4c0CaD/tJK/Lcy/a6SkgYRzewKIgeVINR lYVZjDlLyXM5Y6Xq+cgHYN5fYRT9XjM4OeVttSp8xx2PAP128C4L0fkZjGavya41oO2V yipg== X-Received: by 10.112.28.7 with SMTP id x7mr22711804lbg.7.1373788598076; Sun, 14 Jul 2013 00:56:38 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id et10sm16450078lbc.6.2013.07.14.00.56.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 14 Jul 2013 00:56:37 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 14 Jul 2013 10:56:34 +0300 From: Mikolaj Golub To: Mark Johnston Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130714075634.GC2832@gmail.com> References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130713234200.GA40803@raichu> 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: Sun, 14 Jul 2013 07:56:40 -0000 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. -- Mikolaj Golub