From owner-freebsd-bugs@freebsd.org Sat Aug 13 23:56:32 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3108BB9529 for ; Sat, 13 Aug 2016 23:56:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B24091ED2 for ; Sat, 13 Aug 2016 23:56:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DNuWXP072418 for ; Sat, 13 Aug 2016 23:56:32 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 211821] dtrace: invalid probe specifier lockstat:::: "/usr/lib/dtrace/tcp.d", line 201: operator / requires operands of arithmetic type Date: Sat, 13 Aug 2016 23:56:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: freebsd@g3os.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2016 23:56:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211821 Bug ID: 211821 Summary: dtrace: invalid probe specifier lockstat:::: "/usr/lib/dtrace/tcp.d", line 201: operator / requires operands of arithmetic type Product: Base System Version: 10.3-RELEASE Hardware: ppc OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: freebsd@g3os.org It seems that while dtrace knows about `hz, /usr/lib/dtrace/tcp.d does not, which causes the following problem: EXPECTED -------- When I run dtrace -ln [[[provider:]module:]probe:]name I expect output like this: # dtrace -ln lockstat::: ID PROVIDER MODULE FUNCTION NAME 25295 lockstat kernel mtx_lock_spin spin-acquire 25296 lockstat kernel mtx_lock_spin spin-s= pin 25297 lockstat kernel mtx_unlock_spin spin-release ... 25321 lockstat kernel sx_try_upgrade sx-upg= rade 25322 lockstat kernel sx_downgrade sx-downgrade 25323 lockstat kernel thread_lock thread-spin ACTUAL ------ but instead I get output like this: dtrace -ln lockstat::: dtrace: invalid probe specifier lockstat:::: "/usr/lib/dtrace/tcp.d", line = 201: operator / requires operands of arithmetic type # dtrace -l by itself is not affected. HACK/FIX -------- In /usr/lib/dtrace/tcp.d, when I change line 201 from: 201 tcps_rto =3D p =3D=3D NULL ? -1 : (p->t_rxtcur * 1= 000) / `hz; to: 201 tcps_rto =3D p =3D=3D NULL ? -1 : (p->t_rxtcur * 1= 000) / (int) `hz; I get the output I expect. My understanding is that backticks tell dtrace to use kernel variable names= but I'm not sure how to include them so that dtrace sees it. I think hz is an int defined in sys/sys/kernel.h: 60 extern int tick; /* usec per tick (1000000 / hz)= */ 61 extern int hz; /* system clock's frequency */ 62 extern int psratio; /* ratio: prof / stat */ and that t_rxtcur defined in sys/netinet/tcp_var.h is also an int. 202 203 int t_rxtcur; /* current retransmit value (ticks) */ 204 u_int t_maxseg; /* maximum segment size */ So I think casting to an int is reasonable. With my hack this also works: # dtrace -n 'BEGIN { trace(`hz); }' dtrace: description 'BEGIN ' matched 1 probe dtrace: buffer size lowered to 2m CPU ID FUNCTION:NAME 0 1 :BEGIN 1000 So I conclude that dtrace knows about hz but tcp.d does not. I suspect the= re is a way for tcp.d to know about kernel.h rather than do a cast, and that t= his would be preferable, but I don't know how to do that. SYSTEM INFO ----------- I'm using an eMac (PowerPC G4). # uname -a FreeBSD emac.local 10.3-RELEASE FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 05:18:20 UTC 2016=20=20=20=20 root@releng1.nyi.freebsd.org:/usr/obj/powerpc.powerpc/usr/src/sys/GENERIC=20 powerpc $ dmesg ... FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 05:18:20 UTC 2016 root@releng1.nyi.freebsd.org:/usr/obj/powerpc.powerpc/usr/src/sys/GENER= IC powerpc gcc version 4.2.1 20070831 patched [FreeBSD] cpu0: Motorola PowerPC 7455 revision 3.3, 1000.29 MHz cpu0: Features 9c000000 cpu0: HID0 8450c0bc real memory =3D 520597504 (496 MB) ... Thank you, - d --=20 You are receiving this mail because: You are the assignee for the bug.=