# Error when compiling Mono DTrace probes (mono.d)



## jackp (May 6, 2013)

Mono supports DTrace on OS X and Solaris, so I thought it would be nice to have it working on FreeBSD as well. I made a few minor changes to the configuration script (actually, the 'patch-configure' file in the port) to enable the DTrace support, but when I tried to build Mono again the configure script detected DTrace but skipped over it due to some error.

After looking through the configure script, I determined that the dtrace tool was returning an error when it was invoked to generate the probe header file.

When I ran `dtrace -h -s work/mono-3.0.3/data/mono.d` from the command line (where the pwd is /usr/ports/lang/mono), I get the following error message:


```
dtrace: failed to compile script work/mono-3.0.3/data/mono.d: "/usr/lib/dtrace/io.d", line 13: operator -> cannot be applied to a forward declaration: no struct devstat definition is available
```

Does anyone know what I need to do to fix this? I haven't used dtrace before -- ever -- so I don't even know where to start. All I could find from searching is that dtrace apparently can't find the definition for the devstat struct, but that's not used anywhere within the mono.d file so I'm at a loss to explain it.

If it matters, I recompiled my kernel a few weeks ago when DTRACE was enabled by default for the generic kernel; the output from `uname -a` is:


```
FreeBSD jack-bsd 9.1-STABLE FreeBSD 9.1-STABLE #0 r249603: Thu Apr 18 15:16:51 EDT 2013     root@jack-bsd:/usr/obj/usr/src/sys/GENERIC  i386
```


----------

