--- linux-2.6.3-bk5op/arch/i386/oprofile/nmi_int.c.orig 2004-02-23 12:41:00.000000000 -0500 +++ linux-2.6.3-bk5op/arch/i386/oprofile/nmi_int.c 2004-02-23 12:45:26.000000000 -0500 @@ -295,6 +295,12 @@ }; +inline static int __init is_ia32e(void) +{ + return (test_bit(X86_FEATURE_LM, current_cpu_data.x86_capability)); +} + + static int __init p4_init(void) { __u8 cpu_model = current_cpu_data.x86_model; @@ -303,24 +309,36 @@ return 0; #ifndef CONFIG_SMP - nmi_ops.cpu_type = "i386/p4"; + if (is_ia32e()) + nmi_ops.cpu_type = "x86-64/ia32e"; + else + nmi_ops.cpu_type = "i386/p4"; model = &op_p4_spec; return 1; #else switch (smp_num_siblings) { case 1: - nmi_ops.cpu_type = "i386/p4"; + if (is_ia32e()) + nmi_ops.cpu_type = "x86-64/ia32e"; + else + nmi_ops.cpu_type = "i386/p4"; model = &op_p4_spec; return 1; case 2: - nmi_ops.cpu_type = "i386/p4-ht"; + if (is_ia32e()) + nmi_ops.cpu_type = "x86-64/ia32e-ht"; + else + nmi_ops.cpu_type = "i386/p4-ht"; model = &op_p4_ht2_spec; return 1; } #endif - printk(KERN_INFO "oprofile: P4 HyperThreading detected with > 2 threads\n"); + if (is_ia32e()) + printk(KERN_INFO "oprofile: ia32e HyperThreading detected with > 2 threads\n"); + else + printk(KERN_INFO "oprofile: P4 HyperThreading detected with > 2 threads\n"); printk(KERN_INFO "oprofile: Reverting to timer mode.\n"); return 0; }