linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] OProfile: correct CPU type for x86-64
       [not found] <20030831191937.GA32426@compsoc.man.ac.uk.suse.lists.linux.kernel>
@ 2003-08-31 20:25 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2003-08-31 20:25 UTC (permalink / raw)
  To: John Levon; +Cc: linux-kernel

John Levon <levon@movementarian.org> writes:

> +				break;
> +#if defined(CONFIG_X86_64)
> +			case 0xf:
> +				model = &op_athlon_spec;
> +				nmi_ops.cpu_type = "x86-64/hammer";
> +				break;
> +#endif /* CONFIG_X86_64 */

The ifdef is not needed. The case is valid for i386 too, when running
an Opteron with an 32bit kernel. In that case you also want the user tools
to select the Opteron events.

-Andi


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] OProfile: correct CPU type for x86-64
@ 2003-08-31 19:19 John Levon
  0 siblings, 0 replies; 2+ messages in thread
From: John Levon @ 2003-08-31 19:19 UTC (permalink / raw)
  To: torvalds, linux-kernel


Enable the Hammer specific events by giving the correct cpu string.
From, and tested by, Will Cohen.

diff -Naur -X dontdiff linux-cvs/arch/i386/oprofile/nmi_int.c linux-fixes/arch/i386/oprofile/nmi_int.c
--- linux-cvs/arch/i386/oprofile/nmi_int.c	2003-08-29 16:56:24.000000000 +0100
+++ linux-fixes/arch/i386/oprofile/nmi_int.c	2003-08-29 17:02:20.000000000 +0100
@@ -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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-31 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030831191937.GA32426@compsoc.man.ac.uk.suse.lists.linux.kernel>
2003-08-31 20:25 ` [PATCH] OProfile: correct CPU type for x86-64 Andi Kleen
2003-08-31 19:19 John Levon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).