From: Anastasia Lyupa Date: Thu, 20 Jun 2013 13:36:16 +0000 (+0400) Subject: remove pc, add define to rewrite return, add several UICONTROL probes X-Git-Tag: Tizen_SDK_2.3~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5348af3775d2add814216c8f3f5e88cda114f061;p=platform%2Fcore%2Fsystem%2Fswap-probe.git remove pc, add define to rewrite return, add several UICONTROL probes --- diff --git a/include/binproto.h b/include/binproto.h index 599340c..28764c5 100644 --- a/include/binproto.h +++ b/include/binproto.h @@ -144,6 +144,7 @@ static char *pack_args(char *to, const char *fmt, ...) } #define BUF_PTR p +#define RET_PTR ret_p #define PACK_INT32(val) \ BUF_PTR = pack_int32(BUF_PTR, val); #define PACK_INT64(val) \ @@ -161,12 +162,12 @@ static char *pack_args(char *to, const char *fmt, ...) BUF_PTR = pack_int32(BUF_PTR, getpid()); \ BUF_PTR = pack_int32(BUF_PTR, syscall(__NR_gettid)); \ BUF_PTR = pack_args(BUF_PTR, fmt, __VA_ARGS__); \ + RET_PTR = BUF_PTR; \ } while (0) -#define PACK_COMMON_END(ret, pc, errn, intern_call) \ +#define PACK_COMMON_END(ret, errn, intern_call) \ do { \ BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)(ret)); \ - BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)(pc)); \ BUF_PTR = pack_int32(BUF_PTR, (uint32_t)errn); \ BUF_PTR = pack_int32(BUF_PTR, (uint32_t)intern_call); \ BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)CALLER_ADDRESS); \ @@ -174,6 +175,9 @@ static char *pack_args(char *to, const char *fmt, ...) BUF_PTR = pack_int32(BUF_PTR, 0); \ } while (0) +#define PACK_RETURN_END(ret) \ + RET_PTR = pack_int64(RET_PTR, (uintptr_t)(ret)); + #define PACK_MEMORY(size, memory_api_type, addr) \ do { \ BUF_PTR = pack_int32(p, size); \ @@ -281,7 +285,8 @@ static char *pack_args(char *to, const char *fmt, ...) #define LOCAL_BUF_SIZE 1024 #define PREPARE_LOCAL_BUF() \ char buf[LOCAL_BUF_SIZE]; \ - char *p = buf; + char *p = buf; \ + char *ret_p = NULL; #define MSG_LEN_OFFSET 16 #define MSG_HDR_LEN 20 diff --git a/probe_badaapi/bada_lifecycle.cpp b/probe_badaapi/bada_lifecycle.cpp index 79c880a..1070b84 100755 --- a/probe_badaapi/bada_lifecycle.cpp +++ b/probe_badaapi/bada_lifecycle.cpp @@ -102,7 +102,7 @@ result UiApp::Execute(UiAppInstanceFactory pUiAppFactory, PREPARE_LOCAL_BUF(); PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE, LC_LIFECYCLE, "pp", pUiAppFactory, pArguments); - PACK_COMMON_END(ret, uiapp_executep, 0, 0); + PACK_COMMON_END(ret, 0, 0); FLUSH_LOCAL_BUF(); return ret; diff --git a/probe_badaapi/osp_controls.cpp b/probe_badaapi/osp_controls.cpp index a930fbf..1d12520 100755 --- a/probe_badaapi/osp_controls.cpp +++ b/probe_badaapi/osp_controls.cpp @@ -96,9 +96,7 @@ result UiApp::AddFrame(const Tizen::Ui::Controls::Frame& frame) PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, LC_UICREATE, "p", &frame); - // PACK_COMMON_END(ret, uiapp_addframep, 0); - // TODO: type cast for function pointer - PACK_COMMON_END(ret, 0, 0, 0); + PACK_COMMON_END(ret, 0, 0); PACK_UICONTROL(parent); PACK_UICONTROL(&frame); FLUSH_LOCAL_BUF(); @@ -117,6 +115,8 @@ result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame) result ret; bool bOption; + PREPARE_LOCAL_BUF(); + GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp11RemoveFrameERKNS_2Ui8Controls5FrameE, LIBOSP_UIFW, uiapp_removeframep); probeBlockStart(); @@ -131,6 +131,13 @@ result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame) APPEND_LOG_COMMON_NONE(CALLER_ADDRESS); APPEND_LOG_CONTROL_OSP(parent); APPEND_LOG_CONTROL_OSP(&frame); + + PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, + LC_UICREATE, + "p", &frame); + PACK_COMMON_END(0, 0, 0); + PACK_UICONTROL(parent); + PACK_UICONTROL(&frame); } probeBlockEnd(); @@ -144,6 +151,11 @@ result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame) } probeBlockEnd(); + if(bOption) + PACK_RETURN_END(ret); + + FLUSH_LOCAL_BUF(); + return ret; } @@ -194,11 +206,9 @@ void Control::SetName(const Tizen::Base::String &name) PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, LC_UICREATE, "p", this); - // PACK_COMMON_END(ret, uiapp_addframep, 0); - // TODO: type cast for function pointer - PACK_COMMON_END(0, 0, 0, 0); - PACK_UICONTROL(parent); + PACK_COMMON_END(0, 0, 0); PACK_UICONTROL(this); + PACK_UICONTROL(parent); FLUSH_LOCAL_BUF(); } probeBlockEnd(); @@ -252,6 +262,15 @@ result Container::AddControl(const Control &control) APPEND_LOG_CONTROL_OSP(this); APPEND_LOG_CONTROL_OSP(&control); printLog(&log, MSG_LOG); + + PREPARE_LOCAL_BUF(); + PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, + LC_UICREATE, + "p", this); + PACK_COMMON_END(ret, 0, 0); + PACK_UICONTROL(this); + PACK_UICONTROL(&control); + FLUSH_LOCAL_BUF(); } } probeBlockEnd(); @@ -267,6 +286,8 @@ result Container::RemoveControl(const Control &control) result ret; bool bOption; + PREPARE_LOCAL_BUF(); + GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlERKNS0_7ControlE, LIBOSP_UIFW, container_removecontrolp); probeBlockStart(); @@ -280,6 +301,13 @@ result Container::RemoveControl(const Control &control) APPEND_LOG_COMMON_NONE(CALLER_ADDRESS); APPEND_LOG_CONTROL_OSP(this); APPEND_LOG_CONTROL_OSP(&control); + + PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, + LC_UICREATE, + "p", this); + PACK_COMMON_END(0, 0, 0); + PACK_UICONTROL(this); + PACK_UICONTROL(&control); } probeBlockEnd(); @@ -293,6 +321,11 @@ result Container::RemoveControl(const Control &control) } probeBlockEnd(); + if(bOption) + PACK_RETURN_END(ret); + + FLUSH_LOCAL_BUF(); + return ret; } @@ -304,6 +337,8 @@ result Container::RemoveControl(int index) result ret; bool bOption; + PREPARE_LOCAL_BUF(); + GET_REAL_FUNC_OSP(_ZN5Tizen2Ui9Container13RemoveControlEi, LIBOSP_UIFW, container_removecontrolip); probeBlockStart(); @@ -318,6 +353,13 @@ result Container::RemoveControl(int index) APPEND_LOG_COMMON_NONE(CALLER_ADDRESS); APPEND_LOG_CONTROL_OSP(this); APPEND_LOG_CONTROL_OSP(pcontrol); + + PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, + LC_UICREATE, + "p", this); + PACK_COMMON_END(0, 0, 0); + PACK_UICONTROL(this); + PACK_UICONTROL(pcontrol); } probeBlockEnd(); @@ -331,6 +373,11 @@ result Container::RemoveControl(int index) } probeBlockEnd(); + if(bOption) + PACK_RETURN_END(ret); + + FLUSH_LOCAL_BUF(); + return ret; } @@ -353,6 +400,15 @@ void Container::RemoveAllControls(void) APPEND_LOG_CONTROL_OSP(this); APPEND_LOG_CONTROL_OSP(pcontrol); printLog(&log, MSG_LOG); + + PREPARE_LOCAL_BUF(); + PACK_COMMON_BEGIN(MSG_PROBE_UICONTROL, + LC_UICREATE, + "p", this); + PACK_COMMON_END(0, 0, 0); + PACK_UICONTROL(this); + PACK_UICONTROL(pcontrol); + FLUSH_LOCAL_BUF(); } probeBlockEnd(); diff --git a/probe_event/keytouch.c b/probe_event/keytouch.c index cefc028..db806ab 100755 --- a/probe_event/keytouch.c +++ b/probe_event/keytouch.c @@ -62,19 +62,15 @@ bool touch_pressed = false; printLog(&log, MSG_LOG) #define PACK_HW_EVENT(_EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA, \ - _FUNCNAME, _ARGDATA, _ARGTYPE, _ARGEVENT) \ - PREPARE_LOCAL_BUF(); \ - PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, LC_UIEVENT, "pdp", \ - _ARGDATA, _ARGTYPE, _ARGEVENT); \ - PACK_COMMON_END(0, _FUNCNAME, 0, 0); \ - PACK_UIEVENT(_EVENTTYPE, \ - _DETAILTYPE, \ - _X, \ - _Y, \ - _KEYCODE, \ - _EXTRA); \ - FLUSH_LOCAL_BUF(); - + _ARGDATA, _ARGTYPE, _ARGEVENT) \ + do { \ + PREPARE_LOCAL_BUF(); \ + PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, LC_UIEVENT, "pdp", \ + _ARGDATA, _ARGTYPE, _ARGEVENT); \ + PACK_COMMON_END(0, 0, 0); \ + PACK_UIEVENT(_EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA); \ + FLUSH_LOCAL_BUF(); \ + } while (0) Eina_Bool ecore_event_evas_key_down(void *data, int type, void *event) { @@ -93,7 +89,7 @@ Eina_Bool ecore_event_evas_key_down(void *data, int type, void *event) { HW_EVENT_LOG(_EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0); PACK_HW_EVENT(_EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0, \ - ecore_event_evas_key_down, data, type, event); + data, type, event); } } probeBlockEnd(); @@ -119,7 +115,7 @@ Eina_Bool ecore_event_evas_key_up(void *data, int type, void *event) { HW_EVENT_LOG(_EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0); PACK_HW_EVENT(_EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0, \ - ecore_event_evas_key_up, data, type, event); + data, type, event); } } probeBlockEnd(); @@ -144,7 +140,7 @@ Eina_Bool ecore_event_evas_mouse_button_down(void *data, int type, void *event) touch_pressed = true; HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device); PACK_HW_EVENT(_EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \ - ecore_event_evas_mouse_button_down, data, type, event); + data, type, event); } probeBlockEnd(); } @@ -168,7 +164,7 @@ Eina_Bool ecore_event_evas_mouse_button_up(void *data, int type, void *event) touch_pressed = false; HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device); PACK_HW_EVENT(_EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \ - ecore_event_evas_mouse_button_up, data, type, event); + data, type, event); } probeBlockEnd(); } @@ -193,7 +189,7 @@ Eina_Bool ecore_event_evas_mouse_move(void *data, int type, void *event) 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); PACK_HW_EVENT(_EVENT_TOUCH, _TOUCH_MOVED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \ - ecore_event_evas_mouse_move, data, type, event); + data, type, event); } } probeBlockEnd(); diff --git a/probe_memory/libdanew.cpp b/probe_memory/libdanew.cpp index bb5ee89..7f4b49e 100644 --- a/probe_memory/libdanew.cpp +++ b/probe_memory/libdanew.cpp @@ -70,7 +70,7 @@ void *operator new(std::size_t size) throw (std::bad_alloc) PREPARE_LOCAL_BUF(); PACK_COMMON_BEGIN(MSG_PROBE_MEMORY, LC_MEMORY, "d", size); - PACK_COMMON_END(pret, newp, newerrno, blockresult); + PACK_COMMON_END(pret, newerrno, blockresult); PACK_MEMORY(size, MEMORY_API_ALLOC, pret); FLUSH_LOCAL_BUF(); diff --git a/probe_thread/libdasync.c b/probe_thread/libdasync.c index 1d0532c..1b518d5 100644 --- a/probe_thread/libdasync.c +++ b/probe_thread/libdasync.c @@ -100,7 +100,7 @@ int pthread_mutex_lock(pthread_mutex_t *mutex) { PREPARE_LOCAL_BUF(); PACK_COMMON_BEGIN(MSG_PROBE_SYNC, LC_SYNC, "p", mutex); - PACK_COMMON_END(ret, pthread_mutex_lockp, errno, blockresult); + PACK_COMMON_END(ret, errno, blockresult); PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END); FLUSH_LOCAL_BUF();