[runtime] Prioritize loading a profiler library from the installation dir over standa...
authorVladimir Kargov <vkargov@users.noreply.github.com>
Mon, 23 Feb 2015 04:02:20 +0000 (07:02 +0300)
committerVladimir Kargov <vkargov@users.noreply.github.com>
Mon, 23 Feb 2015 04:02:20 +0000 (07:02 +0300)
mono/metadata/profiler.c
mono/mini/driver.c

index 103e966d948325cdac02c9dddd278cdb3824e6ef..05e8d367a8bdf3a021b697608ec9e61f78f6c4ad 100644 (file)
@@ -1196,17 +1196,15 @@ mono_profiler_load (const char *desc)
                }
                if (!load_embedded_profiler (desc, mname)) {
                        libname = g_strdup_printf ("mono-profiler-%s", mname);
-                       if (!load_profiler_from_directory (NULL, libname, desc)) {
-                               res = FALSE;
 #if defined (MONO_ASSEMBLIES)
-                               res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
+                       res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
 #endif
-                               if (!res)
-                                       res = load_profiler_from_mono_instalation (libname, desc);
-
-                               if (!res)
-                                       g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
-                       }
+                       if (!res)
+                               res = load_profiler_from_directory (NULL, libname, desc);
+                       if (!res)
+                               res = load_profiler_from_mono_instalation (libname, desc);
+                       if (!res)
+                               g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
                        g_free (libname);
                }
                g_free (mname);
index b4e3e858d8964f501867f513f280fc03e709dbdd..41b5db28e6eb3985584f22024cb621b4c3f94bc0 100644 (file)
@@ -1875,6 +1875,9 @@ mono_main (int argc, char* argv[])
 
        mono_counters_init ();
 
+       /* Set rootdir before loading config */
+       mono_set_rootdir ();
+
        if (enable_profile)
                mono_profiler_load (profile_options);
 
@@ -1909,9 +1912,6 @@ mono_main (int argc, char* argv[])
                mono_load_coree (argv [i]);
 #endif
 
-       /* Set rootdir before loading config */
-       mono_set_rootdir ();
-
        /* Parse gac loading options before loading assemblies. */
        if (mono_compile_aot || action == DO_EXEC || action == DO_DEBUGGER) {
                mono_config_parse (config_file);