Module Name:    src
Committed By:   abhinav
Date:           Mon Jun  5 17:11:10 UTC 2017

Modified Files:
        src/external/cddl/osnet/dist/cmd/dtrace: dtrace.c

Log Message:
Fix the trailing space in the probe specifier's name in dtrace(1)'s output.

When using dtrace using one of the tracing options, such as -n, -P, -i, -f etc.,
the first line of output from dtrace one is something like this:

sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry ' matched 482 probes

There is a trailing space at the end of the probe specifier name 
('syscall:::entry ').
This happens beucase dtrace tries to separate the probe name from the predicate 
and actions
using `{' and `/' as the separators but doesn't consider space also as a 
possible separator.

Output after this change:
sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry' matched 482 probes

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c
diff -u src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.8 src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.9
--- src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.8	Wed Feb  1 20:02:22 2017
+++ src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c	Mon Jun  5 17:11:10 2017
@@ -762,7 +762,7 @@ compile_str(dtrace_cmd_t *dcp)
 	    dcp->dc_spec, g_cflags | DTRACE_C_PSPEC, g_argc, g_argv)) == NULL)
 		dfatal("invalid probe specifier %s", dcp->dc_arg);
 
-	if ((p = strpbrk(dcp->dc_arg, "{/;")) != NULL)
+	if ((p = strpbrk(dcp->dc_arg, "{/; ")) != NULL)
 		*p = '\0'; /* crop name for reporting */
 
 	dcp->dc_desc = "description";

Reply via email to