From owner-freebsd-dtrace@FreeBSD.ORG Thu Oct 24 16:16:28 2013 Return-Path: Delivered-To: dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D247E26E; Thu, 24 Oct 2013 16:16:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8326E28FF; Thu, 24 Oct 2013 16:16:28 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id w4so1496975qcr.12 for ; Thu, 24 Oct 2013 09:16:27 -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=QmNXff5WehBM1ul37U8hPJjyOsVKXtiASBnRZL6biAA=; b=GfAgd9RDGTHx0Vfv4d/RFvIFnVoWf3aMmKrmteho9WpZy2T0dhapbYLIDOkxTIP+VQ B2WVSfxvXMwojp9G5aiQfODaeW+GesqcK2mQJqewhJi6Y5a8lAeGeUQEaQXKCogR+0/9 2SHuFqZ3sZ7NI2bHTP6q4n/AkKy5B4M8a+uVwbT1wBAvItJSpHZh3fEEcLxIQR1TjXQk 0UOTrXH4UWGopygUX0oeTxOulPbbeLkBdn7GsH693o9Oh/bbQzR/EhLFRhJwoIOrm99q Aw998XdFi4cmmzgXe+kjf2H08xTUIR1g8W5eheMj0uh0wUbQQGk0ckQScbUmGpXWs3yk /K1Q== X-Received: by 10.224.8.65 with SMTP id g1mr5175823qag.68.1382631387188; Thu, 24 Oct 2013 09:16:27 -0700 (PDT) Received: from charmander (mail1.sandvine.com. [64.7.137.162]) by mx.google.com with ESMTPSA id x10sm9066915qas.5.2013.10.24.09.16.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 09:16:26 -0700 (PDT) Sender: Mark Johnston Date: Thu, 24 Oct 2013 12:16:20 -0400 From: Mark Johnston To: Andriy Gapon Subject: Re: "unstable" sdt probes Message-ID: <20131024161620.GA1710@charmander> References: <5268F461.7080504@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5268F461.7080504@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: 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, 24 Oct 2013 16:16:28 -0000 On Thu, Oct 24, 2013 at 01:20:17PM +0300, Andriy Gapon wrote: > > Can our SDT (for kernel) implementation support probes with unspecified types > for arguments? > I would like to get DTRACE_PROBE*() which can be found in the code with > OpenSolaris origins (e.g. ZFS) to work. With minimal efforts :-) Hm, it looks like illumos uses the first argument to DTRACE_PROBE* to specify both the provider name and probe name; if no provider name is given (based on a lookup in a table in sdt_subr.c), a default "sdt" provider is used. It looks like this is what's happening for the ZFS probes. I'd suggest something like the following: - to kern_sdt.c, add SDT_PROVIDER_DEFINE(sdt); - add DTRACE_PROBE* macros to sdt.h which invoke SDT_PROBE* with the sdt provider, i.e. something like #define DTRACE_PROBE1(name, type, arg) \ SDT_PROBE1(sdt, , , name, arg) - add a FreeBSD-only zfs_dtrace.c which contains the SDT_PROBE_DEFINE* invocations for the ZFS probes. You can define the types there, or not (using an empty string or NULL should work, I'm not sure). This won't work for illumos code where the probes specify a provider, but I think that's ok. I can do the first two steps if you agree with this approach. I don't have any way to test the ZFS probes at the moment, but I guess I can provide a zfs_dtrace.c too if you (or anyone else) can test. Thanks, -Mark