Commit 1cfcea1b2d67987ddb84dc75f454321bcf536555

Authored by Andi Kleen
Committed by Linus Torvalds
1 parent 46f6976101

[PATCH] x86_64: Allow oprofile for model P4 models

Add it for P4 model 6 - reported to work and have a similar PMU to
earlier P4s.

Add an p4force=1 module override parameter for future use.

We had a discussion about that earlier - it's a trade off between the
PMU staying compatible or not.  I think the force parameter is a
reasonable compromise.

Cc: oprofile-list@lists.sf.net
Cc: Asit Mallick <asit.k.mallick@intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

arch/i386/oprofile/nmi_int.c
... ... @@ -13,6 +13,7 @@
13 13 #include <linux/oprofile.h>
14 14 #include <linux/sysdev.h>
15 15 #include <linux/slab.h>
  16 +#include <linux/moduleparam.h>
16 17 #include <asm/nmi.h>
17 18 #include <asm/msr.h>
18 19 #include <asm/apic.h>
19 20  
... ... @@ -296,12 +297,14 @@
296 297 return 0;
297 298 }
298 299  
  300 +static int p4force;
  301 +module_param(p4force, int, 0);
299 302  
300 303 static int __init p4_init(char ** cpu_type)
301 304 {
302 305 __u8 cpu_model = boot_cpu_data.x86_model;
303 306  
304   - if (cpu_model > 4)
  307 + if (!p4force && (cpu_model > 6 || cpu_model == 5))
305 308 return 0;
306 309  
307 310 #ifndef CONFIG_SMP