From: Suthikulpanit, S. <Sur...@am...> - 2010-06-21 14:49:06
|
John, Sorry for delay. - The patch works fine. - Please move the new entry of CPU to the end of the list (in liop/op_cpu_type.[h|c]). - Please provide a change log entry in the ChangeLog file. Suravee -----Original Message----- From: Maynard Johnson [mailto:may...@us...] Sent: Thursday, June 10, 2010 10:45 AM To: Suthikulpanit, Suravee Cc: John Villalovos; opr...@li... Subject: Re: Enable use of "i386/nehalem" cpu_type in Oprofile userspace On 05/27/2010 1:14 PM, John Villalovos wrote: > This patch enables the use of the "i386/nehalem" cpu_type in the Oprofile > userspace code. Suravee, Can you review this patch? Thanks. -Maynard > > At the moment no kernel reports any CPU as "i386/nehalem", but I was hoping to > have the flexibility to do that in the future if desired. I figured it would > be wise to have the support for it in oprofile before any kernel changes were > ever done. > > This does not impact the "i386/core_i7" cpu_type. > > The reason I think this might be useful as at the moment we have Intel Core i7 > processors which are Westmere microarchitecture and therefore can not be > reported as "i386/core_i7". > > Testing: > I made a custom kernel that reported a Nehalem-EX processor as "i386/nehalem" > (instead of "i386/core_i7") and oprofile recognized it. > > Signed-off-by: John L. Villalovos<joh...@in...> > > > diff -prauN oprofile.old/libop/op_cpu_type.c oprofile/libop/op_cpu_type.c > --- oprofile.old/libop/op_cpu_type.c 2010-05-27 14:00:29.000000000 -0400 > +++ oprofile/libop/op_cpu_type.c 2010-05-27 13:14:51.000000000 -0400 > @@ -81,6 +81,7 @@ static struct cpu_descr const cpu_descrs > { "ppc64 POWER7", "ppc64/power7", CPU_PPC64_POWER7, 6 }, > { "ppc64 compat version 1", "ppc64/ibm-compat-v1", CPU_PPC64_IBM_COMPAT_V1, 4 }, > { "Intel Core/i7", "i386/core_i7", CPU_CORE_I7, 4 }, > + { "Intel Nehalem microarchitecture", "i386/nehalem", CPU_NEHALEM, 4 }, > { "Intel Atom", "i386/atom", CPU_ATOM, 2 }, > { "Loongson2", "mips/loongson2", CPU_MIPS_LOONGSON2, 2 }, > }; > diff -prauN oprofile.old/libop/op_cpu_type.h oprofile/libop/op_cpu_type.h > --- oprofile.old/libop/op_cpu_type.h 2010-05-27 14:00:29.000000000 -0400 > +++ oprofile/libop/op_cpu_type.h 2010-05-27 13:15:50.000000000 -0400 > @@ -78,6 +78,7 @@ typedef enum { > CPU_PPC64_POWER7, /**< ppc64 POWER7 family */ > CPU_PPC64_IBM_COMPAT_V1, /**< IBM PPC64 processor compat mode version 1 */ > CPU_CORE_I7, /* Intel Core i7, Nehalem */ > + CPU_NEHALEM, /* Intel Nehalem microarchitecture */ > CPU_ATOM, /* First generation Intel Atom */ > CPU_MIPS_LOONGSON2, /*< loongson2 family */ > MAX_CPU_TYPE > diff -prauN oprofile.old/libop/op_events.c oprofile/libop/op_events.c > --- oprofile.old/libop/op_events.c 2010-05-27 14:00:29.000000000 -0400 > +++ oprofile/libop/op_events.c 2010-05-27 13:15:10.000000000 -0400 > @@ -970,6 +970,7 @@ void op_default_event(op_cpu cpu_type, s > case CPU_FAMILY11H: > case CPU_ATOM: > case CPU_CORE_I7: > + case CPU_NEHALEM: > case CPU_MIPS_LOONGSON2: > descr->name = "CPU_CLK_UNHALTED"; > break; > diff -prauN oprofile.old/utils/ophelp.c oprofile/utils/ophelp.c > --- oprofile.old/utils/ophelp.c 2010-05-27 14:00:29.000000000 -0400 > +++ oprofile/utils/ophelp.c 2010-05-27 13:16:27.000000000 -0400 > @@ -483,6 +483,7 @@ int main(int argc, char const * argv[]) > case CPU_CORE: > case CPU_CORE_2: > case CPU_CORE_I7: > + case CPU_NEHALEM: > case CPU_ATOM: > event_doc = > "See Intel Architecture Developer's Manual Volume 3B, Appendix A and\n" |