[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <49D68F4B.9010808@kernel.org>
Date: Fri, 03 Apr 2009 15:35:55 -0700
From: Yinghai Lu <yinghai@...nel.org>
To: Ingo Molnar <mingo@...e.hu>
CC: Linus Torvalds <torvalds@...ux-foundation.org>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>,
"Siddha, Suresh B" <suresh.b.siddha@...el.com>,
Arjan van de Ven <arjan@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: make mtrr code could use debugpat
Impact: cleanup
only print out get_mtrr when debugpat
Signed-off-by: Yinghai Lu <yinghai@...nel.org>
---
arch/x86/kernel/cpu/mtrr/generic.c | 9 ++++++---
arch/x86/kernel/cpu/mtrr/mtrr.h | 4 ++++
arch/x86/mm/pat.c | 6 +++---
3 files changed, 13 insertions(+), 6 deletions(-)
Index: linux-2.6/arch/x86/kernel/cpu/mtrr/generic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/mtrr/generic.c
+++ linux-2.6/arch/x86/kernel/cpu/mtrr/generic.c
@@ -462,9 +462,12 @@ static void generic_get_mtrr(unsigned in
*base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
*type = base_lo & 0xff;
- printk(KERN_DEBUG " get_mtrr: cpu%d reg%02d base=%010lx size=%010lx %s\n",
- cpu, reg, *base, *size,
- mtrr_attrib_to_str(*type & 0xff));
+#ifdef CONFIG_X86_PAT
+ if (debugpat)
+ printk(KERN_DEBUG " get_mtrr: cpu%d reg%02d base=%010lx size=%010lx %s\n",
+ cpu, reg, *base, *size,
+ mtrr_attrib_to_str(*type & 0xff));
+#endif
out_put_cpu:
put_cpu();
}
Index: linux-2.6/arch/x86/kernel/cpu/mtrr/mtrr.h
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/mtrr/mtrr.h
+++ linux-2.6/arch/x86/kernel/cpu/mtrr/mtrr.h
@@ -92,3 +92,7 @@ int centaur_init_mtrr(void);
extern int changed_by_mtrr_cleanup;
extern int mtrr_cleanup(unsigned address_bits);
+
+#if CONFIG_X86_PAT
+extern int debugpat;
+#endif
Index: linux-2.6/arch/x86/mm/pat.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/pat.c
+++ linux-2.6/arch/x86/mm/pat.c
@@ -51,17 +51,17 @@ static inline void pat_disable(const cha
#endif
-static int debug_enable;
+int debugpat;
static int __init pat_debug_setup(char *str)
{
- debug_enable = 1;
+ debugpat = 1;
return 0;
}
__setup("debugpat", pat_debug_setup);
#define dprintk(fmt, arg...) \
- do { if (debug_enable) printk(KERN_INFO fmt, ##arg); } while (0)
+ do { if (debugpat) printk(KERN_INFO fmt, ##arg); } while (0)
static u64 __read_mostly boot_pat_state;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists