perf/x86: Clean up PEBS_XMM_REGS
authorKan Liang <kan.liang@linux.intel.com>
Tue, 28 May 2019 22:08:32 +0000 (15:08 -0700)
committerIngo Molnar <mingo@kernel.org>
Mon, 24 Jun 2019 17:19:24 +0000 (19:19 +0200)
Use generic macro PERF_REG_EXTENDED_MASK to replace PEBS_XMM_REGS to
avoid duplication.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: https://lkml.kernel.org/r/1559081314-9714-3-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/core.c
arch/x86/events/intel/ds.c
arch/x86/events/perf_event.h

index f315425d8468f473bf11e95c6039b59ac6b318a4..7708a6fb5f4a816f77a41d2d89bda5d03f7ab618 100644 (file)
@@ -561,13 +561,13 @@ int x86_pmu_hw_config(struct perf_event *event)
        }
 
        /* sample_regs_user never support XMM registers */
-       if (unlikely(event->attr.sample_regs_user & PEBS_XMM_REGS))
+       if (unlikely(event->attr.sample_regs_user & PERF_REG_EXTENDED_MASK))
                return -EINVAL;
        /*
         * Besides the general purpose registers, XMM registers may
         * be collected in PEBS on some platforms, e.g. Icelake
         */
-       if (unlikely(event->attr.sample_regs_intr & PEBS_XMM_REGS)) {
+       if (unlikely(event->attr.sample_regs_intr & PERF_REG_EXTENDED_MASK)) {
                if (x86_pmu.pebs_no_xmm_regs)
                        return -EINVAL;
 
index 6cb38ab02c8a8cbc3a4d00ea3bda7468b87a3436..955b2c688f23fc9ec40fbd65dd2f2bfdf8f11a2c 100644 (file)
@@ -987,7 +987,7 @@ static u64 pebs_update_adaptive_cfg(struct perf_event *event)
                pebs_data_cfg |= PEBS_DATACFG_GP;
 
        if ((sample_type & PERF_SAMPLE_REGS_INTR) &&
-           (attr->sample_regs_intr & PEBS_XMM_REGS))
+           (attr->sample_regs_intr & PERF_REG_EXTENDED_MASK))
                pebs_data_cfg |= PEBS_DATACFG_XMMS;
 
        if (sample_type & PERF_SAMPLE_BRANCH_STACK) {
index a6ac2f4f76fc97ef2409e31fb3f8a3ac54a35bd4..d3b6e90c80d31d498438555482d7526bd602e7a3 100644 (file)
@@ -121,24 +121,6 @@ struct amd_nb {
         (1ULL << PERF_REG_X86_R14)   | \
         (1ULL << PERF_REG_X86_R15))
 
-#define PEBS_XMM_REGS                   \
-       ((1ULL << PERF_REG_X86_XMM0)  | \
-        (1ULL << PERF_REG_X86_XMM1)  | \
-        (1ULL << PERF_REG_X86_XMM2)  | \
-        (1ULL << PERF_REG_X86_XMM3)  | \
-        (1ULL << PERF_REG_X86_XMM4)  | \
-        (1ULL << PERF_REG_X86_XMM5)  | \
-        (1ULL << PERF_REG_X86_XMM6)  | \
-        (1ULL << PERF_REG_X86_XMM7)  | \
-        (1ULL << PERF_REG_X86_XMM8)  | \
-        (1ULL << PERF_REG_X86_XMM9)  | \
-        (1ULL << PERF_REG_X86_XMM10) | \
-        (1ULL << PERF_REG_X86_XMM11) | \
-        (1ULL << PERF_REG_X86_XMM12) | \
-        (1ULL << PERF_REG_X86_XMM13) | \
-        (1ULL << PERF_REG_X86_XMM14) | \
-        (1ULL << PERF_REG_X86_XMM15))
-
 /*
  * Per register state.
  */