From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 16 02:03:59 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 7ED6A9E; Tue, 16 Sep 2014 02:03:59 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 4425DFDC; Tue, 16 Sep 2014 02:03:58 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id C65B820E7088D; Tue, 16 Sep 2014 02:03:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE, STOX_REPLY_TYPE_WITHOUT_QUOTES autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id 255E220E70886; Tue, 16 Sep 2014 02:03:55 +0000 (UTC) Message-ID: From: "Steven Hartland" To: Subject: ZFS SET_ERROR dtrace probe possible under FreeBSD? Date: Tue, 16 Sep 2014 03:03:51 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: hackers@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 02:03:59 -0000 The following commit added SET_ERROR dtrace probes to illumos https://github.com/illumos/illumos-gate/commit/be6fd75 Now we have all the SET_ERROR calls but the FreeBSD's ZFS implementation but our SET_ERROR in sys/cddl/compat/opensolaris/sys/sdt.h is simply: #define SET_ERROR(err) (err) I tried using the illumos version but that resulted being unable to mount ZFS root, so clearly not right. /* * the set-error SDT probe is extra static, in that we declare its fake * function literally, rather than with the DTRACE_PROBE1() macro. This is * necessary so that SET_ERROR() can evaluate to a value, which wouldn't * be possible if it required multiple statements (to declare the function * and then call it). * * SET_ERROR() uses the comma operator so that it can be used without much * additional code. For example, "return (EINVAL);" becomes * "return (SET_ERROR(EINVAL));". Note that the argument will be evaluated * twice, so it should not have side effects (e.g. something like: * "return (SET_ERROR(log_error(EINVAL, info)));" would log the error twice). */ extern void __dtrace_probe_set__error(uintptr_t); #define SET_ERROR(err) (__dtrace_probe_set__error(err), err) For those that know the the ins and outs of our dtrace is it possible for us to add support for this trace point? Regards Steve