Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/cmd/dtrace Fix the trailing space i...



details:   https://anonhg.NetBSD.org/src/rev/63a3f2d40b15
branches:  trunk
changeset: 354140:63a3f2d40b15
user:      abhinav <abhinav%NetBSD.org@localhost>
date:      Mon Jun 05 17:11:10 2017 +0000

description:
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@

diffstat:

 external/cddl/osnet/dist/cmd/dtrace/dtrace.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r da6e88588876 -r 63a3f2d40b15 external/cddl/osnet/dist/cmd/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/cmd/dtrace/dtrace.c      Mon Jun 05 15:20:51 2017 +0000
+++ b/external/cddl/osnet/dist/cmd/dtrace/dtrace.c      Mon Jun 05 17:11:10 2017 +0000
@@ -762,7 +762,7 @@
            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";



Home | Main Index | Thread Index | Old Index