Mesa (gallium-0.2): CELL: improve legibility of CELL_DEBUG environment variable output

Robert Ellison papillo at kemper.freedesktop.org
Tue Sep 23 16:10:21 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: 6901d6ef24224c27e20c3e864d035db1552aeeb8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6901d6ef24224c27e20c3e864d035db1552aeeb8

Author: Robert Ellison <papillo at tungstengraphics.com>
Date:   Tue Sep 23 10:09:36 2008 -0600

CELL: improve legibility of CELL_DEBUG environment variable output

---

 src/gallium/auxiliary/util/p_debug.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/p_debug.c b/src/gallium/auxiliary/util/p_debug.c
index b6cff28..3ed8bdf 100644
--- a/src/gallium/auxiliary/util/p_debug.c
+++ b/src/gallium/auxiliary/util/p_debug.c
@@ -306,6 +306,13 @@ debug_get_flags_option(const char *name,
    str = _debug_get_option(name);
    if(!str)
       result = dfault;
+   else if (!util_strcmp(str, "help")) {
+      result = dfault;
+      while (flags->name) {
+         debug_printf("%s: help for %s: %s [0x%lx]\n", __FUNCTION__, name, flags->name, flags->value);
+         flags++;
+      }
+   }
    else {
       result = 0;
       while( flags->name ) {
@@ -315,7 +322,12 @@ debug_get_flags_option(const char *name,
       }
    }
 
-   debug_printf("%s: %s = 0x%lx\n", __FUNCTION__, name, result);
+   if (str) {
+      debug_printf("%s: %s = 0x%lx (%s)\n", __FUNCTION__, name, result, str);
+   }
+   else {
+      debug_printf("%s: %s = 0x%lx\n", __FUNCTION__, name, result);
+   }
 
    return result;
 }




More information about the mesa-commit mailing list