Re: DTrace broken on 9.0-Release?

From: Garrett Cooper <yanegomi_at_gmail.com>
Date: Wed, 13 Jun 2012 23:32:56 -0700
On Wed, Jun 13, 2012 at 9:33 PM, Ryan Goodfellow <rgoodfel_at_eecs.wsu.edu> wrote:
> Hi FreeBSD community,
>
> Today I downloaded and installed FreeBSD 9.0-RELEASE and followed the directions from <http://wiki.freebsd.org/DTrace> to get DTrace up and running.  The output of DTrace instrumenting a simple program, however, is not correct.  The program is as follows:
>
> // test.cc
> #include<cstdlib>
>
> int main(void) {
>  for(int i = 0; i < 5; i++) {
>    malloc(47);
>  }
> }
>
> then compiling and running DTrace as follows:
>
> g++ test.cc -o test
>
> dtrace -n 'pid$target::malloc:entry{ }' -c ./test
>
>
> The correct output for this example is something to the tune of:
>
> dtrace: description 'pid$target::malloc:entry' matched 2 probes
> dtrace: pid 95236 has exited
> CPU     ID                    FUNCTION:NAME
>  0 188748                     malloc:entry
>  0 188748                     malloc:entry
>  0 188748                     malloc:entry
>  0 188748                     malloc:entry
>  0 188748                     malloc:entry
>
> (this from a machine with the same code running DTrace)
>
> The DTrace session should also make an immediate exit on completion. On FreeBSD I have the following
> CPU     ID                    FUNCTION:NAME
>  2      42213                     malloc:entry
>
> and the execution does either not exit on it's own or hangs, it requires a ctrl-c.
>
> I followed the instructions from the FreeBSD site exactly, compiling and installing the custom kernel.  I used both clang++ and g++ for compilation with the same result.  The system has even completely hung on other attempts.
>
> Is DTrace not something that should be relied upon in FreeBSD?  I have also tried this on the latest 10-CURRENT build with the same result.

    Did you compile world with -fno-omit-frame-pointer ? I didn't
doing that (at least) and I'm seeing the same things that you are
seeing.
Thanks,
-Garrett
Received on Thu Jun 14 2012 - 04:32:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:28 UTC