Author: dteske
Date: Sun May 27 22:27:47 2018
New Revision: 334261
URL: https://svnweb.freebsd.org/changeset/base/334261

Log:
  dwatch(1): Guard against error when given -t "*..."
  
  dwatch allows you to customnize the predicate (condition) for when
  information is displayed. The DTrace syntax for this is:
  
        probe[, ...] /predicate/ { [actions] }
  
  But if predicate is something like "*args[1]!=NULL" to test that
  the first pointer in an array is non-NULL, the syntax produced is:
  
        probe[, ...] /*arg1!=NULL/ { [actions] }
  
  The issue being that "/*" is the beginning of a comment and thus
  the following error is emitted:
  
        dtrace: failed to compile script /dev/stdin:
                line 535: /* encountered inside a comment
  
  This patch adds whitespace around the argument given to -t,
  producing:
  
        probe[, ...] / *arg1!=NULL / { [actions] }
  
  Sponsored by: Smule, Inc.

Modified:
  head/cddl/usr.sbin/dwatch/dwatch

Modified: head/cddl/usr.sbin/dwatch/dwatch
==============================================================================
--- head/cddl/usr.sbin/dwatch/dwatch    Sun May 27 20:36:43 2018        
(r334260)
+++ head/cddl/usr.sbin/dwatch/dwatch    Sun May 27 22:27:47 2018        
(r334261)
@@ -47,7 +47,7 @@ DTRACE_PRAGMA="
 
 ############################################################ GLOBALS
 
-VERSION='$Version: 1.2 $' # -V
+VERSION='$Version: 1.3 $' # -V
 
 pgm="${0##*/}" # Program basename
 
@@ -1353,7 +1353,7 @@ $ACTIONS
 }
 /*********************************************************/
 
-$PROBE${EVENT_TEST:+ /$EVENT_TEST/} /* probe ID $ID */
+$PROBE${EVENT_TEST:+ / $EVENT_TEST /} /* probe ID $ID */
 {${TRACE:+
        printf("<$ID>");
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to