From owner-freebsd-dtrace@FreeBSD.ORG Tue Oct 29 21:11:46 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 0DCA9D84; Tue, 29 Oct 2013 21:11:46 +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 2B30A2803; Tue, 29 Oct 2013 21:11:44 +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 XAA15681; Tue, 29 Oct 2013 23:11:43 +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 1VbGZj-0005x6-9I; Tue, 29 Oct 2013 23:11:43 +0200 Message-ID: <5270246B.6070105@FreeBSD.org> Date: Tue, 29 Oct 2013 23:11:07 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: dtrace@FreeBSD.org Subject: sdt "sname" removal X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@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: Tue, 29 Oct 2013 21:11:46 -0000 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. Please test, review, comment, etc. Thank you! -- Andriy Gapon