[Mono-dev] [PATCH] Mono DTrace provider v2

Andreas Färber andreas.faerber at web.de
Fri May 30 18:09:03 EDT 2008


Hello,

Here's an updated version of my patch, adding initial DTrace support  
to the Mono runtime.

A new hand-crafted header file has been added, which is to be included  
in place of the generated header file. It defines MONO_PROBE_* macros  
as requested by Zoltan. The generated header file is then only needed  
iff DTrace is enabled.

Ugly build steps for Solaris were moved to a shell script. It extracts  
object files from their library to a temporary directory, patches them  
and puts them back in. This helps keep Makefiles clean and provides a  
one-stop resource to fix things, should they break. Tested on  
OpenSolaris 2008.05 i86. (Warning: I am not experienced in writing  
shell scripts.)

It appears the problem with the gc-end probe on Solaris was due to  
some kind of compiler optimization or the like. Adding a trailing  
sleep(0) call made it work; I have limited this workaround to when the  
gc-end probe is enabled on Solaris, to minimize the impact. Better  
ideas welcome. If we do stick with it and it turns out this is needed  
in more void functions, we could consider turning this into a  
MONO_PROBE_* macro to keep source files clean.

Signed-off-by: Andreas Faerber <andreas.faerber at web.de>

Change Log v2:

* dtrace-prelink.sh.in: New
   Script to prevent ugly Solaris hacks in Makefiles.

* configure.in:
   Prepare support for OSX/x86_64 (untested)
   Output dtrace-prelink.sh script.

* data/mono.d: Renamed (from mono-trace.d)
   Added standard Mono header.
   Added generation argument to gc-{begin,end} probes.
   Added explicit stability attributes.

* mono/utils/dtrace.h: New
   Wrapper around generated mono/utils/mono-dtrace.h.
   Define MONO_PROBE_* macros.

* mono/utils/Makefile.am:
   We no longer need to postprocess the generated header file.

* mono/metadata/Makefile.am,
   mono/mini/Makefile.am:
   Use new dtrace-prelink.sh script.

* mono/mini/mini.c,
   mono/metadata/boehm-gc.c:
   Use new macros

* mono/metadata/boehm-gc.c:
   Add workaround to make gc-end probe work on Solaris.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DTrace-USDT-2.diff
Type: application/octet-stream
Size: 11079 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080531/9ebb2468/attachment.obj 
-------------- next part --------------





More information about the Mono-devel-list mailing list