aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-11 11:55:42 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-11 11:55:42 -0400
commit940010c5a314a7bd9b498593bc6ba1718ac5aec5 (patch)
treed141e08ced08c40c6a8e3ab2cdecde5ff14e560f /arch/x86/oprofile
parent8dc8e5e8bc0ce00b0f656bf972f67cd8a72759e5 (diff)
parent991ec02cdca33b03a132a0cacfe6f0aa0be9aa8d (diff)
Merge branch 'linus' into perfcounters/core
Conflicts: arch/x86/kernel/irqinit.c arch/x86/kernel/irqinit_64.c arch/x86/kernel/traps.c arch/x86/mm/fault.c include/linux/sched.h kernel/exit.c
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r--arch/x86/oprofile/nmi_int.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index c638685136e..b07dd8d0b32 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -357,14 +357,11 @@ static void exit_sysfs(void)
357#define exit_sysfs() do { } while (0) 357#define exit_sysfs() do { } while (0)
358#endif /* CONFIG_PM */ 358#endif /* CONFIG_PM */
359 359
360static int p4force;
361module_param(p4force, int, 0);
362
363static int __init p4_init(char **cpu_type) 360static int __init p4_init(char **cpu_type)
364{ 361{
365 __u8 cpu_model = boot_cpu_data.x86_model; 362 __u8 cpu_model = boot_cpu_data.x86_model;
366 363
367 if (!p4force && (cpu_model > 6 || cpu_model == 5)) 364 if (cpu_model > 6 || cpu_model == 5)
368 return 0; 365 return 0;
369 366
370#ifndef CONFIG_SMP 367#ifndef CONFIG_SMP
@@ -390,10 +387,25 @@ static int __init p4_init(char **cpu_type)
390 return 0; 387 return 0;
391} 388}
392 389
390static int force_arch_perfmon;
391static int force_cpu_type(const char *str, struct kernel_param *kp)
392{
393 if (!strcmp(str, "archperfmon")) {
394 force_arch_perfmon = 1;
395 printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
396 }
397
398 return 0;
399}
400module_param_call(cpu_type, force_cpu_type, NULL, NULL, 0);
401
393static int __init ppro_init(char **cpu_type) 402static int __init ppro_init(char **cpu_type)
394{ 403{
395 __u8 cpu_model = boot_cpu_data.x86_model; 404 __u8 cpu_model = boot_cpu_data.x86_model;
396 405
406 if (force_arch_perfmon && cpu_has_arch_perfmon)
407 return 0;
408
397 switch (cpu_model) { 409 switch (cpu_model) {
398 case 0 ... 2: 410 case 0 ... 2:
399 *cpu_type = "i386/ppro"; 411 *cpu_type = "i386/ppro";
@@ -415,6 +427,13 @@ static int __init ppro_init(char **cpu_type)
415 case 15: case 23: 427 case 15: case 23:
416 *cpu_type = "i386/core_2"; 428 *cpu_type = "i386/core_2";
417 break; 429 break;
430 case 26:
431 arch_perfmon_setup_counters();
432 *cpu_type = "i386/core_i7";
433 break;
434 case 28:
435 *cpu_type = "i386/atom";
436 break;
418 default: 437 default:
419 /* Unknown */ 438 /* Unknown */
420 return 0; 439 return 0;