From owner-freebsd-current@FreeBSD.ORG Thu Jun 14 16:01:07 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDC44106564A for ; Thu, 14 Jun 2012 16:01:07 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 8653C8FC08 for ; Thu, 14 Jun 2012 16:01:07 +0000 (UTC) Received: from [96.24.66.162] (port=59973 helo=[192.168.1.14]) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1SfCTY-0004GB-4a; Thu, 14 Jun 2012 12:00:48 -0400 Mime-Version: 1.0 (Apple Message framework v1280) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <20120614115301.1cd0975b@fabiankeil.de> Date: Thu, 14 Jun 2012 09:00:45 -0700 Content-Transfer-Encoding: 7bit Message-Id: <5BD5B2B1-7165-4705-8750-50EEBB5E26F2@neville-neil.com> References: <5D6510D5-A8B3-41D9-B175-15FA680AF7F2@eecs.wsu.edu> <20120614115301.1cd0975b@fabiankeil.de> To: Fabian Keil X-Mailer: Apple Mail (2.1280) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: freebsd-current@freebsd.org, Ryan Goodfellow Subject: Re: DTrace broken on 9.0-Release? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 16:01:08 -0000 Top post. File a PR and assign it to me (gnn) please. I'm on vacation until Sunday but I am actively working on DTrace when I'm not on vacation. Best, Geo On Jun 14, 2012, at 02:53 , Fabian Keil wrote: > Ryan Goodfellow wrote: > >> Today I downloaded and installed FreeBSD 9.0-RELEASE and followed the >> directions from to get DTrace up and >> running. The output of DTrace instrumenting a simple program, however, >> is not correct. The program is as follows: >> >> // test.cc >> #include >> >> int main(void) { >> for(int i = 0; i < 5; i++) { >> malloc(47); >> } >> } >> >> then compiling and running DTrace as follows: >> >> g++ test.cc -o test >> >> dtrace -n 'pid$target::malloc:entry{ }' -c ./test >> >> >> The correct output for this example is something to the tune of: >> >> dtrace: description 'pid$target::malloc:entry' matched 2 probes >> dtrace: pid 95236 has exited >> CPU ID FUNCTION:NAME >> 0 188748 malloc:entry >> 0 188748 malloc:entry >> 0 188748 malloc:entry >> 0 188748 malloc:entry >> 0 188748 malloc:entry >> >> (this from a machine with the same code running DTrace) >> >> The DTrace session should also make an immediate exit on completion. On >> FreeBSD I have the following CPU ID FUNCTION:NAME >> 2 42213 malloc:entry >> >> and the execution does either not exit on it's own or hangs, it requires >> a ctrl-c. > > Doesn't work for me either on 10-CURRENT amd64. > Converting it to C doesn't make a difference, it works if > one changes the loop to "for (;;)", though. > >> I followed the instructions from the FreeBSD site exactly, compiling and >> installing the custom kernel. I used both clang++ and g++ for >> compilation with the same result. The system has even completely hung >> on other attempts. >> >> Is DTrace not something that should be relied upon in FreeBSD? I have >> also tried this on the latest 10-CURRENT build with the same result. > > In my opinion the problem with DTrace on FreeBSD is that while it's > known to be incomplete, there doesn't seem to be documentation > available about which parts are supposed to work already and which > aren't. > > For example the trivial example program at: > http://wiki.freebsd.org/DTrace/userland (which works for me) doesn't > actually use a counting loop, so maybe dtracing your example program > isn't supposed to work yet and never did on FreeBSD. > > Without documentation it's hard to tell. > > Fabian