• Kan Liang's avatar
    perf vendor events: Add stepping in CPUID string for x86 · 3b54411a
    Kan Liang authored
    The perf tools cannot find the proper event list for the Cascadelake
    server.  Because the Cascadelake server and the Skylake server have the
    same CPU model number, which are used by the perf tools to find the
    event list.
    
    The stepping for Skylake server is up to 4.
    
    The stepping for Cascadelake server starts from 5.
    
    The stepping can be used to distinguish between them.
    
    The stepping is added in get_cpuid_str().
    
    The stepping information for Skylake server is updated in mapfile.csv.
    
    A x86 specific strcmp_cpuid_cmp() function is added to handle two CPUID
    formats in mapfile.csv, "vendor-family-model-stepping" and
    "vendor-family-model":
    
    - If a cpuid-regular-expression from the mapfile.csv using the new
      stepping format, a cpuid-string generated on the machine must include
      stepping. Otherwise, it is a mismatch.
    
    - If the cpuid-regular-expression using the old non-stepping format,
      the stepping in the cpuid-string will be ignored.
    
    The script, using environment string "PERF_CPUID" without stepping on
    Skylake server, will be broken. If so, users must fix their scripts.
    
    Committer notes:
    
    Fixed this build error on centos:6 and debian:7:
    
      arch/x86/util/header.c: In function 'is_full_cpuid':
      arch/x86/util/header.c:82:39: error: declaration of 'cpuid' shadows a global declaration [-Werror=shadow]
      arch/x86/util/header.c:12:1: error: shadowed declaration is here [-Werror=shadow]
      arch/x86/util/header.c: In function 'strcmp_cpuid_str':
      arch/x86/util/header.c:98:56: error: declaration of 'cpuid' shadows a global declaration [-Werror=shadow]
      arch/x86/util/header.c:12:1: error: shadowed declaration is here [-Werror=shadow]
      cc1: all warnings being treated as errors
    Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
    Reviewed-by: default avatarJiri Olsa <jolsa@kernel.org>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/20181114212416.15665-1-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    3b54411a
mapfile.csv 1.23 KB