lkml.org 
[lkml]   [2015]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] perf: Use pmu_events_map table to create event aliases
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



\
 
 \ /
  Last update: 2015-05-21 02:41    [W:0.115 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site