From owner-freebsd-current@FreeBSD.ORG Thu Jun 14 09:55:17 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FE651065759 for ; Thu, 14 Jun 2012 09:55:17 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.30]) by mx1.freebsd.org (Postfix) with ESMTP id C0CC78FC17 for ; Thu, 14 Jun 2012 09:55:16 +0000 (UTC) Received: from [78.35.134.186] (helo=fabiankeil.de) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1Sf6lQ-00048u-B7; Thu, 14 Jun 2012 11:54:52 +0200 Date: Thu, 14 Jun 2012 11:53:01 +0200 From: Fabian Keil To: Ryan Goodfellow Message-ID: <20120614115301.1cd0975b@fabiankeil.de> In-Reply-To: <5D6510D5-A8B3-41D9-B175-15FA680AF7F2@eecs.wsu.edu> References: <5D6510D5-A8B3-41D9-B175-15FA680AF7F2@eecs.wsu.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/E6obdHOAq.1VH2PflLSPJDX"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: freebsd-current@freebsd.org 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 09:55:17 -0000 --Sig_/E6obdHOAq.1VH2PflLSPJDX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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: >=20 > // test.cc > #include >=20 > int main(void) { > for(int i =3D 0; i < 5; i++) { > malloc(47); > } > } >=20 > then compiling and running DTrace as follows: >=20 > g++ test.cc -o test >=20 > dtrace -n 'pid$target::malloc:entry{ }' -c ./test >=20 >=20 > The correct output for this example is something to the tune of: >=20 > dtrace: description 'pid$target::malloc:entry' matched 2 probes > dtrace: pid 95236 has exited > CPU ID FUNCTION:NAME > 0 188748 malloc:entry=20 > 0 188748 malloc:entry=20 > 0 188748 malloc:entry=20 > 0 188748 malloc:entry=20 > 0 188748 malloc:entry=20 >=20 > (this from a machine with the same code running DTrace) >=20 > 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=20 >=20 > 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. >=20 > 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 --Sig_/E6obdHOAq.1VH2PflLSPJDX Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/ZtIUACgkQBYqIVf93VJ0vHQCfS/5oHrwEDEr7vhi7EFjXUm9t CUIAoI/sPbw1WwPbfjK/axaieisKKcEu =Ouc8 -----END PGP SIGNATURE----- --Sig_/E6obdHOAq.1VH2PflLSPJDX--