From: Woongsuk Cho Date: Tue, 26 Apr 2022 00:17:52 +0000 (+0900) Subject: Set collect delay when profile data does not exist X-Git-Tag: submit/tizen/20220429.002649~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d4be53cffbd0159bee69b56cd44a3720f34c60a;p=platform%2Fcore%2Fdotnet%2Flauncher.git Set collect delay when profile data does not exist --- diff --git a/NativeLauncher/launcher/lib/core_runtime.cc b/NativeLauncher/launcher/lib/core_runtime.cc index f11aa79..c2fca03 100644 --- a/NativeLauncher/launcher/lib/core_runtime.cc +++ b/NativeLauncher/launcher/lib/core_runtime.cc @@ -574,19 +574,20 @@ int CoreRuntime::launch(const char* appId, const char* root, const char* path, i setEnvironmentVariable("COMPlus_MultiCoreJitProfile", multiCoreJitProfile); setEnvironmentVariable("COMPlus_MultiCoreJitMinNumCpus", "1"); - // stop profiling and write collected data after delay if env value is set. - char *env = getenv("CLR_MCJ_PROFILE_WRITE_DELAY"); - if (env != nullptr) { - int delay = std::atoi(env); - // To avoid undefined behavior by out-of-range input(atoi), set max delay value to 100. - if (delay > 0) { - if (delay > MAX_DELAY_SEC) delay = MAX_DELAY_SEC; - stopProfileAfterDelay(delay); - } - } - if (exist(multiCoreJitProfile)) { setEnvironmentVariable("COMPlus_MultiCoreJitNoProfileGather", "1"); + } else { + setEnvironmentVariable("COMPlus_MultiCoreJitNoProfileGather", "0"); + // stop profiling and write collected data after delay if env value is set. + char *env = getenv("CLR_MCJ_PROFILE_WRITE_DELAY"); + if (env != nullptr) { + int delay = std::atoi(env); + // To avoid undefined behavior by out-of-range input(atoi), set max delay value to 100. + if (delay > 0) { + if (delay > MAX_DELAY_SEC) delay = MAX_DELAY_SEC; + stopProfileAfterDelay(delay); + } + } } } free(localDataPath);