Print HW clock log for performance measurement 27/215127/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 2 Oct 2019 01:33:58 +0000 (10:33 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 2 Oct 2019 01:33:58 +0000 (10:33 +0900)
Change-Id: Ie41ec9866bed85f73f674808cbe5f4762535606c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tool/app_launcher.c

index ed92691..0deeb46 100644 (file)
@@ -26,6 +26,7 @@
 #include <gio/gio.h>
 #include <pkgmgr-info.h>
 #include <bundle_internal.h>
+#include <sys/prctl.h>
 
 #include "aul.h"
 #include "aul_svc.h"
 #define APP_TYPE_SERVICE "svcapp"
 #define INOTIFY_BUF (1024 * ((sizeof(struct inotify_event)) + 16))
 
+#ifndef PR_TASK_PERF_USER_TRACE
+#define PR_TASK_PERF_USER_TRACE 666
+#endif
+
 struct launch_arg {
        char *appid;
        bundle *b;
@@ -190,6 +195,18 @@ static GOptionEntry opt_entries[] = {
        }
 };
 
+static void __print_hwc_messages(const char *format, ...)
+{
+       char buf[1024];
+       va_list ap;
+
+       va_start(ap, format);
+       vsnprintf(buf, sizeof(buf), format, ap);
+       va_end(ap);
+
+       prctl(PR_TASK_PERF_USER_TRACE, buf, strlen(buf));
+}
+
 static GOptionGroup *__get_opt_group(void)
 {
        GOptionGroup *group;
@@ -793,6 +810,8 @@ int main(int argc, char *argv[])
        GError *error = NULL;
        struct launch_arg *launch_arg;
 
+       __print_hwc_messages("%d|main start", getpid());
+
        context = g_option_context_new(NULL);
        g_option_context_add_main_entries(context, cmd_entries, NULL);