;;
esac
+dnl *************
+dnl *** VTUNE ***
+dnl *************
+
+AC_ARG_ENABLE(vtune,[ --enable-vtune Enable the VTUNE back-end], enable_vtune=$enableval, enable_vtune=no)
+AC_ARG_WITH(vtune, [ --with-vtune=<vtune prefix> Enable jit vtune profiling], enable_vtune=yes,)
+
+AM_CONDITIONAL(HAVE_VTUNE, test x$enable_vtune = xyes)
+
+if test "x$enable_vtune" = "xyes"; then
+ if test "x$with_vtune" = "x"; then
+ VTUNE_PATH=/opt/intel/vtune_amplifier_xe
+ else
+ VTUNE_PATH=$with_vtune
+ fi
+ VTUNE_INCLUDE=$VTUNE_PATH/include
+ case "$TARGET" in
+ X86)
+ VTUNE_LIB=$VTUNE_PATH/lib32
+ ;;
+ AMD64)
+ VTUNE_LIB=$VTUNE_PATH/lib64
+ ;;
+ *)
+ AC_MSG_ERROR([Unsupported target $TARGET for VTUNE.])
+ ;;
+ esac
+ if test ! -f $VTUNE_INCLUDE/jitprofiling.h; then
+ AC_MSG_ERROR([VTUNE $VTUNE_INCLUDE/jitprofiling.h not found.])
+ fi
+ if test ! -f $VTUNE_LIB/libjitprofiling.a; then
+ AC_MSG_ERROR([VTUNE $VTUNE_LIB/libjitprofiling.a not found.])
+ fi
+
+ VTUNE_CFLAGS=-I$VTUNE_INCLUDE
+ VTUNE_LIBS="-L/$VTUNE_LIB/ -ljitprofiling"
+
+ AC_SUBST(VTUNE_LIBS)
+ AC_SUBST(VTUNE_CFLAGS)
+fi
dnl Use GCC atomic ops if they work on the target.
if test x$GCC = "xyes"; then
case $TARGET in
if !DISABLE_LIBRARIES
if !DISABLE_PROFILER
bin_PROGRAMS = mprof-report
-lib_LTLIBRARIES = libmono-profiler-cov.la libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la
+
+if HAVE_VTUNE
+vtune_lib = libmono-profiler-vtune.la
+endif
+
+lib_LTLIBRARIES = libmono-profiler-cov.la libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
+
if PLATFORM_DARWIN
libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
endif
libmono_profiler_iomap_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
libmono_profiler_log_la_SOURCES = proflog.c
libmono_profiler_log_la_LIBADD = $(LIBMONO) $(Z_LIBS)
+if HAVE_VTUNE
+libmono_profiler_vtune_la_SOURCES = mono-profiler-vtune.c
+libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
+libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
+endif
if PLATFORM_ANDROID
libmono_profiler_log_la_LIBADD += $(GLIB_LIBS)
#define bool char
-#include "jitprofiling.h"
+#include <jitprofiling.h>
/* called at the end of the program */
static void
if (result == MONO_PROFILE_OK) {
int i;
MonoDebugSourceLocation *sourceLoc;
- MonoDebugMethodInfo *methodDebugInfo;
MonoDebugMethodJitInfo *dmji;
MonoClass *klass = mono_method_get_class (method);
char *signature = mono_signature_get_desc (mono_method_signature (method), TRUE);