diff options
Diffstat (limited to 'arch/x86/oprofile/nmi_int.c')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 202864ad49a7..3b285e656e27 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -356,14 +356,11 @@ static void exit_sysfs(void) | |||
356 | #define exit_sysfs() do { } while (0) | 356 | #define exit_sysfs() do { } while (0) |
357 | #endif /* CONFIG_PM */ | 357 | #endif /* CONFIG_PM */ |
358 | 358 | ||
359 | static int p4force; | ||
360 | module_param(p4force, int, 0); | ||
361 | |||
362 | static int __init p4_init(char **cpu_type) | 359 | static int __init p4_init(char **cpu_type) |
363 | { | 360 | { |
364 | __u8 cpu_model = boot_cpu_data.x86_model; | 361 | __u8 cpu_model = boot_cpu_data.x86_model; |
365 | 362 | ||
366 | if (!p4force && (cpu_model > 6 || cpu_model == 5)) | 363 | if (cpu_model > 6 || cpu_model == 5) |
367 | return 0; | 364 | return 0; |
368 | 365 | ||
369 | #ifndef CONFIG_SMP | 366 | #ifndef CONFIG_SMP |
@@ -389,10 +386,25 @@ static int __init p4_init(char **cpu_type) | |||
389 | return 0; | 386 | return 0; |
390 | } | 387 | } |
391 | 388 | ||
389 | static int force_arch_perfmon; | ||
390 | static int force_cpu_type(const char *str, struct kernel_param *kp) | ||
391 | { | ||
392 | if (!strcmp(str, "archperfmon")) { | ||
393 | force_arch_perfmon = 1; | ||
394 | printk(KERN_INFO "oprofile: forcing architectural perfmon\n"); | ||
395 | } | ||
396 | |||
397 | return 0; | ||
398 | } | ||
399 | module_param_call(cpu_type, force_cpu_type, NULL, NULL, 0); | ||
400 | |||
392 | static int __init ppro_init(char **cpu_type) | 401 | static int __init ppro_init(char **cpu_type) |
393 | { | 402 | { |
394 | __u8 cpu_model = boot_cpu_data.x86_model; | 403 | __u8 cpu_model = boot_cpu_data.x86_model; |
395 | 404 | ||
405 | if (force_arch_perfmon && cpu_has_arch_perfmon) | ||
406 | return 0; | ||
407 | |||
396 | switch (cpu_model) { | 408 | switch (cpu_model) { |
397 | case 0 ... 2: | 409 | case 0 ... 2: |
398 | *cpu_type = "i386/ppro"; | 410 | *cpu_type = "i386/ppro"; |
@@ -414,6 +426,13 @@ static int __init ppro_init(char **cpu_type) | |||
414 | case 15: case 23: | 426 | case 15: case 23: |
415 | *cpu_type = "i386/core_2"; | 427 | *cpu_type = "i386/core_2"; |
416 | break; | 428 | break; |
429 | case 26: | ||
430 | arch_perfmon_setup_counters(); | ||
431 | *cpu_type = "i386/core_i7"; | ||
432 | break; | ||
433 | case 28: | ||
434 | *cpu_type = "i386/atom"; | ||
435 | break; | ||
417 | default: | 436 | default: |
418 | /* Unknown */ | 437 | /* Unknown */ |
419 | return 0; | 438 | return 0; |