+ _INFO("MCJ playing start for %s", appId);
+ } 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);
+ }
+ }
+ _INFO("MCJ recording start for %s", appId);