Add a print for library loading start and end time 65/202565/1
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 1 Apr 2019 02:53:35 +0000 (11:53 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 1 Apr 2019 02:53:35 +0000 (11:53 +0900)
Change-Id: I760bcaa3ceb2e7a745993610e5ef17d3c44ca229
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
src/launchpad_loader.c

index d9b4202a335d636317e28b69f41a9b0d368826b3..0fffb16ea97bfa6730c44239a727aa706549c55b 100644 (file)
 #include <Elementary.h>
 #include <bundle_internal.h>
 #include <vconf.h>
+#include <sys/prctl.h>
 
 #include "launchpad_common.h"
 #include "launchpad.h"
 #include "key.h"
 
+#ifndef PR_TASK_PERF_USER_TRACE
+#define PR_TASK_PERF_USER_TRACE 666
+#endif
+
 #define KEY_LOADER_TYPE                "loader_type"
 #define LOADER_TYPE_COMMON     "common-loader"
 #define LOADER_TYPE_HW         "hw-loader"
@@ -308,6 +313,7 @@ static int __loader_terminate_cb(int argc, char **argv, void *user_data)
        char old_cwd[PATH_MAX];
        bool restore = false;
        char *libdir = NULL;
+       char hwc_message[MAX_LOCAL_BUFSZ];
 
        SECURE_LOGD("[candidate] Launch real application (%s)",
                        argv[LOADER_ARG_PATH]);
@@ -329,6 +335,8 @@ static int __loader_terminate_cb(int argc, char **argv, void *user_data)
                restore = true;
 
 do_dlopen:
+       snprintf(hwc_message, sizeof(hwc_message), "%d|lib loading start", getpid());
+       prctl(PR_TASK_PERF_USER_TRACE, hwc_message, strlen(hwc_message));
        handle = dlopen(argv[LOADER_ARG_PATH],
                        RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE);
        if (handle == NULL) {
@@ -337,6 +345,8 @@ do_dlopen:
                goto do_exec;
        }
 
+       snprintf(hwc_message, sizeof(hwc_message), "%d|lib loading end", getpid());
+       prctl(PR_TASK_PERF_USER_TRACE, hwc_message, strlen(hwc_message));
        dlerror();
 
        if (restore && chdir(old_cwd))