[profiler] Profiler entry point name must now include the module name.
[mono.git] / mono / metadata / profiler.h
index 2d5935e6fdd8b4d9f3ab35084357efe31d0d0eb8..5063431bc8bf1b2ed2a7b21e5a8e0b8a007e78fd 100644 (file)
@@ -27,9 +27,9 @@ MONO_BEGIN_DECLS
  * the module after it has been loaded. If the specified module has already
  * been loaded, this function has no effect.
  *
- * A module should declare an entry point like so:
+ * A module called foo should declare an entry point like so:
  *
- * void mono_profiler_init (const char *desc)
+ * void mono_profiler_init_foo (const char *desc)
  * {
  * }
  *
@@ -134,14 +134,14 @@ typedef enum {
 MONO_API mono_bool mono_profiler_enable_sampling (MonoProfilerHandle handle);
 
 /*
- * Sets the sampling mode and frequency (in Hz). If the calling profiler has
- * ownership over sampling settings, the settings will be changed and this
- * function will return TRUE; otherwise, it returns FALSE without changing any
- * settings.
+ * Sets the sampling mode and frequency (in Hz). The frequency must be a
+ * positive number. If the calling profiler has ownership over sampling
+ * settings, the settings will be changed and this function will return TRUE;
+ * otherwise, it returns FALSE without changing any settings.
  *
  * This function is async safe.
  */
-MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint64_t freq);
+MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq);
 
 /*
  * Retrieves the current sampling mode and/or frequency (in Hz). Returns TRUE if
@@ -150,7 +150,7 @@ MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, Mon
  *
  * This function is async safe.
  */
-MONO_API mono_bool mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint64_t *freq);
+MONO_API mono_bool mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq);
 
 /*
  * Enables instrumentation of GC allocations. This is necessary so that managed
@@ -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 */
@@ -227,18 +229,13 @@ typedef enum {
        MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9,
 } MonoProfilerCodeBufferType;
 
-// Keep somewhat in sync with libgc/include/gc.h : GC_EventType.
 typedef enum {
-       MONO_GC_EVENT_START = 0,
-       MONO_GC_EVENT_MARK_START = 1,
-       MONO_GC_EVENT_MARK_END = 2,
-       MONO_GC_EVENT_RECLAIM_START = 3,
-       MONO_GC_EVENT_RECLAIM_END = 4,
-       MONO_GC_EVENT_END = 5,
        MONO_GC_EVENT_PRE_STOP_WORLD = 6,
        /* When this event arrives, the GC and suspend locks are acquired. */
        MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
        MONO_GC_EVENT_POST_STOP_WORLD = 7,
+       MONO_GC_EVENT_START = 0,
+       MONO_GC_EVENT_END = 5,
        MONO_GC_EVENT_PRE_START_WORLD = 8,
        /* When this event arrives, the GC and suspend locks are released. */
        MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11,