#include <mono/utils/mono-threads-coop.h>
#include <mono/utils/checked-build.h>
#include <mono/metadata/w32handle.h>
-#include <mono/io-layer/io-layer.h>
#include "mini.h"
#include "seq-points.h"
*/
gboolean mono_use_llvm = FALSE;
+gboolean mono_use_interpreter = FALSE;
+
#define mono_jit_lock() mono_os_mutex_lock (&jit_mutex)
#define mono_jit_unlock() mono_os_mutex_unlock (&jit_mutex)
static mono_mutex_t jit_mutex;
#endif
GList* mono_aot_paths;
+static gboolean mini_enable_profiler = FALSE;
+static char* mini_profiler_options = NULL;
+
static GSList *tramp_infos;
static void register_icalls (void);
+static gboolean mini_profiler_enabled (void) { return mini_enable_profiler; }
+static const char* mini_profiler_get_options (void) { return mini_profiler_options; }
+
gboolean
mono_running_on_valgrind (void)
{
#endif
}
+void
+mini_profiler_enable_with_options (const char* profile_options)
+{
+ mini_enable_profiler = TRUE;
+ mini_profiler_options = g_strdup (profile_options);
+}
+
MonoDomain *
mini_init (const char *filename, const char *runtime_version)
{
mono_install_get_class_from_name (mono_aot_get_class_from_name);
mono_install_jit_info_find_in_aot (mono_aot_find_jit_info);
+ if (mini_profiler_enabled ()) {
+ mono_profiler_load (mini_profiler_get_options ());
+ mono_profiler_thread_name (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()), "Main");
+ }
+
if (debug_options.collect_pagefault_stats)
mono_aot_set_make_unreadable (TRUE);