[Title] apply runtime config and new protocol
authorgreatim <jaewon81.lim@samsung.com>
Wed, 10 Apr 2013 10:51:09 +0000 (19:51 +0900)
committergreatim <jaewon81.lim@samsung.com>
Wed, 10 Apr 2013 10:52:32 +0000 (19:52 +0900)
[Desc.]
[Issue]

Change-Id: I7e2b13f72ee702f25173f707ece29460b029d9c7

29 files changed:
helper/btsym.c
helper/dacapture.c
helper/dahelper.c
helper/libdaprobe.c
include/dahelper.h
include/daprobe.h
include/osp_probe.h
include/probeinfo.h
packaging/dynamic-analysis-probe.spec
probe_badaapi/bada_file.cpp
probe_badaapi/bada_sync.cpp
probe_badaapi/bada_thread.cpp
probe_badaapi/osp_controls.cpp
probe_event/da_event.c
probe_event/gesture.cpp
probe_event/keytouch.c
probe_file/da_io.h
probe_file/da_io_posix.c
probe_file/da_io_stdc.c
probe_memory/libdamemalloc.c
probe_memory/libdamemmanage.c
probe_memory/libdanew.cpp
probe_socket/libdasocket.c
probe_thread/libdasync.c
probe_thread/libdathread.c
probe_tizenapi/tizen_appfw.c
probe_ui/osp_display.cpp
probe_ui/osp_scenemanager.cpp
probe_userfunc/libdauserfunc.c

index 9128f78..bf8c2c6 100755 (executable)
@@ -398,7 +398,6 @@ char** da_backtrace_symbols (void* const* array, int size)
                }
                else            // there is a entry for key
                {
-//                     printf("there is get k(%d)\n", k);
                        chararr[cnt] = foundsym;
                        if(chararr[cnt] != NULL)
                                total += (strlen(chararr[cnt]) + 1);
index 5f61992..a97d351 100755 (executable)
@@ -403,7 +403,6 @@ int finalize_screencapture()
 static Eina_Bool _captureTimer(void* data)
 {
        probeBlockStart();
-//     PRINTMSG("_captureTimer");
        SCREENSHOT_DONE();
        probeBlockEnd();
 
@@ -419,7 +418,6 @@ int activateCaptureTimer()
 void _cb_render_post(void* data, Evas* e, void* eventinfo)
 {
        probeBlockStart();
-//     PRINTMSG("_cb_render_post");
        SCREENSHOT_DONE();
        probeBlockEnd();
 }
index f9a9484..d4fddd8 100755 (executable)
 #include <unistd.h>                    // for unlink\r
 #include <sys/types.h>\r
 #include <dirent.h>                    // for opendir, readdir\r
-#include <sys/shm.h>           // for shared memory operation\r
 \r
 #include "dahelper.h"\r
 \r
-#define SHAREDMEMKEY                   ((key_t)463825)\r
-\r
-typedef struct\r
-{\r
-       long long allocsize;\r
-       long launch_flag;\r
-} __daSharedInfo;\r
-\r
-typedef struct\r
-{\r
-       int memid;                              // shared mem id\r
-       __daSharedInfo* pvalue;         // total alloced heap size\r
-} __sharedMemInfo;\r
-\r
-static __sharedMemInfo sharedmem =\r
-{\r
-       -1,                     // memid\r
-       (void*)-1       // pvalue\r
-};\r
-\r
-long long total_alloc_size = 0;\r
-\r
 /* trace info global variable */\r
 __traceInfo gTraceInfo =\r
 {\r
@@ -84,71 +61,11 @@ __traceInfo gTraceInfo =
        -1,                                                             // int stateTouch\r
        0,                                                              // int init_complete\r
        0,                                                              // int custom_chart_callback_count\r
-       NULL                                                    // long* pprobeflag\r
+       0                                                               // unsigned long optionflag\r
 };\r
 \r
 __thread unsigned long gSTrace = 0;\r
 \r
-// **************************************************************************************\r
-// shared memory management function\r
-// **************************************************************************************\r
-\r
-// return 0 for normal case\r
-// return -1 for error case\r
-int __atSharedMemory()\r
-{\r
-       sharedmem.memid = shmget(SHAREDMEMKEY, sizeof(__daSharedInfo), 0);\r
-       if(sharedmem.memid == -1)\r
-       {\r
-               return -1;\r
-       }\r
-       else\r
-       {\r
-               sharedmem.pvalue = (__daSharedInfo*)shmat(sharedmem.memid, NULL, 0);\r
-               if(sharedmem.pvalue == (void*)-1)\r
-               {\r
-                       return -1;\r
-               }\r
-               else\r
-               {\r
-                       sharedmem.pvalue->allocsize = total_alloc_size;\r
-                       gTraceInfo.pprobeflag = &(sharedmem.pvalue->launch_flag);\r
-                       return 0;\r
-               }\r
-       }\r
-}\r
-\r
-int __dtSharedMemory()\r
-{\r
-       int ret = 0;\r
-       if(sharedmem.pvalue != (void*)-1)\r
-       {\r
-               ret = shmdt(sharedmem.pvalue);\r
-               if(ret == 0)\r
-                       sharedmem.pvalue = (void*)-1;\r
-       }\r
-       gTraceInfo.pprobeflag = NULL;\r
-       return ret;\r
-}\r
-\r
-// update heap memory size into shared memory\r
-// return 0 if size is updated into shared memory\r
-// return 1 if size is updated into global variable\r
-int update_heap_memory_size(bool isAdd, size_t size)\r
-{\r
-       if(likely(sharedmem.pvalue != (void*)-1))\r
-       {\r
-               if(isAdd) sharedmem.pvalue->allocsize += (long)size;\r
-               else sharedmem.pvalue->allocsize -= (long)size;\r
-               return 0;\r
-       }\r
-       else\r
-       {\r
-               if(isAdd) total_alloc_size += (long)size;\r
-               else total_alloc_size -= (long)size;\r
-               return 1;\r
-       }\r
-}\r
 \r
 void WcharToChar(char* pstrDest, const wchar_t* pwstrSrc)\r
 {\r
index 08c9813..8ee82a1 100755 (executable)
@@ -28,7 +28,7 @@
  * 
  */
 
-#include <stdio.h>                     // for printf
+#include <stdio.h>                     // for sprintf
 #include <stdlib.h>                    // for getenv
 #include <string.h>                    // for strstr
 #include <stdbool.h>           // for bool
@@ -42,6 +42,7 @@
 #include <sys/time.h>          // for gettimeofday
 #include <sys/socket.h>                // for socket, connect
 #include <sys/un.h>                    // for sockaddr_un
+#include <sys/timerfd.h>       // for timerfd
 
 #include "probeinfo.h"
 #include "dautil.h"
 
 #define APP_INSTALL_PATH               "/opt/apps"
 #define UDS_NAME                               "/tmp/da.socket"
+#define TIMERFD_INTERVAL               100000000               // 0.1 sec
 
 __thread int                   gProbeDepth = 0;
 __thread unsigned int  gProbeBlockCount = 0;
 __thread pid_t                 gTid = -1;
 
+int                    g_timerfd = 0;
+long           g_total_alloc_size = 0;
+pthread_t      g_recvthread_id;
+
 int getExecutableMappingAddress();
 
 /******************************************************************************
  * internal functions
    (this means that these functions do not need to set enter/exit flag)
  ******************************************************************************/
+
+// runtime configure the probe option
+static void _configure(char* configstr)
+{
+       char buf[64];
+       gTraceInfo.optionflag = atoi(configstr);
+
+       sprintf(buf, "configure in probe : %s, %lx\n", configstr, gTraceInfo.optionflag);
+       PRINTMSG(buf);
+
+       if(isOptionEnabled(OPT_FUNC))
+       {
+               __profil(1);
+       }
+       else
+       {
+               __profil(0);
+       }
+}
+
 // create sokcet to daemon and connect
 static int createSocket(void)
 {
+       ssize_t recvlen;
        int clientLen, ret = 0;
        struct sockaddr_un clientAddr;
        char buf[16];
+       log_t log;
 
        if((gTraceInfo.socket.daemonSock = socket(AF_UNIX, SOCK_STREAM,0)) != -1)
        {
@@ -78,11 +105,41 @@ static int createSocket(void)
                clientLen = sizeof(clientAddr);
                if(connect(gTraceInfo.socket.daemonSock, (struct sockaddr *)&clientAddr, clientLen) >= 0)
                {
-                       PRINTMSG("createSocket connect() success\n");
-                       sprintf(buf, "%d", getpid());
+                       // recv initial configuration value
+                       recvlen = recv(gTraceInfo.socket.daemonSock, &log,
+                                       sizeof(log.type) + sizeof(log.length), MSG_WAITALL);
+
+                       if(recvlen > 0) // recv succeed
+                       {
+                               if(log.length > 0)
+                               {
+                                       recvlen = recv(gTraceInfo.socket.daemonSock, log.data,
+                                               log.length, MSG_WAITALL);
+                               }
+                               log.data[log.length] = '\0';
+
+                               if(log.type == MSG_CONFIG)
+                               {
+                                       _configure(log.data);
+                               }
+                               else
+                               {
+                                       // unexpected case
+                               }
+                       }
+                       else if(recvlen < 0)
+                       {
+                               char buf[64];
+                               sprintf(buf, "recv failed in socket creation with error(%d)\n", recvlen);
+                               PRINTMSG(buf);
+                       }
+                       else    // closed by other peer
+                       {
+
+                       }
+                       sprintf(buf, "%d|%u", getpid(), gTraceInfo.app.startTime);
                        printLogStr(buf, MSG_PID);
-                       sprintf(buf, "%u", gTraceInfo.app.startTime);
-                       printLogStr(buf, MSG_TIME);
+                       PRINTMSG("createSocket connect() success\n");
                }
                else
                {
@@ -129,13 +186,112 @@ static pid_t _gettid()
        return gTid;
 }
 
+static void* recvThread(void* data)
+{
+       fd_set readfds, workfds;
+       int maxfd = 0, rc;
+       uint64_t xtime;
+       ssize_t recvlen;
+       log_t log;
+
+       if(gTraceInfo.socket.daemonSock == -1)
+               return NULL;
+
+       FD_ZERO(&readfds);
+       if(g_timerfd > 0)
+       {
+               maxfd = g_timerfd;
+               FD_SET(g_timerfd, &readfds);
+       }
+       if(maxfd < gTraceInfo.socket.daemonSock)
+               maxfd = gTraceInfo.socket.daemonSock;
+       FD_SET(gTraceInfo.socket.daemonSock, &readfds);
+
+       while(1)
+       {
+               workfds = readfds;
+               rc = select(maxfd + 1, &workfds, NULL, NULL, NULL);
+               if(rc < 0)
+               {
+                       continue;
+               }
+
+               if(g_timerfd > 0 && FD_ISSET(g_timerfd, &workfds))
+               {
+                       recvlen = read(g_timerfd, &xtime, sizeof(xtime));
+                       if(recvlen > 0)
+                       {
+                               log.length = sprintf(log.data, "%ld", g_total_alloc_size);
+                               printLog(&log, MSG_ALLOC);
+                       }
+                       else
+                       {
+                               // read failed
+                       }
+                       continue;
+               }
+               else if(FD_ISSET(gTraceInfo.socket.daemonSock, &workfds))
+               {
+                       recvlen = recv(gTraceInfo.socket.daemonSock, &log,
+                                       sizeof(log.type) + sizeof(log.length), MSG_WAITALL);
+
+                       if(recvlen > 0) // recv succeed
+                       {
+                               if(log.length > 0)
+                               {
+                                       recvlen = recv(gTraceInfo.socket.daemonSock, log.data,
+                                               log.length, MSG_WAITALL);
+                               }
+                               log.data[log.length] = '\0';
+
+                               if(log.type == MSG_CONFIG)
+                               {
+                                       _configure(log.data);
+                               }
+                               else if(log.type == MSG_STOP)
+                               {
+                                       exit(0);
+                               }
+                               else
+                               {
+                                       char buf[64];
+                                       sprintf(buf, "recv unknown message(%d)\n", log.type);
+                                       PRINTMSG(buf);
+                                       continue;
+                               }
+                       }
+                       else if(recvlen == 0)   // closed by other peer
+                       {
+                               close(gTraceInfo.socket.daemonSock);
+                               gTraceInfo.socket.daemonSock = -1;
+                               break;
+                       }
+                       else    // recv error
+                       {
+                               char buf[64];
+                               sprintf(buf, "recv failed in recv thread with error(%d)\n", recvlen);
+                               PRINTMSG(buf);
+                               continue;
+                       }
+               }
+               else    // unknown case
+               {
+                       PRINTMSG("unknown fd in recvThread\n");
+                       continue;
+               }
+       }
+
+       return NULL;
+}
+
 /*****************************************************************************
  * initialize / finalize function
  *****************************************************************************/
 
 void __attribute__((constructor)) _init_probe()
 {
-       struct timeval cTime;
+       struct timeval ttime;
+       struct itimerspec ctime;
 
        TRACE_STATE_SET(TS_INIT);
 
@@ -148,16 +304,42 @@ void __attribute__((constructor)) _init_probe()
        getExecutableMappingAddress();
 
        // get app start time
-       gettimeofday(&cTime, NULL);
-       gTraceInfo.app.startTime = ((cTime.tv_sec * 10000 + (cTime.tv_usec/100)));
+       gettimeofday(&ttime, NULL);
+       gTraceInfo.app.startTime = ((ttime.tv_sec * 10000 + (ttime.tv_usec/100)));
 
        // create socket for communication with da_daemon
-#ifndef PRINT_STDOUT
-       if(createSocket() >= 0)
-#endif
-       if(__atSharedMemory() < 0)
+       if(createSocket() == 0)
+       {
+               // create timerfd
+               g_timerfd = timerfd_create(CLOCK_REALTIME, TFD_CLOEXEC);
+               if(g_timerfd > 0)
+               {
+                       ctime.it_value.tv_sec = 0;
+                       ctime.it_value.tv_nsec = TIMERFD_INTERVAL;
+                       ctime.it_interval.tv_sec = 0;
+                       ctime.it_interval.tv_nsec = TIMERFD_INTERVAL;
+                       if(0 > timerfd_settime(g_timerfd, 0, &ctime, NULL))
+                       {
+                               PRINTMSG("failed to set timerfd\n");
+                               close(g_timerfd);
+                               g_timerfd = 0;
+                       }
+               }
+               else
+               {
+                       PRINTMSG("failed to create timerdf\n");
+               }
+
+               // create recv Thread
+               if(pthread_create(&g_recvthread_id, NULL, recvThread, NULL) < 0)        // thread creation failed
+               {
+                       PRINTMSG("failed to crate recv thread\n");
+               }
+               update_heap_memory_size(true, 0);
+       }
+       else
        {
-               printLogStr("cannot at shared memory in helper", MSG_ERROR);
+
        }
 
        PRINTMSG("dynamic analyzer probe helper so loading...\n");
@@ -173,19 +355,19 @@ void __attribute__((destructor)) _fini_probe()
        gTraceInfo.init_complete = -1;
        PRINTMSG("dynamic analyzer probe helper so unloading...\n");
 
-       __dtSharedMemory();
-
        remove_all_glist();
 
+       // close timerfd
+       if(g_timerfd > 0)
+               close(g_timerfd);
+
        // close socket
-#ifndef PRINT_STDOUT
        if(gTraceInfo.socket.daemonSock != -1)
        {
                printLogStr(NULL, MSG_TERMINATE);
                close(gTraceInfo.socket.daemonSock);
                gTraceInfo.socket.daemonSock = -1;
        }
-#endif
 
        finalize_event();
 
@@ -204,8 +386,10 @@ void __attribute__((destructor)) _fini_probe()
 /************************************************************************
  * manipulate and print log functions
  ************************************************************************/
+
 bool printLog(log_t* log, int msgType)
 {
+       int res;
        if(unlikely(gTraceInfo.socket.daemonSock == -1))
                return false;
 
@@ -213,18 +397,10 @@ bool printLog(log_t* log, int msgType)
                return false;
 
        TRACE_STATE_SET(TS_PRINT_LOG);
-
-#ifndef PRINT_STDOUT
        log->type = msgType;
-
        pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
-       send(gTraceInfo.socket.daemonSock, log, sizeof(log->type) + sizeof(log->length) + log->length, 0);
+       res = send(gTraceInfo.socket.daemonSock, log, sizeof(log->type) + sizeof(log->length) + log->length, 0);
        pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
-
-#else
-       if(log != NULL && log->length > 0 && msgType == MSG_MSG)
-               printf("%s\n", log->data);
-#endif
        TRACE_STATE_UNSET(TS_PRINT_LOG);
 
        return true;
@@ -232,18 +408,15 @@ bool printLog(log_t* log, int msgType)
 
 bool printLogStr(const char* str, int msgType)
 {
-#ifndef PRINT_STDOUT
+       int res;
        log_t log;
-#endif
 
        if(unlikely(gTraceInfo.socket.daemonSock == -1))
                return false;
 
        TRACE_STATE_SET(TS_PRINT_LOG);
 
-#ifndef PRINT_STDOUT
        log.type = msgType;
-
        if(str)
        {
                sprintf(log.data, "%s", str);
@@ -255,13 +428,9 @@ bool printLogStr(const char* str, int msgType)
        }
 
        pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
-       send(gTraceInfo.socket.daemonSock, &log, sizeof(log.type) + sizeof(log.length) + log.length, 0);
+       res = send(gTraceInfo.socket.daemonSock, &log, sizeof(log.type) + sizeof(log.length) + log.length, MSG_DONTWAIT);
        pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
 
-#else
-       if(str != NULL && msgType == MSG_MSG)
-               printf("%s\n", str);
-#endif
        TRACE_STATE_UNSET(TS_PRINT_LOG);
 
        return true;
@@ -431,25 +600,10 @@ int getBacktraceString(log_t* log, int bufsize)
        }
 }
 
-/*
-int printSamplingLog()
-{
-       log_t log;
-
-       TRACE_STATE_SET(TS_PRINT_SAMPLE_LOG);
-       log.length = sprintf(log.data, "%d`,%lu`,%d`,%Ld",
-                       LC_ALLOCMEM, getCurrentTime(), getpid(), total_alloc_size);
-
-       printLog(&log, MSG_LOG);
-       TRACE_STATE_UNSET(TS_PRINT_SAMPLE_LOG);
-       return 0;
-}
-*/
-
 /*************************************************************************
  * probe block control functions
  *************************************************************************/
-int preBlockBegin(void* caller, bool bFiltering)
+int preBlockBegin(void* caller, bool bFiltering, enum DaOptions option)
 {
        bool user = false;
        void* tarray[1];
@@ -461,6 +615,9 @@ int preBlockBegin(void* caller, bool bFiltering)
        if(gTraceInfo.init_complete <= 0)
                return 0;
 
+       if((gTraceInfo.optionflag & option) == 0)
+               return 0;
+
        TRACE_STATE_SET(TS_ENTER_PROBE_BLOCK);
 
        if(gTraceInfo.exec_map.map_start != NULL)
@@ -575,23 +732,6 @@ unsigned long getTraceState()
        return gSTrace;
 }
 
-bool isEnableSnapshot()
-{
-       if(gTraceInfo.pprobeflag != NULL)
-               return (bool)(*gTraceInfo.pprobeflag & ENABLE_SNAPSHOT);
-       else
-               return false;
-}
-
-bool isEnableInternalMalloc()
-{
-       if(gTraceInfo.pprobeflag != NULL)
-               return (bool)(*gTraceInfo.pprobeflag & ENABLE_INTERNAL_MALLOC);
-       else
-               return false;
-}
-
-
 /******************************************************************
  * screen capture and event related functions
  ******************************************************************/
@@ -622,7 +762,7 @@ void detectTouchEvent(int touchID)
        gTraceInfo.stateTouch = touchID;
 
        TRACE_STATE_SET(TS_DETECT_TOUCH);
-       if(isEnableSnapshot())
+       if(isOptionEnabled(OPT_SNAPSHOT))
        {
                if(touchID == EVENT_TYPE_UP)
                {
@@ -692,3 +832,22 @@ bool setProbePoint(probeInfo_t* iProbe)
        return true;
 }
 
+// update heap memory size though socket
+// return 0 if size is updated though socket
+// return 1 if size is updated into global variable
+int update_heap_memory_size(bool isAdd, size_t size)
+{
+       long tmp;
+       if(isAdd)
+       {
+               tmp = __sync_add_and_fetch(&g_total_alloc_size, (long)size);
+       }
+       else
+       {
+               tmp = __sync_sub_and_fetch(&g_total_alloc_size, (long)size);
+       }
+
+       return 0;
+}
+
+
index 6a4445d..ed7c90d 100755 (executable)
@@ -86,7 +86,7 @@ extern "C"{
                gTraceInfo.screenshot.state = -1;                                               \
                pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
                if(old > 0) {                                                                                   \
-                       if(isEnableSnapshot())                                                          \
+                       if(isOptionEnabled(OPT_SNAPSHOT))                                       \
                                captureScreen();                                                                \
                }                                                                                                               \
        } while(0)
@@ -107,7 +107,7 @@ extern "C"{
                        gTraceInfo.screenshot.state = 1;                                        \
                pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex)); \
                if(old == 2) {                                                                                  \
-                       if(isEnableSnapshot())                                                          \
+                       if(isOptionEnabled(OPT_SNAPSHOT))                                       \
                                captureScreen();                                                                \
                }                                                                                                               \
        } while(0)
@@ -135,7 +135,7 @@ extern "C"{
                if(old == 1) {                                                                                  \
                        activateCaptureTimer();                                                         \
                } else if(old == 2) {                                                                   \
-                       if(isEnableSnapshot())                                                          \
+                       if(isOptionEnabled(OPT_SNAPSHOT))                                       \
                                captureScreen();                                                                \
                }                                                                                                               \
        } while(0)
@@ -181,18 +181,17 @@ typedef struct
        int                                     stateTouch;
        int                                     init_complete;
        int                                     custom_chart_callback_count;
-       long*                           pprobeflag;
+       unsigned long           optionflag;
 } __traceInfo;
 
 extern __thread unsigned long  gSTrace;
 extern __traceInfo gTraceInfo;
 
-int __atSharedMemory();
-int __dtSharedMemory();
-
 char** da_backtrace_symbols (void* const* array, int size);
 char** cached_backtrace_symbols (void* const* array, int size);
-int update_heap_memory_size(bool isAdd, size_t size);
+
+// profil turned on
+int __profil(int mode);
 
 //wchar_t* -> char*
 void WcharToChar(char* pstrDest, const wchar_t* pwstrSrc);
@@ -213,6 +212,9 @@ void on_orientation_changed(int angle, bool capi);
 
 int remove_indir(const char* dirname);
 
+// query functions
+#define isOptionEnabled(OPT)   ((gTraceInfo.optionflag & OPT) != 0)
+
 #ifdef __cplusplus
 }
 #endif
index b0c863e..651989b 100644 (file)
@@ -89,7 +89,7 @@ typedef struct
  * helper apis
  ***************************************************************************/
 
-int preBlockBegin(void* caller, bool bFiltering);
+int preBlockBegin(void* caller, bool bFiltering, enum DaOptions);
 void preBlockEnd();
 
 int postBlockBegin(int preresult);
@@ -102,9 +102,8 @@ unsigned int getCurrentEventIndex();
 unsigned int getCallDepth();
 unsigned long getTraceState();
 unsigned long getCurrentTime();
-bool isEnableSnapshot();
-bool isEnableInternalMalloc();
 bool setProbePoint(probeInfo_t * iProbe);
+int update_heap_memory_size(bool isAdd, size_t size);
 
 bool printLogStr(const char* str, int msgType);
 bool printLog(log_t* log, int msgType);
@@ -209,23 +208,10 @@ int getBacktraceString(log_t* log, int bufsize);
 #define GET_REAL_FUNC_RTLD_NEXT_CPP(FUNCNAME)  \
                GET_REAL_FUNCP_RTLD_NEXT_CPP(FUNCNAME, FUNCNAME##p)
 
-// ======================== basic probe block define =======================
-#define PRE_BLOCK_BEGIN \
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
-
-#define PRE_BLOCK_END \
-               preBlockEnd(); }
-
-#define POST_BLOCK_BEGIN \
-       if(postBlockBegin(blockresult)) {
-
-#define POST_BLOCK_END \
-               postBlockEnd(); }
-
 // ======================= pre block macro ================================
 
-#define PRE_PROBEBLOCK_BEGIN()                                                         \
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {    \
+#define PRE_PROBEBLOCK_BEGIN()                                                                                                 \
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {     \
                setProbePoint(&probeInfo)
 
 #define PRE_PROBEBLOCK_END()   \
index fd80368..3841f8b 100755 (executable)
@@ -57,12 +57,12 @@ extern "C" {
                }                                                                                                               \
        } while(0)
 
-#define PRE_PROBEBLOCK_OSP(FILTERING)                                                                          \
-       do {                                                                                                                                    \
-               if((blockresult = preBlockBegin(CALLER_ADDRESS, FILTERING)) != 0) {     \
-                       setProbePoint(&probeInfo);                                                                              \
-                       preBlockEnd();                                                                                                  \
-               }                                                                                                                                       \
+#define PRE_PROBEBLOCK_OSP(FILTER)                                                                                             \
+       do {                                                                                                                                            \
+               if((blockresult = preBlockBegin(CALLER_ADDRESS, FILTER, _sopt)) != 0) { \
+                       setProbePoint(&probeInfo);                                                                                      \
+                       preBlockEnd();                                                                                                          \
+               }                                                                                                                                               \
        } while(0)
 
 extern int SceneManagerUsed;
index 572115c..2a40cba 100755 (executable)
@@ -147,10 +147,28 @@ enum MessageType
        MSG_TERMINATE = 7,\r
        MSG_PID = 8,\r
        MSG_MSG = 9,\r
-       MSG_APPNAME = 10,\r
-       MSG_ERROR = 11\r
+       MSG_ALLOC = 10,\r
+       MSG_ERROR = 11,\r
+       MSG_STOP = 101,\r
+       MSG_CONFIG = 103\r
 };\r
 \r
+enum DaOptions\r
+{\r
+       OPT_ALWAYSOFF   =       0x00000000,\r
+       OPT_CPUMEM              =       0x00000001,\r
+       OPT_FUNC                =       0x00000002,\r
+       OPT_ALLOC               =       0x00000004,\r
+       OPT_FILE                =       0x00000008,\r
+       OPT_THREAD              =       0x00000010,\r
+       OPT_UI                  =       0x00000020,\r
+       OPT_SNAPSHOT    =       0x00000040,\r
+       OPT_EVENT               =       0x00000080,\r
+       OPT_RECORD              =       0x00000100,\r
+       OPT_ALWAYSON    =       0x11111111\r
+};\r
+\r
+\r
 #ifdef __cplusplus\r
 }\r
 #endif\r
index de50d5b..9bd7d58 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dynamic-analysis-probe
 Summary:    dynamic analyzer probe library
-Version:    2.1.0
+Version:    2.1.1
 Release:    1
 Group:      System/Libraries
 License:       GNU Lesser General Public License, Version 2.1
index 4d2a60b..055a21f 100755 (executable)
@@ -43,6 +43,8 @@ enum FileSeekPosition {
 /**<The end of the file */
 };
 
+static enum DaOptions _sopt = OPT_FILE;
+
 namespace Tizen {
 namespace Io {
 
@@ -166,7 +168,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -241,7 +243,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -315,7 +317,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -386,7 +388,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -460,7 +462,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -530,7 +532,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -602,7 +604,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -669,7 +671,7 @@ result File::Flush(void) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -733,7 +735,7 @@ Tizen::Base::String File::GetName(void) const{
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -800,7 +802,7 @@ result File::Read(Tizen::Base::String& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -867,7 +869,7 @@ result File::Read(Tizen::Base::ByteBuffer& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -933,7 +935,7 @@ int File::Read(void *buffer, int length) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nRead = Tell();
                preBlockEnd();
@@ -1002,7 +1004,7 @@ result File::Seek(FileSeekPosition position, long offset) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1075,7 +1077,7 @@ int File::Tell(void) const {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1140,7 +1142,7 @@ result File::Truncate(int length) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1205,7 +1207,7 @@ result File::Write(const void *buffer, int length) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nWritten = Tell();
                preBlockEnd();
@@ -1272,7 +1274,7 @@ result File::Write(const Tizen::Base::ByteBuffer& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nWritten = Tell();
                preBlockEnd();
@@ -1339,7 +1341,7 @@ result File::Write(const Tizen::Base::String& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nWritten = Tell();
                preBlockEnd();
@@ -1403,7 +1405,7 @@ File::~File(void) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
index 05e36d3..31ddf82 100755 (executable)
@@ -37,6 +37,8 @@
 #include "probeinfo.h"
 #include "dahelper.h"
 
+static enum DaOptions _sopt = OPT_THREAD;
+
 namespace Tizen {
 namespace Base {
 namespace Runtime {
@@ -133,7 +135,7 @@ result Mutex::Create(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -195,7 +197,7 @@ result Mutex::Create(const Tizen::Base::String& name) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -257,7 +259,7 @@ result Mutex::Release(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -318,7 +320,7 @@ result Mutex::Acquire(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -398,7 +400,7 @@ result Mutex::TryToAcquire(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -460,7 +462,7 @@ result Semaphore::Create(int count) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -522,7 +524,7 @@ result Semaphore::Create(const Tizen::Base::String& name, int count) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -585,7 +587,7 @@ result Semaphore::Acquire(long timeout) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -665,7 +667,7 @@ result Semaphore::TryToAcquire(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -726,7 +728,7 @@ result Semaphore::Release(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -787,7 +789,7 @@ result Monitor::Construct(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -848,7 +850,7 @@ result Monitor::Enter(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -928,7 +930,7 @@ result Monitor::Exit(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -989,7 +991,7 @@ result Monitor::Wait(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -1069,7 +1071,7 @@ result Monitor::Notify(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1130,7 +1132,7 @@ result Monitor::NotifyAll(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
index 2e2dcc7..7f65697 100755 (executable)
@@ -38,6 +38,8 @@
 #include "probeinfo.h"
 #include "dahelper.h"
 
+static enum DaOptions _sopt = OPT_THREAD;
+
 extern __thread unsigned int gProbeDepth;
 
 namespace Tizen {
@@ -148,7 +150,7 @@ private:
 //             probeBlockEnd();
 //     }
 //
-//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
 //             setProbePoint(&probeInfo);
 //             preBlockEnd();
 //     }
@@ -239,7 +241,7 @@ _ThreadImpl::ThreadProc(void* params) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -331,7 +333,7 @@ _ThreadImpl::ThreadProc(void* params) {
 //             probeBlockEnd();
 //     }
 //
-//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
 //             setProbePoint(&probeInfo);
 //             preBlockEnd();
 //     }
@@ -390,7 +392,7 @@ _ThreadImpl::ThreadProc(void* params) {
 //             probeBlockEnd();
 //     }
 //
-//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
 //             setProbePoint(&probeInfo);
 //             preBlockEnd();
 //     }
@@ -448,7 +450,7 @@ _ThreadImpl::ThreadProc(void* params) {
 //             probeBlockEnd();
 //     }
 //
-//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
 //             setProbePoint(&probeInfo);
 //             preBlockEnd();
 //     }
@@ -507,7 +509,7 @@ _ThreadImpl::ThreadProc(void* params) {
 //             probeBlockEnd();
 //     }
 //
-//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
 //             setProbePoint(&probeInfo);
 //             preBlockEnd();
 //     }
@@ -566,7 +568,7 @@ result Thread::Sleep(long milliSeconds) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -652,7 +654,7 @@ Thread* Thread::GetCurrentThread(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -714,7 +716,7 @@ result Thread::Yield(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -778,7 +780,7 @@ result Thread::Exit(int exitCode) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -844,7 +846,7 @@ result Thread::Construct(ThreadType threadType, long stackSize,
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -904,7 +906,7 @@ result Thread::Construct(long stackSize, ThreadPriority priority) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -970,7 +972,7 @@ result Thread::Construct(const Tizen::Base::String &name, long stackSize,
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1037,7 +1039,7 @@ result Thread::Construct(const Tizen::Base::String &name, ThreadType threadType,
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1103,7 +1105,7 @@ result Thread::Construct(IRunnable &target, long stackSize,
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1169,7 +1171,7 @@ result Thread::Construct(const Tizen::Base::String &name, IRunnable &target,
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1233,7 +1235,7 @@ result Thread::GetExitCode(int &exitCode) const {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1295,7 +1297,7 @@ const Tizen::Base::String & Thread::GetName(void) const {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1357,7 +1359,7 @@ result Thread::Join(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                log.type = 0;
                log.length = 0;
@@ -1451,7 +1453,7 @@ result Thread::Join(void) {
 //             probeBlockEnd();
 //     }
 //
-//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+//     if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
 //             setProbePoint(&probeInfo);
 //             preBlockEnd();
 //     }
@@ -1512,7 +1514,7 @@ result Thread::Start(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1570,7 +1572,7 @@ result Thread::Stop(void) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1630,7 +1632,7 @@ result EventDrivenThread::Construct(long stackSize, ThreadPriority priority) {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1697,7 +1699,7 @@ result EventDrivenThread::Construct(const Tizen::Base::String &name, long stackS
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -1759,7 +1761,7 @@ result EventDrivenThread::Quit() {
                probeBlockEnd();
        }
 
-       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
index 8c19c0b..c96dbb7 100755 (executable)
@@ -77,17 +77,19 @@ result UiApp::AddFrame(const Tizen::Ui::Controls::Frame& frame)
        probeBlockStart();
        if(ret == E_SUCCESS)
        {
-               Control* parent = NULL;
-               setProbePoint(&probeInfo);
-               INIT_LOG;
-               APPEND_LOG_BASIC_NAME(LC_UICREATE, "AddFrame");
-               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
                frame.IsInTouchMode();
 
-               APPEND_LOG_CONTROL_OSP(parent);
-               APPEND_LOG_CONTROL_OSP(&frame);
-               printLog(&log, MSG_LOG);
+               if(isOptionEnabled(OPT_UI))
+               {
+                       Control* parent = NULL;
+                       setProbePoint(&probeInfo);
+                       INIT_LOG;
+                       APPEND_LOG_BASIC_NAME(LC_UICREATE, "AddFrame");
+                       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+                       APPEND_LOG_CONTROL_OSP(parent);
+                       APPEND_LOG_CONTROL_OSP(&frame);
+                       printLog(&log, MSG_LOG);
+               }
        }
        probeBlockEnd();
 
@@ -100,20 +102,23 @@ result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame)
        static methodType uiapp_removeframep;
        DECLARE_COMMON_VARIABLE;
        result ret;
+       bool bOption;
 
        GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp11RemoveFrameERKNS_2Ui8Controls5FrameE, libosp-uifw.so, uiapp_removeframep);
 
        probeBlockStart();
-       Control* parent = NULL;
-       setProbePoint(&probeInfo);
-       INIT_LOG;
-       APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveFrame");
-       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
        frame.IsInTouchMode();
 
-       APPEND_LOG_CONTROL_OSP(parent);
-       APPEND_LOG_CONTROL_OSP(&frame);
+       if((bOption = isOptionEnabled(OPT_UI)))
+       {
+               Control* parent = NULL;
+               setProbePoint(&probeInfo);
+               INIT_LOG;
+               APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveFrame");
+               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+               APPEND_LOG_CONTROL_OSP(parent);
+               APPEND_LOG_CONTROL_OSP(&frame);
+       }
        probeBlockEnd();
 
        ret = (this->*uiapp_removeframep)(frame);
@@ -121,7 +126,8 @@ result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame)
        probeBlockStart();
        if(ret == E_SUCCESS)
        {
-               printLog(&log, MSG_LOG);
+               if(bOption)
+                       printLog(&log, MSG_LOG);
        }
        probeBlockEnd();
 
@@ -158,18 +164,19 @@ void Control::SetName(const Tizen::Base::String &name)
        (this->*control_setnamep)(name);
 
        probeBlockStart();
-       Control* parent = NULL;
-       setProbePoint(&probeInfo);
-       INIT_LOG;
-       APPEND_LOG_BASIC_NAME(LC_UICREATE, "SetName");
-       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
        IsInTouchMode();
 
-       APPEND_LOG_CONTROL_OSP(this);
-       APPEND_LOG_CONTROL_OSP(parent);
-
-       printLog(&log, MSG_LOG);
+       if(isOptionEnabled(OPT_UI))
+       {
+               Control* parent = NULL;
+               setProbePoint(&probeInfo);
+               INIT_LOG;
+               APPEND_LOG_BASIC_NAME(LC_UICREATE, "SetName");
+               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+               APPEND_LOG_CONTROL_OSP(this);
+               APPEND_LOG_CONTROL_OSP(parent);
+               printLog(&log, MSG_LOG);
+       }
        probeBlockEnd();
 }
 
@@ -209,18 +216,19 @@ result Container::AddControl(const Control &control)
        probeBlockStart();
        if(ret == E_SUCCESS)
        {
-               setProbePoint(&probeInfo);
-               INIT_LOG;
-               APPEND_LOG_BASIC_NAME(LC_UICREATE, "AddControl");
-               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
                IsInTouchMode();
                control.IsInTouchMode();
 
-               APPEND_LOG_CONTROL_OSP(this);
-               APPEND_LOG_CONTROL_OSP(&control);
-
-               printLog(&log, MSG_LOG);
+               if(isOptionEnabled(OPT_UI))
+               {
+                       setProbePoint(&probeInfo);
+                       INIT_LOG;
+                       APPEND_LOG_BASIC_NAME(LC_UICREATE, "AddControl");
+                       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+                       APPEND_LOG_CONTROL_OSP(this);
+                       APPEND_LOG_CONTROL_OSP(&control);
+                       printLog(&log, MSG_LOG);
+               }
        }
        probeBlockEnd();
 
@@ -233,19 +241,22 @@ result Container::RemoveControl(const Control &control)
        static methodType container_removecontrolp;
        DECLARE_COMMON_VARIABLE;
        result ret;
+       bool bOption;
 
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlERKNS0_7ControlE, libosp-uifw.so, container_removecontrolp);
 
        probeBlockStart();
-       setProbePoint(&probeInfo);
-       INIT_LOG;
-       APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveControl");
-       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
        control.IsInTouchMode();
 
-       APPEND_LOG_CONTROL_OSP(this);
-       APPEND_LOG_CONTROL_OSP(&control);
+       if((bOption = isOptionEnabled(OPT_UI)))
+       {
+               setProbePoint(&probeInfo);
+               INIT_LOG;
+               APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveControl");
+               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+               APPEND_LOG_CONTROL_OSP(this);
+               APPEND_LOG_CONTROL_OSP(&control);
+       }
        probeBlockEnd();
 
        ret = (this->*container_removecontrolp)(control);
@@ -253,7 +264,8 @@ result Container::RemoveControl(const Control &control)
        probeBlockStart();
        if(ret == E_SUCCESS)
        {
-               printLog(&log, MSG_LOG);
+               if(bOption)
+                       printLog(&log, MSG_LOG);
        }
        probeBlockEnd();
 
@@ -266,21 +278,23 @@ result Container::RemoveControl(int index)
        static methodType container_removecontrolip;
        DECLARE_COMMON_VARIABLE;
        result ret;
+       bool bOption;
 
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlEi, libosp-uifw.so, container_removecontrolip);
 
        probeBlockStart();
-       Control* pcontrol;
-       setProbePoint(&probeInfo);
-       INIT_LOG;
-       APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveControl");
-       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
-       pcontrol = GetControl(index);
+       Control* pcontrol = GetControl(index);
        pcontrol->IsInTouchMode();
 
-       APPEND_LOG_CONTROL_OSP(this);
-       APPEND_LOG_CONTROL_OSP(pcontrol);
+       if((bOption = isOptionEnabled(OPT_UI)))
+       {
+               setProbePoint(&probeInfo);
+               INIT_LOG;
+               APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveControl");
+               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+               APPEND_LOG_CONTROL_OSP(this);
+               APPEND_LOG_CONTROL_OSP(pcontrol);
+       }
        probeBlockEnd();
 
        ret = (this->*container_removecontrolip)(index);
@@ -288,7 +302,8 @@ result Container::RemoveControl(int index)
        probeBlockStart();
        if(ret == E_SUCCESS)
        {
-               printLog(&log, MSG_LOG);
+               if(bOption)
+                       printLog(&log, MSG_LOG);
        }
        probeBlockEnd();
 
@@ -304,15 +319,17 @@ void Container::RemoveAllControls(void)
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container17RemoveAllControlsEv, libosp-uifw.so, container_removeallcontrolp);
 
        probeBlockStart();
-       Control* pcontrol = NULL;
-       setProbePoint(&probeInfo);
-       INIT_LOG;
-       APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveAllControl");
-       APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
-
-       APPEND_LOG_CONTROL_OSP(this);
-       APPEND_LOG_CONTROL_OSP(pcontrol);
-       printLog(&log, MSG_LOG);
+       if(isOptionEnabled(OPT_UI))
+       {
+               Control* pcontrol = NULL;
+               setProbePoint(&probeInfo);
+               INIT_LOG;
+               APPEND_LOG_BASIC_NAME(LC_UICREATE, "RemoveAllControl");
+               APPEND_LOG_COMMON_NONE(CALLER_ADDRESS);
+               APPEND_LOG_CONTROL_OSP(this);
+               APPEND_LOG_CONTROL_OSP(pcontrol);
+               printLog(&log, MSG_LOG);
+       }
        probeBlockEnd();
 
        (this->*container_removeallcontrolp)();
index 37e98b9..8a16b8b 100755 (executable)
@@ -86,14 +86,17 @@ void on_orientation_changed(int angle, bool capi)
        if(autoRotation)        // rotation is not locked
        {
                external_angle = internal_angle;
-               setProbePoint(&probeInfo);
-
-               INIT_LOG;
-               APPEND_LOG_BASIC_NAME(LC_UIEVENT, "OrientationChanged");
-               APPEND_LOG_COMMON_NONE(0);
-               log.length += sprintf(log.data + log.length, "`,%d`,`,`,`,%d`,",
-                               _EVENT_ORIENTATION, convert_angle(external_angle));
-               printLog(&log, MSG_LOG);
+
+               if(isOptionEnabled(OPT_EVENT))
+               {
+                       setProbePoint(&probeInfo);
+                       INIT_LOG;
+                       APPEND_LOG_BASIC_NAME(LC_UIEVENT, "OrientationChanged");
+                       APPEND_LOG_COMMON_NONE(0);
+                       log.length += sprintf(log.data + log.length, "`,%d`,`,`,`,%d`,",
+                                       _EVENT_ORIENTATION, convert_angle(external_angle));
+                       printLog(&log, MSG_LOG);
+               }
 
 //             if(orientation_enabled)
 //             {
index 9a2cf3d..37ed8c9 100755 (executable)
@@ -29,6 +29,7 @@
  */
 
 #include "daprobe.h"
+#include "dahelper.h"
 #include "probeinfo.h"
 #include "osp_probe.h"
 #include "dacollection.h"
@@ -60,320 +61,386 @@ void GestureEventListener::OnCustomGestureCanceled (TouchGestureDetector &gestur
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
-       GESTURE_EVENT_LOG("canceled", _GESTURE_CUSTOM, 0, 0, 0, 0);
-       probeBlockEnd();
+       if(isOptionEnabled(OPT_EVENT))
+       {
+               probeBlockStart();
+               GESTURE_EVENT_LOG("canceled", _GESTURE_CUSTOM, 0, 0, 0, 0);
+               probeBlockEnd();
+       }
 }
 
 void GestureEventListener::OnCustomGestureChanged (TouchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
-       GESTURE_EVENT_LOG("changed", _GESTURE_CUSTOM, 0, 0, 0, 0);
-       probeBlockEnd();
+       if(isOptionEnabled(OPT_EVENT))
+       {
+               probeBlockStart();
+               GESTURE_EVENT_LOG("changed", _GESTURE_CUSTOM, 0, 0, 0, 0);
+               probeBlockEnd();
+       }
 }
 
 void GestureEventListener::OnCustomGestureFinished (TouchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
-       GESTURE_EVENT_LOG("finished", _GESTURE_CUSTOM, 0, 0, 0, 0);
-       probeBlockEnd();
+       if(isOptionEnabled(OPT_EVENT))
+       {
+               probeBlockStart();
+               GESTURE_EVENT_LOG("finished", _GESTURE_CUSTOM, 0, 0, 0, 0);
+               probeBlockEnd();
+       }
 }
 
 void GestureEventListener::OnCustomGestureStarted (TouchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
-       GESTURE_EVENT_LOG("started", _GESTURE_CUSTOM, 0, 0, 0, 0);
-       probeBlockEnd();
+       if(isOptionEnabled(OPT_EVENT))
+       {
+               probeBlockStart();
+               GESTURE_EVENT_LOG("started", _GESTURE_CUSTOM, 0, 0, 0, 0);
+               probeBlockEnd();
+       }
 }
 
 void GestureEventListener::OnFlickGestureCanceled (TouchFlickGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int x = 0, y = 0, dur = 0;
-               FlickDirection direction = FLICK_DIRECTION_NONE;
+               probeBlockStart();
+               {
+                       int x = 0, y = 0, dur = 0;
+                       FlickDirection direction = FLICK_DIRECTION_NONE;
 
-               gestureDetector.GetDistance(x, y);
-               dur = gestureDetector.GetDuration();
-               direction = gestureDetector.GetDirection();
-               GESTURE_EVENT_LOG("canceled", _GESTURE_FLICK, x, y, dur, (int)direction);
+                       gestureDetector.GetDistance(x, y);
+                       dur = gestureDetector.GetDuration();
+                       direction = gestureDetector.GetDirection();
+                       GESTURE_EVENT_LOG("canceled", _GESTURE_FLICK, x, y, dur, (int)direction);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnFlickGestureDetected (TouchFlickGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int x = 0, y = 0, dur = 0;
-               FlickDirection direction = FLICK_DIRECTION_NONE;
+               probeBlockStart();
+               {
+                       int x = 0, y = 0, dur = 0;
+                       FlickDirection direction = FLICK_DIRECTION_NONE;
 
-               gestureDetector.GetDistance(x, y);
-               dur = gestureDetector.GetDuration();
-               direction = gestureDetector.GetDirection();
-               GESTURE_EVENT_LOG("detected", _GESTURE_FLICK, x, y, dur, (int)direction);
+                       gestureDetector.GetDistance(x, y);
+                       dur = gestureDetector.GetDuration();
+                       direction = gestureDetector.GetDirection();
+                       GESTURE_EVENT_LOG("detected", _GESTURE_FLICK, x, y, dur, (int)direction);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnLongPressGestureCanceled (TouchLongPressGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int moveallow = 0, tcount = 0, dur = 0;
+               probeBlockStart();
+               {
+                       int moveallow = 0, tcount = 0, dur = 0;
 
-               moveallow = gestureDetector.GetMoveAllowance();
-               dur = gestureDetector.GetDuration();
-               tcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("canceled", _GESTURE_LONGPRESS, moveallow, 0, dur, tcount);
+                       moveallow = gestureDetector.GetMoveAllowance();
+                       dur = gestureDetector.GetDuration();
+                       tcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("canceled", _GESTURE_LONGPRESS, moveallow, 0, dur, tcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnLongPressGestureDetected (TouchLongPressGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int moveallow = 0, tcount = 0, dur = 0;
+               probeBlockStart();
+               {
+                       int moveallow = 0, tcount = 0, dur = 0;
 
-               moveallow = gestureDetector.GetMoveAllowance();
-               dur = gestureDetector.GetDuration();
-               tcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("detected", _GESTURE_LONGPRESS, moveallow, 0, dur, tcount);
+                       moveallow = gestureDetector.GetMoveAllowance();
+                       dur = gestureDetector.GetDuration();
+                       tcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("detected", _GESTURE_LONGPRESS, moveallow, 0, dur, tcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPanningGestureCanceled (TouchPanningGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int tcount = 0;
+               probeBlockStart();
+               {
+                       int tcount = 0;
 
-               tcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("canceled", _GESTURE_PANNING, 0, 0, 0, tcount);
+                       tcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("canceled", _GESTURE_PANNING, 0, 0, 0, tcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPanningGestureChanged (TouchPanningGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int tcount = 0;
+               probeBlockStart();
+               {
+                       int tcount = 0;
 
-               tcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("changed", _GESTURE_PANNING, 0, 0, 0, tcount);
+                       tcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("changed", _GESTURE_PANNING, 0, 0, 0, tcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPanningGestureFinished (TouchPanningGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int tcount = 0;
+               probeBlockStart();
+               {
+                       int tcount = 0;
 
-               tcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("finished", _GESTURE_PANNING, 0, 0, 0, tcount);
+                       tcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("finished", _GESTURE_PANNING, 0, 0, 0, tcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPanningGestureStarted (TouchPanningGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int tcount = 0;
+               probeBlockStart();
+               {
+                       int tcount = 0;
 
-               tcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("started", _GESTURE_PANNING, 0, 0, 0, tcount);
+                       tcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("started", _GESTURE_PANNING, 0, 0, 0, tcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPinchGestureCanceled (TouchPinchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Tizen::Graphics::Point point;
-               int scale = 0;
+               probeBlockStart();
+               {
+                       Tizen::Graphics::Point point;
+                       int scale = 0;
 
-               point = gestureDetector.GetCenterPoint();
-               scale = gestureDetector.GetScale();
-               GESTURE_EVENT_LOG("canceled", _GESTURE_PINCH, point.x, point.y, scale, 0);
+                       point = gestureDetector.GetCenterPoint();
+                       scale = gestureDetector.GetScale();
+                       GESTURE_EVENT_LOG("canceled", _GESTURE_PINCH, point.x, point.y, scale, 0);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPinchGestureChanged (TouchPinchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Tizen::Graphics::Point point;
-               int scale = 0;
+               probeBlockStart();
+               {
+                       Tizen::Graphics::Point point;
+                       int scale = 0;
 
-               point = gestureDetector.GetCenterPoint();
-               scale = gestureDetector.GetScale();
-               GESTURE_EVENT_LOG("changed", _GESTURE_PINCH, point.x, point.y, scale, 0);
+                       point = gestureDetector.GetCenterPoint();
+                       scale = gestureDetector.GetScale();
+                       GESTURE_EVENT_LOG("changed", _GESTURE_PINCH, point.x, point.y, scale, 0);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPinchGestureFinished (TouchPinchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Tizen::Graphics::Point point;
-               int scale = 0;
+               probeBlockStart();
+               {
+                       Tizen::Graphics::Point point;
+                       int scale = 0;
 
-               point = gestureDetector.GetCenterPoint();
-               scale = gestureDetector.GetScale();
-               GESTURE_EVENT_LOG("finished", _GESTURE_PINCH, point.x, point.y, scale, 0);
+                       point = gestureDetector.GetCenterPoint();
+                       scale = gestureDetector.GetScale();
+                       GESTURE_EVENT_LOG("finished", _GESTURE_PINCH, point.x, point.y, scale, 0);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnPinchGestureStarted (TouchPinchGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Tizen::Graphics::Point point;
-               int scale = 0;
+               probeBlockStart();
+               {
+                       Tizen::Graphics::Point point;
+                       int scale = 0;
 
-               point = gestureDetector.GetCenterPoint();
-               scale = gestureDetector.GetScale();
-               GESTURE_EVENT_LOG("started", _GESTURE_PINCH, point.x, point.y, scale, 0);
+                       point = gestureDetector.GetCenterPoint();
+                       scale = gestureDetector.GetScale();
+                       GESTURE_EVENT_LOG("started", _GESTURE_PINCH, point.x, point.y, scale, 0);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnRotationGestureCanceled (TouchRotationGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int distance = 0;
-               float angle = 0.0f;
+               probeBlockStart();
+               {
+                       int distance = 0;
+                       float angle = 0.0f;
 
-               distance = gestureDetector.GetDistance();
-               angle = gestureDetector.GetAngle();
-               GESTURE_EVENT_LOG("canceled", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+                       distance = gestureDetector.GetDistance();
+                       angle = gestureDetector.GetAngle();
+                       GESTURE_EVENT_LOG("canceled", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnRotationGestureChanged (TouchRotationGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int distance = 0;
-               float angle = 0.0f;
+               probeBlockStart();
+               {
+                       int distance = 0;
+                       float angle = 0.0f;
 
-               distance = gestureDetector.GetDistance();
-               angle = gestureDetector.GetAngle();
-               GESTURE_EVENT_LOG("changed", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+                       distance = gestureDetector.GetDistance();
+                       angle = gestureDetector.GetAngle();
+                       GESTURE_EVENT_LOG("changed", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnRotationGestureFinished (TouchRotationGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int distance = 0;
-               float angle = 0.0f;
+               probeBlockStart();
+               {
+                       int distance = 0;
+                       float angle = 0.0f;
 
-               distance = gestureDetector.GetDistance();
-               angle = gestureDetector.GetAngle();
-               GESTURE_EVENT_LOG("finished", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+                       distance = gestureDetector.GetDistance();
+                       angle = gestureDetector.GetAngle();
+                       GESTURE_EVENT_LOG("finished", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnRotationGestureStarted (TouchRotationGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int distance = 0;
-               float angle = 0.0f;
+               probeBlockStart();
+               {
+                       int distance = 0;
+                       float angle = 0.0f;
 
-               distance = gestureDetector.GetDistance();
-               angle = gestureDetector.GetAngle();
-               GESTURE_EVENT_LOG("started", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+                       distance = gestureDetector.GetDistance();
+                       angle = gestureDetector.GetAngle();
+                       GESTURE_EVENT_LOG("started", _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle));
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnTapGestureCanceled (TouchTapGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int move = 0, tapcount = 0, touchcount = 0, interval = 0;
+               probeBlockStart();
+               {
+                       int move = 0, tapcount = 0, touchcount = 0, interval = 0;
 
-               move = gestureDetector.GetMoveAllowance();
-               tapcount = gestureDetector.GetTapCount();
-               interval = gestureDetector.GetTapInterval();
-               touchcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("canceled", _GESTURE_TAP, move, tapcount, interval, touchcount);
+                       move = gestureDetector.GetMoveAllowance();
+                       tapcount = gestureDetector.GetTapCount();
+                       interval = gestureDetector.GetTapInterval();
+                       touchcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("canceled", _GESTURE_TAP, move, tapcount, interval, touchcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 void GestureEventListener::OnTapGestureDetected (TouchTapGestureDetector &gestureDetector)
 {
        DECLARE_COMMON_VARIABLE;
 
-       probeBlockStart();
+       if(isOptionEnabled(OPT_EVENT))
        {
-               int move = 0, tapcount = 0, touchcount = 0, interval = 0;
+               probeBlockStart();
+               {
+                       int move = 0, tapcount = 0, touchcount = 0, interval = 0;
 
-               move = gestureDetector.GetMoveAllowance();
-               tapcount = gestureDetector.GetTapCount();
-               interval = gestureDetector.GetTapInterval();
-               touchcount = gestureDetector.GetTouchCount();
-               GESTURE_EVENT_LOG("detected", _GESTURE_TAP, move, tapcount, interval, touchcount);
+                       move = gestureDetector.GetMoveAllowance();
+                       tapcount = gestureDetector.GetTapCount();
+                       interval = gestureDetector.GetTapInterval();
+                       touchcount = gestureDetector.GetTouchCount();
+                       GESTURE_EVENT_LOG("detected", _GESTURE_TAP, move, tapcount, interval, touchcount);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 }
 
 GestureEventListener& GestureEventListener::GetInstance()
index 0e403cf..d177f6c 100755 (executable)
@@ -43,6 +43,7 @@
 //#include <linux/input.h>
 
 #include "daprobe.h"
+#include "dahelper.h"
 #include "probeinfo.h"
 //#include "dautil.h"
 #include "da_event.h"
@@ -67,16 +68,19 @@ Eina_Bool ecore_event_evas_key_down(void *data, int type, void *event)
 
        GET_REAL_FUNC(ecore_event_evas_key_down, LIBECOREINPUT);
 
-       probeBlockStart();
-       if(event != NULL)
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
-               if(strcasestr(pEv->keyname, "volume") == NULL)
+               probeBlockStart();
+               if(event != NULL)
                {
-                       HW_EVENT_LOG(_EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0);
+                       Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
+                       if(strcasestr(pEv->keyname, "volume") == NULL)
+                       {
+                               HW_EVENT_LOG(_EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0);
+                       }
                }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 
        return ecore_event_evas_key_downp(data, type, event);
 }
@@ -88,16 +92,19 @@ Eina_Bool ecore_event_evas_key_up(void *data, int type, void *event)
 
        GET_REAL_FUNC(ecore_event_evas_key_up, LIBECOREINPUT);
 
-       probeBlockStart();
-       if(event != NULL)
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
-               if(strcasestr(pEv->keyname, "volume") == NULL) 
+               probeBlockStart();
+               if(event != NULL)
                {
-                       HW_EVENT_LOG(_EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0);
+                       Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
+                       if(strcasestr(pEv->keyname, "volume") == NULL)
+                       {
+                               HW_EVENT_LOG(_EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0);
+                       }
                }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 
        return ecore_event_evas_key_upp(data, type, event);
 }
@@ -109,14 +116,17 @@ Eina_Bool ecore_event_evas_mouse_button_down(void *data, int type, void *event)
 
        GET_REAL_FUNC(ecore_event_evas_mouse_button_down, LIBECOREINPUT);
 
-       probeBlockStart();
-       if(event != NULL)
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
-               touch_pressed = true;
-               HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
+               probeBlockStart();
+               if(event != NULL)
+               {
+                       Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
+                       touch_pressed = true;
+                       HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 
        return ecore_event_evas_mouse_button_downp(data, type, event);
 }
@@ -128,14 +138,17 @@ Eina_Bool ecore_event_evas_mouse_button_up(void *data, int type, void *event)
 
        GET_REAL_FUNC(ecore_event_evas_mouse_button_up, LIBECOREINPUT);
 
-       probeBlockStart();
-       if(event != NULL)
+       if(isOptionEnabled(OPT_EVENT))
        {
-               Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
-               touch_pressed = false;
-               HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
+               probeBlockStart();
+               if(event != NULL)
+               {
+                       Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
+                       touch_pressed = false;
+                       HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
+               }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 
        return ecore_event_evas_mouse_button_upp(data, type, event);
 }
@@ -147,16 +160,19 @@ Eina_Bool ecore_event_evas_mouse_move(void *data, int type, void *event)
 
        GET_REAL_FUNC(ecore_event_evas_mouse_move, LIBECOREINPUT);
 
-       probeBlockStart();
-       if(touch_pressed)
+       if(isOptionEnabled(OPT_EVENT))
        {
-               if(event != NULL)
+               probeBlockStart();
+               if(touch_pressed)
                {
-                       Ecore_Event_Mouse_Move* pEv = (Ecore_Event_Mouse_Move*)event;
-                       HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_MOVED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
+                       if(event != NULL)
+                       {
+                               Ecore_Event_Mouse_Move* pEv = (Ecore_Event_Mouse_Move*)event;
+                               HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_MOVED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
+                       }
                }
+               probeBlockEnd();
        }
-       probeBlockEnd();
 
        return ecore_event_evas_mouse_movep(data, type, event);
 }
index a6ce09e..16612c7 100755 (executable)
        POST_PROBEBLOCK_BEGIN(LC_RESOURCE, RTYPE, RVAL, INPUTFORMAT, __VA_ARGS__);                      \\r
        GET_FD_FROM_FILEP(FILEP);                                                                                                                       \\r
        _fstatret = fstat(_fd, &_statbuf);                                                                                                      \\r
-       if(_fstatret != 0) PRINTMSG("ERROR : fstat error");                                                                     \\r
+       if(_fstatret != 0) PRINTMSG("ERROR : fstat error\n");                                                           \\r
        POST_PROBEBLOCK_MIDDLE_FD(SIZE, _fd, APITYPE);                                                                          \\r
        POST_PROBEBLOCK_CALLSTACK_RESOURCE(APITYPE);                                                                            \\r
        POST_PROBEBLOCK_END()\r
index 8eb39b5..fb0d738 100755 (executable)
@@ -47,6 +47,8 @@
 #include <stdlib.h>
 #include <errno.h>
 
+static enum DaOptions _sopt = OPT_FILE;
+
 int open(const char* path, int oflag, ...)
 {
        static int (*openp)(const char* path, int oflag, ...);
index cd0e27b..99e68aa 100644 (file)
@@ -39,6 +39,8 @@
 #include "dautil.h"
 #include "da_io.h"
 
+static enum DaOptions _sopt = OPT_FILE;
+
 FILE* fopen(const char* filename, const char* mode)
 {
        static FILE* (*fopenp)(const char* filename, const char* mode);
index d851b47..b24d993 100755 (executable)
 #include "da_memory.h"
 
 #define EXTRA_MEM_SIZE         20
-#define MEMORYFILTERING                (!isEnableInternalMalloc())
+//#define INTERNALFILTERING            (!isEnableInternalMalloc())
+#define INTERNALFILTERING              true
 static char extra_mem[EXTRA_MEM_SIZE];
+static enum DaOptions _sopt = OPT_ALLOC;
 
 void *malloc(size_t size)
 {
@@ -53,7 +55,7 @@ void *malloc(size_t size)
 
        GET_REAL_FUNC_RTLD_NEXT(malloc);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        pret = mallocp(size);
@@ -78,7 +80,7 @@ void free(void *ptr)
 
        GET_REAL_FUNC_RTLD_NEXT(free);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        if(ptr != NULL && getTraceState() == 0)
@@ -132,7 +134,7 @@ void *calloc(size_t nelem, size_t elsize)
                probeBlockEnd();
        }
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        pret = callocp(nelem, elsize);
@@ -158,7 +160,7 @@ void *realloc(void *memblock, size_t size)
 
        GET_REAL_FUNC_RTLD_NEXT(realloc);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        if(memblock != NULL && getTraceState() == 0)
index 82918cd..80d17c2 100644 (file)
@@ -40,6 +40,8 @@
 #include "dautil.h"
 #include "da_memory.h"
 
+static enum DaOptions _sopt = OPT_ALLOC;
+
 void *memset(void *memblock, int c, size_t n)
 {
        static void *(*memsetp)(void *,int,size_t);
index 2085858..cd2c735 100644 (file)
 #include "dacollection.h"
 #include "da_memory.h"
 
-#define MEMORYFILTERING                (!isEnableInternalMalloc())
+//#define INTERNALFILTERING            (!isEnableInternalMalloc())
+#define INTERNALFILTERING              true
+
+static enum DaOptions _sopt = OPT_ALLOC;
 
 void *operator new(std::size_t size) throw (std::bad_alloc)
 {
@@ -50,7 +53,7 @@ void *operator new(std::size_t size) throw (std::bad_alloc)
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_Znwj,newp);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        pret = newp(size);
@@ -76,7 +79,7 @@ void *operator new[](std::size_t size) throw (std::bad_alloc)
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_Znaj, newp);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        pret = newp(size);
@@ -101,7 +104,7 @@ void operator delete(void *ptr) throw()
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdlPv, deletep);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        if(ptr != NULL && getTraceState() == 0)
@@ -124,7 +127,7 @@ void operator delete[](void *ptr) throw()
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdaPv, deletep);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        if(ptr != NULL && getTraceState() == 0)
@@ -148,7 +151,7 @@ void *operator new(std::size_t size, const std::nothrow_t& nothrow) throw()
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZnwjRKSt9nothrow_t, newp);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        pret = newp(size, nothrow);
@@ -174,7 +177,7 @@ void *operator new[](std::size_t size, const std::nothrow_t& nothrow) throw()
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZnajRKSt9nothrow_t, newp);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        pret = newp(size, nothrow);
@@ -199,7 +202,7 @@ void operator delete(void *ptr, const std::nothrow_t& nothrow) throw()
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdlPvRKSt9nothrow_t, deletep);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        if(ptr != NULL && getTraceState() == 0)
@@ -222,7 +225,7 @@ void operator delete[](void *ptr, const std::nothrow_t& nothrow) throw()
 
        GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdaPvRKSt9nothrow_t, deletep);
 
-       bfiltering = MEMORYFILTERING;
+       bfiltering = INTERNALFILTERING;
        PRE_PROBEBLOCK();
 
        if(ptr != NULL && getTraceState() == 0)
index 9d10b19..718ec1b 100644 (file)
@@ -46,6 +46,8 @@
 #include "dautil.h"
 #include "da_socket.h"
 
+static enum DaOptions _sopt = OPT_FILE;
+
 int socket(int domain, int type, int protocol)
 {
        static int (*socketp)(int domain, int type, int protocol);
index 9012e2d..71dc7e2 100644 (file)
@@ -36,6 +36,8 @@
 #include "dahelper.h"
 #include "da_sync.h"
 
+static enum DaOptions _sopt = OPT_THREAD;
+
 int pthread_mutex_init(pthread_mutex_t *mutex, 
                const pthread_mutexattr_t *attr) {
        static int (*pthread_mutex_initp)(pthread_mutex_t *mutex,
index c4dfb79..e542536 100644 (file)
@@ -40,6 +40,8 @@ typedef struct thread_routine_call_t {
        void *argument;
 } thread_routine_call;
 
+static enum DaOptions _sopt = OPT_THREAD;
+
 // called when pthread_exit, pthread_cancel is called
 void _da_cleanup_handler(void *data)
 {
index 1f7f7d0..86be9ec 100644 (file)
@@ -50,6 +50,7 @@ app_event_callback_s gAppCallback;
        } while(0);                                                                                                                             \
        errno = (newerrno != 0) ? newerrno : olderrno
 
+static enum DaOptions _sopt = OPT_ALWAYSON;
 
 static bool _dalc_app_create(void* user_data)
 {
index a87a1e7..1c58e70 100644 (file)
@@ -27,13 +27,11 @@ bool _DisplayManager::RenderAll(bool check)
 
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui10Animations15_DisplayManager9RenderAllEb, libosp-uifw.so, mp);
        probeBlockStart();
-       PRINTMSG("Before RenderAll");
        probeBlockEnd();
 
        ret = (this->*mp)(check);
 
        probeBlockStart();
-       PRINTMSG("After RenderAll");
        probeBlockEnd();
 
        return ret;
@@ -47,11 +45,9 @@ bool _DisplayManager::Render(_RootVisualElement& root, bool check)
        
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui10Animations15_DisplayManager6RenderERNS1_18_RootVisualElementEb, libosp-uifw.so, mp);
        probeBlockStart();
-       PRINTMSG("Before Render");
        probeBlockEnd();
        ret = (this->*mp)(root, check);
        probeBlockStart();
-       PRINTMSG("After Render");
        probeBlockEnd();
 
        return ret;
@@ -65,14 +61,12 @@ result _DisplayManager::PostRender(_RootVisualElement& root)
        
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui10Animations15_DisplayManager10PostRenderERNS1_18_RootVisualElementE, libosp-uifw.so, mp);
        probeBlockStart();
-//     PRINTMSG("Before PostRender");
        probeBlockEnd();
 
        ret = (this->*mp)(root);
 
        probeBlockStart();
        SCREENSHOT_DONE();
-//     PRINTMSG("After PostRender");
        probeBlockEnd();
 
        return ret;
@@ -86,11 +80,9 @@ result _DisplayManager::Flush(void)
        
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui10Animations15_DisplayManager5FlushEv, libosp-uifw.so, mp);
        probeBlockStart();
-       PRINTMSG("Before Flush");
        probeBlockEnd();
        ret = (this->*mp)();
        probeBlockStart();
-       PRINTMSG("After Flush");
        probeBlockEnd();
 
        return ret;
@@ -104,11 +96,9 @@ bool _DisplayManager::UpdateScene(bool force)
 
        GET_REAL_FUNC_OSP(_ZN5Tizen2Ui10Animations15_DisplayManager11UpdateSceneEb, libosp-uifw.so, mp);
        probeBlockStart();
-       PRINTMSG("Before UpdateScene");
        probeBlockEnd();
        ret = (this->*mp)(force);
        probeBlockStart();
-       PRINTMSG("After UpdateScene");
        probeBlockEnd();
 
        return ret;
index 6aa5b7e..d2eb68c 100755 (executable)
@@ -80,34 +80,37 @@ void SceneManagerEventListener::OnSceneTransitionCompleted(const SceneId &previo
 
                if(scenemanager->GetCurrentSceneId() == currentSceneId)
                {
-                       DECLARE_COMMON_VARIABLE;
-                       Scene* scene;
-                       String sceneid, formid, panelid;
-                       Form* pform;
-                       Panel* ppanel;
-                       unsigned long transition, user = 0;
-
-                       setProbePoint(&probeInfo);
-                       INIT_LOG;
-
-                       scene = scenemanager->GetCurrentScene();
-                       sceneid = scene->GetSceneId();
-                       formid = scene->GetFormId();
-                       panelid = scene->GetPanelId();
-                       pform = scene->GetForm();
-                       ppanel = scene->GetPanel();
-
-                       transition = (probeInfo.currentTime - startTime);
-
-                       APPEND_LOG_BASIC_NAME(LC_SCENE, "OnSceneTransitionCompleted");
-                       APPEND_LOG_COMMON_NONE(0);
-                       log.length += sprintf(log.data + log.length, "`,%S",
-                                       const_cast<wchar_t*>(sceneid.GetPointer()));
-                       APPEND_SCENE_ELEM(formid, pform);
-                       APPEND_SCENE_ELEM(panelid, ppanel);
-                       log.length += sprintf(log.data + log.length, "`,%lu`,%lu`,", transition, user);
-
-                       printLog(&log, MSG_LOG);
+                       if(isOptionEnabled(OPT_UI))
+                       {
+                               DECLARE_COMMON_VARIABLE;
+                               Scene* scene;
+                               String sceneid, formid, panelid;
+                               Form* pform;
+                               Panel* ppanel;
+                               unsigned long transition, user = 0;
+
+                               setProbePoint(&probeInfo);
+                               INIT_LOG;
+
+                               scene = scenemanager->GetCurrentScene();
+                               sceneid = scene->GetSceneId();
+                               formid = scene->GetFormId();
+                               panelid = scene->GetPanelId();
+                               pform = scene->GetForm();
+                               ppanel = scene->GetPanel();
+
+                               transition = (probeInfo.currentTime - startTime);
+
+                               APPEND_LOG_BASIC_NAME(LC_SCENE, "OnSceneTransitionCompleted");
+                               APPEND_LOG_COMMON_NONE(0);
+                               log.length += sprintf(log.data + log.length, "`,%S",
+                                               const_cast<wchar_t*>(sceneid.GetPointer()));
+                               APPEND_SCENE_ELEM(formid, pform);
+                               APPEND_SCENE_ELEM(panelid, ppanel);
+                               log.length += sprintf(log.data + log.length, "`,%lu`,%lu`,", transition, user);
+
+                               printLog(&log, MSG_LOG);
+                       }
                }
                else
                {
index 80fdbb1..0f966cf 100755 (executable)
@@ -69,6 +69,7 @@ void *custom_cb_addr = (void*)-1;
 extern __thread unsigned long gSTrace;
 
 volatile int profil_turned_on = 0;
+volatile int profil_thread_on = 0;
 u_long low_pc, high_pc;
 
 typedef struct elapsed_time_t {
@@ -229,7 +230,7 @@ void *profil_log_func(void *data)
 
        INIT_LOG;
 
-       while(profil_turned_on)
+       while(profil_thread_on)
        {
                while(!IS_EMPTY_SAMPLE_ARRAY)
                {
@@ -268,7 +269,6 @@ void __cyg_profile_func_enter(void *this, void *callsite)
                                char **strings = BACKTRACE_SYMBOLS(&callsite, 1);
                                if(likely(strings != NULL))
                                {
-                                       printf("%s\n\n", strings[0]);
                                        if(strstr(strings[0], CUSTOM_CB_FUNC_NAME) != NULL)
                                        {
                                                custom_cb_addr = callsite;
@@ -324,7 +324,6 @@ void __cyg_profile_func_exit(void *this, void *callsite)
                                char **strings = BACKTRACE_SYMBOLS(&callsite, 1);
                                if(likely(strings != NULL))
                                {
-                                       printf("%s\n\n", strings[0]);
                                        if(strstr(strings[0], CUSTOM_CB_FUNC_NAME) != NULL)
                                        {
                                                custom_cb_addr = callsite;
@@ -455,6 +454,7 @@ static void profil_counter(int signo, const struct sigcontext scp)
 static void profil_counter(int signr, siginfo_t *si, struct ucontext *uctx)
 {
        profil_count((void *) GET_PC(uctx));
+
        /* This is a hack to prevent the compiler from implementing the
           above function call as a sibcall. The sibcall would overwrite
           the signal context */
@@ -504,6 +504,7 @@ int __profil(int mode)
                profil_turned_on = 0;
                return sigaction(SIGPROF, &oact, NULL);
        }
+
        if(profil_turned_on == 1)
        {
                if(setitimer(ITIMER_PROF, &otimer, NULL) < 0
@@ -511,7 +512,6 @@ int __profil(int mode)
                {
                        return -1;
                }
-
        }
        profil_turned_on = 1;
 
@@ -537,8 +537,8 @@ void __monstartup(u_long lowpc, u_long highpc)
        high_pc = highpc;
 
        pthread_mutex_init(&profil_log_mutex, NULL);
-       __profil(1);
        probeBlockStart();
+       profil_thread_on = 1;
        if(pthread_create(&profil_log_thread, NULL, &profil_log_func, NULL) < 0)
        {
                perror("Fail to create profil_log thread");
@@ -550,6 +550,7 @@ void __monstartup(u_long lowpc, u_long highpc)
 void _mcleanup(void)
 {
        __profil(0);
+       profil_thread_on = 0;
        return;
 }