Re: [PATCH] oprofile: add support for Cavium ThunderX2
Robert Richter <[email protected]> Wed, 13 Mar 2019 08:06:59 +0000
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <[email protected]> |
On 11.03.19 11:12:42, David Aldridge wrote:
> > > diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
> > > index d2babd1..061aa70 100644
> > > --- a/libop/op_cpu_type.c
> > > +++ b/libop/op_cpu_type.c
> > > @@ -122,6 +122,7 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = {
> > > { "ARM Cortex-A17", "arm/armv7-ca17", CPU_ARM_V7_CA17, 7 },
> > > { "ppc64 POWER9", "ppc64/power9", CPU_PPC64_POWER9, 6 },
> > > { "Intel Knights Landing", "i386/knightslanding", CPU_KNIGHTSLANDING, 4 },
> > > + { "Cavium ThunderX2", "arm/armv8-thunderx2", CPU_ARM_V8_CAVIUM_THUNDERX2, 6 },
> > > };
> > > static size_t const nr_cpu_descrs = sizeof(cpu_descrs) / sizeof(struct cpu_descr);
> > > @@ -442,6 +443,11 @@ static op_cpu _get_arm_cpu_type(void)
> > > case 2:
> > > return op_get_cpu_number("arm/xscale2");
> > > }
> >
> > How likely is there to be processors with the alternative ID for Thunderx2 (vendorid = 0x42, cpuid = 0x516) as in
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/pmu-events/arch/arm64/mapfile.csv ?
> >
> That is a good question, I guess it depends upon possible future
> acquisitions. I was testing on a box with the vendor id == 0x43, happy to
> add 0x42 as well.
Yes, both cpu ids are valid.
-Robert
>
> > > + } else if (vendorid == 0x43) { /* Cavium */
> > > + switch (cpuid) {
> > > + case 0x0af:
> > > + return op_get_cpu_number("arm/armv8-thunderx2");
> > > + }
> > > }
> > > return CPU_NO_GOOD;