Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / profiler / aot.c
index b5c2d47fb5149cc5b842b4c443fd85f47e74d115..ea2dc1b23fa174995584fc949a38644c5f626e94 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mono-profiler-aot.c: Ahead of Time Compiler Profiler for Mono.
+ * aot.c: Ahead of Time Compiler Profiler for Mono.
  *
  *
  * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
@@ -46,12 +46,7 @@ static mono_mutex_t mutex;
 static gboolean verbose;
 
 static void
-prof_jit_enter (MonoProfiler *prof, MonoMethod *method)
-{
-}
-
-static void
-prof_jit_leave (MonoProfiler *prof, MonoMethod *method, int result)
+prof_jit_leave (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo)
 {
        MonoImage *image = mono_class_get_image (mono_method_get_class (method));
 
@@ -117,19 +112,19 @@ match_option (const char* p, const char *opt, char **rval)
 }
 
 void
-mono_profiler_startup (const char *desc);
+mono_profiler_init_aot (const char *desc);
 
 /**
- * mono_profiler_startup:
+ * mono_profiler_init_aot:
  * the entry point
  */
 void
-mono_profiler_startup (const char *desc)
+mono_profiler_init_aot (const char *desc)
 {
        MonoProfiler *prof;
        const char *p;
        const char *opt;
-       char *outfile_name;
+       char *outfile_name = NULL;
 
        p = desc;
        if (strncmp (p, "aot", 3))
@@ -172,11 +167,9 @@ mono_profiler_startup (const char *desc)
 
        mono_os_mutex_init (&mutex);
 
-       mono_profiler_install (prof, prof_shutdown);
-
-       mono_profiler_install_jit_compile (prof_jit_enter, prof_jit_leave);
-
-       mono_profiler_set_events (MONO_PROFILE_JIT_COMPILATION);
+       MonoProfilerHandle handle = mono_profiler_create (prof);
+       mono_profiler_set_runtime_shutdown_end_callback (handle, prof_shutdown);
+       mono_profiler_set_jit_done_callback (handle, prof_jit_leave);
 }
 
 static void