[profiler] Disable `perf` events by default.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Wed, 25 Mar 2015 12:22:39 +0000 (13:22 +0100)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Wed, 25 Mar 2015 12:22:39 +0000 (13:22 +0100)
As it turns out, `perf` support crashes/hangs on a lot of Linux
kernels in the wild, and produces no output on some Android devices.
So, given that using a signal + helper thread is more reliable, use
it by default and make `perf` support optional.

The configure flag is now `--enable-perf-events`.

configure.ac
mono/profiler/proflog.c

index e32184ac590d093faf8a184d7927f0b0fee87205..73a96466a086c23e6bfb939452c9c9b60a1c3f1f 100644 (file)
@@ -2512,10 +2512,10 @@ fi
 
 AC_ARG_ENABLE(bcl-opt, [  --disable-bcl-opt    BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
 
-AC_ARG_ENABLE(perf-events, [  --disable-perf-events Disable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=yes)
-if test "x$test_perf_events" != "xyes"; then
-       AC_DEFINE(DISABLE_PERF_EVENTS, 1, [Disable using `perf` for profiling on Linux])
-       AC_SUBST(DISABLE_PERF_EVENTS)
+AC_ARG_ENABLE(perf-events, [  --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
+if test "x$test_perf_events" == "xyes"; then
+       AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
+       AC_SUBST(ENABLE_PERF_EVENTS)
 fi
 
 AC_MSG_CHECKING([if big-arrays are to be enabled])
index 9afa74dfacfaa493a60e01caf58c5ce003507e14..c2108f2325238c06bd819f7370b338cfe941896d 100644 (file)
@@ -78,7 +78,7 @@
 #include <sys/syscall.h>
 #include "perf_event.h"
 
-#ifndef DISABLE_PERF_EVENTS
+#ifdef ENABLE_PERF_EVENTS
 #define USE_PERF_EVENTS 1
 
 static int read_perf_mmap (MonoProfiler* prof, int cpu);