From owner-freebsd-current@FreeBSD.ORG Sat Jun 23 11:38:13 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 4162F106564A; Sat, 23 Jun 2012 11:38:13 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.37]) by mx1.freebsd.org (Postfix) with ESMTP id C5DAF8FC12; Sat, 23 Jun 2012 11:38:12 +0000 (UTC) Received: from [78.35.156.199] (helo=fabiankeil.de) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1SiOeQ-0006EL-Up; Sat, 23 Jun 2012 13:37:15 +0200 Date: Sat, 23 Jun 2012 13:36:24 +0200 From: Fabian Keil To: Pedro Giffuni Message-ID: <20120623133624.3433ec78@fabiankeil.de> In-Reply-To: <4FE4A9CF.40102@FreeBSD.org> References: <4FE4A9CF.40102@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/sSbVD+d3iKo/iopW6x3EHDn"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: freebsd-current@FreeBSD.org Subject: Re: [RFT] llquantize for FreeBSD's dtrace X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 11:38:13 -0000 --Sig_/sSbVD+d3iKo/iopW6x3EHDn Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Pedro Giffuni wrote: > I am not a Dtrace user (yet) but I started to port the Log/linear > quantizations from Illumos: >=20 > http://dtrace.org/blogs/bmc/2011/02/08/llquantize/ >=20 > Apparently this patch should do it: >=20 > http://people.freebsd.org/~pfg/patches/patch-llquantize-complete >=20 > Unfortunately when I tried to build current with Dtrace support, > my i386 Virtualbox VM got stuck in ctfmerge so this is > completely untested. >=20 > Testers that know how to use it are welcome :). I applied it on 10-CURRENT amd64 from /usr/src with patch -p0 without any conflicts, but it doesn't appear to be working. The example from the blog post above triggers an assertion that is still reproducible when reducing the test case: fk@r500 /tmp $sudo dtrace -n 'tick-1ms{@ =3D llquantize(i++, 10, 0, 6, 20);= }' Assertion failed: (!(arg & (UINT16_MAX << args[i].shift))), file /usr/src/c= ddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt= _cc.c, line 1429. Changing the i++ to i seems to trigger a different bug (or at least doesn't behave like I would expect): fk@r500 /tmp $sudo dtrace -n 'tick-1ms{@ =3D llquantize(i, 10, 0, 6, 20);}' dtrace: invalid probe specifier tick-1ms{@ =3D llquantize(i, 10, 0, 6, 20);= }: in action list: failed to resolve i: Unknown variable name Replacing the i with a zero behaves similar to the version that uses i++ ag= ain: fk@r500 /tmp $sudo dtrace -n 'tick-1ms{ i =3D 0; @ =3D llquantize(0, 10, 0,= 6, 20);}' Assertion failed: (!(arg & (UINT16_MAX << args[i].shift))), file /usr/src/c= ddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt= _cc.c, line 1429. fk@r500 /tmp $gdb741 $(which dtrace) dtrace.core [GDB will not be able to debug user-mode threads: Undefined symbol "td_thr_= getxmmregs"] GNU gdb (GDB) 7.4.1 [GDB v7.4.1 for FreeBSD] Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-portbld-freebsd10.0". For bug reporting instructions, please see: ... Reading symbols from /usr/sbin/dtrace...done. [New process 100454] Core was generated by `dtrace'. Program terminated with signal 6, Aborted. #0 0x00000008019a26ac in thr_kill () at thr_kill.S:3 3 RSYSCALL(thr_kill) (gdb) where #0 0x00000008019a26ac in thr_kill () at thr_kill.S:3 #1 0x000000080082ff5c in _thr_send_sig (thread=3D, sig=3D6)= at /usr/src/lib/libthr/thread/thr_sig.c:113 #2 0x00000008008305b6 in _raise (sig=3D0) at /usr/src/lib/libthr/thread/th= r_sig.c:505 #3 0x0000000801a517d3 in abort () at /usr/src/lib/libc/stdlib/abort.c:65 #4 0x0000000800a91c60 in __assert (line=3D, file=3D, expr=3D) at /usr/src/cddl/lib/libdtrace/../../../cd= dl/compat/opensolaris/include/assert.h:56 #5 dt_compile_agg (dtp=3D0x80243f000, dnp=3D0x803e223e0, sdp=3D0x803e17140= ) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libd= trace/common/dt_cc.c:1366 #6 0x0000000800a9257f in dt_compile_one_clause (pnp=3D, cnp= =3D, dtp=3D) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/li= bdtrace/common/dt_cc.c:1597 #7 dt_compile_clause (dtp=3D0x80243f000, cnp=3D0x803e23040) at /usr/src/cd= dl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_= cc.c:1628 #8 0x0000000800a94441 in dt_compile (dtp=3D0x80243f000, context=3D362, psp= ec=3DDTRACE_PROBESPEC_NAME, arg=3D0x0, cflags=3D128, argc=3D1, argv=3D0x802= 417040, fp=3D0x0, s=3D0x7fffffffd9ca "tick-1ms{ i =3D 0; @ =3D llquantize(i, 10, 0, 6, 20= );}") at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/= libdtrace/common/dt_cc.c:2396 #9 0x0000000800a948bc in dtrace_program_strcompile (dtp=3D0x18866, s=3D, spec=3DDTRACE_PROBESPEC_PROVIDER, cflags=3D0, argc=3D-2123430= 480, argv=3D) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/li= bdtrace/common/dt_cc.c:2460 #10 0x0000000000405ae4 in compile_str (dcp=3D0x802418e00) at /usr/src/cddl/= usr.sbin/dtrace/../../../cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:766 #11 0x0000000000403b41 in main (argc=3D, argv=3D0x7fffffffd6= 68) at /usr/src/cddl/usr.sbin/dtrace/../../../cddl/contrib/opensolaris/cmd/= dtrace/dtrace.c:1632 Fabian --Sig_/sSbVD+d3iKo/iopW6x3EHDn Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/lqj4ACgkQBYqIVf93VJ3W0wCdFDvRSNwjb3xt+4oXKhkK2Mrn MnUAoKrEtNK3bZnPPS3FvvFKMVo965l4 =D9LB -----END PGP SIGNATURE----- --Sig_/sSbVD+d3iKo/iopW6x3EHDn--