From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 5 10:01:52 2013 Return-Path: Delivered-To: freebsd-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 ESMTP id 0CC5363A; Tue, 5 Nov 2013 10:01:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EEFF52A6F; Tue, 5 Nov 2013 10:01:50 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA01767; Tue, 05 Nov 2013 12:01:49 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1VddSG-000ATG-PH; Tue, 05 Nov 2013 12:01:48 +0200 Message-ID: <5278C1D4.1000601@FreeBSD.org> Date: Tue, 05 Nov 2013 12:00:52 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Mark Johnston Subject: Re: sdt "sname" removal References: <5270246B.6070105@FreeBSD.org> <20131031033636.GC9355@raichu> <5271FD6B.1040807@FreeBSD.org> In-Reply-To: <5271FD6B.1040807@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, dtrace@FreeBSD.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2013 10:01:52 -0000 on 31/10/2013 08:49 Andriy Gapon said the following: > on 31/10/2013 05:36 Mark Johnston said the following: >> 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. > > Provided that my kernel has all of the SDT probes :-) > >>> >>> 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. > > Oh, yes, my head is from ~ 2 month ago. Need to update ASAP and will rebase the > change then. > >> Could you also update the SDT(9) man page? Also >> the "strlcpy(name, ..." immediately before the loop you added to sdt.c >> becomes redundant. > > Good points. Will fix. I have rebased my changes and addressed your comments. The updated patch is in the same place: http://people.freebsd.org/~avg/sdt-sname-removal.diff I am also merging the other thread into this one, so here is an update patch for DTRACE_PROBE* macros: http://people.freebsd.org/~avg/dtrace-probe-macros.diff The most notable change is that the argument types are now recorded. Thank you for reviewing and your suggestions! -- Andriy Gapon