From e3cfac464bfd8f5f815d86c04552a39d54197145 Mon Sep 17 00:00:00 2001 From: Vladimir Kargov Date: Mon, 23 Feb 2015 07:02:20 +0300 Subject: [PATCH 1/1] [runtime] Prioritize loading a profiler library from the installation dir over standard libarary paths. --- mono/metadata/profiler.c | 16 +++++++--------- mono/mini/driver.c | 6 +++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c index 103e966d948..05e8d367a8b 100644 --- a/mono/metadata/profiler.c +++ b/mono/metadata/profiler.c @@ -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); diff --git a/mono/mini/driver.c b/mono/mini/driver.c index b4e3e858d89..41b5db28e6e 100644 --- a/mono/mini/driver.c +++ b/mono/mini/driver.c @@ -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); -- 2.25.1