From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754613AbbEUAUJ (ORCPT ); Wed, 20 May 2015 20:20:09 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:37766 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbbEUAUG (ORCPT ); Wed, 20 May 2015 20:20:06 -0400 Date: Wed, 20 May 2015 17:19:35 -0700 From: Sukadev Bhattiprolu To: Andi Kleen Cc: mingo@redhat.com, Michael Ellerman , Jiri Olsa , Arnaldo Carvalho de Melo , Paul Mackerras , namhyung@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] perf: Use pmu_events_map table to create event aliases Message-ID: <20150521001935.GD11568@us.ibm.com> References: <1432080130-6678-1-git-send-email-sukadev@linux.vnet.ibm.com> <1432080130-6678-4-git-send-email-sukadev@linux.vnet.ibm.com> <20150520235826.GB7484@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150520235826.GB7484@tassilo.jf.intel.com> X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15052100-0013-0000-0000-00000AF17BEA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andi Kleen [ak@linux.intel.com] wrote: | > +/* | > + * Return TRUE if the CPU identified by @vfm, @version, and @type | > + * matches the current CPU. vfm refers to [Vendor, Family, Model], | > + * | > + * Return FALSE otherwise. | > + * | > + * For Powerpc, we only compare @version to the processor PVR. | > + */ | > +bool arch_pmu_events_match_cpu(const char *vfm __maybe_unused, | > + const char *version, | > + const char *type __maybe_unused) | > +{ | > + char *cpustr; | > + bool rc; | > + | > + cpustr = get_cpu_str(); | > + rc = !strcmp(version, cpustr); | | | Surely against vfm not version | I think your mapfile is wrong if that works? Like I say in the comment, and elsewhere, each archictecture could use a subset of [vfm, version, type] to match the CPU. On Power, we use the PVR, which is a string like "004d0100", to uniquely identify the CPU. Obviously, that does not fit into the VFM field. We could either add a new PVR field to the mapfile: [vfm, version, type, pvr] or, as the patch currently does, let architectures intepret the "version" field as they see fit? IOW, leave it to architectures to keep arch_pmu_events_match_cpu() consistent with _their_ mapfile? | | That's the Intel format: | | .vfm = "GenuineIntel-6-3E", | .version = "V16", | .type = "core", | .table = pme_IvyTown_core | | | -Andi