From owner-freebsd-dtrace@FreeBSD.ORG Sat Oct 4 04:13:07 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B07A0634 for ; Sat, 4 Oct 2014 04:13:07 +0000 (UTC) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (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 87870981 for ; Sat, 4 Oct 2014 04:13:07 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id et14so2478891pad.31 for ; Fri, 03 Oct 2014 21:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=GgmXDpu+eBk1KVlKmJ1r4Vwar+/82NACa2zTLYyfnMM=; b=MjEhbWkb+ZU+ZuROk1NtCLPEJ6318hcIaFP5N/nPxHJpe9u80TcuOr6TVCMd6Jb6hv Ei/Hlu65iHKsnepulsP/xvodZ0nyEdW2iRTSDMORZ3TNMukYItllHZOOirdnskjyY0Jj v6US+WUOSBEWve7pnXNMn1H3y5LriiN3rneF6mDndWHKw27HJrzx6/UH+MIIUENtwWFD +n9VS2UhZnXQydHfaL03KbNzlHVyW+Y6Y77wT+IfERC4XibUBoOYdCQ6xmnsYZi+4dOi rzRZy7LLDieMjxKRmj7SZTUALnpmnZuRIgCpDCz936kW05MvaR1ZuzoBir2UGgw4UyKi 2GfA== X-Received: by 10.66.226.36 with SMTP id rp4mr2745404pac.61.1412395987010; Fri, 03 Oct 2014 21:13:07 -0700 (PDT) Received: from charmander.picturesperfect.net (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id b4sm5477183pdh.2.2014.10.03.21.13.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Oct 2014 21:13:06 -0700 (PDT) Sender: Mark Johnston Date: Fri, 3 Oct 2014 21:13:00 -0700 From: Mark Johnston To: freebsd-dtrace@FreeBSD.org, dtrace-discuss@lists.dtrace.org Subject: dtrace keywords in postfix expressions Message-ID: <20141004041300.GA21821@charmander.picturesperfect.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sat, 04 Oct 2014 04:13:07 -0000 Hello, DTrace has a few keywords which are not keywords in C/C++ (e.g. "provider"). One annoyance which has come up a few times is the fact that such keywords cannot be used in expressions which would be valid in the code being traced. For example, FreeBSD's struct g_consumer contains a field called "provider", and attempting to run the following snippet of D results in a syntax error: fbt::g_vfs_done:entry {printf("%s", stringof(args[0]->bio_from->provider->name));} I don't see any reason the D grammar can't support this, however. The patch at [1] attempts to fix this problem by allowing certain keywords to appear in the place of identifiers in postfix expressions. It's not a complete solution since it doesn't handle types or probe names, but it's a start. Any thoughts on this approach? Thanks! -Mark [1] http://people.freebsd.org/~markj/patches/dtrace_keywords.diff