From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 20 19:10:10 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D9EA1065673 for ; Wed, 20 Jul 2011 19:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA688FC19 for ; Wed, 20 Jul 2011 19:10:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KJAAhN014458 for ; Wed, 20 Jul 2011 19:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p6KJAAPW014457; Wed, 20 Jul 2011 19:10:10 GMT (envelope-from gnats) Resent-Date: Wed, 20 Jul 2011 19:10:10 GMT Resent-Message-Id: <201107201910.p6KJAAPW014457@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Samorukov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 083221065676 for ; Wed, 20 Jul 2011 19:08:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D2C828FC0A for ; Wed, 20 Jul 2011 19:08:35 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KJ8Zb6059351 for ; Wed, 20 Jul 2011 19:08:35 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p6KJ8Z8G059350; Wed, 20 Jul 2011 19:08:35 GMT (envelope-from nobody) Message-Id: <201107201908.p6KJ8Z8G059350@red.freebsd.org> Date: Wed, 20 Jul 2011 19:08:35 GMT From: Alex Samorukov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/159064: MFC request for dtrace to fix "invalid probe specifier" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 19:10:10 -0000 >Number: 159064 >Category: misc >Synopsis: MFC request for dtrace to fix "invalid probe specifier" >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 20 19:10:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Alex Samorukov >Release: 8.2-STABLE >Organization: netart >Environment: FreeBSD bsd.home 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Jul 20 17:26:56 UTC 2011 root@bsd.home:/usr/obj/usr/src/sys/DTRACE amd64 >Description: I found that my dtrace scripts perfectly running on -CURRENT failing with strange messages on -STABLE. This is example: bsd# dtrace -n 'device_get_softc:entry{printf("%s",stringof(args[0]->nameunit))}' dtrace: invalid probe specifier device_get_softc:entry{printf("%s",stringof(args[0]->nameunit))}: in action list: failed to resolve translated type for args[0] args[0] should be "struct device" type. After debugging i found that it fail in libdrace and fix is already commited to the the HEAD. See http://svnweb.freebsd.org/base/head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l?r1=209305&r2=209358 for the actual fix. After applying the patch system resolving symbol correctly: bsd# dtrace -n 'device_get_softc:entry{printf("%s",stringof(args[0]->nameunit))}' dtrace: description 'device_get_softc:entry' matched 1 probe dtrace: buffer size lowered to 2m ^C CPU ID FUNCTION:NAME 0 19594 device_get_softc:entry est0 7 19594 device_get_softc:entry cpufreq0 7 19594 device_get_softc:entry cpufreq0 >How-To-Repeat: Run dtrace -n 'device_get_softc:entry{printf("%s",stringof(args[0]->nameunit))}' on 8-STABLE with dtrace enabled kernel >Fix: bsd# diff -u dt_lex.l.orig dt_lex.l.new --- dt_lex.l.orig 2010-11-08 12:54:55.000000000 +0000 +++ dt_lex.l.new 2010-08-02 13:40:53.000000000 +0000 @@ -44,7 +44,7 @@ #undef input #undef unput #else -/* +/* * Define YY_INPUT for flex since input() can't be re-defined. */ #define YY_INPUT(buf,result,max_size) \ @@ -59,6 +59,19 @@ buf[n] = *yypcb->pcb_strptr++; \ result = n; \ } +/* + * Do not EOF let tokens to be put back. This does not work with flex. + * On the other hand, leaving current buffer in same state it was when + * last EOF was received guarantees that input() will keep returning EOF + * for all subsequent invocations, which is the effect desired. + */ +#undef unput +#define unput(c) \ + do { \ + int _c = c; \ + if (_c != EOF) \ + yyunput(_c, yytext_ptr); \ + } while(0) #endif static int id_or_type(const char *); >Release-Note: >Audit-Trail: >Unformatted: