e_comp_wl_rsm: add logs in input event transfer request 80/232680/2 submit/tizen_5.5/20200507.084851
authorjeon <jhyuni.kang@samsung.com>
Thu, 7 May 2020 06:23:37 +0000 (15:23 +0900)
committerJeongHyun Kang <jhyuni.kang@samsung.com>
Thu, 7 May 2020 07:39:23 +0000 (07:39 +0000)
Change-Id: I9f8ee9e3573519e3876209592eff7084d07108d3

src/bin/e_comp_wl_rsm.c

index 86d2ec62d1e33dee5c0150c37a49681b51b0f9df..b114695f1fe6adfdb35fbcbe253ce02bd4e5cb36 100644 (file)
@@ -1621,6 +1621,9 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso
    Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE;
    double eradx, erady, epressure, eangle;
 
+   E_Comp_Config *comp_conf = NULL;
+   pid_t pid = 0;
+
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
    EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid);
@@ -1649,6 +1652,19 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso
    epressure = wl_fixed_to_double(pressure);
    eangle = wl_fixed_to_double(angle);
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     {
+        if (event_type != TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_MOVE)
+          {
+             wl_client_get_credentials(client, &pid, NULL, NULL);
+             ELOGF("TRS", "TRANSFER Mouse event [pid: %d -> pid: %d (ec: %p)] type: %d, time: %d",
+                   NULL, pid, ec?ec->netwm.pid:-1, ec, event_type, time);
+             ELOGF("TRS", "\tDetail: device: %d, button: %d, x:%d, y:%d, clas: %d, identifier: %20s",
+                   NULL, device, button, x, y, clas, identifier);
+          }
+     }
+
    if (eclas == ECORE_DEVICE_CLASS_MOUSE)
      {
         switch (event_type)
@@ -1754,6 +1770,9 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso
    Ecore_Device *edev = NULL;
    Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE;
 
+   E_Comp_Config *comp_conf = NULL;
+   pid_t pid = 0;
+
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
    EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid);
@@ -1774,6 +1793,16 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso
      }
    edev = _device_get_by_identifier(identifier, eclas);
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     {
+        wl_client_get_credentials(client, &pid, NULL, NULL);
+        ELOGF("TRS", "TRANSFER Mouse wheel [pid: %d -> pid: %d (ec: %p)], time: %d",
+              NULL, pid, ec?ec->netwm.pid:-1, ec, time);
+        ELOGF("TRS", "\tDetail: direction: %d, z: %d, clas: %d, identifier: %20s)",
+              NULL, direction, z, clas, identifier);
+     }
+
    e_client_mouse_wheel_send(ec, direction, z, edev, time);
 }
 
@@ -1788,6 +1817,9 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso
    Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE;
    double eradx, erady, epressure, eangle;
 
+   E_Comp_Config *comp_conf = NULL;
+   pid_t pid = 0;
+
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
    EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid);
@@ -1826,6 +1858,19 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso
    epressure = wl_fixed_to_double(pressure);
    eangle = wl_fixed_to_double(angle);
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     {
+        if (event_type != TIZEN_REMOTE_SURFACE_EVENT_TYPE_TOUCH_MOVE)
+          {
+             wl_client_get_credentials(client, &pid, NULL, NULL);
+             ELOGF("TRS", "TRANSFER Touch event [pid: %d -> pid: %d (ec: %p)] type: %d, time: %d",
+                   NULL, pid, ec?ec->netwm.pid:-1, ec, event_type, time);
+             ELOGF("TRS", "\tDetail: device: %d, button: %d, x: %d, y: %d, clas: %d, identifier: %20s",
+                   NULL, device, button, x, y, clas, identifier);
+          }
+     }
+
    if (eclas == ECORE_DEVICE_CLASS_TOUCH)
      {
         switch (event_type)
@@ -1876,6 +1921,9 @@ _remote_surface_cb_touch_cancel_transfer(struct wl_client *client, struct wl_res
    E_Comp_Wl_Remote_Surface *remote_surface;
    E_Client *ec;
 
+   E_Comp_Config *comp_conf = NULL;
+   pid_t pid = 0;
+
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
    EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid);
@@ -1886,6 +1934,15 @@ _remote_surface_cb_touch_cancel_transfer(struct wl_client *client, struct wl_res
    ec = provider->common.ec;
 
    if (e_object_is_del(E_OBJECT(ec))) return;
+
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     {
+        wl_client_get_credentials(client, &pid, NULL, NULL);
+        ELOGF("TRS", "TRANSFER Touch cancel [pid: %d -> pid: %d (ec: %p)]",
+              NULL, pid, ec?ec->netwm.pid:-1, ec);
+     }
+
    e_client_touch_cancel_send(ec);
 }
 
@@ -1899,6 +1956,9 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour
    Ecore_Device *edev = NULL;
    Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE;
 
+   E_Comp_Config *comp_conf = NULL;
+   pid_t pid = 0;
+
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
    EINA_SAFETY_ON_FALSE_RETURN(remote_surface->valid);
@@ -1919,6 +1979,16 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour
         return;
      }
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     {
+        wl_client_get_credentials(client, &pid, NULL, NULL);
+        ELOGF("TRS", "TRANSFER Key event [pid: %d -> pid: %d (ec: %p)] type: %d, time: %d",
+              NULL, pid, ec?ec->netwm.pid:-1, ec, event_type, time);
+        ELOGF("TRS", "\tDetail: keycode: %d, clas: %d, identifier: %20s",
+              NULL, keycode, clas, identifier);
+     }
+
    /* find ecore device*/
    edev = _device_get_by_identifier(identifier, eclas);