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 From owner-freebsd-dtrace@FreeBSD.ORG Sat Oct 4 07:59:59 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 D416B436; Sat, 4 Oct 2014 07:59:59 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (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 49276F7A; Sat, 4 Oct 2014 07:59:59 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id a1so3054859wgh.35 for ; Sat, 04 Oct 2014 00:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aTzutqAb5owHWpnW3nxDKN3f8LEMZqZuto8DRpbm1OU=; b=iJISAzbOiLIqiT9Dx3ydvIAO3fqkXTCC842MOH9uTeulu3Y4YT4CkVa0baZKNwFwQw Y5KYvD44I1D2/CkP+khRNj5L1f/VWRjD7U7sNr+fbW8t1vraK7PhkzWzC5BFalIuqjGT IvAvdmsCPVWRijRdJy0NlahifBXJFshmNUhISaUTM9rczTO84lhQv5YqmaoqlJitoS6z p8gtJ1IkyhafJlwyvq93KYJMDMWHKZeH+27h1sFmp7GaBUZPORi4Rbqdqq10nxfBwkls 4q61+dCh85S/6i4DZIEUJ4ivZTRlVIC9bYMjjL2gdIN1FpomVZ/pQgaVVhpR/FreDct3 SG0A== MIME-Version: 1.0 X-Received: by 10.181.27.197 with SMTP id ji5mr4110050wid.54.1412409597548; Sat, 04 Oct 2014 00:59:57 -0700 (PDT) Received: by 10.27.137.87 with HTTP; Sat, 4 Oct 2014 00:59:57 -0700 (PDT) In-Reply-To: <20141004041300.GA21821@charmander.picturesperfect.net> References: <20141004041300.GA21821@charmander.picturesperfect.net> Date: Sat, 4 Oct 2014 00:59:57 -0700 Message-ID: Subject: Re: [dtrace-discuss] dtrace keywords in postfix expressions From: Bryan Cantrill To: Mark Johnston Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "dtrace-discuss@lists.dtrace.org" , freebsd-dtrace@freebsd.org 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 07:59:59 -0000 Nothing like cracking open dt_grammar.y to get the blood flowing! ;) I don't think the change looks unreasonable; how does the test suite fare? If this is no way breaks extant D programs, I'm all for it... - Bryan On Fri, Oct 3, 2014 at 9:13 PM, Mark Johnston via dtrace-discuss < dtrace-discuss@lists.dtrace.org> wrote: > 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 > > > ------------------------------------------- > dtrace-discuss > Archives: https://www.listbox.com/member/archive/184261/=now > RSS Feed: > https://www.listbox.com/member/archive/rss/184261/21484475-e7237b25 > Modify Your Subscription: > https://www.listbox.com/member/?member_id=21484475&id_secret=21484475-2fcb7543 > Powered by Listbox: http://www.listbox.com > From owner-freebsd-dtrace@FreeBSD.ORG Sat Oct 4 19:22:47 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5AD15D5 for ; Sat, 4 Oct 2014 19:22:47 +0000 (UTC) Received: from mail-pd0-x232.google.com (mail-pd0-x232.google.com [IPv6:2607:f8b0:400e:c02::232]) (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 87D41B14 for ; Sat, 4 Oct 2014 19:22:47 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id y10so1213605pdj.37 for ; Sat, 04 Oct 2014 12:22:47 -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=95Mt/elX4rhB9Y6Rw9CUaHxW2R2FXHkH9p7lDLzb4LA=; b=GunDblr+p8R5Nu7DHl3DkJEQqt2FgAijvXigTbw9cEraolqcELzVnuRI1GTCc95AEW qtdke5hnJSxdoOi4WX14MIP9XNukOLhq23BPUbL1JTVruasdheDsrfKp2mw33JW/H/4L Bum0juK1PAf+SRwEvOPcBZQOzJ9Tg2xPTanE+OnL4o0Ib4R105Qho9StH1tbKcsY1h13 1acc5NdvGyyEJn4K/cxPZKHarvwYegRQBFWAY5/cPn4P8ZqIPW5G9XQTtUryde9CxclT mDc5CKyNT491w8MbJJM5d/LN1VNoyJ/YeDhqGgqPyy0BuI9okwW9zWRdRWKNTqc2iEiu dvrA== X-Received: by 10.70.44.73 with SMTP id c9mr8458330pdm.11.1412450567170; Sat, 04 Oct 2014 12:22:47 -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 yt3sm9410306pbc.34.2014.10.04.12.22.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Oct 2014 12:22:46 -0700 (PDT) Sender: Mark Johnston Date: Sat, 4 Oct 2014 12:22:43 -0700 From: Mark Johnston To: Bryan Cantrill Subject: Re: [dtrace-discuss] dtrace keywords in postfix expressions Message-ID: <20141004192243.GC22999@charmander.picturesperfect.net> References: <20141004041300.GA21821@charmander.picturesperfect.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dtrace-discuss@lists.dtrace.org" , freebsd-dtrace@freebsd.org 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 19:22:47 -0000 On Sat, Oct 04, 2014 at 12:59:57AM -0700, Bryan Cantrill wrote: > Nothing like cracking open dt_grammar.y to get the blood flowing! ;) Made for a fun Friday evening. :) > I > don't think the change looks unreasonable; how does the test suite fare? > If this is no way breaks extant D programs, I'm all for it... I don't see any regressions in the test suite. In principle this shouldn't break anything - it just increases the number of valid D programs without affecting the parse trees of existing programs. I updated the patch to handle the offsetof() rule (so that "offsetof(struct g_consumer, provider)" now works), and the "stringof" keyword. If there aren't any objections I'll commit it to FreeBSD in a few days and submit a PR for illumos. Thanks, -Mark > > - Bryan > > > On Fri, Oct 3, 2014 at 9:13 PM, Mark Johnston via dtrace-discuss < > dtrace-discuss@lists.dtrace.org> wrote: > > > 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 > > > > > > ------------------------------------------- > > dtrace-discuss > > Archives: https://www.listbox.com/member/archive/184261/=now > > RSS Feed: > > https://www.listbox.com/member/archive/rss/184261/21484475-e7237b25 > > Modify Your Subscription: > > https://www.listbox.com/member/?member_id=21484475&id_secret=21484475-2fcb7543 > > Powered by Listbox: http://www.listbox.com > > From owner-freebsd-dtrace@FreeBSD.ORG Sat Oct 4 19:25:15 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1BE563F for ; Sat, 4 Oct 2014 19:25:15 +0000 (UTC) Received: from mail-pd0-x236.google.com (mail-pd0-x236.google.com [IPv6:2607:f8b0:400e:c02::236]) (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 874D6B1B for ; Sat, 4 Oct 2014 19:25:15 +0000 (UTC) Received: by mail-pd0-f182.google.com with SMTP id y10so1237959pdj.13 for ; Sat, 04 Oct 2014 12:25:15 -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=asdATIsN/yZsQ7T4Ec04A8HI9/+7TBMEehFuIFSRN/w=; b=U+bCdgIJXUoMR/icFSZIoX2kUzYn3wkqdkIbw0zkyI/9sNATtBo/YI7Xv+g+NrFKUj MG3K/DRkkwDskGHZFPAnWs9zz/Z6vngh5o3wZ+Buv1hPhTtK/RnU1B38asJXZUCCJ7Z/ nrpj185OYb78C+EPXRSivt0atniZtHRN4mrA76ZgXAzF3yRuUIAKeIn3ahSe065rzmWp Abem3KDgiL70KddaZBbXtzvdN5dozaWU+Ojt/9rr7w5Mpf10hyiK0QjcRrfO4YjTJPyr JoxvkPS1aipKpoCXQoChzosJpiB0/kw0PqcZEm67qzwuxJyWeT/9mVIUNB1QJp+FOa4G +PpQ== X-Received: by 10.67.1.195 with SMTP id bi3mr14934764pad.74.1412450715228; Sat, 04 Oct 2014 12:25:15 -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 td4sm9562687pab.19.2014.10.04.12.25.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Oct 2014 12:25:14 -0700 (PDT) Sender: Mark Johnston Date: Sat, 4 Oct 2014 12:25:11 -0700 From: Mark Johnston To: Anton Yuzhaninov Subject: Re: Pid provider Message-ID: <20141004192511.GD22999@charmander.picturesperfect.net> References: <5411A7BD.7020705@citrin.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5411A7BD.7020705@citrin.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-dtrace@freebsd.org 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 19:25:15 -0000 On Thu, Sep 11, 2014 at 05:46:37PM +0400, Anton Yuzhaninov wrote: > Is PID provider is usable in FreeBSD? > > I try to list probes with > > dtrace -ln 'pid$target:::entry' -p NNN > > And for most processes no function from main binary shown (only functions from > shared libraries are listed). For some only some functions are shown, e. g. for > tcsh only two functions shown: > ID PROVIDER MODULE FUNCTION NAME > 61372 pid57232 tcsh glob entry > 61373 pid57232 tcsh globfree entry > > Also there is bug_or_feature: examined process terminated if dtrace command > terminated, e. g. run: > dtrace -ln 'pid$target:::entry' -p XX | less > then type q to quit from less - process with pid XX will be terminated. This is fixed by r272455: https://svnweb.freebsd.org/base?view=revision&revision=272455