EXE /usr/bin/dotnet-launcher
APP_TYPE dotnet-nui
EXTRA_ARG --PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE
+# EXTRA_ARG --profile
EXTRA_ARG --standalone
HYDRA OFF
EXTRA --appType dotnet-nui
EXTRA TIZEN_UIFW NUI
+EXTRA --profile false
EXE /usr/bin/dotnet-launcher
APP_TYPE dotnet
EXTRA_ARG --PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE
+# EXTRA_ARG --profile
EXTRA_ARG --appType
EXTRA_ARG dotnet
EXTRA_ARG --standalone
HYDRA OFF
EXTRA --appType dotnet
EXTRA TIZEN_UIFW ElmSharp
+EXTRA --profile false
#define PATH_SEPARATOR '/'
#endif
+#ifndef PROFILE_BASENAME
+#define PROFILE_BASENAME ".__tizen_specific_profile_data"
+#endif
+
namespace bf = boost::filesystem;
namespace bs = boost::system;
static std::string StandaloneOption("--standalone");
static std::string PaddingOption("--PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE");
static std::string AppTypeOption("--appType");
+static std::string ProfileOption("--profile");
int main(int argc, char *argv[])
{
char* standalonePath = nullptr;
bool paddingExist = false;
+ bool profile = false;
const char* appType = NULL;
const char* appRootPath = NULL;
char appId[APPID_MAX_LENGTH] = {0,};
standalonePath = argv[i];
} else if (PaddingOption.compare(argv[i]) == 0) {
paddingExist = true;
+ } else if (ProfileOption.compare(argv[i]) == 0) {
+ profile = true;
} else if (AppTypeOption.compare(argv[i]) == 0) {
if (i > argc - 1) {
_ERR("app type for launchpad must be after \"--appType\" option");
_ERR("Failed to initialize");
} else {
// launch application
- err = CoreRuntime::launch(appId, appRootPath, standalonePath, vargs.size(), &vargs[0]);
+ err = CoreRuntime::launch(appId, appRootPath, standalonePath, vargs.size(), &vargs[0], profile);
if (err) {
_ERR("Failed to launch");
}
static const char* KEY_APP_TYPE = "--appType";
static const char* KEY_TIZEN_UIFW = "TIZEN_UIFW";
+static const char* KEY_PROFILE = "--profile";
static Ecore_Fd_Handler *__fd_handler;
static loader_receiver_cb __receiver;
} AppInfo;
static AppInfo __appInfo;
+// Collect/use multicorejit profile or not
+static bool profile;
+
//################## Code for running event loop for loader ####################
_INFO("TIZEN_UIFW is set to %s", uifw);
}
+ char *profile_str = NULL;
+ profile = false;
+ bundle_get_str(extra, KEY_PROFILE, &profile_str);
+ if (profile_str != NULL) {
+ if (!strcmp(profile_str, "true")) {
+ profile = true;
+ } else if (!strcmp(profile_str, "false")) {
+ profile = false;
+ } else {
+ _DBG("PROFILE value %s not recognized. Valid values: true, false. Turn off PROFILE mode as default", profile_str);
+ }
+ }
+
// initialize CoreRuntime (launchmode, dlog redirection enable, root path NULL)
if (CoreRuntime::initialize(appType ? appType : "dotnet", LaunchMode::loader) != 0) {
_ERR("Failed to initialized");
// The launchpad pass the name of exe file to the first argument.
// For the C# spec, we have to skip this first argument.
if (CoreRuntime::launch(__appInfo.appid.c_str(), __appInfo.root.c_str(),
- __appInfo.app_path.c_str(), argc - 1, argv + 1)) {
+ __appInfo.app_path.c_str(), argc - 1, argv + 1, profile)) {
_ERR("Failed to launch");
return -1;
}
_INFO("CoreRuntime finalized");
}
-int CoreRuntime::launch(const char* appId, const char* root, const char* path, int argc, char* argv[])
+int CoreRuntime::launch(const char* appId, const char* root, const char* path, int argc, char* argv[], bool profile)
{
if (!__initialized) {
_ERR("Runtime is not initialized");
char* localDataPath = app_get_data_path();
if (localDataPath != nullptr) {
setEnvironmentVariable("XDG_DATA_HOME", localDataPath);
+
+ // set profile.data path and collect/use it if it non-exists/exists.
+ if (profile) {
+ char multiCoreJitProfile[strlen(localDataPath) + strlen(PROFILE_BASENAME)];
+ strcpy(multiCoreJitProfile, localDataPath);
+ strcat(multiCoreJitProfile, PROFILE_BASENAME);
+
+ setEnvironmentVariable("COMPlus_MultiCoreJitProfile", multiCoreJitProfile);
+ if (!access(multiCoreJitProfile, R_OK)) {
+ setEnvironmentVariable("COMPlus_MultiCoreJitNoProfileGather", "1");
+ }
+ }
free(localDataPath);
}
public:
static int initialize(const char* appType, LaunchMode launchMode);
static void finalize();
- static int launch(const char* appId, const char* root, const char* path, int argc, char* argv[]);
+ static int launch(const char* appId, const char* root, const char* path, int argc, char* argv[], bool profile);
private:
static PathManager* __pm;