aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-10 22:51:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-10 22:51:10 -0400
commit57eee9ae7bbcfb692dc96c739a5184adb6349733 (patch)
treedd268927f30b91e8cbf95ec58e6004673b71fe40 /arch/x86/oprofile
parent8f40642ad315c553bab4ae800766ade07e574a77 (diff)
parent7e4e0bd50e80df2fe5501f48f872448376cdd997 (diff)
Merge branch 'oprofile-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'oprofile-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: oprofile: introduce module_param oprofile.cpu_type oprofile: add support for Core i7 and Atom oprofile: remove undocumented oprofile.p4force option oprofile: re-add force_arch_perfmon option
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 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
359static int p4force;
360module_param(p4force, int, 0);
361
362static int __init p4_init(char **cpu_type) 359static 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
389static int force_arch_perfmon;
390static 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}
399module_param_call(cpu_type, force_cpu_type, NULL, NULL, 0);
400
392static int __init ppro_init(char **cpu_type) 401static 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;