e_comp_wl: add ttrace for mouse/touch/key events 05/59205/3 accepted/tizen/ivi/20160218.024851 accepted/tizen/mobile/20160216.002231 accepted/tizen/tv/20160216.002248 accepted/tizen/wearable/20160216.002302 submit/tizen/20160215.064127 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000005
authorDuna Oh <duna.oh@samsung.com>
Thu, 11 Feb 2016 10:11:33 +0000 (19:11 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 15 Feb 2016 04:26:35 +0000 (20:26 -0800)
Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I61a35ed33e06ef5f27a082cae045230aa1a89ac1

configure.ac
packaging/enlightenment.spec
src/bin/Makefile.mk
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h

index eb6e0b3..9aa4f1f 100755 (executable)
@@ -816,6 +816,15 @@ if test "x${have_wayland}" = "xyes"; then
   fi
 fi
 
+# Check for ttrace header files
+PKG_CHECK_MODULES(TTRACE,
+               [ttrace],
+               [have_ttrace="yes"], [have_ttrace="no"])
+
+if test "x$have_ttrace" = "xyes"; then
+       AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available])
+fi
+
 AM_CONDITIONAL([HAVE_WAYLAND], [test "x${have_wayland}" = "xyes"])
 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "x${have_wayland_egl}" = "xyes"])
 AM_CONDITIONAL([HAVE_WAYLAND_TBM], [test "x${have_wayland_tbm}" = "xyes"])
index 1a4b989..d8da0d2 100644 (file)
@@ -43,6 +43,7 @@ BuildRequires:  pkgconfig(ice)
 BuildRequires:  pkgconfig(libudev)
 BuildRequires:  pkgconfig(udev)
 BuildRequires:  pkgconfig(libtbm)
+BuildRequires:  pkgconfig(ttrace)
 %if %{with x}
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xext)
index 64881fc..e97393e 100644 (file)
@@ -395,7 +395,7 @@ endif
 
 endif
 
-src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ @WAYLAND_EGL_CFLAGS@ @ECORE_X_CFLAGS@
+src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ @WAYLAND_EGL_CFLAGS@ @ECORE_X_CFLAGS@ $(TTRACE_CFLAGS)
 if HAVE_WAYLAND_TBM
 src_bin_enlightenment_CPPFLAGS += @WAYLAND_TBM_CFLAGS@ @ECORE_DRM_CFLAGS@
 endif
@@ -404,7 +404,7 @@ src/bin/e_main.c \
 $(enlightenment_src)
 
 src_bin_enlightenment_LDFLAGS = -export-dynamic
-src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ @WL_DRM_LIBS@ @WAYLAND_EGL_LIBS@ -lm @SHM_OPEN_LIBS@ @ECORE_X_LIBS@
+src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ @WL_DRM_LIBS@ @WAYLAND_EGL_LIBS@ -lm @SHM_OPEN_LIBS@ @ECORE_X_LIBS@ $(TTRACE_LIBS)
 if HAVE_WAYLAND_TBM
 src_bin_enlightenment_LDADD += @WAYLAND_TBM_LIBS@ @ECORE_DRM_LIBS@
 endif
index 69ca5af..daf4a3f 100644 (file)
@@ -1061,17 +1061,39 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    Evas_Device *dev = NULL;
    const char *dev_name;
 
+   TRACE_BEGIN(_e_comp_wl_evas_cb_mouse_move);
+
    ev = event;
 
    e_comp->wl_comp_data->ptr.x = wl_fixed_from_int(ev->cur.canvas.x);
    e_comp->wl_comp_data->ptr.y = wl_fixed_from_int(ev->cur.canvas.y);
 
-   if (!(ec = data)) return;
+   if (!(ec = data))
+     {
+        TRACE_END();
+        return;
+     }
 
-   if (ec->cur_mouse_action) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
-   if (ec->ignored) return;
-   if (!ec->comp_data->surface) return;
+   if (ec->cur_mouse_action)
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
+   if (ec->ignored)
+     {
+        TRACE_END();
+        return;
+     }
+   if (!ec->comp_data->surface)
+     {
+        TRACE_END();
+        return;
+     }
 
    if ((!e_comp_wl->drag_client) ||
        (!e_client_has_xwindow(e_comp_wl->drag_client)))
@@ -1099,6 +1121,8 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
         else
           e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
      }
+
+   TRACE_END();
 }
 
 static void
@@ -1140,8 +1164,18 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    Evas_Device *dev = NULL;
    const char *dev_name;
 
-   if (!ec) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
+   TRACE_BEGIN(_e_comp_wl_evas_cb_mouse_down);
+
+   if (!ec)
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
 
    dev = ev->dev;
 
@@ -1153,6 +1187,8 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    else
      e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
                                         WL_POINTER_BUTTON_STATE_PRESSED);
+
+   TRACE_END();
 }
 
 static void
@@ -1163,8 +1199,18 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
    Evas_Device *dev = NULL;
    const char *dev_name;
 
-   if (!ec) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
+   TRACE_BEGIN(_e_comp_wl_evas_cb_mouse_up);
+
+   if (!ec)
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
 
    dev = ev->dev;
 
@@ -1176,6 +1222,8 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
    else
      e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
                                         WL_POINTER_BUTTON_STATE_RELEASED);
+
+   TRACE_END();
 }
 
 static void
@@ -1188,11 +1236,29 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *
    Eina_List *l;
    uint32_t axis, dir;
 
+   TRACE_BEGIN(_e_comp_wl_evas_cb_mouse_wheel);
+
    ev = event;
-   if (!(ec = data)) return;
-   if (ec->cur_mouse_action) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
+   if (!(ec = data))
+     {
+        TRACE_END();
+        return;
+     }
+   if (ec->cur_mouse_action)
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
    if (ec->ignored) return;
+     {
+        TRACE_END();
+        return;
+     }
 
    if (ev->direction == 0)
      axis = WL_POINTER_AXIS_VERTICAL_SCROLL;
@@ -1204,14 +1270,23 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *
    else
      dir = wl_fixed_from_int(ev->z);
 
-   if (!ec->comp_data->surface) return;
+   if (!ec->comp_data->surface)
+     {
+        TRACE_END();
+        return;
+     }
 
-   if (ec->comp_data->transform.start) return;
+   if (ec->comp_data->transform.start)
+     {
+        TRACE_END();
+        return;
+     }
    if (ec->comp_data->transform.enabled)
      {
         if (ec->comp_data->transform.stime == 0)
           {
              ec->comp_data->transform.stime = ev->timestamp;
+             TRACE_END();
              return;
           }
 
@@ -1224,6 +1299,7 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *
           }
 
         /* do not send wheel event to client */
+        TRACE_END();
         return;
      }
 
@@ -1234,6 +1310,8 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *
         if (wl_resource_get_client(res) != wc) continue;
         wl_pointer_send_axis(res, ev->timestamp, axis, dir);
      }
+
+   TRACE_END();
 }
 
 static void
@@ -1298,9 +1376,23 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    const char *dev_name;
    Evas_Device_Class dev_class;
 
-   if (!ec) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
-   if (!ec->comp_data->surface) return;
+   TRACE_BEGIN(_e_comp_wl_evas_cb_multi_down);
+
+   if (!ec)
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
+   if (!ec->comp_data->surface)
+     {
+        TRACE_END();
+        return;
+     }
 
    dev = ev->dev;
 
@@ -1312,7 +1404,11 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
      }
 
    /* Do not deliver emulated single touch events to client */
-   if (ev->device == 0) return;
+   if (ev->device == 0)
+     {
+        TRACE_END();
+        return;
+     }
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
@@ -1327,6 +1423,8 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
         wl_touch_send_down(res, serial, ev->timestamp,
                            ec->comp_data->surface, ev->device, x, y);
      }
+
+   TRACE_END();
 }
 
 static void
@@ -1342,9 +1440,23 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
    const char *dev_name;
    Evas_Device_Class dev_class;
 
-   if (!ec) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
-   if (!ec->comp_data->surface) return;
+   TRACE_BEGIN(_e_comp_wl_evas_cb_multi_up);
+
+   if (!ec)
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
+   if (!ec->comp_data->surface)
+     {
+        TRACE_END();
+        return;
+     }
 
    dev = ev->dev;
 
@@ -1356,7 +1468,11 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
      }
 
    /* Do not deliver emulated single touch events to client */
-   if (ev->device == 0) return;
+   if (ev->device == 0)
+     {
+        TRACE_END();
+        return;
+     }
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
@@ -1367,6 +1483,8 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
         if (!e_comp_wl_input_touch_check(res)) continue;
         wl_touch_send_up(res, serial, ev->timestamp, ev->device);
      }
+
+   TRACE_END();
 }
 
 static void
@@ -1382,9 +1500,23 @@ _e_comp_wl_evas_cb_multi_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    const char *dev_name;
    Evas_Device_Class dev_class;
 
+   TRACE_BEGIN(_e_comp_wl_evas_cb_multi_move);
+
    if (!ec) return;
-   if (e_object_is_del(E_OBJECT(ec))) return;
-   if (!ec->comp_data->surface) return;
+     {
+        TRACE_END();
+        return;
+     }
+   if (e_object_is_del(E_OBJECT(ec)))
+     {
+        TRACE_END();
+        return;
+     }
+   if (!ec->comp_data->surface)
+     {
+        TRACE_END();
+        return;
+     }
 
    dev = ev->dev;
 
@@ -1396,7 +1528,11 @@ _e_comp_wl_evas_cb_multi_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
      }
 
    /* Do not deliver emulated single touch events to client */
-   if (ev->device == 0) return;
+   if (ev->device == 0)
+     {
+        TRACE_END();
+        return;
+     }
 
    wc = wl_resource_get_client(ec->comp_data->surface);
 
@@ -1409,6 +1545,8 @@ _e_comp_wl_evas_cb_multi_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
         if (!e_comp_wl_input_touch_check(res)) continue;
         wl_touch_send_motion(res, ev->timestamp, ev->device, x, y);
      }
+
+   TRACE_END();
 }
 
 static void
@@ -4927,18 +5065,31 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
    E_Client *ec = NULL;
    uint32_t serial, *end, *k, keycode;
 
-   if ((e_comp->comp_type != E_PIXMAP_TYPE_WL) || (ev->window != e_comp->ee_win)) return EINA_FALSE;
+   TRACE_BEGIN(e_comp_wl_key_down);
+
+   if ((e_comp->comp_type != E_PIXMAP_TYPE_WL) || (ev->window != e_comp->ee_win))
+     {
+        TRACE_END();
+        return EINA_FALSE;
+     }
    _last_event_time = ecore_loop_time_get();
 
    keycode = (ev->keycode - 8);
-   if (!(e_comp_wl = e_comp->wl_comp_data)) return EINA_FALSE;
+   if (!(e_comp_wl = e_comp->wl_comp_data))
+     {
+        TRACE_END();
+        return EINA_FALSE;
+     }
 
 #ifndef E_RELEASE_BUILD
    if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
        ((ev->modifiers & ECORE_EVENT_MODIFIER_ALT) ||
        (ev->modifiers & ECORE_EVENT_MODIFIER_ALTGR)) &&
        eina_streq(ev->key, "BackSpace"))
-     exit(0);
+     {
+        TRACE_END();
+        exit(0);
+     }
 #endif
 
    end = (uint32_t *)e_comp_wl->kbd.keys.data + (e_comp_wl->kbd.keys.size / sizeof(*k));
@@ -4946,7 +5097,11 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
    for (k = e_comp_wl->kbd.keys.data; k < end; k++)
      {
         /* ignore server-generated key repeats */
-        if (*k == keycode) return EINA_FALSE;
+        if (*k == keycode)
+          {
+             TRACE_END();
+             return EINA_FALSE;
+          }
      }
 
    if ((!e_client_action_get()) && (!e_comp->input_key_grabs) &&
@@ -4968,6 +5123,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
              if (!(k = wl_array_add(&e_comp_wl->kbd.keys, sizeof(*k))))
                {
                   DBG("wl_array_add: Out of memory\n");
+                  TRACE_END();
                   return EINA_FALSE;
                }
              *k = keycode;
@@ -4976,6 +5132,8 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
 
    /* update modifier state */
    e_comp_wl_input_keyboard_state_update(keycode, EINA_TRUE);
+
+   TRACE_END();
    return !!ec;
 }
 
@@ -4988,14 +5146,23 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
    Eina_List *l;
    uint32_t delivered_key;
 
+   TRACE_BEGIN(e_comp_wl_key_up);
    if ((e_comp->comp_type != E_PIXMAP_TYPE_WL) ||
-       (ev->window != e_comp->ee_win)) return EINA_FALSE;
+       (ev->window != e_comp->ee_win))
+     {
+        TRACE_END();
+        return EINA_FALSE;
+     }
 
    _last_event_time = ecore_loop_time_get();
 
    keycode = (ev->keycode - 8);
    delivered_key = 0;
-   if (!(e_comp_wl = e_comp->wl_comp_data)) return EINA_FALSE;
+   if (!(e_comp_wl = e_comp->wl_comp_data))
+     {
+        TRACE_END();
+        return EINA_FALSE;
+     }
 
    end = (uint32_t *)e_comp_wl->kbd.keys.data + (e_comp_wl->kbd.keys.size / sizeof(*k));
    for (k = e_comp_wl->kbd.keys.data; k < end; k++)
@@ -5028,6 +5195,8 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
 
    /* update modifier state */
    e_comp_wl_input_keyboard_state_update(keycode, EINA_FALSE);
+
+   TRACE_END();
    return !!ec;
 }
 
index 86eb602..63f4bc4 100644 (file)
 
 #include <Evas_GL.h>
 
+#ifdef ENABLE_TTRACE
+#include <ttrace.h>
+
+#define TRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_INPUT, "INPUT:SERVER:"#NAME)
+#define TRACE_END() traceEnd(TTRACE_TAG_INPUT)
+#else
+#define TRACE_BEGIN(NAME)
+#define TRACE_END()
+#endif
+
 typedef struct _E_Comp_Wl_Aux_Hint  E_Comp_Wl_Aux_Hint;
 typedef struct _E_Comp_Wl_Buffer E_Comp_Wl_Buffer;
 typedef struct _E_Comp_Wl_Buffer_Ref E_Comp_Wl_Buffer_Ref;