[runtime] Set pending, don't raise, in object.c icalls
[mono.git] / mono / metadata / profiler.h
index b0250d9bc976752d64e4e2a600032c38b75e4994..17128a1cb5a79d950d70cc90c6a73337fae24b0b 100644 (file)
@@ -6,29 +6,6 @@
 
 MONO_BEGIN_DECLS
 
-/*
- * The profiler API is considered unstable because it needs to evolve with the
- * Mono runtime. Profilers will pass in the profiler API version they are built
- * against when calling mono_profiler_install (). If the profiler API version
- * of the runtime is not equal to the one passed in, Mono will print a warning
- * letting developers know that a profiler module needs to be updated.
- *
- * When you have updated a module to be compatible with a version of the
- * profiler API, make it pass in the current value of MONO_PROFILER_VERSION.
- * Pass the value literally; using the macro will defeat the purpose.
- * (Modules within Mono are exceptions to this rule.)
- *
- * mono_profiler_install () is the single function guaranteed to be stable.
- *
- * -- Change Log --
- *
- * Version 1:
- *
- *  - Introduced profiler API versioning.
- */
-
-#define MONO_PROFILER_VERSION 1
-
 #define MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH 128
 
 typedef enum {
@@ -53,7 +30,8 @@ typedef enum {
        MONO_PROFILE_MONITOR_EVENTS   = 1 << 17,
        MONO_PROFILE_IOMAP_EVENTS     = 1 << 18, /* this should likely be removed, too */
        MONO_PROFILE_GC_MOVES         = 1 << 19,
-       MONO_PROFILE_GC_ROOTS         = 1 << 20
+       MONO_PROFILE_GC_ROOTS         = 1 << 20,
+       MONO_PROFILE_CONTEXT_EVENTS   = 1 << 21
 } MonoProfileFlags;
 
 typedef enum {
@@ -141,6 +119,7 @@ typedef enum {
 typedef void (*MonoProfileFunc) (MonoProfiler *prof);
 
 typedef void (*MonoProfileAppDomainFunc) (MonoProfiler *prof, MonoDomain   *domain);
+typedef void (*MonoProfileContextFunc)   (MonoProfiler *prof, MonoAppContext *context);
 typedef void (*MonoProfileMethodFunc)   (MonoProfiler *prof, MonoMethod   *method);
 typedef void (*MonoProfileClassFunc)    (MonoProfiler *prof, MonoClass    *klass);
 typedef void (*MonoProfileModuleFunc)   (MonoProfiler *prof, MonoImage    *module);
@@ -151,6 +130,7 @@ typedef void (*MonoProfileExceptionFunc) (MonoProfiler *prof, MonoObject *object
 typedef void (*MonoProfileExceptionClauseFunc) (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_num);
 
 typedef void (*MonoProfileAppDomainResult)(MonoProfiler *prof, MonoDomain   *domain,   int result);
+typedef void (*MonoProfileAppDomainFriendlyNameFunc) (MonoProfiler *prof, MonoDomain *domain, const char *name);
 typedef void (*MonoProfileMethodResult)   (MonoProfiler *prof, MonoMethod   *method,   int result);
 typedef void (*MonoProfileJitResult)      (MonoProfiler *prof, MonoMethod   *method,   MonoJitInfo* jinfo,   int result);
 typedef void (*MonoProfileClassResult)    (MonoProfiler *prof, MonoClass    *klass,    int result);
@@ -183,13 +163,15 @@ typedef void (*MonoProfilerCodeBufferNew) (MonoProfiler *prof, void* buffer, int
 /*
  * Function the profiler may call.
  */
-MONO_API void mono_profiler_install       (MonoProfiler *prof, int version, MonoProfileFunc shutdown_callback);
+MONO_API void mono_profiler_install       (MonoProfiler *prof, MonoProfileFunc shutdown_callback);
 MONO_API void mono_profiler_set_events    (MonoProfileFlags events);
 
 MONO_API MonoProfileFlags mono_profiler_get_events (void);
 
 MONO_API void mono_profiler_install_appdomain   (MonoProfileAppDomainFunc start_load, MonoProfileAppDomainResult end_load,
                                         MonoProfileAppDomainFunc start_unload, MonoProfileAppDomainFunc end_unload);
+MONO_API void mono_profiler_install_appdomain_name (MonoProfileAppDomainFriendlyNameFunc domain_name_cb);
+MONO_API void mono_profiler_install_context     (MonoProfileContextFunc load, MonoProfileContextFunc unload);
 MONO_API void mono_profiler_install_assembly    (MonoProfileAssemblyFunc start_load, MonoProfileAssemblyResult end_load,
                                         MonoProfileAssemblyFunc start_unload, MonoProfileAssemblyFunc end_unload);
 MONO_API void mono_profiler_install_module      (MonoProfileModuleFunc start_load, MonoProfileModuleResult end_load,