# FreeBSD's DTrace needs specific settings?



## martintangsl (Apr 5, 2012)

I'm learning and evaluating DTrace. 

DTrace on FreeBSD seems to be a bit different from other platforms. 

`# dtrace -n 'syscall:::'`
gives the message

```
dtrace: failed to initialize dtrace: DTrace device not available on system
```

Other platforms tested show a list of system calls. 

Does DTrace need some specific settings on FreeBSD? My platform is FreeBSD 9.0 x86 running inside VirtualBox.


----------



## SirDice (Apr 5, 2012)

Dtrace needs to be specifically enabled.

Handbook: 26.3 Enabling DTrace Support


----------



## martintangsl (Apr 7, 2012)

Thanks. Still some problems in using DTrace. Some probes does not work and running them several times would cause the virtual machine restarts. 
`sudo dtrace -n 'pid$target:a.out::entry' -c ./a.out` gives

```
dtrace: description 'pid$target:a.out::entry' matched 5 probes
dtrace: buffer size lowered to 6m
dtrace: pid 1150 has exited
```

I followed the wiki page here, created and wrote /etc/make.conf, compiled and installed the world. Still restarting.


----------



## tthtlc (Aug 12, 2012)

After FreeBSD9 installation, I got the same error too.   Then I did "kldload dtrace" and "kldload dtraceall" and surprisingly, no error, which means that default it is not loaded.   These kernel modules are residing in /boot/kernel - so go there and make sure it exists.   If yes, then just kldload the module, and it should work.


----------

