From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 16 03:19:06 2014 Return-Path: Delivered-To: hackers@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 28BB59EE for ; Tue, 16 Sep 2014 03:19:06 +0000 (UTC) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) (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 9DF368F3 for ; Tue, 16 Sep 2014 03:19:05 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id b17so5942175lan.4 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=Gjx6Ab0ieFfj0ZD1PUMJNVwGPm1Pen7AYKUaRe2EaJcZN59g9PizWw2qjbi2N0bNiD k5nkwPNylTvtEubZEFUZ9PLntKnz5XAIp1jkWR/x/2QIVQ4zHB45/jbMomZnQJKxMDWH MsQl5nqG5xlSYCI5jFdP2X6xPsy+y18X5DJP8QOi/ZNN59PA5/WBXL1Hfit+WofHk/dB tjAMSIPxGo3xMlZdP0OjTvx1xDv823hdMeMEjowvctUql32POaTkr1frgoII2m4J+j33 DYIh9n1y74ABGo9pD2aGsTc8DIsozJzlJe2aG5WWuV/pXufrMeOjiS3UOjGBj4+ATL47 T2wA== X-Gm-Message-State: ALoCoQkqLFeWta/gRTP8Xj8Q4jB9l9sGF6uH52juhf5TFPozsiYGcQSYoT2RM6fBl5qULsTzG/hl 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 X-Mailman-Approved-At: Tue, 16 Sep 2014 04:02:05 +0000 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-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to 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