Add field with function address to MSG_PROBE_ 34/96634/6
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Wed, 9 Nov 2016 12:30:44 +0000 (15:30 +0300)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Wed, 9 Nov 2016 13:41:58 +0000 (05:41 -0800)
MSG_PROBE Common columns change:

/---+-------------------+------+------------------\
| n | name              | size |     change       |
|---+-------------------+------+------------------|
| 1 | API ID            |  4   |      same        |
| 2 | PID               |  4   |                  |
| 3 | TID               |  4   |                  |
| 4 | args              |  var |                  |
| 5 | return            |  8   |                  |
| 6 | errno             |  8   |                  |
| 7 | Internal call     |  4   |                  |
| 8 | Caller_PC_address |  8   |                  |
|---+-------------------+------+------------------|
| 9 | reserved          |  4   | probe undefined  |
| 10| reserved          |  4   | instruction addr |
|   |                   |      | size 8 bytes     |
\---+-------------------+------+------------------/

Change-Id: I290c8aff071d84d7688044686bed268fc52d40c1
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
helper/common_probe_init.c
include/binproto.h
include/da_gles20.h
probe_capi/capi_appfw.c
probe_event/da_event.c
probe_event/gesture.c
probe_event/keytouch.c
probe_thread/libdathread.c

index c1bc8cb..08b7967 100644 (file)
@@ -174,6 +174,8 @@ void init_probe_gl(const char *func_name, void **func_pointer,
                        /* get max value */
                        char maxValString[64];
                        GLint maxVal[2];
+                       ElfW(Addr) orig = 0;
+
                        real_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVal[0]);
                        real_glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
                                           &maxVal[1]);
index 9e08a0f..4d8b890 100644 (file)
@@ -563,8 +563,7 @@ _ret CONCAT(PROBE_NAME(_name), _always)(FUNC_DECL(__VA_ARGS__))
                BUF_PTR = pack_int64(BUF_PTR, (uint64_t)errn);  /* errno */     \
                BUF_PTR = pack_int32(BUF_PTR, intern_call);     /* internal call*/      \
                BUF_PTR = pack_int64(BUF_PTR, caller); /*caller addr*/  \
-               BUF_PTR = pack_int32(BUF_PTR, 0);       /* reserved */          \
-               BUF_PTR = pack_int32(BUF_PTR, 0);       /* reserved */          \
+               BUF_PTR = pack_int64(BUF_PTR, orig);    /* original func addr */\
        } while (0)
 
 #endif
@@ -575,8 +574,7 @@ _ret CONCAT(PROBE_NAME(_name), _always)(FUNC_DECL(__VA_ARGS__))
                BUF_PTR = pack_int64(BUF_PTR, (uint64_t)errn);  /* errno */     \
                BUF_PTR = pack_int32(BUF_PTR, (uint32_t)0);     /* internal call*/      \
                BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)0); /*caller addr*/\
-               BUF_PTR = pack_int32(BUF_PTR, 0);       /* reserved */          \
-               BUF_PTR = pack_int32(BUF_PTR, 0);       /* reserved */          \
+               BUF_PTR = pack_int64(BUF_PTR, (uint64_t)0);     /* original func addr */\
        } while (0)
 
 #define PACK_RETURN_END(ret_type, ret)                                         \
index 93981fd..801488f 100644 (file)
@@ -124,6 +124,7 @@ extern EGLContext eglGetCurrentContext(void);
        GLenum error = GL_NO_ERROR;                                     \
        int32_t vAPI_ID = API_ID_ ## FUNCNAME;                          \
        uint64_t start_nsec = 0;                                        \
+       ElfW(Addr) orig = ElfW(Addr)(__gl_api->FUNCNAME);               \
        PRE_PROBEBLOCK();                                               \
        if(blockresult != 0)                                            \
                start_nsec = get_current_nsec();                        \
index e0f7e0b..94f811d 100644 (file)
@@ -63,6 +63,7 @@ static bool _ui_dalc_app_create(void *user_data)
        bool bret = false;
        DECLARE_ERRNO_VARS;
        int blockresult = 1;
+       ElfW(Addr) orig = (ElfW(Addr))(uiAppCallback.create);
 
        bret = uiAppCallback.create(user_data);
 
@@ -76,6 +77,7 @@ static void _ui_dalc_app_terminate(void *user_data)
 {
        DECLARE_ERRNO_VARS;
        int blockresult = 1;
+       ElfW(Addr) orig = (ElfW(Addr))(uiAppCallback.terminate);
 
        uiAppCallback.terminate(user_data);
 
@@ -87,6 +89,7 @@ static void _ui_dalc_app_pause(void *user_data)
 {
        DECLARE_ERRNO_VARS;
        int blockresult = 1;
+       ElfW(Addr) orig = (ElfW(Addr))(uiAppCallback.pause);
 
        uiAppCallback.pause(user_data);
 
@@ -98,6 +101,7 @@ static void _ui_dalc_app_resume(void *user_data)
 {
        DECLARE_ERRNO_VARS;
        int blockresult = 1;
+       ElfW(Addr) orig = (ElfW(Addr))(uiAppCallback.resume);
 
        uiAppCallback.resume(user_data);
 
@@ -109,6 +113,7 @@ static void _ui_dalc_app_control(app_control_h handle, void *user_data)
 {
        DECLARE_ERRNO_VARS;
        int blockresult = 1;
+       ElfW(Addr) orig = (ElfW(Addr))(uiAppCallback.app_control);
 
        uiAppCallback.app_control(handle, user_data);
 
index 20c0fb4..fa83c16 100755 (executable)
@@ -75,6 +75,8 @@ static int convert_angle(int angle)
 void on_orientation_changed(int angle, bool capi)
 {
        if (isOptionEnabled(OPT_EVENT)) {
+               ElfW(Addr) orig = 0;
+
                inc_current_event_index();
 
                PREPARE_LOCAL_BUF();
index 3e2d4d2..f941c84 100755 (executable)
@@ -201,6 +201,7 @@ Evas_Event_Flags __common_elm_gesture_layer_cb(void *data , void *event_info)
 {
        struct __elm_gesture_layer_cb_set_data *d = data;
        Evas_Event_Flags res;
+       ElfW(Addr) orig = 0;
 
        res = d->cb(d->data, event_info);
 
index 32415a9..ba924f8 100755 (executable)
@@ -61,6 +61,7 @@ static Ecore_Event_Handler *ecore_event_evas_handlers[5];
 #define PACK_HW_EVENT(API_ID, _EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA, \
        _ARGDATA, _ARGTYPE, _ARGEVENT)                                                                                          \
        do {                                                                                                                                            \
+               ElfW(Addr) orig = 0;                                            \
                inc_current_event_index();                                                                                              \
                PREPARE_LOCAL_BUF();                                                                                                    \
                PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, API_ID, "pdp",                                     \
index e896970..8a9de3c 100644 (file)
@@ -748,6 +748,7 @@ void _da_cleanup_handler(void *data)
        pthread_t pSelf;
        /* TODO Arch dependent */
        uint32_t caller;
+       ElfW(Addr) orig = 0;
 
        caller = (uint32_t)
            (__builtin_extract_return_addr(__builtin_return_address(0)));
@@ -783,6 +784,7 @@ void *_da_ThreadProc(void *params)
        int new_state = PTHREAD_CANCEL_DISABLE;
        /* TODO Arch dependent */
        uint32_t caller;
+       ElfW(Addr) orig = 0;
 
        caller = (uint32_t)
            (__builtin_extract_return_addr(__builtin_return_address(0)));