dwatch(1): Guard against error when given -t "*..."
authordteske <dteske@FreeBSD.org>
Sun, 27 May 2018 22:27:47 +0000 (22:27 +0000)
committerdteske <dteske@FreeBSD.org>
Sun, 27 May 2018 22:27:47 +0000 (22:27 +0000)
commitcf7a366f1d358a0dd29dc4fe880c52a950f93efa
tree631819df81f3d9af7ae7e9bd2637445bba5d0e88
parenta71068739bc77e28e2e06b15b73dba25e64d0c26
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.
cddl/usr.sbin/dwatch/dwatch