From owner-freebsd-dtrace@FreeBSD.ORG Thu Oct 31 03:36:40 2013 Return-Path: Delivered-To: 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 ESMTP id B255DD84; Thu, 31 Oct 2013 03:36:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qe0-x22e.google.com (mail-qe0-x22e.google.com [IPv6:2607:f8b0:400d:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50E012B41; Thu, 31 Oct 2013 03:36:40 +0000 (UTC) Received: by mail-qe0-f46.google.com with SMTP id s14so1401417qeb.5 for ; Wed, 30 Oct 2013 20:36:39 -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=pKpfJe6Cv6wc9DS+1G+bt3uxUhKsiAbQAyMvXrTRkKQ=; b=K9zXHCJ0/k7PXHfb6UmeraBCz6A7dqhT0+aqcMDV36JIv8oD//E5Ojb93xqMq5j5Hg 6dwpy0IYtUZKtZSzJ/H9oKSpElPOdZX6wUCdhVg9nBR73wGtz0E/qr3pDrE8m+2Qmvaw HrsFXx19Te/23HyYzxFj7gm+FnlCPs8rrS7GBrtbQGCIn9njwiUEWAnETAeHIsi/4NU0 AtAE2//wYNrHOVSh62PFyQfRlBXRFwt/UuY0fABaKqOEiaFjMFqsH4PewmTDKpFberMh /OuCZ4EGOCh6qlhY+DtqjrjWoalV5kNHFaxiWmkw/0StRmWhjlyENmtKQef7by1+PUzP EYog== X-Received: by 10.224.76.10 with SMTP id a10mr2228308qak.9.1383190599419; Wed, 30 Oct 2013 20:36:39 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id og1sm3084840qeb.3.2013.10.30.20.36.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Oct 2013 20:36:38 -0700 (PDT) Sender: Mark Johnston Date: Wed, 30 Oct 2013 23:36:36 -0400 From: Mark Johnston To: Andriy Gapon Subject: Re: sdt "sname" removal Message-ID: <20131031033636.GC9355@raichu> References: <5270246B.6070105@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5270246B.6070105@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@FreeBSD.org, 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, 31 Oct 2013 03:36:40 -0000 On Tue, Oct 29, 2013 at 11:11:07PM +0200, Andriy Gapon wrote: > > I never understood why FreeBSD SDT as opposed to upstream SDT requires the same > or almost the same probe name to be specified twice. This seems to be silly and > a little bit error-prone. > In other words, I do not see any reason not to re-use the original upstream > trick where double underscore in a providers name in the C code gets converted > to a single dash in a DTrace provider name. [*] > > So here is my take at that: > http://people.freebsd.org/~avg/sdt-sname-removal.diff > > An inline preview of the change: > -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, priv-ok, "int"); > -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, priv-err, "int"); > +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__ok, "int"); > +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__err, "int"); > > It's possible that I missed some places where old style SDT_PROBE_DEFINE macros > are used or where an old probe name is used with SDT_PROBE_ARGTYPE or SDT_PROBE. A good way to test this is to compare the output of 'dtrace -lv' with and without your change. If nothing changes, I'd be pretty confident that the diff is correct. > > Please test, review, comment, etc. I don't think this diff will apply cleanly to head - I've made some changes that will cause conflicts, and the diff doesn't touch netinet/in_kdtrace.c or kern/subr_devstat.c. Could you also update the SDT(9) man page? Also the "strlcpy(name, ..." immediately before the loop you added to sdt.c becomes redundant. Thanks, -Mark