From: Gwanglim Lee Date: Wed, 5 Aug 2015 12:29:09 +0000 (+0900) Subject: moved logging functions to e_log X-Git-Tag: submit/tizen/20150806.024618~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9454cc4394bc775d445f5f5f6b23e5d6d0c80b9;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wm-policy.git moved logging functions to e_log Change-Id: Ia85bfb7b034eb4387380c6d61adcc336fc6720e5 --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 701c227..b6e202d 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -32,7 +32,6 @@ static void _pol_cb_hook_client_desk_set(void *d EINA_UNUSED, E_Client *e static void _pol_cb_hook_client_eval_end(void *d EINA_UNUSED, E_Client *ec); static void _pol_cb_hook_client_fullscreen_pre(void *data EINA_UNUSED, E_Client *ec); -static void _pol_cb_hook_pixmap_new(void *data EINA_UNUSED, E_Pixmap *cp); static void _pol_cb_hook_pixmap_del(void *data EINA_UNUSED, E_Pixmap *cp); static void _pol_cb_desk_data_free(void *data); @@ -426,16 +425,9 @@ _pol_cb_hook_client_fullscreen_pre(void* data EINA_UNUSED, E_Client *ec) ec->skip_fullscreen = 1; } -static void -_pol_cb_hook_pixmap_new(void *data EINA_UNUSED, E_Pixmap *cp) -{ - PLOG("PIXMAP NEW", cp, e_pixmap_client_get(cp)); -} - static void _pol_cb_hook_pixmap_del(void *data EINA_UNUSED, E_Pixmap *cp) { - PLOG("PIXMAP DEL", cp, e_pixmap_client_get(cp)); #ifdef HAVE_WAYLAND_ONLY e_mod_pol_wl_pixmap_del(cp); #endif @@ -601,8 +593,6 @@ _pol_cb_client_remove(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) ev = event; EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON); - PLOG("CLIENT DEL", ev->ec ? ev->ec->pixmap : NULL, ev->ec); - #ifdef HAVE_WAYLAND_ONLY e_mod_pol_wl_client_del(ev->ec); #endif @@ -627,8 +617,6 @@ _pol_cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) ev = event; EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON); - PLOG("CLIENT ADD", ev->ec ? ev->ec->pixmap : NULL, ev->ec); - e_mod_pol_client_window_opaque_set(ev->ec); return ECORE_CALLBACK_PASS_ON; @@ -1026,7 +1014,6 @@ e_modapi_init(E_Module *m) E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_EVAL_END, _pol_cb_hook_client_eval_end, NULL); E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_FULLSCREEN_PRE, _pol_cb_hook_client_fullscreen_pre, NULL); - E_PIXMAP_HOOK_APPEND(hooks_cp, E_PIXMAP_HOOK_NEW, _pol_cb_hook_pixmap_new, NULL); E_PIXMAP_HOOK_APPEND(hooks_cp, E_PIXMAP_HOOK_DEL, _pol_cb_hook_pixmap_del, NULL); e_mod_pol_rotation_init(); diff --git a/src/e_mod_main.h b/src/e_mod_main.h index a147bb2..05531f8 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -10,19 +10,6 @@ # endif #endif -#define PLOG(t, cp, ec) \ - DBG("WMPOL|%20.20s|cp:0x%08x|ec:0x%08x|", \ - (t), \ - (unsigned int)(cp), \ - (unsigned int)(ec)); - -#define PLOGF(t, f, cp, ec, x...) \ - DBG("WMPOL|%20.20s|cp:0x%08x|ec:0x%08x|"f, \ - (t), \ - (unsigned int)(cp), \ - (unsigned int)(ec), \ - ##x); - typedef struct _Pol_Desk Pol_Desk; typedef struct _Pol_Client Pol_Client; typedef struct _Pol_Softkey Pol_Softkey; diff --git a/src/e_mod_wl.c b/src/e_mod_wl.c index abfb9bc..a560d7b 100644 --- a/src/e_mod_wl.c +++ b/src/e_mod_wl.c @@ -47,7 +47,7 @@ _pol_wl_tzpol_add(struct wl_resource *res_tzpol) tzpol->res_tzpol = res_tzpol; - PLOGF("TZPOL", + ELOGF("TZPOL", "HASH_ADD |res:0x%08x|tzpol:0x%08x", NULL, NULL, (unsigned int)res_tzpol, @@ -69,7 +69,7 @@ _pol_wl_tzpol_del(void *data) _pol_wl_surf_del(psurf); } - PLOGF("TZPOL", + ELOGF("TZPOL", "HASH_DEL |res:0x%08x|tzpol:0x%08x", NULL, NULL, (unsigned int)tzpol->res_tzpol, @@ -153,7 +153,7 @@ _pol_wl_surf_add(E_Pixmap *cp, struct wl_resource *res_tzpol) psurf->cp = cp; psurf->ec = e_pixmap_client_get(cp); - PLOGF("POLSURF", + ELOGF("POLSURF", "LIST_ADD |s:0x%08x|tzpol:0x%08x|ps:0x%08x", psurf->cp, psurf->ec, @@ -169,7 +169,7 @@ _pol_wl_surf_add(E_Pixmap *cp, struct wl_resource *res_tzpol) static void _pol_wl_surf_del(Pol_Wl_Surface *psurf) { - PLOGF("POLSURF", + ELOGF("POLSURF", "LIST_DEL |s:0x%08x|tzpol:0x%08x|ps:0x%08x|pending_notilv:%d", psurf->cp, psurf->ec, @@ -185,33 +185,6 @@ _pol_wl_surf_del(Pol_Wl_Surface *psurf) E_FREE(psurf); } -// -------------------------------------------------------- -// util funcs -// -------------------------------------------------------- -static void -_pol_wl_pname_print(pid_t pid) -{ - FILE *h; - char proc[512], pname[512]; - size_t len; - - sprintf(proc, "/proc/%d/cmdline", pid); - - h = fopen(proc, "r"); - if (!h) return; - - len = fread(pname, sizeof(char), 512, h); - if (len > 0) - { - if ('\n' == pname[len - 1]) - pname[len - 1] = '\0'; - } - - fclose(h); - - PLOGF("TZPOL", " |%s", NULL, NULL, pname); -} - // -------------------------------------------------------- // visibility // -------------------------------------------------------- @@ -718,7 +691,7 @@ _tzpol_iface_cb_notilv_set(struct wl_client *client EINA_UNUSED, struct wl_resou psurf->notilv = lv; - PLOGF("TZPOL", + ELOGF("TZPOL", "NOTI_DONE|s:0x%08x|res_tzpol:0x%08x|psurf:0x%08x|lv%d", cp, ec, (unsigned int)surf, @@ -792,7 +765,7 @@ _tzpol_iface_cb_transient_for_set(struct wl_client *client EINA_UNUSED, struct w E_Client *ec, *pc; struct wl_resource *parent_surf; - PLOGF("TZPOL", + ELOGF("TZPOL", "TF_SET |res_tzpol:0x%08x|parent:%d|child:%d", NULL, NULL, (unsigned int)res_tzpol, parent_id, child_id); @@ -807,11 +780,11 @@ _tzpol_iface_cb_transient_for_set(struct wl_client *client EINA_UNUSED, struct w _pol_wl_parent_surf_set(ec, parent_surf); - PLOGF("TZPOL", + ELOGF("TZPOL", " |parent|s:0x%08x", pc->pixmap, pc, (unsigned int)parent_surf); - PLOGF("TZPOL", + ELOGF("TZPOL", " |child |s:0x%08x", ec->pixmap, ec, (unsigned int)(ec->comp_data ? ec->comp_data->surface : NULL)); @@ -826,7 +799,7 @@ _tzpol_iface_cb_transient_for_unset(struct wl_client *client EINA_UNUSED, struct { E_Client *ec; - PLOGF("TZPOL", + ELOGF("TZPOL", "TF_UNSET |res_tzpol:0x%08x|child:%d", NULL, NULL, (unsigned int)res_tzpol, child_id); @@ -918,9 +891,6 @@ _tzpol_cb_unbind(struct wl_resource *res_tzpol) { Pol_Wl_Tzpol *tzpol; struct wl_client *client; - pid_t pid = 0; - uid_t uid = 0; - gid_t gid = 0; tzpol = _pol_wl_tzpol_get(res_tzpol); EINA_SAFETY_ON_NULL_RETURN(tzpol); @@ -928,20 +898,16 @@ _tzpol_cb_unbind(struct wl_resource *res_tzpol) eina_hash_del_by_key(polwl->tzpols, &res_tzpol); client = wl_resource_get_client(res_tzpol); - if (client) wl_client_get_credentials(client, &pid, &uid, &gid); - PLOGF("TZPOL", - "UNBIND |client:0x%08x|%d|%d|%d", - NULL, NULL, (unsigned int)client, pid, uid, gid); + ELOGF("TZPOL", + "UNBIND |client:0x%08x", + NULL, NULL, (unsigned int)client); } static void _tzpol_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t ver, uint32_t id) { struct wl_resource *res_tzpol; - pid_t pid = 0; - uid_t uid = 0; - gid_t gid = 0; EINA_SAFETY_ON_NULL_GOTO(polwl, err); @@ -958,13 +924,9 @@ _tzpol_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t ver, u NULL, _tzpol_cb_unbind); - wl_client_get_credentials(client, &pid, &uid, &gid); - - PLOGF("TZPOL", - "BIND |client:0x%08x|%d|%d|%d", - NULL, NULL, (unsigned int)client, pid, uid, gid); - - _pol_wl_pname_print(pid); + ELOGF("TZPOL", + "BIND |client:0x%08x", + NULL, NULL, (unsigned int)client); _pol_wl_tzpol_add(res_tzpol); return;