[FIX] missing log from destructor of tizen class
authorAnastasia Lyupa <a.lyupa@samsung.com>
Mon, 25 Nov 2013 08:21:39 +0000 (12:21 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 28 Nov 2013 13:03:43 +0000 (13:03 +0000)
Port original DA commit:
d4db830c925b52d5df8f18baa1beadb77e7e159f

Change-Id: I5c7bf4057e4b6b44a43b420a6ffacb266059018c
Signed-off-by: Anastasia Lyupa <a.lyupa@samsung.com>
helper/dacollection.c
include/binproto.h
include/dacollection.h
probe_tizenapi/tizen_constructor.cpp
probe_tizenapi/tizen_controls.cpp
probe_tizenapi/tizen_file.cpp
probe_ui/tizen_capture.cpp
probe_ui/tizen_scenemanager.cpp

index b0bf63f..d46d574 100755 (executable)
@@ -44,6 +44,8 @@ __hashInfo _hashinfo =
        PTHREAD_MUTEX_INITIALIZER,      // pthread_mutex_t symHashMutex
        NULL,                                           // khash_t(allocmap)*   memHash
        PTHREAD_MUTEX_INITIALIZER,      // pthread_mutex_t memHashMutex
+       NULL,                                           // khash_t(uiobject)*   uiobjHash
+       PTHREAD_MUTEX_INITIALIZER,      // pthread_mutex_t      uiobjHashMutex
        NULL,                                           // khash_t(object)*     objHash
        PTHREAD_MUTEX_INITIALIZER,      // pthread_mutex_t objHashMutex
        NULL,                                           // khash_t(detector)*   dttHash
@@ -79,6 +81,10 @@ int initialize_hash_table()
        MEMORYHASH = kh_init(allocmap);
        MEMORYHASH_UNLOCK;
 
+       UIOBJECTHASH_LOCK;
+       UIOBJECTHASH = kh_init(uiobject);
+       UIOBJECTHASH_UNLOCK;
+
        OBJECTHASH_LOCK;
        OBJECTHASH = kh_init(object);
        OBJECTHASH_UNLOCK;
@@ -92,7 +98,7 @@ int initialize_hash_table()
 
 int finalize_hash_table()
 {
-       if(SYMBOLHASH)
+       if (SYMBOLHASH)
        {
                khiter_t k;
                char* val;
@@ -100,7 +106,7 @@ int finalize_hash_table()
                SYMBOLHASH_LOCK;
                for(k = kh_begin(SYMBOLHASH); k != kh_end(SYMBOLHASH); k++)
                {
-                       if(kh_exist(SYMBOLHASH, k))
+                       if (kh_exist(SYMBOLHASH, k))
                        {
                                val = kh_value(SYMBOLHASH, k);
                                free(val);
@@ -111,7 +117,7 @@ int finalize_hash_table()
                SYMBOLHASH_UNLOCK;
        }
 
-       if(MEMORYHASH)
+       if (MEMORYHASH)
        {
                MEMORYHASH_LOCK;
                kh_destroy(allocmap, MEMORYHASH);
@@ -119,28 +125,36 @@ int finalize_hash_table()
                MEMORYHASH_UNLOCK;
        }
 
-       if(OBJECTHASH)
+       if (UIOBJECTHASH)
        {
                khiter_t k;
-               _objectinfo* val;
+               _uiobjectinfo* val;
 
-               OBJECTHASH_LOCK;
-               for(k = kh_begin(OBJECTHASH); k != kh_end(OBJECTHASH); k++)
+               UIOBJECTHASH_LOCK;
+               for(k = kh_begin(UIOBJECTHASH); k != kh_end(UIOBJECTHASH); k++)
                {
-                       if(kh_exist(OBJECTHASH, k))
+                       if (kh_exist(UIOBJECTHASH, k))
                        {
-                               val = kh_value(OBJECTHASH, k);
-                               if(likely(val->type != 0)) free(val->type);
-                               if(likely(val->name != 0)) free(val->name);
+                               val = kh_value(UIOBJECTHASH, k);
+                               if (likely(val->type != 0)) free(val->type);
+                               if (likely(val->name != 0)) free(val->name);
                                free(val);
                        }
                }
+               kh_destroy(uiobject, UIOBJECTHASH);
+               UIOBJECTHASH = NULL;
+               UIOBJECTHASH_UNLOCK;
+       }
+
+       if (OBJECTHASH)
+       {
+               OBJECTHASH_LOCK;
                kh_destroy(object, OBJECTHASH);
                OBJECTHASH = NULL;
                OBJECTHASH_UNLOCK;
        }
 
-       if(DETECTORHASH)
+       if (DETECTORHASH)
        {
                DETECTORHASH_LOCK;
                kh_destroy(detector, DETECTORHASH);
@@ -162,20 +176,20 @@ int find_symbol_hash(void* ptr, char** psymbol)
        khiter_t k;
        int ret = 0;
 
-       if(unlikely(SYMBOLHASH == 0))
+       if (unlikely(SYMBOLHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(psymbol == NULL))
+       if (unlikely(psymbol == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
 
        SYMBOLHASH_LOCK;
        k = kh_get(symbol, SYMBOLHASH, (uint32_t)ptr);
-       if(k == kh_end(SYMBOLHASH))             // there is no entry for key
+       if (k == kh_end(SYMBOLHASH))            // there is no entry for key
        {
                ret = 0;
        }
@@ -197,23 +211,23 @@ int add_symbol_hash(void* ptr, const char* str, int strlen)
        khiter_t k;
        int rethash, ret = 0;
 
-       if(unlikely(SYMBOLHASH == 0))
+       if (unlikely(SYMBOLHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(str == NULL))
+       if (unlikely(str == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
 
        SYMBOLHASH_LOCK;
        k = kh_put(symbol, SYMBOLHASH, (uint32_t)ptr, &rethash);
-       if(likely(rethash != 0))        // succeed to add in hash table
+       if (likely(rethash != 0))       // succeed to add in hash table
        {
                char* tlast = (char*)malloc(strlen);
-               if(likely(tlast != NULL))
+               if (likely(tlast != NULL))
                {
                        memcpy(tlast, str, strlen);
                        kh_value(SYMBOLHASH, k) = tlast;
@@ -247,16 +261,16 @@ int add_memory_hash(void* ptr, size_t size, unsigned short type, unsigned short
        size_t memsize;
        uint64_t meminfo;
 
-       if(unlikely(MEMORYHASH == 0))
+       if (unlikely(MEMORYHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
        MEMORYHASH_LOCK;
        k = kh_put(allocmap, MEMORYHASH, (uint32_t)ptr, &rethash);
-       if(likely(rethash != 0))        // succeed to add in hash table
+       if (likely(rethash != 0))       // succeed to add in hash table
        {
                kh_value(MEMORYHASH, k) = MAKE_MEMINFO(caller, type, size);
                update_heap_memory_size(true, size);
@@ -267,7 +281,7 @@ int add_memory_hash(void* ptr, size_t size, unsigned short type, unsigned short
                // update memory info
                meminfo = kh_value(MEMORYHASH, k);
                memsize = GET_MEMSIZE(meminfo);
-               if(memsize == size)
+               if (memsize == size)
                {
                        kh_value(MEMORYHASH, k) = MAKE_MEMINFO(caller, type, size);
                }
@@ -288,26 +302,26 @@ int del_memory_hash(void* ptr, unsigned short type, unsigned short* caller)
        uint32_t size;
        uint64_t meminfo;
 
-       if(unlikely(MEMORYHASH == 0))
+       if (unlikely(MEMORYHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
        MEMORYHASH_LOCK;
        k = kh_get(allocmap, MEMORYHASH, (uint32_t)ptr);
-       if(likely(k != kh_end(MEMORYHASH)))
+       if (likely(k != kh_end(MEMORYHASH)))
        {                               // there is entry in hash table
                meminfo = kh_value(MEMORYHASH, k);
-               if(unlikely(type != GET_MEMTYPE(meminfo)))
+               if (unlikely(type != GET_MEMTYPE(meminfo)))
                {
                        ret = -1;
                }
                else
                {
                        size = GET_MEMSIZE(meminfo);
-                       if(caller != NULL)
+                       if (caller != NULL)
                                *caller = GET_MEMCALLER(meminfo);
                        update_heap_memory_size(false, size);
                        kh_del(allocmap, MEMORYHASH, k);
@@ -324,43 +338,43 @@ int del_memory_hash(void* ptr, unsigned short type, unsigned short* caller)
 }
 
 /***********************************************************
- * object hash related functions
+ * uiobject hash related functions
  ***********************************************************/
 // return 0 if there is no entry in hash
 // return 1 if there is entry in hash
 // return negative value if error occurred
-int find_object_hash(void* ptr, char** type, char** classname)
+int find_uiobject_hash(void* ptr, char** type, char** classname)
 {
        khiter_t k;
        int ret = 0;
 
-       if(unlikely(OBJECTHASH == 0))
+       if (unlikely(UIOBJECTHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(type == NULL))
+       if (unlikely(type == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(classname == NULL))
+       if (unlikely(classname == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
 
-       OBJECTHASH_LOCK;
-       k = kh_get(object, OBJECTHASH, (uint32_t)ptr);
-       if(unlikely(k == kh_end(OBJECTHASH)))           // there is no entry for key
+       UIOBJECTHASH_LOCK;
+       k = kh_get(uiobject, UIOBJECTHASH, (uint32_t)ptr);
+       if (unlikely(k == kh_end(UIOBJECTHASH)))                // there is no entry for key
        {
                ret = 0;
        }
        else
        {
-               *classname = kh_value(OBJECTHASH, k)->name;
-               *type = kh_value(OBJECTHASH, k)->type;
+               *classname = kh_value(UIOBJECTHASH, k)->name;
+               *type = kh_value(UIOBJECTHASH, k)->type;
                ret = 1;
        }
-       OBJECTHASH_UNLOCK;
+       UIOBJECTHASH_UNLOCK;
        probeBlockEnd();
        return ret;
 }
@@ -368,42 +382,42 @@ int find_object_hash(void* ptr, char** type, char** classname)
 // return 0 if succeed
 // return 1 if there is no entry in hash
 // return negative value if other error occurred
-int add_object_hash_class(void* ptr, const char* classname)
+int add_uiobject_hash_class(void* ptr, const char* classname)
 {
        int str_len;
        khiter_t k;
        int rethash, ret = 0;
 
-       if(unlikely(OBJECTHASH == 0))
+       if (unlikely(UIOBJECTHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(classname == NULL))
+       if (unlikely(classname == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
 
        str_len = strlen(classname) + 1;
 
-       OBJECTHASH_LOCK;
-       k = kh_put(object, OBJECTHASH, (uint32_t)ptr, &rethash);
-       if(likely(rethash == 0))        // entry is already in hash table
+       UIOBJECTHASH_LOCK;
+       k = kh_put(uiobject, UIOBJECTHASH, (uint32_t)ptr, &rethash);
+       if (likely(rethash == 0))       // entry is already in hash table
        {
-               if(likely(kh_value(OBJECTHASH, k) != NULL))
+               if (likely(kh_value(UIOBJECTHASH, k) != NULL))
                {
-                       if(kh_value(OBJECTHASH, k)->name == NULL)
+                       if (kh_value(UIOBJECTHASH, k)->name == NULL)
                        {
                                char* tlast = (char*)malloc(str_len);
-                               if(likely(tlast != NULL))
+                               if (likely(tlast != NULL))
                                {
                                        memcpy(tlast, classname, str_len);
-                                       kh_value(OBJECTHASH, k)->name = tlast;
+                                       kh_value(UIOBJECTHASH, k)->name = tlast;
                                }
                                else
                                {
-                                       kh_value(OBJECTHASH, k)->name = NULL;
+                                       kh_value(UIOBJECTHASH, k)->name = NULL;
                                        ret = ERR_OUTOFMEMORY;  // out of memory
                                }
                        }
@@ -416,7 +430,7 @@ int add_object_hash_class(void* ptr, const char* classname)
        else    // error
                ret = 1;        // there is no entry
 
-       OBJECTHASH_UNLOCK;
+       UIOBJECTHASH_UNLOCK;
        probeBlockEnd();
        return ret;
 }
@@ -424,58 +438,165 @@ int add_object_hash_class(void* ptr, const char* classname)
 // return 0 if succeed
 // return 1 if there is already exist in hash
 // return negative value if other error occurred
-int add_object_hash_type(void* ptr, const char* type)
+int add_uiobject_hash_type(void* ptr, const char* type)
 {
        int str_len;
        khiter_t k;
        int rethash, ret = 0;
 
-       if(unlikely(OBJECTHASH == 0))
+       if (unlikely(UIOBJECTHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(type == NULL))
+       if (unlikely(type == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
 
        str_len = strlen(type) + 1;
 
-       OBJECTHASH_LOCK;
-       k = kh_put(object, OBJECTHASH, (uint32_t)ptr, &rethash);
-       if(likely(rethash != 0))        // succeed to add in hash table
+       UIOBJECTHASH_LOCK;
+       k = kh_put(uiobject, UIOBJECTHASH, (uint32_t)ptr, &rethash);
+       if (likely(rethash != 0))       // succeed to add in hash table
        {
                char* tlast;
-               _objectinfo* newentry;
+               _uiobjectinfo* newentry;
 
-               newentry = (_objectinfo*)calloc(1, sizeof(_objectinfo));
-               if(likely(newentry != NULL))
+               newentry = (_uiobjectinfo*)calloc(1, sizeof(_uiobjectinfo));
+               if (likely(newentry != NULL))
                {
-                       kh_value(OBJECTHASH, k) = newentry;
+                       kh_value(UIOBJECTHASH, k) = newentry;
 
                        tlast = (char*)malloc(str_len);
-                       if(likely(tlast != NULL))
+                       if (likely(tlast != NULL))
                        {
                                memcpy(tlast, type, str_len);
-                               kh_value(OBJECTHASH, k)->type = tlast;
+                               kh_value(UIOBJECTHASH, k)->type = tlast;
                        }
                        else
                        {
-                               kh_value(OBJECTHASH, k)->type = NULL;
+                               kh_value(UIOBJECTHASH, k)->type = NULL;
                                ret = ERR_OUTOFMEMORY;
                        }
                }
                else
                {
-                       kh_del(object, OBJECTHASH, k);
+                       kh_del(uiobject, UIOBJECTHASH, k);
                        ret = ERR_OUTOFMEMORY;
                }
        }
        else
                ret = 1;
 
+       UIOBJECTHASH_UNLOCK;
+       probeBlockEnd();
+       return ret;
+}
+
+// return 0 if succeed
+// return 1 if key is not in hash table
+// return negative value if other error occurred
+int del_uiobject_hash(void* ptr)
+{
+       khiter_t k;
+       _uiobjectinfo* val;
+       int ret = 0;
+
+       if (unlikely(UIOBJECTHASH == 0))
+               return ERR_NOTINITIALIZED;
+
+       if (unlikely(ptr == NULL))
+               return ERR_WRONGPARAMETER;
+
+       probeBlockStart();
+       UIOBJECTHASH_LOCK;
+       k = kh_get(uiobject, UIOBJECTHASH, (uint32_t)ptr);
+       if (likely(k != kh_end(UIOBJECTHASH)))          // there is entry in hash table
+       {
+               val = kh_value(UIOBJECTHASH, k);
+               kh_del(uiobject, UIOBJECTHASH, k);
+               if (likely(val->type != NULL)) free(val->type);
+               if (likely(val->name != NULL)) free(val->name);
+               free(val);
+       }
+       else
+       {
+               ret = 1;
+       }
+       UIOBJECTHASH_UNLOCK;
+       probeBlockEnd();
+
+       return ret;
+}
+
+/***********************************************************
+ * object hash related functions
+ ***********************************************************/
+// return 0 if there is no entry in hash
+// return 1 if there is entry in hash
+// return negative value if error occurred
+int find_object_hash(void* ptr, unsigned short *caller)
+{
+       khiter_t k;
+       int ret = 0;
+
+       if (unlikely(OBJECTHASH == 0))
+               return ERR_NOTINITIALIZED;
+
+       if (unlikely(ptr == NULL))
+               return ERR_WRONGPARAMETER;
+
+       if (unlikely(caller == NULL))
+               return ERR_WRONGPARAMETER;
+
+       probeBlockStart();
+
+       OBJECTHASH_LOCK;
+       k = kh_get(object, OBJECTHASH, (uint32_t)ptr);
+       if (unlikely(k == kh_end(OBJECTHASH)))          // there is no entry for key
+       {
+               ret = 0;
+       }
+       else
+       {
+               *caller = kh_value(OBJECTHASH, k);
+               ret = 1;
+       }
+       OBJECTHASH_UNLOCK;
+       probeBlockEnd();
+       return ret;
+}
+
+// return 0 if succeed
+// return 1 if there is no entry in hash
+// return negative value if other error occurred
+int add_object_hash(void* ptr, unsigned short caller)
+{
+       khiter_t k;
+       int rethash, ret = 0;
+
+       if (unlikely(OBJECTHASH == 0))
+               return ERR_NOTINITIALIZED;
+
+       if (unlikely(ptr == NULL))
+               return ERR_WRONGPARAMETER;
+
+       probeBlockStart();
+
+       OBJECTHASH_LOCK;
+       k = kh_put(object, OBJECTHASH, (uint32_t)ptr, &rethash);
+       if (likely(rethash != 0))       // entry is already in hash table
+       {
+               kh_value(OBJECTHASH, k) = caller;
+       }
+       else
+       {
+               // TODO : error handling
+               ret = 1;
+       }
+
        OBJECTHASH_UNLOCK;
        probeBlockEnd();
        return ret;
@@ -484,28 +605,28 @@ int add_object_hash_type(void* ptr, const char* type)
 // return 0 if succeed
 // return 1 if key is not in hash table
 // return negative value if other error occurred
-int del_object_hash(void* ptr)
+int del_object_hash(void* ptr, unsigned short *caller)
 {
        khiter_t k;
-       _objectinfo* val;
        int ret = 0;
 
-       if(unlikely(OBJECTHASH == 0))
+       if (unlikely(OBJECTHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
+               return ERR_WRONGPARAMETER;
+
+       if (unlikely(caller == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
+
        OBJECTHASH_LOCK;
        k = kh_get(object, OBJECTHASH, (uint32_t)ptr);
-       if(likely(k != kh_end(OBJECTHASH)))             // there is entry in hash table
+       if (likely(k != kh_end(OBJECTHASH)))            // there is entry in hash table
        {
-               val = kh_value(OBJECTHASH, k);
+               *caller = kh_value(OBJECTHASH, k);
                kh_del(object, OBJECTHASH, k);
-               if(likely(val->type != NULL)) free(val->type);
-               if(likely(val->name != NULL)) free(val->name);
-               free(val);
        }
        else
        {
@@ -528,20 +649,20 @@ int add_detector_hash(void* ptr, void* listener)
        khiter_t k;
        int rethash, ret = 0;
 
-       if(unlikely(DETECTORHASH == 0))
+       if (unlikely(DETECTORHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
-       if(unlikely(listener == NULL))
+       if (unlikely(listener == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
 
        DETECTORHASH_LOCK;
        k = kh_put(detector, DETECTORHASH, (uint32_t)ptr, &rethash);
-       if(likely(rethash != 0))        // succeed to add in hash table
+       if (likely(rethash != 0))       // succeed to add in hash table
        {
                kh_value(DETECTORHASH, k) = listener;
        }
@@ -563,16 +684,16 @@ int del_detector_hash(void* ptr)
        khiter_t k;
        int ret = 0;
 
-       if(unlikely(DETECTORHASH == 0))
+       if (unlikely(DETECTORHASH == 0))
                return ERR_NOTINITIALIZED;
 
-       if(unlikely(ptr == NULL))
+       if (unlikely(ptr == NULL))
                return ERR_WRONGPARAMETER;
 
        probeBlockStart();
        DETECTORHASH_LOCK;
        k = kh_get(detector, DETECTORHASH, (uint32_t)ptr);
-       if(likely(k != kh_end(DETECTORHASH)))           // there is entry in hash table
+       if (likely(k != kh_end(DETECTORHASH)))          // there is entry in hash table
        {
                kh_del(detector, DETECTORHASH, k);
        }
@@ -597,7 +718,7 @@ static element_t* find_element(char* key)
        element_t* res;
        int keylen;
 
-       if(unlikely(key == NULL))
+       if (unlikely(key == NULL))
                return NULL;
 
        keylen = strlen(key);
@@ -606,7 +727,7 @@ static element_t* find_element(char* key)
        res = gsymbol_list;
        while(res != NULL)
        {
-               if(keylen == res->keylen && (strcmp(key, res->keystr) == 0))
+               if (keylen == res->keylen && (strcmp(key, res->keystr) == 0))
                        break;
                res = res->next;
        }
@@ -620,25 +741,25 @@ int add_to_glist(char* key, void* data)
        element_t* elm;
        int ret = 0;
 
-       if(unlikely(key == NULL || data == NULL))
+       if (unlikely(key == NULL || data == NULL))
                return 0;
 
        pthread_mutex_lock(&glist_mutex);
        elm = find_element(key);
-       if(elm == NULL)
+       if (elm == NULL)
        {
                elm = (element_t*)malloc(sizeof(element_t));
-               if(likely(elm != NULL))
+               if (likely(elm != NULL))
                {
                        elm->keylen = strlen(key);
                        elm->keystr = (char*)malloc(elm->keylen + 1);
-                       if(likely(elm->keystr != NULL))
+                       if (likely(elm->keystr != NULL))
                        {
                                strcpy(elm->keystr, key);
                                elm->dataptr = data;
                                elm->next = gsymbol_list;
                                elm->prev = NULL;
-                               if(gsymbol_list)
+                               if (gsymbol_list)
                                        gsymbol_list->prev = elm;
                                gsymbol_list = elm;
                                ret = 1;
@@ -661,18 +782,18 @@ int remove_from_glist(char* key)
 
        pthread_mutex_lock(&glist_mutex);
        elm = find_element(key);
-       if(elm != NULL)
+       if (elm != NULL)
        {
-               if(elm->prev)
+               if (elm->prev)
                        elm->prev->next = elm->next;
-               if(elm->next)
+               if (elm->next)
                        elm->next->prev = elm->prev;
-               if(gsymbol_list == elm)
+               if (gsymbol_list == elm)
                        gsymbol_list = gsymbol_list->next;
        }
        pthread_mutex_unlock(&glist_mutex);
 
-       if(elm != NULL)
+       if (elm != NULL)
        {
                free(elm->dataptr);
                free(elm->keystr);
@@ -709,7 +830,7 @@ void* find_glist(char* key)
        elm = find_element(key);
        pthread_mutex_unlock(&glist_mutex);
 
-       if(elm)
+       if (elm)
                return elm->dataptr;
        else
                return NULL;
index 59ebce7..28631e1 100644 (file)
@@ -266,7 +266,7 @@ static char __attribute__((used)) *pack_ret(char *to, char ret_type, ...)
                        BUF_PTR = pack_int64(BUF_PTR, 0);               \
                } else {                                                \
                        char *type = NULL, *name = NULL;                \
-                       if (find_object_hash((void*)(control),          \
+                       if (find_uiobject_hash((void*)(control),        \
                                             &type, &name) == 1) {      \
                                BUF_PTR = pack_string(BUF_PTR, type);   \
                                BUF_PTR = pack_string(BUF_PTR, name);   \
@@ -312,7 +312,7 @@ static char __attribute__((used)) *pack_ret(char *to, char ret_type, ...)
                        BUF_PTR = pack_int64(BUF_PTR, 0);                               \
                } else {                                                                \
                        char *type = NULL, *name = NULL;                                \
-                       if (find_object_hash((void*)(pform), &type, &name) == 1) {      \
+                       if (find_uiobject_hash((void*)(pform), &type, &name) == 1) {    \
                                BUF_PTR = pack_string(BUF_PTR, name);                   \
                        } else {                                                        \
                                BUF_PTR = pack_string(BUF_PTR, "");                     \
@@ -324,7 +324,7 @@ static char __attribute__((used)) *pack_ret(char *to, char ret_type, ...)
                        BUF_PTR = pack_int64(BUF_PTR, 0);                               \
                } else {                                                                \
                        char *type = NULL, *name = NULL;                                \
-                       if (find_object_hash((void*)(ppanel), &type, &name) == 1) {     \
+                       if (find_uiobject_hash((void*)(ppanel), &type, &name) == 1) {   \
                                BUF_PTR = pack_string(BUF_PTR, name);                   \
                        } else {                                                        \
                                BUF_PTR = pack_string(BUF_PTR, "");                     \
index 8e62da3..f45aea4 100755 (executable)
@@ -47,6 +47,10 @@ extern "C"{
 #define MEMORYHASH_LOCK                pthread_mutex_lock(&(_hashinfo.memHashMutex))
 #define MEMORYHASH_UNLOCK      pthread_mutex_unlock(&(_hashinfo.memHashMutex))
 
+#define UIOBJECTHASH           _hashinfo.uiobjHash
+#define UIOBJECTHASH_LOCK      pthread_mutex_lock(&(_hashinfo.uiobjHashMutex))
+#define UIOBJECTHASH_UNLOCK    pthread_mutex_unlock(&(_hashinfo.uiobjHashMutex))
+
 #define OBJECTHASH                     _hashinfo.objHash
 #define OBJECTHASH_LOCK                pthread_mutex_lock(&(_hashinfo.objHashMutex))
 #define OBJECTHASH_UNLOCK      pthread_mutex_unlock(&(_hashinfo.objHashMutex))
@@ -74,18 +78,23 @@ extern "C"{
 #define MAKE_MEMINFO(caller, type, size)       \
        (((uint64_t)caller << 48) | ((uint64_t)type << 32) | ((uint64_t)size))
 
+#define OBJECT_INTERNAL        0x01
+#define OBJECT_EXTERNAL        0x02
+
 typedef struct
 {
        char* type;
        char* name;
-} _objectinfo;
+} _uiobjectinfo;
 
 // khash table function definition
 KHASH_MAP_INIT_INT(symbol, char*)
 
 KHASH_MAP_INIT_INT(allocmap, uint64_t)
 
-KHASH_MAP_INIT_INT(object, _objectinfo*)
+KHASH_MAP_INIT_INT(uiobject, _uiobjectinfo*)
+
+KHASH_MAP_INIT_INT(object, unsigned short)
 
 KHASH_MAP_INIT_INT(detector, void*)
 
@@ -95,6 +104,8 @@ typedef struct
        pthread_mutex_t         symHashMutex;
        khash_t(allocmap)*      memHash;
        pthread_mutex_t         memHashMutex;
+       khash_t(uiobject)*      uiobjHash;
+       pthread_mutex_t         uiobjHashMutex;
        khash_t(object)*        objHash;
        pthread_mutex_t         objHashMutex;
        khash_t(detector)*      dttHash;
@@ -118,10 +129,14 @@ int add_symbol_hash(void* ptr, const char* str, int strlen);
 int add_memory_hash(void* ptr, size_t size, unsigned short type, unsigned short caller);
 int del_memory_hash(void* ptr, unsigned short type, unsigned short* caller);
 
-int find_object_hash(void* ptr, char** type,  char** classname);
-int add_object_hash_class(void* ptr, const char* classname);
-int add_object_hash_type(void* ptr, const char* type);
-int del_object_hash(void* ptr);
+int find_uiobject_hash(void* ptr, char** type,  char** classname);
+int add_uiobject_hash_class(void* ptr, const char* classname);
+int add_uiobject_hash_type(void* ptr, const char* type);
+int del_uiobject_hash(void* ptr);
+
+int find_object_hash(void* ptr, unsigned short *caller);
+int add_object_hash(void* ptr, unsigned short caller);
+int del_object_hash(void* ptr, unsigned short *caller);
 
 int add_detector_hash(void* ptr, void* listener);
 int del_detector_hash(void* ptr);
index efbea65..83b9537 100755 (executable)
@@ -64,7 +64,7 @@ Control::Control(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui7ControlC2Ev, LIBOSP_UIFW, control_controlp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Control");
+       add_uiobject_hash_type((void*)this, "Control");
        probeBlockEnd();
 
        (this->*control_controlp)();
@@ -78,7 +78,7 @@ Control::~Control(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui7ControlD2Ev, LIBOSP_UIFW, control__controlvoidp);
 
        probeBlockStart();
-       del_object_hash(static_cast<void*>(this));
+       del_uiobject_hash(static_cast<void*>(this));
        probeBlockEnd();
 
        (this->*control__controlvoidp)();
@@ -92,7 +92,7 @@ CustomControlBase::CustomControlBase(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui17CustomControlBaseC2Ev, LIBOSP_UIFW, customcontrolbase_customcontrolbasep);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "CustomControlBase");
+       add_uiobject_hash_type((void*)this, "CustomControlBase");
        probeBlockEnd();
 
        (this->*customcontrolbase_customcontrolbasep)();
@@ -106,7 +106,7 @@ Container::Container(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui9ContainerC2Ev, LIBOSP_UIFW, container_containerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Container");
+       add_uiobject_hash_type((void*)this, "Container");
        probeBlockEnd();
 
        (this->*container_containerp)();
@@ -120,7 +120,7 @@ Window::Window(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui6WindowC2Ev, LIBOSP_UIFW, window_windowp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Window");
+       add_uiobject_hash_type((void*)this, "Window");
        probeBlockEnd();
 
        (this->*window_windowp)();
@@ -401,7 +401,7 @@ Animation::Animation(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls9AnimationC2Ev, LIBOSP_UIFW, animation_animationp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Animation");
+       add_uiobject_hash_type((void*)this, "Animation");
        probeBlockEnd();
 
        (this->*animation_animationp)();
@@ -415,7 +415,7 @@ Button::Button(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls6ButtonC2Ev, LIBOSP_UIFW, button_buttonp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Button");
+       add_uiobject_hash_type((void*)this, "Button");
        probeBlockEnd();
 
        (this->*button_buttonp)();
@@ -429,7 +429,7 @@ CheckButton::CheckButton(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls11CheckButtonC2Ev, LIBOSP_UIFW, checkbutton_checkbuttonp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "CheckButton");
+       add_uiobject_hash_type((void*)this, "CheckButton");
        probeBlockEnd();
 
        (this->*checkbutton_checkbuttonp)();
@@ -443,7 +443,7 @@ ColorPicker::ColorPicker(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls11ColorPickerC2Ev, LIBOSP_UIFW, colorpicker_colorpickerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "ColorPicker");
+       add_uiobject_hash_type((void*)this, "ColorPicker");
        probeBlockEnd();
 
        (this->*colorpicker_colorpickerp)();
@@ -457,7 +457,7 @@ CustomList::CustomList(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10CustomListC2Ev, LIBOSP_UIFW, customlist_customlistp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "CustomList");
+       add_uiobject_hash_type((void*)this, "CustomList");
        probeBlockEnd();
 
        (this->*customlist_customlistp)();
@@ -471,7 +471,7 @@ EditArea::EditArea(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls8EditAreaC2Ev, LIBOSP_UIFW, editarea_editareap);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "EditArea");
+       add_uiobject_hash_type((void*)this, "EditArea");
        probeBlockEnd();
 
        (this->*editarea_editareap)();
@@ -485,7 +485,7 @@ EditDate::EditDate(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls8EditDateC2Ev, LIBOSP_UIFW, editdate_editdatep);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "EditDate");
+       add_uiobject_hash_type((void*)this, "EditDate");
        probeBlockEnd();
 
        (this->*editdate_editdatep)();
@@ -499,7 +499,7 @@ EditField::EditField(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls9EditFieldC2Ev, LIBOSP_UIFW, editfield_editfieldp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "EditField");
+       add_uiobject_hash_type((void*)this, "EditField");
        probeBlockEnd();
 
        (this->*editfield_editfieldp)();
@@ -513,7 +513,7 @@ EditTime::EditTime(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls8EditTimeC2Ev, LIBOSP_UIFW, edittime_edittimep);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "EditTime");
+       add_uiobject_hash_type((void*)this, "EditTime");
        probeBlockEnd();
 
        (this->*edittime_edittimep)();
@@ -527,7 +527,7 @@ ExpandableEditArea::ExpandableEditArea(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls18ExpandableEditAreaC2Ev, LIBOSP_UIFW, expandableeditarea_expandableeditareap);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "ExpandableEditArea");
+       add_uiobject_hash_type((void*)this, "ExpandableEditArea");
        probeBlockEnd();
 
        (this->*expandableeditarea_expandableeditareap)();
@@ -541,7 +541,7 @@ ExpandableList::ExpandableList(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls14ExpandableListC2Ev, LIBOSP_UIFW, expandablelist_expandablelistp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "ExpandableList");
+       add_uiobject_hash_type((void*)this, "ExpandableList");
        probeBlockEnd();
 
        (this->*expandablelist_expandablelistp)();
@@ -555,7 +555,7 @@ Footer::Footer(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls6FooterC2Ev, LIBOSP_UIFW, footer_footerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Footer");
+       add_uiobject_hash_type((void*)this, "Footer");
        probeBlockEnd();
 
        (this->*footer_footerp)();
@@ -569,7 +569,7 @@ Gallery::Gallery(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls7GalleryC2Ev, LIBOSP_UIFW, gallery_galleryp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Gallery");
+       add_uiobject_hash_type((void*)this, "Gallery");
        probeBlockEnd();
 
        (this->*gallery_galleryp)();
@@ -583,7 +583,7 @@ GroupedList::GroupedList(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls11GroupedListC2Ev, LIBOSP_UIFW, groupedlist_groupedlistp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "GroupedList");
+       add_uiobject_hash_type((void*)this, "GroupedList");
        probeBlockEnd();
 
        (this->*groupedlist_groupedlistp)();
@@ -597,7 +597,7 @@ GroupedListView::GroupedListView(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls15GroupedListViewC2Ev, LIBOSP_UIFW, groupedlistview_groupedlistviewp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "GroupedListView");
+       add_uiobject_hash_type((void*)this, "GroupedListView");
        probeBlockEnd();
 
        (this->*groupedlistview_groupedlistviewp)();
@@ -611,7 +611,7 @@ Header::Header(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls6HeaderC2Ev, LIBOSP_UIFW, header_headerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Header");
+       add_uiobject_hash_type((void*)this, "Header");
        probeBlockEnd();
 
        (this->*header_headerp)();
@@ -625,7 +625,7 @@ IconList::IconList(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls8IconListC2Ev, LIBOSP_UIFW, iconlist_iconlistp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "IconList");
+       add_uiobject_hash_type((void*)this, "IconList");
        probeBlockEnd();
 
        (this->*iconlist_iconlistp)();
@@ -639,7 +639,7 @@ IconListView::IconListView(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls12IconListViewC2Ev, LIBOSP_UIFW, iconlistview_iconlistviewp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "IconListView");
+       add_uiobject_hash_type((void*)this, "IconListView");
        probeBlockEnd();
 
        (this->*iconlistview_iconlistviewp)();
@@ -653,7 +653,7 @@ Label::Label(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls5LabelC2Ev, LIBOSP_UIFW, label_labelp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Label");
+       add_uiobject_hash_type((void*)this, "Label");
        probeBlockEnd();
 
        (this->*label_labelp)();
@@ -667,7 +667,7 @@ List::List(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls4ListC2Ev, LIBOSP_UIFW, list_listp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "List");
+       add_uiobject_hash_type((void*)this, "List");
        probeBlockEnd();
 
        (this->*list_listp)();
@@ -681,7 +681,7 @@ ListView::ListView(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls8ListViewC2Ev, LIBOSP_UIFW, listview_listviewp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "ListView");
+       add_uiobject_hash_type((void*)this, "ListView");
        probeBlockEnd();
 
        (this->*listview_listviewp)();
@@ -695,7 +695,7 @@ Progress::Progress(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls8ProgressC2Ev, LIBOSP_UIFW, progress_progressp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Progress");
+       add_uiobject_hash_type((void*)this, "Progress");
        probeBlockEnd();
 
        (this->*progress_progressp)();
@@ -709,7 +709,7 @@ RadioGroup::RadioGroup(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10RadioGroupC2Ev, LIBOSP_UIFW, radiogroup_radiogroupp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "RadioGroup");
+       add_uiobject_hash_type((void*)this, "RadioGroup");
        probeBlockEnd();
 
        (this->*radiogroup_radiogroupp)();
@@ -723,7 +723,7 @@ SearchBar::SearchBar(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls9SearchBarC2Ev, LIBOSP_UIFW, searchbar_searchbarp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "SearchBar");
+       add_uiobject_hash_type((void*)this, "SearchBar");
        probeBlockEnd();
 
        (this->*searchbar_searchbarp)();
@@ -737,7 +737,7 @@ SlidableGroupedList::SlidableGroupedList(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls19SlidableGroupedListC2Ev, LIBOSP_UIFW, slidablegroupedlist_slidablegroupedlistp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "SlidableGroupedList");
+       add_uiobject_hash_type((void*)this, "SlidableGroupedList");
        probeBlockEnd();
 
        (this->*slidablegroupedlist_slidablegroupedlistp)();
@@ -751,7 +751,7 @@ SlidableList::SlidableList(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls12SlidableListC2Ev, LIBOSP_UIFW, slidablelist_slidablelistp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "SlidableList");
+       add_uiobject_hash_type((void*)this, "SlidableList");
        probeBlockEnd();
 
        (this->*slidablelist_slidablelistp)();
@@ -765,7 +765,7 @@ Slider::Slider(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls6SliderC2Ev, LIBOSP_UIFW, slider_sliderp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Slider");
+       add_uiobject_hash_type((void*)this, "Slider");
        probeBlockEnd();
 
        (this->*slider_sliderp)();
@@ -779,7 +779,7 @@ SplitPanel::SplitPanel(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10SplitPanelC2Ev, LIBOSP_UIFW, splitpanel_splitpanelp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "SplitPanel");
+       add_uiobject_hash_type((void*)this, "SplitPanel");
        probeBlockEnd();
 
        (this->*splitpanel_splitpanelp)();
@@ -793,7 +793,7 @@ Tab::Tab(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls3TabC2Ev, LIBOSP_UIFW, tab_tabp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Tab");
+       add_uiobject_hash_type((void*)this, "Tab");
        probeBlockEnd();
 
        (this->*tab_tabp)();
@@ -807,7 +807,7 @@ TabBar::TabBar(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls6TabBarC2Ev, LIBOSP_UIFW, tabbar_tabbarp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TabBar");
+       add_uiobject_hash_type((void*)this, "TabBar");
        probeBlockEnd();
 
        (this->*tabbar_tabbarp)();
@@ -821,7 +821,7 @@ TextBox::TextBox(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls7TextBoxC2Ev, LIBOSP_UIFW, textbox_textboxp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TextBox");
+       add_uiobject_hash_type((void*)this, "TextBox");
        probeBlockEnd();
 
        (this->*textbox_textboxp)();
@@ -835,7 +835,7 @@ Form::Form(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls4FormC2Ev, LIBOSP_UIFW, form_formp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Form");
+       add_uiobject_hash_type((void*)this, "Form");
        probeBlockEnd();
 
        (this->*form_formp)();
@@ -849,7 +849,7 @@ GroupedTableView::GroupedTableView(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls16GroupedTableViewC2Ev, LIBOSP_UIFW, groupedtableview_groupedtableviewp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "GroupedTableView");
+       add_uiobject_hash_type((void*)this, "GroupedTableView");
        probeBlockEnd();
 
        (this->*groupedtableview_groupedtableviewp)();
@@ -863,7 +863,7 @@ Panel::Panel(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls5PanelC2Ev, LIBOSP_UIFW, panel_panelp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Panel");
+       add_uiobject_hash_type((void*)this, "Panel");
        probeBlockEnd();
 
        (this->*panel_panelp)();
@@ -877,7 +877,7 @@ OverlayPanel::OverlayPanel(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls12OverlayPanelC2Ev, LIBOSP_UIFW, overlaypanel_overlaypanelp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "OverlayPanel");
+       add_uiobject_hash_type((void*)this, "OverlayPanel");
        probeBlockEnd();
 
        (this->*overlaypanel_overlaypanelp)();
@@ -891,7 +891,7 @@ ScrollPanel::ScrollPanel(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls11ScrollPanelC2Ev, LIBOSP_UIFW, scrollpanel_scrollpanelp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "ScrollPanel");
+       add_uiobject_hash_type((void*)this, "ScrollPanel");
        probeBlockEnd();
 
        (this->*scrollpanel_scrollpanelp)();
@@ -905,7 +905,7 @@ SectionTableView::SectionTableView(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls16SectionTableViewC2Ev, LIBOSP_UIFW, sectiontableview_sectiontableviewp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "SectionTableView");
+       add_uiobject_hash_type((void*)this, "SectionTableView");
        probeBlockEnd();
 
        (this->*sectiontableview_sectiontableviewp)();
@@ -919,7 +919,7 @@ TableView::TableView(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls9TableViewC2Ev, LIBOSP_UIFW, tableview_tableviewp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableView");
+       add_uiobject_hash_type((void*)this, "TableView");
        probeBlockEnd();
 
        (this->*tableview_tableviewp)();
@@ -933,7 +933,7 @@ TableViewItemBase::TableViewItemBase(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls17TableViewItemBaseC2Ev, LIBOSP_UIFW, tableviewitembase_tableviewitembasep);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableViewItemBase");
+       add_uiobject_hash_type((void*)this, "TableViewItemBase");
        probeBlockEnd();
 
        (this->*tableviewitembase_tableviewitembasep)();
@@ -947,7 +947,7 @@ TableViewContextItem::TableViewContextItem(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls20TableViewContextItemC2Ev, LIBOSP_UIFW, tableviewcontextitem_tableviewcontextitemp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableViewContextItem");
+       add_uiobject_hash_type((void*)this, "TableViewContextItem");
        probeBlockEnd();
 
        (this->*tableviewcontextitem_tableviewcontextitemp)();
@@ -961,7 +961,7 @@ TableViewGroupItem::TableViewGroupItem(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls18TableViewGroupItemC2Ev, LIBOSP_UIFW, tableviewgroupitem_tableviewgroupitemp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableViewGroupItem");
+       add_uiobject_hash_type((void*)this, "TableViewGroupItem");
        probeBlockEnd();
 
        (this->*tableviewgroupitem_tableviewgroupitemp)();
@@ -975,7 +975,7 @@ TableViewItem::TableViewItem(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls13TableViewItemC2Ev, LIBOSP_UIFW, tableviewitem_tableviewitemp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableViewItem");
+       add_uiobject_hash_type((void*)this, "TableViewItem");
        probeBlockEnd();
 
        (this->*tableviewitem_tableviewitemp)();
@@ -989,7 +989,7 @@ TableViewSimpleGroupItem::TableViewSimpleGroupItem(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls24TableViewSimpleGroupItemC2Ev, LIBOSP_UIFW, tableviewsimplegroupitem_tableviewsimplegroupitemp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableViewSimpleGroupItem");
+       add_uiobject_hash_type((void*)this, "TableViewSimpleGroupItem");
        probeBlockEnd();
 
        (this->*tableviewsimplegroupitem_tableviewsimplegroupitemp)();
@@ -1003,7 +1003,7 @@ TableViewSimpleItem::TableViewSimpleItem(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls19TableViewSimpleItemC2Ev, LIBOSP_UIFW, tableviewsimpleitem_tableviewsimpleitemp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TableViewSimpleItem");
+       add_uiobject_hash_type((void*)this, "TableViewSimpleItem");
        probeBlockEnd();
 
        (this->*tableviewsimpleitem_tableviewsimpleitemp)();
@@ -1017,7 +1017,7 @@ ContextMenu::ContextMenu(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls11ContextMenuC2Ev, LIBOSP_UIFW, contextmenu_contextmenup);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "ContextMenu");
+       add_uiobject_hash_type((void*)this, "ContextMenu");
        probeBlockEnd();
 
        (this->*contextmenu_contextmenup)();
@@ -1031,7 +1031,7 @@ DatePicker::DatePicker(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10DatePickerC2Ev, LIBOSP_UIFW, datepicker_datepickerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "DatePicker");
+       add_uiobject_hash_type((void*)this, "DatePicker");
        probeBlockEnd();
 
        (this->*datepicker_datepickerp)();
@@ -1045,7 +1045,7 @@ DateTimePicker::DateTimePicker(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls14DateTimePickerC2Ev, LIBOSP_UIFW, datetimepicker_datetimepickerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "DateTimePicker");
+       add_uiobject_hash_type((void*)this, "DateTimePicker");
        probeBlockEnd();
 
        (this->*datetimepicker_datetimepickerp)();
@@ -1059,7 +1059,7 @@ Frame::Frame(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls5FrameC2Ev, LIBOSP_UIFW, frame_framep);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Frame");
+       add_uiobject_hash_type((void*)this, "Frame");
        probeBlockEnd();
 
        (this->*frame_framep)();
@@ -1073,7 +1073,7 @@ Keypad::Keypad(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls6KeypadC2Ev, LIBOSP_UIFW, keypad_keypadp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Keypad");
+       add_uiobject_hash_type((void*)this, "Keypad");
        probeBlockEnd();
 
        (this->*keypad_keypadp)();
@@ -1087,7 +1087,7 @@ MessageBox::MessageBox(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10MessageBoxC2Ev, LIBOSP_UIFW, messagebox_messageboxp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "MessageBox");
+       add_uiobject_hash_type((void*)this, "MessageBox");
        probeBlockEnd();
 
        (this->*messagebox_messageboxp)();
@@ -1101,7 +1101,7 @@ OptionMenu::OptionMenu(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10OptionMenuC2Ev, LIBOSP_UIFW, optionmenu_optionmenup);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "OptionMenu");
+       add_uiobject_hash_type((void*)this, "OptionMenu");
        probeBlockEnd();
 
        (this->*optionmenu_optionmenup)();
@@ -1115,7 +1115,7 @@ Popup::Popup(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls5PopupC2Ev, LIBOSP_UIFW, popup_popupp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Popup");
+       add_uiobject_hash_type((void*)this, "Popup");
        probeBlockEnd();
 
        (this->*popup_popupp)();
@@ -1129,7 +1129,7 @@ TimePicker::TimePicker(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen2Ui8Controls10TimePickerC2Ev, LIBOSP_UIFW, timepicker_timepickerp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "TimePicker");
+       add_uiobject_hash_type((void*)this, "TimePicker");
        probeBlockEnd();
 
        (this->*timepicker_timepickerp)();
@@ -1155,7 +1155,7 @@ Web::Web(void)
        GET_REAL_FUNC_TIZEN(_ZN5Tizen3Web8Controls3WebC2Ev, LIBOSP_WEB, web_webp);
 
        probeBlockStart();
-       add_object_hash_type((void*)this, "Web");
+       add_uiobject_hash_type((void*)this, "Web");
        probeBlockEnd();
 
        (this->*web_webp)();
index 4db822e..fd473f8 100755 (executable)
@@ -137,7 +137,7 @@ bool Control::IsInTouchMode(void) const
        GET_REAL_FUNC_TIZEN(_ZNK5Tizen2Ui7Control13IsInTouchModeEv, LIBOSP_UIFW, control_isintouchmodep);
 
        probeBlockStart();
-       add_object_hash_class((void*)(this), typeid(*this).name());
+       add_uiobject_hash_class((void*)(this), typeid(*this).name());
        probeBlockEnd();
 
        return (this->*control_isintouchmodep)();
@@ -183,12 +183,12 @@ result Container::AddControl(const Control &control)
        if(unlikely(IsRegisteredFrameAnimatorEventListener == false))
        {
                char *type = NULL, *classname = NULL;
-               if(likely(find_object_hash((void*)this, &type, &classname) == 1))       // there is entry in object hash
+               if (likely(find_uiobject_hash((void*)this, &type, &classname) == 1))    // there is entry in object hash
                {
-                       if(strcmp(type, "Frame") == 0)
+                       if (strcmp(type, "Frame") == 0)
                        {
                                FrameAnimator* fa = ((Frame*)this)->GetFrameAnimator();
-                               if(fa != NULL)
+                               if (fa != NULL)
                                {
                                        fa->AddFrameAnimatorEventListener(GetFrameAnimatorEventListener());
                                        IsRegisteredFrameAnimatorEventListener = true;
@@ -236,12 +236,12 @@ result Container::AddControl(Control* control)
        if(unlikely(IsRegisteredFrameAnimatorEventListener == false))
        {
                char *type = NULL, *classname = NULL;
-               if(likely(find_object_hash((void*)this, &type, &classname) == 1))       // there is entry in object hash
+               if (likely(find_uiobject_hash((void*)this, &type, &classname) == 1))    // there is entry in object hash
                {
-                       if(strcmp(type, "Frame") == 0)
+                       if (strcmp(type, "Frame") == 0)
                        {
                                FrameAnimator* fa = ((Frame*)this)->GetFrameAnimator();
-                               if(fa != NULL)
+                               if (fa != NULL)
                                {
                                        fa->AddFrameAnimatorEventListener(GetFrameAnimatorEventListener());
                                        IsRegisteredFrameAnimatorEventListener = true;
@@ -329,7 +329,6 @@ result Container::RemoveControl(Control* control)
        PACK_COMMON_END('x', ret, 0, 0);
        PACK_UICONTROL(this);
        PACK_UICONTROL(control);
-
        PRE_PROBEBLOCK_END();
 
        ret = (this->*container_removecontrolp)(control);
index dda8131..078b5f7 100755 (executable)
@@ -35,6 +35,7 @@
 #include "daprobe.h"
 #include "probeinfo.h"
 #include "dahelper.h"
+#include "dacollection.h"
 
 #include "binproto.h"
 
@@ -71,17 +72,22 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Constructp)(filePath, openMode, createParentDirectories);
 
-       if(postBlockBegin(blockresult)) {
+       if (gProbeBlockCount == 0 && blockresult)
+       {
+               add_object_hash((void*)this, OBJECT_EXTERNAL);
+       }
+
+       if (postBlockBegin(blockresult)) {
                char buffer[PATH_MAX];
 
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp_path,filePath.GetPointer());
                WcharToChar(temp_mode,openMode.GetPointer());
@@ -114,12 +120,12 @@ result File::Construct(const Tizen::Base::String& filePath,
        FileAttributes attr;
        long long size = 0L;
 
-       if(!Constructp) {
+       if (!Constructp) {
                probeBlockStart();
                void *tmpPtr = dlsym(RTLD_NEXT,
                                "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringES5_");
 
-               if(tmpPtr == NULL || dlerror() != NULL) {
+               if (tmpPtr == NULL || dlerror() != NULL) {
                        perror("dlsym failed : Tizen::Io::File::Construct");
                        exit(0);
                }
@@ -128,14 +134,19 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Constructp)(filePath, openMode);
 
-       if(postBlockBegin(blockresult)) {
+       if (gProbeBlockCount == 0 && blockresult)
+       {
+               add_object_hash((void*)this, OBJECT_EXTERNAL);
+       }
+
+       if (postBlockBegin(blockresult)) {
                char buffer[PATH_MAX];
 
                WcharToChar(temp_path,filePath.GetPointer());
@@ -143,7 +154,7 @@ result File::Construct(const Tizen::Base::String& filePath,
                // Comment this because of fault during Internet application profiling
                // (it closes unexpectedly) but for DATizenTestApp it is ok
                // There is the same problem at File::~File(void)
-               //if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               //if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                //      size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
@@ -173,12 +184,12 @@ result File::Construct(const Tizen::Base::String& filePath,
        FileAttributes attr;
        long long size = 0L;
 
-       if(!Constructp) {
+       if (!Constructp) {
                probeBlockStart();
                void *tmpPtr = dlsym(RTLD_NEXT,
                                "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringEPKc");
 
-               if(tmpPtr == NULL || dlerror() != NULL) {
+               if (tmpPtr == NULL || dlerror() != NULL) {
                        perror("dlsym failed : Tizen::Io::File::Construct");
                        exit(0);
                }
@@ -187,18 +198,23 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Constructp)(filePath, pOpenMode);
 
-       if(postBlockBegin(blockresult)) {
+       if (gProbeBlockCount == 0 && blockresult)
+       {
+               add_object_hash((void*)this, OBJECT_EXTERNAL);
+       }
+
+       if (postBlockBegin(blockresult)) {
                char buffer[PATH_MAX];
 
                WcharToChar(temp,filePath.GetPointer());
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
@@ -231,13 +247,13 @@ result File::Construct(const Tizen::Base::String& filePath,
        FileAttributes attr;
        long long size = 0L;
 
-       if(!Constructp) {
+       if (!Constructp) {
                probeBlockStart();
 
                void *tmpPtr = dlsym(RTLD_NEXT,
                                                "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringEPKcRKNS2_10ByteBufferE");
 
-               if(tmpPtr == NULL || dlerror() != NULL) {
+               if (tmpPtr == NULL || dlerror() != NULL) {
                        perror("dlsym failed : Tizen::Io::File::Construct");
                        exit(0);
                }
@@ -246,16 +262,21 @@ result File::Construct(const Tizen::Base::String& filePath,
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Constructp)(filePath, pOpenMode, secretKey);
 
-       if(postBlockBegin(blockresult)) {
+       if (gProbeBlockCount == 0 && blockresult)
+       {
+               add_object_hash((void*)this, OBJECT_EXTERNAL);
+       }
+
+       if (postBlockBegin(blockresult)) {
                WcharToChar(temp,filePath.GetPointer());
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
@@ -298,16 +319,16 @@ result File::Flush(void) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Flushp)();
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                WcharToChar(temp,this->GetName().GetPointer());
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
@@ -349,7 +370,7 @@ Tizen::Base::String File::GetName(void) const{
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -357,7 +378,7 @@ Tizen::Base::String File::GetName(void) const{
        ret = (this->*GetNamep)();
        result res = GetLastResult();
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                WcharToChar(temp,ret.GetPointer());
                if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
@@ -403,9 +424,9 @@ result File::Read(Tizen::Base::String& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
 
@@ -422,9 +443,9 @@ result File::Read(Tizen::Base::String& buffer) {
 
        ret = (this->*Readp)(buffer);
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
                nRead = buffer.GetLength();
@@ -470,9 +491,9 @@ result File::Read(Tizen::Base::ByteBuffer& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
 
@@ -489,9 +510,9 @@ result File::Read(Tizen::Base::ByteBuffer& buffer) {
 
        ret = (this->*Readp)(buffer);
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
                buffer.GetInt(nRead);
@@ -536,10 +557,10 @@ int File::Read(void *buffer, int length) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nRead = Tell();
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
 
@@ -557,9 +578,9 @@ int File::Read(void *buffer, int length) {
        ret = (this->*Readp)(buffer, length);
        result res = GetLastResult();
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
                nRead = Tell() - nRead;
@@ -606,26 +627,26 @@ result File::Seek(FileSeekPosition position, long offset) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Seekp)(position, offset);
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
 
-                if(FILESEEKPOSITION_BEGIN == position)
+                if (FILESEEKPOSITION_BEGIN == position)
                         strcpy(temp_pos, "FILESEEKPOSITION_BEGIN");
-                else if(FILESEEKPOSITION_CURRENT == position)
+                else if (FILESEEKPOSITION_CURRENT == position)
                         strcpy(temp_pos, "FILESEEKPOSITION_CURRENT");
-                else if(FILESEEKPOSITION_END == position)
+                else if (FILESEEKPOSITION_END == position)
                         strcpy(temp_pos, "FILESEEKPOSITION_END");
                 else
 
                sprintf(temp_pos, "%d", position);
 
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
 
@@ -669,7 +690,7 @@ int File::Tell(void) const {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
@@ -677,8 +698,8 @@ int File::Tell(void) const {
        ret = (this->*Tellp)();
        result res = GetLastResult();
 
-       if(postBlockBegin(blockresult)) {
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+       if (postBlockBegin(blockresult)) {
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp,this->GetName().GetPointer());
 
@@ -721,15 +742,15 @@ result File::Truncate(int length) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                preBlockEnd();
        }
 
        ret = (this->*Truncatep)(length);
 
-       if(postBlockBegin(blockresult)) {
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+       if (postBlockBegin(blockresult)) {
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp,this->GetName().GetPointer());
 
@@ -773,10 +794,10 @@ result File::Write(const void *buffer, int length) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nWritten = Tell();
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
 
@@ -793,9 +814,9 @@ result File::Write(const void *buffer, int length) {
 
        ret = (this->*Writep)(buffer, length);
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp, this->GetName().GetPointer());
                nWritten = Tell() - nWritten;
@@ -840,10 +861,10 @@ result File::Write(const Tizen::Base::ByteBuffer& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nWritten = Tell();
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp,this->GetName().GetPointer());
 
@@ -860,9 +881,9 @@ result File::Write(const Tizen::Base::ByteBuffer& buffer) {
 
        ret = (this->*Writep)(buffer);
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                setProbePoint(&probeInfo);
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp,this->GetName().GetPointer());
                nWritten = Tell() - nWritten;
@@ -908,11 +929,11 @@ result File::Write(const Tizen::Base::String& buffer) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
                nWritten = Tell();
                WcharToChar(temp_buf, buffer.GetPointer());
-               if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
                        size = attr.GetFileSize();
                WcharToChar(temp_path, this->GetName().GetPointer());
 
@@ -929,12 +950,12 @@ result File::Write(const Tizen::Base::String& buffer) {
 
        ret = (this->*Writep)(buffer);
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
                setProbePoint(&probeInfo);
                WcharToChar(temp_buf,buffer.GetPointer());
                WcharToChar(temp_path,this->GetName().GetPointer());
                nWritten = Tell() - nWritten;
-               if(E_SUCCESS == File::GetAttributes(this->GetName(),attr))
+               if (E_SUCCESS == File::GetAttributes(this->GetName(),attr))
                        size = attr.GetFileSize();
                nWritten = Tell() - nWritten;
 
@@ -960,6 +981,8 @@ File::~File(void) {
        void *tmpPtr;
        // FileAttributes attr;
        long long size = 0L;
+       unsigned short caller;
+       int ret;
 
        if (!FileDp) {
                probeBlockStart();
@@ -975,7 +998,7 @@ File::~File(void) {
                probeBlockEnd();
        }
 
-       if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
+       if ((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
 // error occur if File class was failed to contruct
                // if (ret == E_SUCCESS &&
@@ -984,9 +1007,22 @@ File::~File(void) {
                preBlockEnd();
        }
 
+       if (gProbeBlockCount == 0)
+       {
+               probeBlockStart();
+               ret = del_object_hash((void*)this, &caller);
+               if (blockresult == 0 && ret == 0 && caller == OBJECT_EXTERNAL)
+               {
+                       setProbePoint(&probeInfo);
+                       blockresult = 2;
+                       probingStart();
+               }
+               probeBlockEnd();
+       }
+
        (this->*FileDp)();
 
-       if(postBlockBegin(blockresult)) {
+       if (postBlockBegin(blockresult)) {
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
index 8577643..525016e 100755 (executable)
@@ -60,36 +60,36 @@ static Tizen::Graphics::Bitmap* sysutil_capture_screen()
        result r;
        Bitmap* pBitmap = NULL;
 
-       if(unlikely(utilx_create_screen_shotp == NULL))
+       if (unlikely(utilx_create_screen_shotp == NULL))
        {
                void* lib_handle = dlopen(LIBUTILX, RTLD_LAZY);
-               if(lib_handle == NULL) {
+               if (lib_handle == NULL) {
                        SetLastResult(ERR_DLOPEN);
                        return NULL;
                }
                utilx_create_screen_shotp = (utilx_create_screen_shot_type)dlsym(lib_handle, "utilx_create_screen_shot");
-               if(utilx_create_screen_shotp == NULL || dlerror() != NULL) {
+               if (utilx_create_screen_shotp == NULL || dlerror() != NULL) {
                        SetLastResult(ERR_DLSYM);
                        return NULL;
                }
        }
 
-       if(unlikely(utilx_release_screen_shotp == NULL))
+       if (unlikely(utilx_release_screen_shotp == NULL))
        {
                void* lib_handle = dlopen(LIBUTILX, RTLD_LAZY);
-               if(lib_handle == NULL) {
+               if (lib_handle == NULL) {
                        SetLastResult(ERR_DLOPEN);
                        return NULL;
                }
                utilx_release_screen_shotp = (utilx_release_screen_shot_type)dlsym(lib_handle, "utilx_release_screen_shot");
-               if(utilx_release_screen_shotp == NULL || dlerror() != NULL) {
+               if (utilx_release_screen_shotp == NULL || dlerror() != NULL) {
                        SetLastResult(ERR_DLSYM);
                        return NULL;
                }
        }
 
        Display* pDpy = XOpenDisplay(NULL);
-       if(pDpy == NULL)
+       if (pDpy == NULL)
        {
                SetLastResult(ERR_USER - 1);
                return NULL;
@@ -99,18 +99,18 @@ static Tizen::Graphics::Bitmap* sysutil_capture_screen()
        int height = DisplayHeight(pDpy, DefaultScreen(pDpy));
 
        void* pDump = utilx_create_screen_shotp(pDpy, width, height);
-       if(likely(pDump != NULL))
+       if (likely(pDump != NULL))
        {
                ByteBuffer buffer;
                r = buffer.Construct(static_cast<byte*>(pDump), 0, width*height*4, width*height*4);\
-               if(likely(r == E_SUCCESS))
+               if (likely(r == E_SUCCESS))
                {
                        Tizen::Graphics::Dimension dim(width, height);
                        Bitmap* pBitmap  = new Bitmap();
-                       if(likely(pBitmap != NULL))
+                       if (likely(pBitmap != NULL))
                        {
                                r = pBitmap->Construct(buffer, dim, BITMAP_PIXEL_FORMAT_ARGB8888);
-                               if(unlikely(r != E_SUCCESS))
+                               if (unlikely(r != E_SUCCESS))
                                {
                                        SetLastResult(r);
                                        delete pBitmap;
@@ -136,14 +136,14 @@ static Bitmap* getBitmapFromBuffer(void* pDump, int width, int height)
        Bitmap* pBitmap = NULL;
 
        r = buffer.Construct(static_cast<byte*>(pDump), 0, width*height*4, width*height*4);
-       if(likely(r == E_SUCCESS))
+       if (likely(r == E_SUCCESS))
        {
                Tizen::Graphics::Dimension dim(width, height);
                pBitmap  = new Bitmap();
-               if(likely(pBitmap != NULL))
+               if (likely(pBitmap != NULL))
                {
                        r = pBitmap->Construct(buffer, dim, BITMAP_PIXEL_FORMAT_ARGB8888);
-                       if(unlikely(r != E_SUCCESS))
+                       if (unlikely(r != E_SUCCESS))
                        {
                                SetLastResult(r);
                                delete pBitmap;
@@ -172,10 +172,10 @@ int captureScreen()
        probeBlockStart();
 
        capbuf = captureScreenShotX(&width, &height);
-       if(capbuf != NULL)
+       if (capbuf != NULL)
        {
                bitmap = getBitmapFromBuffer((void*)capbuf, width, height);
-               if(bitmap != NULL)
+               if (bitmap != NULL)
                {
                        String dstPath;
                        setProbePoint(&probeInfo);
@@ -183,7 +183,7 @@ int captureScreen()
                        dstPath.Format(MAX_PATH_LENGTH, L"/tmp/da/%d.jpg", probeInfo.eventIndex);
                        img.Construct();
                        r = img.EncodeToFile(*bitmap, IMG_FORMAT_JPG, dstPath, true);
-                       if(r == E_SUCCESS)
+                       if (r == E_SUCCESS)
                        {
                                INIT_LOG;
                                APPEND_LOG_BASIC_NAME(LC_SNAPSHOT, "captureScreen");
@@ -263,9 +263,9 @@ result Control::SetShowState(bool state)
        probeBlockStart();
        {
                char *type, *classname;
-               if(find_object_hash((void*)this, &type, &classname) == 1)
+               if (find_uiobject_hash((void*)this, &type, &classname) == 1)
                {
-                       if(strcmp(type, "Panel") == 0 || strcmp(type, "OverlayPanel") == 0 || strcmp(type, "ScrollPanel") == 0)
+                       if (strcmp(type, "Panel") == 0 || strcmp(type, "OverlayPanel") == 0 || strcmp(type, "ScrollPanel") == 0)
                        {
                                SCREENSHOT_SET();
 //                             SCREENSHOT_DONE();
index 311157a..2454790 100755 (executable)
@@ -35,7 +35,7 @@
 #include <FUi.h>
 
 #include "daprobe.h"
-#include "dacollection.h"      // for find_object_hash
+#include "dacollection.h"      // for find_uiobject_hash
 #include "dahelper.h"          // for captureScreen
 #include "tizen_probe.h"
 
@@ -66,9 +66,9 @@ void SceneManagerEventListener::OnSceneTransitionCompleted(const SceneId &previo
        {
                SceneManager* scenemanager = SceneManager::GetInstance();
 
-               if(scenemanager->GetCurrentSceneId() == currentSceneId)
+               if (scenemanager->GetCurrentSceneId() == currentSceneId)
                {
-                       if(isOptionEnabled(OPT_UI))
+                       if (isOptionEnabled(OPT_UI))
                        {
                                probeInfo_t     probeInfo;
                                Scene* scene;
@@ -145,9 +145,9 @@ SceneManager* SceneManager::GetInstance(void)
        ret = scenemanager_getinstancep();
 
        probeBlockStart();
-       if(unlikely(initialized == 0))
+       if (unlikely(initialized == 0))
        {
-               if(likely(ret != NULL))
+               if (likely(ret != NULL))
                {
                        ret->AddSceneManagerEventListener(SceneManagerEventListener::GetInstance());
                        initialized = 1;