Skip to contentSkip to conversation

OProfile: correct CPU type for x86-64

PATCH New John Levon 1 participant 1 message Aug 31, 2003

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 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 +14 -3
diff -Naur -X dontdiff linux-cvs/arch/i386/oprofile/nmi_int.c linux-fixes/arch/i386/oprofile/nmi_int.c
@@ -364,10 +364,21 @@
 	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)