All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: make mtrr code could use debugpat
Date: Fri, 03 Apr 2009 15:35:55 -0700	[thread overview]
Message-ID: <49D68F4B.9010808@kernel.org> (raw)
In-Reply-To: <20090403222928.GA6446@elte.hu>



Impact: cleanup

only print out get_mtrr when debugpat

Signed-off-by: Yinghai Lu <yinghai@kernel.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;

       reply	other threads:[~2009-04-03 22:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090329205805.GA24693@elte.hu>
     [not found] ` <20090329210103.GA24901@elte.hu>
     [not found]   ` <49CFF517.30001@kernel.org>
     [not found]     ` <alpine.LFD.2.00.0903291553210.3948@localhost.localdomain>
     [not found]       ` <1238434120.4529.783.camel@localhost.localdomain>
     [not found]         ` <20090403175555.GH6295@elte.hu>
     [not found]           ` <alpine.LFD.2.00.0904031203400.4015@localhost.localdomain>
     [not found]             ` <20090403212152.GA3493@linux-os.sc.intel.com>
     [not found]               ` <alpine.LFD.2.00.0904031443340.7007@localhost.localdomain>
     [not found]                 ` <alpine.LFD.2.00.0904031521460.3915@localhost.localdomain>
     [not found]                   ` <20090403222928.GA6446@elte.hu>
2009-04-03 22:35                     ` Yinghai Lu [this message]
2009-04-04  0:37                       ` [PATCH] x86: make mtrr code could use debugpat Linus Torvalds
2009-04-04  0:48                         ` Yinghai Lu
2009-04-04  0:49                         ` Yinghai Lu
2009-04-04  0:50                           ` Yinghai Lu
2009-04-04  1:18                         ` Ingo Molnar
2009-04-04  6:39                           ` Jaswinder Singh Rajput
2009-04-04  6:52                           ` Jaswinder Singh Rajput
2009-04-04  7:09                             ` Jaswinder Singh Rajput

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49D68F4B.9010808@kernel.org \
    --to=yinghai@kernel.org \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=venkatesh.pallipadi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.