dtrace showed matched probes but nothing in output on FreeBSD 9.1-RELEASE

Mark Johnston markj at freebsd.org
Mon Nov 4 14:11:08 UTC 2013


On Mon, Nov 04, 2013 at 04:56:43PM +0800, John Luk wrote:
> EDIT:Apologies for miss-sent mail.
> 
> Great! Seems that we're on the right way, I got the output below:
> 
> # dtrace -s ufunc.d -c ./a.out a.out
> dtrace: script 'ufunc.d' matched 5 probes
> ^C
> 
>   foo                                                               1
>   foo1                                                              1
>   main                                                              1
> 
> through the inet_makeaddr was missing. I applied the patch with:

It could be that your compiler is inlining it. Can you run the following
commands and paste the output?

# gdb ./a.out
(gdb) disas main

Thanks
-Mark

> 
> patch < libproc_sym_lookup-9.1.diff
> 
> Thanks again for your patch, Mark :)
> 
> 
> Cheers,
> spin6lock
> 
> 2013/11/4 John Luk <john.37 at gmail.com>:
> > Great! Seems that we're on the right way, I got the output below:
> >
> > # dtrace -s ufunc.d -c ./a.out a.out
> > dtrace: script 'ufunc.d' matched 5 probes
> > ^C
> >
> >   foo                                                               1
> >   foo1                                                              1
> >   main                                                              1
> >
> > through the inet_makeaddr was missing. I applied the patch with:
> >
> > patch < libproc_sym_lookup-9.1.diff
> >
> > Thanks again for your patch, Mark :)
> >
> > Cheers,
> > spin6lock
> >
> >
> > 2013/11/4 Mark Johnston <markj at freebsd.org>:
> >> On Mon, Nov 04, 2013 at 12:11:55PM +0800, John Luk wrote:
> >>> Thanks, Mark. But I still got nothing :(
> >>> The line number of your patch wasn't match with mine, I patched it
> >>> on hand. Was it because I was on an older version of src? The head
> >>> of proc_sym.c shows:
> >>>
> >>>  $FreeBSD: release/9.1.0/lib/libproc/proc_sym.c 211184 2010-08-11
> >>> 17:33:26Z rpaulo
> >>>
> >>> And the patch of mine is include below, is it correct?
> >>
> >> Sorry, I missed that you were on 9.1. The patch you pasted had a mistake
> >> in it; can you instead try applying the patch here:
> >>
> >> http://people.freebsd.org/~markj/patches/libproc_sym_lookup-9.1.diff
> >>
> >> I created it against the 9.1 tree, so it should apply cleanly. I built and
> >> installed the patched 9.1 libproc on a machine running head, and got the
> >> expected behaviour:
> >>
> >>     mark at raichu: ~/src/dtrace/ufunc $ sudo dtrace -s ufunc.d -c ./test test
> >>     dtrace: script 'ufunc.d' matched 9 probes
> >>     dtrace: pid 11555 has exited
> >>
> >>       __do_global_dtors_aux                                             1
> >>       foo                                                               1
> >>       foo1                                                              1
> >>       inet_makeaddr                                                     1
> >>       main                                                              1
> >>
> >>     mark at raichu: ~/src/dtrace/ufunc $
> >>
> >> I don't think that this will be the final patch; checking for ET_EXEC to
> >> determine whether to add a relocation offset seems a bit dubious; I'm
> >> pretty sure it won't work for position-independent executables.
> >>
> >> Thanks,
> >> -Mark
> >>
> >>>
> >>> [...]
> >>>


More information about the freebsd-dtrace mailing list