2008-06-05 Andreas Faerber <andreas.faerber@web.de>
authorAndreas Färber <afaerber@mono-cvs.ximian.com>
Thu, 5 Jun 2008 09:30:51 +0000 (09:30 -0000)
committerAndreas Färber <afaerber@mono-cvs.ximian.com>
Thu, 5 Jun 2008 09:30:51 +0000 (09:30 -0000)
* configure.in: Add configure option for DTrace.
* dtrace-prelink.sh: New file, helper script for DTrace builds.
* data/mono.d: New file, defines the DTrace 'mono' provider.

2008-06-05  Andreas Faerber  <andreas.faerber@web.de>

* dtrace.h: New file, defines macros for DTrace probes.
* Makefile.am (BUILT_SOURCES): Generate mono-dtrace.h when DTrace enabled.

2008-06-05  Andreas Faerber  <andreas.faerber@web.de>

* boehm-gc.c: Add DTrace probes gc-{begin,end}.
* Makefile.am (pedump_LDADD): Post-process object files and
add dtrace-generated object file, if necessary.

2008-06-05  Andreas Faerber  <andreas.faerber@web.de>

* mini.c (mini_init): Add DTrace probes ves-init-{begin,end}.
(mini_method_compile) Add DTrace probes method-compile-{begin,end}.
* Makefile.am (libmono_la_LIBADD,libmono_static_la_LIBADD,mono_LDADD):
Post-process object files and add dtrace-generated object, if necessary.

This commit is licensed under the MIT X11 license.

svn path=/trunk/mono/; revision=104964

14 files changed:
ChangeLog
configure.in
data/README
data/mono.d [new file with mode: 0644]
dtrace-prelink.sh [new file with mode: 0644]
mono/metadata/ChangeLog
mono/metadata/Makefile.am
mono/metadata/boehm-gc.c
mono/mini/ChangeLog
mono/mini/Makefile.am
mono/mini/mini.c
mono/utils/ChangeLog
mono/utils/Makefile.am
mono/utils/dtrace.h [new file with mode: 0644]

index 87f4801401178e0bb1e383b8c958e415e9b02c1e..5c803ddfe56c5027d3e0bc429483d0e4302c0510 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-05  Andreas Färber  <andreas.faerber@web.de>
+
+       * configure.in: Add configure option for DTrace.
+       * dtrace-prelink.sh: New file, helper script for DTrace builds.
+       * data/mono.d: New file, defines the DTrace 'mono' provider.
+
+       Contributed unter MIT/X11 license.
+
 2008-05-31  Andreas Färber  <andreas.faerber@web.de>
 
        * configure.in (big-arrays): Output fix.
index 2c1a6d34993129432df8d37e7711360b8ca6f92e..0c4b00252e71514fa77d4d149d93eac431180cbf 100644 (file)
@@ -1684,6 +1684,53 @@ if test "x$enable_big_arrays" = "xyes" ; then
        AC_DEFINE(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
 fi
 
+AC_MSG_CHECKING([if DTrace support is requested])
+AC_ARG_ENABLE(dtrace,[  --enable-dtrace        Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=no)
+AC_MSG_RESULT($enable_dtrace)
+dtrace_g=no
+if test "x$enable_dtrace" = "xyes"; then
+       AC_DEFINE(ENABLE_DTRACE, 1, [Enable DTrace probes])
+       AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
+       if test "x$DTRACE" = "xno"; then
+               AC_MSG_FAILURE([DTrace requested but not found])
+       fi
+       DTRACEFLAGS=
+       if test "x$ac_cv_sizeof_void_p" = "x8"; then
+               case "$host" in
+                       powerpc-*-darwin*)
+                       DTRACEFLAGS="-arch ppc64"
+                       ;;
+                       i*86-*-darwin*)
+                       DTRACEFLAGS="-arch x86_64"
+                       ;;
+                       *)
+                       DTRACEFLAGS=-64
+                       ;;
+               esac
+       else
+               case "$host" in
+                       powerpc-*-darwin*)
+                       DTRACEFLAGS="-arch ppc"
+                       ;;
+                       i*86-*-darwin*)
+                       DTRACEFLAGS="-arch i386"
+                       ;;
+                       *)
+                       DTRACEFLAGS=-32
+                       ;;
+               esac
+       fi
+       AC_SUBST(DTRACEFLAGS)
+       case "$host" in
+               *-*-solaris*)
+               dtrace_g=yes
+               ;;
+       esac
+       AC_CHECK_HEADERS([sys/sdt.h])
+fi
+AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
+AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
+
 TARGET="unknown"
 ACCESS_UNALIGNED="yes"
 
index 036517cf97825b80dc3cf67a9585e9c7b29910a5..3f4577d2486b88df3237fe4551144798f7267217 100644 (file)
@@ -11,6 +11,11 @@ Files in this directory:
                basis what kind of features it can depend on when
                producing the HTML code.
 
+       mono.d
+               This is a DTrace file listing available probes.
+               This is used by dtrace to generate a C header file,
+               and on Solaris for postprocessing object files.
+
        mono.supp
                This is a valgrind data file, it lists the warnings
                that should be supressed when reporting Mono-related
diff --git a/data/mono.d b/data/mono.d
new file mode 100644 (file)
index 0000000..3d27128
--- /dev/null
@@ -0,0 +1,28 @@
+/* 
+ * mono.d: DTrace provider for Mono
+ * 
+ * Authors:
+ *   Andreas Faerber <andreas.faerber@web.de>
+ * 
+ */
+
+provider mono {
+       /* Virtual Execution System (VES) */
+       probe ves__init__begin ();
+       probe ves__init__end ();
+
+       /* Just-in-time compiler (JIT) */
+       probe method__compile__begin (char* class_name, char* method_name, char* signature);
+       probe method__compile__end (char* class_name, char* method_name, char* signature, int success);
+
+       /* Garbage Collector (GC) */    
+       probe gc__begin (int generation);
+       probe gc__end (int generation);
+};
+
+#pragma D attributes Evolving/Evolving/Common provider mono provider
+#pragma D attributes Private/Private/Unknown provider mono module
+#pragma D attributes Private/Private/Unknown provider mono function
+#pragma D attributes Evolving/Evolving/Common provider mono name
+#pragma D attributes Evolving/Evolving/Common provider mono args
+
diff --git a/dtrace-prelink.sh b/dtrace-prelink.sh
new file mode 100644 (file)
index 0000000..cb6508f
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/sh
+# 
+# dtrace-prelink.sh: DTrace helper script for Mono
+# 
+# Authors:
+#   Andreas Faerber <andreas.faerber@web.de>
+# 
+
+# Assume that PIC object files live in .libs/, non-PIC code in ./
+PIC=no
+if test "$1" = "--pic"; then
+       PIC=yes
+       shift
+fi
+
+OBJ="$1"
+PROV="$2"
+
+shift
+shift
+
+FILES="$*"
+
+OBJS=
+TMPDIR=.dtrace
+mkdir -p "${TMPDIR}"
+
+# Extract relevant object files to temporary directories
+for FILE in ${FILES}; do
+       if echo "${FILE}" | grep .la > /dev/null; then
+               LIBDIR=`dirname ${FILE}`
+               LIB=".libs/`basename ${FILE} .la`.a"
+               DIR="${TMPDIR}/`basename ${FILE}`"
+               mkdir -p ${DIR}
+               (cd "${DIR}" && ${AR} x "../../${LIBDIR}/${LIB}")
+               TMPOBJS=`ls -1 "${DIR}"`
+               for TMPOBJ in ${TMPOBJS}; do
+                       LO=`basename "${TMPOBJ}" .o`.lo
+                       SRCOBJ="${TMPOBJ}"
+                       if test x${PIC} = xyes; then
+                               SRCOBJ=".libs/${SRCOBJ}"
+                       fi
+                       # Overwrite with original version
+                       cp "${LIBDIR}/${SRCOBJ}" "${DIR}/${TMPOBJ}" || cp "${LIBDIR}/${TMPOBJ}" "${DIR}/${TMPOBJ}" || exit
+                       # Add to list
+                       OBJS="${OBJS} ${DIR}/${TMPOBJ}"
+               done
+       fi
+       if echo "${FILE}" | grep .lo > /dev/null; then
+               DIR=`dirname ${FILE}`
+               SRCOBJ=`basename ${FILE} .lo`.o
+               if test x${PIC} = xyes; then
+                       SRCOBJ=".libs/${SRCOBJ}"
+               fi
+               OBJS="${OBJS} ${DIR}/${SRCOBJ}"
+       fi
+done
+
+# Run dtrace -G over the temporary objects
+${DTRACE} -G ${DTRACEFLAGS} -s "${PROV}" -o "${OBJ}" ${OBJS} || exit
+
+# Update the archives with the temporary, modified object files so that they are linked in
+for FILE in ${FILES}; do
+       if echo "${FILE}" | grep .la > /dev/null; then
+               LIBDIR=`dirname ${FILE}`
+               LIB=".libs/`basename ${FILE} .la`.a"
+               DIR="${TMPDIR}/`basename ${FILE}`"
+               (cd "${DIR}" && ${AR} r "../../${LIBDIR}/${LIB}" *.o)
+       fi
+       # .lo files were modified in-place
+done
+
+rm -rf "${TMPDIR}"
+
index c085fcbead380ffc99fcb78c1c9e2bcf389c2536..1cac666b9fe4b1808124d0f9d98bde73539a80c2 100644 (file)
@@ -1,3 +1,11 @@
+2008-06-05  Andreas Färber  <andreas.faerber@web.de>
+
+       * boehm-gc.c: Add DTrace probes gc-{begin,end}.
+       * Makefile.am (pedump_LDADD): Post-process object files and
+       add dtrace-generated object file, if necessary.
+
+       Code is contributed under MIT/X11 license.
+
 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
index ec075aabe126859dba5e35c056f5f02669aeb6fb..f7be2d412fdf8fe00745d137a19548eea2f4f7d9 100644 (file)
@@ -169,11 +169,23 @@ libmonoruntimeinclude_HEADERS = \
        debug-helpers.h \
        mempool.h
 
+if DTRACE_G_REQUIRED
+
+PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
+
+pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
+       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
+       --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
+
+else
+PEDUMP_DTRACE_OBJECT = 
+endif
+
 pedump_SOURCES =               \
        pedump.c
 
 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
-       $(LIBGC_LIBS) $(GLIB_LIBS) -lm
+       $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
 
 EXTRA_DIST = make-bundle.pl sample-bundle
 
index 409bf2db4022e673bb535587e58b20330fe7053b..db29f93924e21f147cf40a34740995d3d6b18cf4 100644 (file)
@@ -13,6 +13,7 @@
 #include <mono/metadata/method-builder.h>
 #include <mono/metadata/opcodes.h>
 #include <mono/utils/mono-logger.h>
+#include <mono/utils/dtrace.h>
 
 #if HAVE_BOEHM_GC
 
@@ -106,7 +107,17 @@ mono_gc_base_init (void)
 void
 mono_gc_collect (int generation)
 {
+       MONO_PROBE_GC_BEGIN (generation);
+       
        GC_gcollect ();
+       
+       MONO_PROBE_GC_END (generation);
+#if defined(ENABLE_DTRACE) && defined(__sun__)
+       /* This works around a dtrace -G problem on Solaris.
+          Limit its actual use to when the probe is enabled. */
+       if (MONO_PROBE_GC_END_ENABLED ())
+               sleep(0);
+#endif
 }
 
 int
index 12b8312cf3fb519cc6bd9a2c5d19d981634c2130..f8fdb2529450a1edd998246ae8ba326b2cdcdc05 100644 (file)
@@ -1,3 +1,12 @@
+2008-06-05  Andreas Färber  <andreas.faerber@web.de>
+
+       * mini.c (mini_init): Add DTrace probes ves-init-{begin,end}.
+       (mini_method_compile) Add DTrace probes method-compile-{begin,end}.
+       * Makefile.am (libmono_la_LIBADD,libmono_static_la_LIBADD,mono_LDADD):
+       Post-process object files and add dtrace-generated object, if necessary.
+
+       Contributed under MIT/X11 license.
+
 2008-06-04  Mark Probst  <mark.probst@gmail.com>
 
        * inssel.brg, mini-ops.h: Added opcode for unboxcast with computed
index a560ec070ba96d1852d2df9ab79ca1b604860935..22eab1ceac8c5de0a5f4b73efc77c6173b9123f3 100644 (file)
@@ -80,6 +80,18 @@ endif
 mono_SOURCES = \
        main.c
 
+if DTRACE_G_REQUIRED
+LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
+if STATIC_MONO
+MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
+else
+MONO_DTRACE_OBJECT = 
+endif
+else
+MONO_DTRACE_OBJECT = 
+LIBMONO_DTRACE_OBJECT = 
+endif
+
 if STATIC_MONO
 # Link libmono into mono statically
 # This leads to higher performance, especially with TLS
@@ -91,11 +103,24 @@ endif
 mono_LDADD = \
        $(MONO_LIB)                     \
        $(GLIB_LIBS)            \
-       -lm
+       -lm     \
+       $(MONO_DTRACE_OBJECT)
 
 mono_LDFLAGS = \
        $(static_flags) -export-dynamic $(monobinldflags)
 
+if DTRACE_G_REQUIRED
+
+mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
+       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
+       $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
+
+.libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
+       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
+       --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
+
+endif
+
 # Create monow.exe, linked for the 'windows' subsystem
 if PLATFORM_WIN32
 monow_LDADD = $(mono_LDADD)
@@ -350,7 +375,7 @@ nodist_libmono_la_SOURCES = inssel.c inssel.h
 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
 libmono_static_la_LDFLAGS = -static
-libmono_static_la_LIBADD = $(static_libs)
+libmono_static_la_LIBADD = $(static_libs) $(MONO_DTRACE_OBJECT)
 
 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
 
@@ -359,7 +384,7 @@ libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
 libmonoinclude_HEADERS = jit.h
 
 libmono_la_LIBADD = \
-       $(libs)
+       $(libs) $(LIBMONO_DTRACE_OBJECT)
 
 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
        $(MCS) -out:$@ $< -r:TestDriver.dll -r:generics-variant-types.dll
index 0951e85e2042024fa7c6f28cdd26be114b469ce9..ab315faebb7d3d5a796211b719cbdbc2abd5b070 100644 (file)
@@ -64,6 +64,7 @@
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-logger.h>
 #include <mono/utils/mono-mmap.h>
+#include <mono/utils/dtrace.h>
 
 #include "mini.h"
 #include <string.h>
@@ -11983,6 +11984,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
        mono_jit_stats.methods_compiled++;
        if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION)
                mono_profiler_method_jit (method);
+       if (MONO_PROBE_METHOD_COMPILE_BEGIN_ENABLED ())
+               MONO_PROBE_METHOD_COMPILE_BEGIN (method);
  
        if (compile_aot)
                /* We are passed the original generic method definition */
@@ -12060,6 +12063,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
        if (!header) {
                cfg->exception_type = MONO_EXCEPTION_INVALID_PROGRAM;
                cfg->exception_message = g_strdup_printf ("Missing or incorrect header for method %s", cfg->method->name);
+               if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+                       MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
                if (cfg->prof_options & MONO_PROFILE_JIT_COMPILATION)
                        mono_profiler_method_end_jit (method, NULL, MONO_PROFILE_FAILED);
                return cfg;
@@ -12081,14 +12086,19 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
 
        if ((i = mono_method_to_ir (cfg, method_to_compile, NULL, NULL, cfg->locals_start, NULL, NULL, NULL, 0, FALSE)) < 0) {
                if (try_generic_shared && cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
-                       if (compile_aot)
+                       if (compile_aot) {
+                               if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+                                       MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
                                return cfg;
+                       }
                        mono_destroy_compile (cfg);
                        try_generic_shared = FALSE;
                        goto restart_compile;
                }
                g_assert (cfg->exception_type != MONO_EXCEPTION_GENERIC_SHARING_FAILED);
 
+               if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+                       MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
                if (cfg->prof_options & MONO_PROFILE_JIT_COMPILATION)
                        mono_profiler_method_end_jit (method, NULL, MONO_PROFILE_FAILED);
                /* cfg contains the details of the failure, so let the caller cleanup */
@@ -12150,8 +12160,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
        }
 
        /* after method_to_ir */
-       if (parts == 1)
+       if (parts == 1) {
+               if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+                       MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
                return cfg;
+       }
 
 //#define DEBUGSSA "logic_run"
 #define DEBUGSSA_CLASS "Tests"
@@ -12181,8 +12194,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
 #endif
 
        /* after SSA translation */
-       if (parts == 2)
+       if (parts == 2) {
+               if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+                       MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
                return cfg;
+       }
 
        if ((cfg->opt & MONO_OPT_CONSPROP) || (cfg->opt & MONO_OPT_COPYPROP)) {
                if (cfg->comp_done & MONO_COMP_SSA) {
@@ -12221,8 +12237,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
 #endif
 
        /* after SSA removal */
-       if (parts == 3)
+       if (parts == 3) {
+               if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+                       MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
                return cfg;
+       }
 
        if (cfg->verbose_level > 4) {
                printf ("BEFORE DECOMPSE START\n");
@@ -12445,6 +12464,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
        }
        mono_jit_stats.native_code_size += cfg->code_len;
 
+       if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+               MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
        if (cfg->prof_options & MONO_PROFILE_JIT_COMPILATION)
                mono_profiler_method_end_jit (method, jinfo, MONO_PROFILE_OK);
 
@@ -13638,6 +13659,8 @@ mini_init (const char *filename, const char *runtime_version)
 {
        MonoDomain *domain;
 
+       MONO_PROBE_VES_INIT_BEGIN ();
+
 #ifdef __linux__
        if (access ("/proc/self/maps", F_OK) != 0) {
                g_print ("Mono requires /proc to be mounted.\n");
@@ -13913,6 +13936,9 @@ mini_init (const char *filename, const char *runtime_version)
        mono_generic_sharing_init ();
 
        mono_thread_attach (domain);
+       
+       MONO_PROBE_VES_INIT_END ();
+       
        return domain;
 }
 
index 514c3cc6fcfaba99bde0e797bd831b3876d1ac2b..44585498ee2b65c1ef686f8aae96ae751446a591 100644 (file)
@@ -1,3 +1,10 @@
+2008-06-05  Andreas Färber  <andreas.faerber@web.de>
+
+       * dtrace.h: New file, defines macros for DTrace probes.
+       * Makefile.am (BUILT_SOURCES): Generate mono-dtrace.h when DTrace enabled.
+
+       Contributed under MIT/X11 license.
+
 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
 
        * mono-value-hash.c: Remove the unused prime functions. Fixes #395320.
index 2ecd435f261238fb393f27b0e818e0b9a68e26c1..5ebf84518020eb495c000fe6c56ad64eb49e813f 100644 (file)
@@ -2,6 +2,15 @@ noinst_LTLIBRARIES = libmonoutils.la
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS)
 
+if ENABLE_DTRACE
+
+BUILT_SOURCES = mono-dtrace.h
+
+mono-dtrace.h: $(top_srcdir)/data/mono.d
+       $(DTRACE) $(DTRACEFLAGS) -h -s $(top_srcdir)/data/mono.d -o $@
+
+endif
+
 if EGLIB_BUILD 
 hash_sources = mono-ehash.c
 else
diff --git a/mono/utils/dtrace.h b/mono/utils/dtrace.h
new file mode 100644 (file)
index 0000000..1b540f7
--- /dev/null
@@ -0,0 +1,76 @@
+/* 
+ * dtrace.h: DTrace probes
+ * 
+ * Authors:
+ *   Andreas Faerber <andreas.faerber@web.de>
+ * 
+ */
+
+#ifndef __UTILS_DTRACE_H__
+#define __UTILS_DTRACE_H__
+
+#ifdef ENABLE_DTRACE
+
+
+#include <mono/utils/mono-dtrace.h>
+
+#define MONO_PROBE_VES_INIT_BEGIN()            MONO_VES_INIT_BEGIN ()
+#define MONO_PROBE_VES_INIT_BEGIN_ENABLED()    MONO_VES_INIT_BEGIN_ENABLED ()
+
+#define MONO_PROBE_VES_INIT_END()              MONO_VES_INIT_END ()
+#define MONO_PROBE_VES_INIT_END_ENABLED()      MONO_VES_INIT_END_ENABLED ()
+
+
+#define MONO_PROBE_METHOD_COMPILE_BEGIN(method) \
+       MONO_METHOD_COMPILE_BEGIN ( \
+               mono_type_get_full_name ((method)->klass), \
+               (gchar*)(method)->name, \
+               mono_signature_get_desc ((method)->signature, TRUE) \
+       )
+#define MONO_PROBE_METHOD_COMPILE_BEGIN_ENABLED()      MONO_METHOD_COMPILE_BEGIN_ENABLED ()
+
+#define MONO_PROBE_METHOD_COMPILE_END(method, success) \
+       MONO_METHOD_COMPILE_END ( \
+               mono_type_get_full_name ((method)->klass), \
+               (gchar*)(method)->name, \
+               mono_signature_get_desc ((method)->signature, TRUE), \
+               success \
+       )
+#define MONO_PROBE_METHOD_COMPILE_END_ENABLED()        MONO_METHOD_COMPILE_END_ENABLED ()
+
+
+#define MONO_PROBE_GC_BEGIN(generation)        MONO_GC_BEGIN (generation)
+#define MONO_PROBE_GC_BEGIN_ENABLED()  MONO_GC_BEGIN_ENABLED ()
+
+#define MONO_PROBE_GC_END(generation)  MONO_GC_END (generation)
+#define MONO_PROBE_GC_END_ENABLED()    MONO_GC_END_ENABLED ()
+
+
+#else
+
+
+#define MONO_PROBE_VES_INIT_BEGIN()
+#define MONO_PROBE_VES_INIT_BEGIN_ENABLED() (0)
+
+#define MONO_PROBE_VES_INIT_END()
+#define MONO_PROBE_VES_INIT_END_ENABLED() (0)
+
+
+#define MONO_PROBE_METHOD_COMPILE_BEGIN(method)
+#define MONO_PROBE_METHOD_COMPILE_BEGIN_ENABLED() (0)
+
+#define MONO_PROBE_METHOD_COMPILE_END(method, success)
+#define MONO_PROBE_METHOD_COMPILE_END_ENABLED() (0)
+
+
+#define MONO_PROBE_GC_BEGIN(generation)
+#define MONO_PROBE_GC_BEGIN_ENABLED() (0)
+
+#define MONO_PROBE_GC_END(generation)
+#define MONO_PROBE_GC_END_ENABLED() (0)
+
+
+#endif
+
+#endif
+