[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH] dix: log privates information only when debugging is on
From:       Tiago Vignatti <tiago.vignatti () nokia ! com>
Date:       2010-06-29 13:04:19
Message-ID: 1277816659-15079-1-git-send-email-tiago.vignatti () nokia ! com
[Download RAW message or body]

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
---
Alternatively we can send this information to the log file. But spits on
stdout by default doesn't seems a good idea, specially when we want to shut up
server's output.

 dix/privates.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dix/privates.c b/dix/privates.c
index ec818d4..6fb8ad1 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -411,6 +411,7 @@ dixLookupPrivateOffset(RESTYPE type)
     return -1;
 }
 
+#ifdef DEBUG
 static const char *key_names[PRIVATE_LAST] = {
     /* XSELinux uses the same private keys for numerous objects */
     [PRIVATE_XSELINUX] = "XSELINUX",
@@ -440,6 +441,7 @@ static const char *key_names[PRIVATE_LAST] = {
     [PRIVATE_GLYPHSET] = "GLYPHSET",
     [PRIVATE_PICTURE] = "PICTURE",
 };
+#endif
 
 void
 dixPrivateUsage(void)
@@ -451,7 +453,7 @@ dixPrivateUsage(void)
 
     for (t = PRIVATE_XSELINUX + 1; t < PRIVATE_LAST; t++) {
 	if (keys[t].offset) {
-	    ErrorF("%s: %d objects of %d bytes = %d total bytes %d private allocs\n",
+	    DebugF("%s: %d objects of %d bytes = %d total bytes %d private allocs\n",
 		   key_names[t], keys[t].created, keys[t].offset, keys[t].created * keys[t].offset,
 		   keys[t].allocated);
 	    bytes += keys[t].created * keys[t].offset;
@@ -459,7 +461,7 @@ dixPrivateUsage(void)
 	    alloc += keys[t].allocated;
 	}
     }
-    ErrorF("TOTAL: %d objects, %d bytes, %d allocs\n",
+    DebugF("TOTAL: %d objects, %d bytes, %d allocs\n",
 	   objects, bytes, alloc);
 }
 
@@ -481,7 +483,7 @@ dixResetPrivates(void)
 		free(key);
 	}
 	if (keys[t].created) {
-	    ErrorF("%d %ss still allocated at reset\n",
+	    DebugF("%d %ss still allocated at reset\n",
 		   keys[t].created, key_names[t]);
 	    dixPrivateUsage();
 	}
-- 
1.7.1.226.g770c5

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic