From owner-freebsd-dtrace@FreeBSD.ORG Tue Sep 16 03:19:06 2014 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 ESMTPS id 387E89EF for ; Tue, 16 Sep 2014 03:19:06 +0000 (UTC) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD37E8F4 for ; Tue, 16 Sep 2014 03:19:05 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id b12so5615967lbj.25 for ; Mon, 15 Sep 2014 20:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphix.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tX5IM6J6fDWgZENsn/sayZndAj6bQxFNLbH52ADUWU4=; b=ZZTKXBckA/kH8djmpKX3czYaMCD1c92IkA9XSqvRdUiolt8nmOYDTxnkV6yEm1w/qE lK3KpGBKDFeB9XnvJZAHIWujNEfpHJYfMx9sM+usc1QxwUsZi0akLiGiyo0z2cb75EOH 3yIA43Ic++6HVxvKmiA4pDImWg7h2Pgafm1SE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tX5IM6J6fDWgZENsn/sayZndAj6bQxFNLbH52ADUWU4=; b=CF9TIsx9ZDCQP9+hvJueLA2W6OWiYoYGToxr2GJ6XN1YHE5fwhWd/XXzmkXZO/Tg6/ BG9fsfrzeZseHAU0VN/63XoGAYuG+sNuyf3ApoD66UvCiBRMeFHrNQy/ShDiaNHo0NIf /YQi7bRpPY14FayKLUyvDE1dmYqt5w4zaxcLfb6vzZAF4U5jLd7tjY6vQCZd6wh2eq3h zxDC5TJJ3WLmoEdfwS5K/qli9W1mgnAAqut4JDhKIEP8GxQQfOdyHnK2M2gOCvVGCmnC vMQIwYwHbbfWPuO54OR/nOXbK/6B9A2LD72yroE/UoRzKYeQncyvIPfzrbYuPy2vC6qX 09fg== X-Gm-Message-State: ALoCoQnJFp6GRGMPEZcJesgP7FD28lD3s7HWpquA9aPoCvY5r3WiRuaCDTL0gfMZCboFrVS/PvNZ MIME-Version: 1.0 X-Received: by 10.112.4.33 with SMTP id h1mr30519046lbh.67.1410837543411; Mon, 15 Sep 2014 20:19:03 -0700 (PDT) Received: by 10.25.170.148 with HTTP; Mon, 15 Sep 2014 20:19:03 -0700 (PDT) In-Reply-To: <20140916031318.GB26720@charmander.picturesperfect.net> References: <20140916031318.GB26720@charmander.picturesperfect.net> Date: Mon, 15 Sep 2014 20:19:03 -0700 Message-ID: Subject: Re: ZFS SET_ERROR dtrace probe possible under FreeBSD? From: Matthew Ahrens To: Mark Johnston Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Steven Hartland , hackers@freebsd.org, freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 16 Sep 2014 03:19:06 -0000 On Mon, Sep 15, 2014 at 8:13 PM, Mark Johnston wrote: > On Mon, Sep 15, 2014 at 07:59:50PM -0700, Matthew Ahrens wrote: > > Disclaimer: I'm not an expert in FreeBSD dtrace. > > > > It looks like the FreeBSD kernel uses these declaration for kernel SDT > > probes, in sdt.h: > ... > > > > To do the equivalent "extra static" magic, you will need to expand out > the > > DTRACE_PROBE1 macro. I think it should look something like: > > > > SDT_PROBE_DEFINE1(sdt, zfs, , set__error, "int"); > > > > #define SET_ERROR(err) \ > > ((sdt_sdt_zfs__set__error->id && \ > > (*sdt_probe_func)(sdt_sdt_zfs__set__error->id, (uintptr_t)err, 0, 0, > 0, > > 0)), \ > > err) > > I think it would need to be > > SDT_PROBE_DECLARE(sdt, , , set__error); > > #define SET_ERROR(err) ... > > in the compat sdt.h, and then kern_dtrace.c or so would contain > > SDT_PROBE_DEFINE1(sdt, , , set__error, "int"); > > Note that the module shouldn't be hard-coded - it'll be filled in when > the probes are created by the SDT code. Ah, yes, that makes sense. --matt