From f41549ab059db71cbae06a6cd4fb3b9fbdbc0b5e Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 31 Aug 2003 00:19:48 -0700 Subject: [PATCH] [PATCH] OProfile: correct CPU type for x86-64 Enable the Hammer specific events by giving the correct cpu string. From, and tested by, Will Cohen. --- arch/i386/oprofile/nmi_int.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index 7e404741f7d1f..3886477011361 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c @@ -364,10 +364,21 @@ int __init nmi_init(struct oprofile_operations ** ops) switch (vendor) { case X86_VENDOR_AMD: /* Needs to be at least an Athlon (or hammer in 32bit mode) */ - if (family < 6) + + switch (family) { + default: return -ENODEV; - model = &op_athlon_spec; - nmi_ops.cpu_type = "i386/athlon"; + case 6: + model = &op_athlon_spec; + nmi_ops.cpu_type = "i386/athlon"; + break; +#if defined(CONFIG_X86_64) + case 0xf: + model = &op_athlon_spec; + nmi_ops.cpu_type = "x86-64/hammer"; + break; +#endif /* CONFIG_X86_64 */ + } break; #if !defined(CONFIG_X86_64) -- 2.53.0