]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
lmb: Make lmb debugging more useful.
authorDavid S. Miller <davem@davemloft.net>
Tue, 13 May 2008 00:21:55 +0000 (17:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 May 2008 00:21:55 +0000 (17:21 -0700)
Having to muck with the build and set DEBUG just to
get lmb_dump_all() to print things isn't very useful.

So use pr_info() and use an early boot param
"lmb=debug" so we can simply ask users to reboot
with this option when we need some debugging from
them.

Signed-off-by: David S. Miller <davem@davemloft.net>
lib/lmb.c

index 93445dc8f8180d6184af268cc6954ecca569142c..867f7b5a8231b9c2cc4fc81e1f269689259857e1 100644 (file)
--- a/lib/lmb.c
+++ b/lib/lmb.c
 
 struct lmb lmb;
 
+static int lmb_debug;
+
+static int __init early_lmb(char *p)
+{
+       if (p && strstr(p, "debug"))
+               lmb_debug = 1;
+       return 0;
+}
+early_param("lmb", early_lmb);
+
 void lmb_dump_all(void)
 {
-#ifdef DEBUG
        unsigned long i;
 
-       pr_debug("lmb_dump_all:\n");
-       pr_debug("    memory.cnt                  = 0x%lx\n", lmb.memory.cnt);
-       pr_debug("    memory.size                 = 0x%llx\n",
+       if (!lmb_debug)
+               return;
+
+       pr_info("lmb_dump_all:\n");
+       pr_info("    memory.cnt           = 0x%lx\n", lmb.memory.cnt);
+       pr_info("    memory.size                  = 0x%llx\n",
            (unsigned long long)lmb.memory.size);
        for (i=0; i < lmb.memory.cnt ;i++) {
-               pr_debug("    memory.region[0x%x].base       = 0x%llx\n",
+               pr_info("    memory.region[0x%lx].base       = 0x%llx\n",
                    i, (unsigned long long)lmb.memory.region[i].base);
-               pr_debug("                    .size     = 0x%llx\n",
+               pr_info("                     .size     = 0x%llx\n",
                    (unsigned long long)lmb.memory.region[i].size);
        }
 
-       pr_debug("    reserved.cnt        = 0x%lx\n", lmb.reserved.cnt);
-       pr_debug("    reserved.size       = 0x%lx\n", lmb.reserved.size);
+       pr_info("    reserved.cnt         = 0x%lx\n", lmb.reserved.cnt);
+       pr_info("    reserved.size        = 0x%lx\n", lmb.reserved.size);
        for (i=0; i < lmb.reserved.cnt ;i++) {
-               pr_debug("    reserved.region[0x%x].base       = 0x%llx\n",
+               pr_info("    reserved.region[0x%lx].base       = 0x%llx\n",
                    i, (unsigned long long)lmb.reserved.region[i].base);
-               pr_debug("                    .size     = 0x%llx\n",
+               pr_info("                     .size     = 0x%llx\n",
                    (unsigned long long)lmb.reserved.region[i].size);
        }
-#endif /* DEBUG */
 }
 
 static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2,