check the xev_trace_on flag at the entry point of callback function. - save the CPU...
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 17 Apr 2013 08:26:48 +0000 (17:26 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 17 Jun 2013 08:44:34 +0000 (17:44 +0900)
Change-Id: Ic0bdea7b3ec2bf5a265618eaa250ce13a357db0f

module/xdbg_module_evlog.c

index 0f5f94a..663e928 100644 (file)
@@ -180,9 +180,6 @@ static void evtPrint (EvlogType type, ClientPtr client, xEvent *ev)
 {
     EvlogInfo evinfo = {0,};
 
-    if (xev_trace_on == FALSE)
-        return;
-
     /* evinfo.type */
     evinfo.type = type;
 
@@ -279,12 +276,18 @@ _traceGetWindowName (ClientPtr client, Window window)
 static void
 _traceFlush (CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 {
+    if (xev_trace_on == FALSE)
+        return;
+
     evtPrint (FLUSH, NULL, NULL);
 }
 
 static void
 _traceAReply (CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 {
+    if (xev_trace_on == FALSE)
+        return;
+
     ReplyInfoRec *pri = (ReplyInfoRec*)calldata;
 
     evtPrint (REPLY, pri->client, NULL);
@@ -293,6 +296,9 @@ _traceAReply (CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 static void
 _traceEvent (CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 {
+    if (xev_trace_on == FALSE)
+        return;
+
     EventInfoRec *pei = (EventInfoRec*)calldata;
     ClientPtr pClient;
     ModuleClientInfo *info;