Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 May 2018 22:27:47 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334261 - head/cddl/usr.sbin/dwatch
Message-ID:  <201805272227.w4RMRlGX050482@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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>");
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805272227.w4RMRlGX050482>