[profiler] Hide the GC roots callback behind a macro and mark it obsolete.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 8 Jul 2017 04:41:38 +0000 (06:41 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 8 Jul 2017 04:41:38 +0000 (06:41 +0200)
13 files changed:
mono/metadata/loader.c
mono/metadata/profiler-events.h
mono/metadata/profiler-private.h
mono/metadata/profiler.h
mono/metadata/string-icalls.c
mono/mini/driver.c
mono/mini/mini-darwin.c
mono/mini/mini-exceptions.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini-windows.c
mono/mini/mini.c
mono/profiler/log.h

index 56c3572e76e9137f7140bbed28329fd0c871c0dd..e685ac227abfc4693a2fedb33903a57e6a56d574 100644 (file)
@@ -35,7 +35,6 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/reflection.h>
-#include <mono/metadata/profiler.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/marshal.h>
index 01902b0bb0c2929c86b16189063edaa940264a9a..7b85f00fb0c1a5512fd4a29f4dfa8708bf6def33 100644 (file)
@@ -70,12 +70,23 @@ MONO_PROFILER_EVENT_2(gc_moves, GCMoves, MonoObject *const *, objects, uint64_t,
 MONO_PROFILER_EVENT_1(gc_resize, GCResize, uintptr_t, size)
 MONO_PROFILER_EVENT_3(gc_handle_created, GCHandleCreated, uint32_t, handle, MonoGCHandleType, type, MonoObject *, object)
 MONO_PROFILER_EVENT_2(gc_handle_deleted, GCHandleDeleted, uint32_t, handle, MonoGCHandleType, type)
-MONO_PROFILER_EVENT_4(gc_roots, GCRoots, MonoObject *const *, roots, const MonoProfilerGCRootType *, types, const uintptr_t *, extra, uint64_t, count)
 MONO_PROFILER_EVENT_0(gc_finalizing, GCFinalizing)
 MONO_PROFILER_EVENT_0(gc_finalized, GCFinalized)
 MONO_PROFILER_EVENT_1(gc_finalizing_object, GCFinalizingObject, MonoObject *, object)
 MONO_PROFILER_EVENT_1(gc_finalized_object, GCFinalizedObject, MonoObject *, object)
 
+/*
+ * This callback provides very low quality data and doesn't really match how
+ * roots are actually handled in the runtime. It will be replaced with a more
+ * sensible callback in the future. **This will be a breaking change.**
+ *
+ * In the meantime, you must define MONO_PROFILER_UNSTABLE_GC_ROOTS to be able
+ * to use this interface.
+ */
+#ifdef MONO_PROFILER_UNSTABLE_GC_ROOTS
+MONO_PROFILER_EVENT_4(gc_roots, GCRoots, MonoObject *const *, roots, const MonoProfilerGCRootType *, types, const uintptr_t *, extra, uint64_t, count)
+#endif
+
 MONO_PROFILER_EVENT_1(monitor_contention, MonitorContention, MonoObject *, object)
 MONO_PROFILER_EVENT_1(monitor_failed, MonitorFailed, MonoObject *, object)
 MONO_PROFILER_EVENT_1(monitor_acquired, MonitorAcquired, MonoObject *, object)
index 4d1b93d4a9566b1e452bcf43fce1bf3027bc7b1c..45535bcf3d8aa7dc9d8334b704cbf5d47299184e 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef __MONO_PROFILER_PRIVATE_H__
 #define __MONO_PROFILER_PRIVATE_H__
 
+#define MONO_PROFILER_UNSTABLE_GC_ROOTS
 #include <mono/metadata/profiler.h>
 #include <mono/utils/mono-lazy-init.h>
 #include <mono/utils/mono-os-mutex.h>
index 2d5935e6fdd8b4d9f3ab35084357efe31d0d0eb8..31fa4a767d48bd7ae6ffbdfb1de6895d6564346c 100644 (file)
@@ -196,6 +196,7 @@ typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFi
  */
 MONO_API void mono_profiler_set_call_instrumentation_filter_callback (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb);
 
+#ifdef MONO_PROFILER_UNSTABLE_GC_ROOTS
 typedef enum {
        /* Upper 2 bytes. */
        MONO_PROFILER_GC_ROOT_PINNING = 1 << 8,
@@ -211,6 +212,7 @@ typedef enum {
 
        MONO_PROFILER_GC_ROOT_TYPEMASK = 0xff,
 } MonoProfilerGCRootType;
+#endif
 
 typedef enum {
        /* data = MonoMethod *method */
index 8556a498940d8b5ae622a8accda3e9f76c79711c..e6cbc3dbfead9b35f8be5412e58b529d09bdeaa5 100644 (file)
@@ -23,8 +23,6 @@
 #include <mono/metadata/object.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/profiler-private.h>
 #include <mono/metadata/gc-internals.h>
 
 /* This function is redirected to String.CreateString ()
index 934eb0a54a363138728a0bdc19f64f45e77df70b..750aa206b992f47a3edd1f041041b090c3e04068 100644 (file)
@@ -36,7 +36,6 @@
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include "mono/metadata/profiler.h"
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
index 75e0a8800fb7531a7083f293f0989b5f44de37ff..73be22c7c6e91d531b43f47c54efdeb9be0424ec 100644 (file)
@@ -34,7 +34,6 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include "mono/metadata/profiler.h"
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
index bd4283bf3f87fab69d58e96c199e53f3acded15c..c8e6b75b496511ff87027095278dea133ac0e0ad 100644 (file)
@@ -60,7 +60,7 @@
 #include <mono/metadata/gc-internals.h>
 #include <mono/metadata/debug-internals.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/profiler.h>
+#include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-endian.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-mlist.h>
index a3fd4f0e2983c745e09adc7c2ec685733a8337af..40a841b729f4fdfdd7ca9a5ae07bfe4ca57b36b0 100644 (file)
@@ -40,7 +40,6 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include "mono/metadata/profiler.h"
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
index 5bd78513c8595453cfa4c36f8d9d89b55564439a..8e385be0afca28fdce9979df8201258d1ce3051c 100644 (file)
@@ -39,7 +39,6 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include "mono/metadata/profiler.h"
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
index 3852baf81f1268a1862a32274c4d3a67c4ea3ff6..efb4739cde2c95866f9dcb34a2643fcf933a76d3 100644 (file)
@@ -27,7 +27,6 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include "mono/metadata/profiler.h"
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
index d058547fc414d8338372721c6ae99c21b30e05de..9948d16c14554277b1c313c217a664b2676a4ca5 100644 (file)
@@ -36,7 +36,6 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include "mono/metadata/profiler.h"
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
index e285f18e618a5a2e4fded37ae2564b03d89a7fdc..2f14b018a421046264045e15d945ac5db6d9eb44 100644 (file)
@@ -2,6 +2,7 @@
 #define __MONO_PROFLOG_H__
 
 #include <glib.h>
+#define MONO_PROFILER_UNSTABLE_GC_ROOTS
 #include <mono/metadata/profiler.h>
 
 #define BUF_ID 0x4D504C01