Re: [RFT] llquantize for FreeBSD's dtrace

From: Fabian Keil <freebsd-listen_at_fabiankeil.de>
Date: Sat, 23 Jun 2012 13:36:24 +0200
Pedro Giffuni <pfg_at_FreeBSD.org> wrote:

> I am not a Dtrace user (yet) but I started to port the Log/linear
> quantizations from Illumos:
> 
> http://dtrace.org/blogs/bmc/2011/02/08/llquantize/
> 
> Apparently this patch should do it:
> 
> http://people.freebsd.org/~pfg/patches/patch-llquantize-complete
> 
> Unfortunately when I tried to build current with Dtrace support,
> my i386 Virtualbox VM got stuck in ctfmerge so this is
> completely untested.
> 
> 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_at_r500 /tmp $sudo dtrace -n 'tick-1ms{_at_ = llquantize(i++, 10, 0, 6, 20);}'
Assertion failed: (!(arg & (UINT16_MAX << args[i].shift))), file /usr/src/cddl/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_at_r500 /tmp $sudo dtrace -n 'tick-1ms{_at_ = llquantize(i, 10, 0, 6, 20);}'
dtrace: invalid probe specifier tick-1ms{_at_ = 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++ again:

fk_at_r500 /tmp $sudo dtrace -n 'tick-1ms{ i = 0; _at_ = llquantize(0, 10, 0, 6, 20);}'
Assertion failed: (!(arg & (UINT16_MAX << args[i].shift))), file /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c, line 1429.

fk_at_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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>...
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=<optimized out>, sig=6) at /usr/src/lib/libthr/thread/thr_sig.c:113
#2  0x00000008008305b6 in _raise (sig=0) at /usr/src/lib/libthr/thread/thr_sig.c:505
#3  0x0000000801a517d3 in abort () at /usr/src/lib/libc/stdlib/abort.c:65
#4  0x0000000800a91c60 in __assert (line=<optimized out>, file=<optimized out>, expr=<optimized out>) at /usr/src/cddl/lib/libdtrace/../../../cddl/compat/opensolaris/include/assert.h:56
#5  dt_compile_agg (dtp=0x80243f000, dnp=0x803e223e0, sdp=0x803e17140) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c:1366
#6  0x0000000800a9257f in dt_compile_one_clause (pnp=<optimized out>, cnp=<optimized out>, dtp=<optimized out>)
    at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c:1597
#7  dt_compile_clause (dtp=0x80243f000, cnp=0x803e23040) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c:1628
#8  0x0000000800a94441 in dt_compile (dtp=0x80243f000, context=362, pspec=DTRACE_PROBESPEC_NAME, arg=0x0, cflags=128, argc=1, argv=0x802417040, fp=0x0,
    s=0x7fffffffd9ca "tick-1ms{ i = 0; _at_ = 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=0x18866, s=<optimized out>, spec=DTRACE_PROBESPEC_PROVIDER, cflags=0, argc=-2123430480, argv=<optimized out>)
    at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c:2460
#10 0x0000000000405ae4 in compile_str (dcp=0x802418e00) at /usr/src/cddl/usr.sbin/dtrace/../../../cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:766
#11 0x0000000000403b41 in main (argc=<optimized out>, argv=0x7fffffffd668) at /usr/src/cddl/usr.sbin/dtrace/../../../cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:1632

Fabian

Received on Sat Jun 23 2012 - 09:38:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:28 UTC