From: Hwankyu Jhun Date: Fri, 19 May 2017 00:42:15 +0000 (+0900) Subject: Add ttrace points X-Git-Tag: accepted/tizen/unified/20170519.195910~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F12%2F130012%2F1;p=platform%2Fcore%2Fappfw%2Fapp-core.git Add ttrace points Change-Id: If803a95777fd6200481cad504c9104b9d4b3b985 Signed-off-by: Hwankyu Jhun --- diff --git a/src/base/appcore_base.c b/src/base/appcore_base.c index 47527a0..00ab25e 100644 --- a/src/base/appcore_base.c +++ b/src/base/appcore_base.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "appcore_base.h" #include "appcore_base_private.h" @@ -857,6 +858,7 @@ EXPORT_API int appcore_base_set_i18n(const char *domain_name, const char *dir_na EXPORT_API int appcore_base_init(appcore_base_ops ops, int argc, char **argv, void *data) { int i; + int r; __context.ops = ops; __context.argc = argc; @@ -882,9 +884,14 @@ EXPORT_API int appcore_base_init(appcore_base_ops ops, int argc, char **argv, vo } } - if (__context.ops.create && __context.ops.create(__context.data) < 0) { - aul_status_update(STATUS_DYING); - return 0; + if (__context.ops.create) { + traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:CREATE"); + r = __context.ops.create(__context.data); + traceEnd(TTRACE_TAG_APPLICATION_MANAGER); + if (r < 0) { + aul_status_update(STATUS_DYING); + return 0; + } } if (__context.ops.run) @@ -898,8 +905,11 @@ EXPORT_API void appcore_base_fini(void) int i; aul_status_update(STATUS_DYING); - if (__context.ops.terminate) + if (__context.ops.terminate) { + traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:TERMINATE"); __context.ops.terminate(__context.data); + traceEnd(TTRACE_TAG_APPLICATION_MANAGER); + } for (i = APPCORE_BASE_EVENT_START + 1; i < APPCORE_BASE_EVENT_MAX; i++) { if (__exist_callback(i)) { @@ -956,8 +966,11 @@ EXPORT_API int appcore_base_on_receive(aul_type type, bundle *b) __remove_suspend_timer(); } - if (__context.ops.control) - __context.ops.control(b, __context.data); + if (__context.ops.control) { + traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:RESET"); + __context.ops.control(b, __context.data); + traceEnd(TTRACE_TAG_APPLICATION_MANAGER); + } break; case AUL_RESUME: _DBG("[APP %d] AUL event: AUL_RESUME", getpid()); diff --git a/src/ui_base/appcore_ui_base.c b/src/ui_base/appcore_ui_base.c index 8a03188..a8ea618 100644 --- a/src/ui_base/appcore_ui_base.c +++ b/src/ui_base/appcore_ui_base.c @@ -166,8 +166,11 @@ static void __exit_from_suspend(void) static void __do_pause(void) { if (__context.state == AS_RUNNING) { - if (__context.ops.pause) + if (__context.ops.pause) { + traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:PAUSE"); __context.ops.pause(__context.data); + traceEnd(TTRACE_TAG_APPLICATION_MANAGER); + } __context.state = AS_PAUSED; __prepare_to_suspend(); @@ -181,7 +184,9 @@ static void __do_resume(void) __exit_from_suspend(); if (__context.ops.resume) { LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:start]", __context.appid); + traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:RESUME"); __context.ops.resume(__context.data); + traceEnd(TTRACE_TAG_APPLICATION_MANAGER); LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:done]", __context.appid); LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:Launching:done]", __context.appid); }