aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2019-05-28 18:08:34 -0400
committerIngo Molnar <mingo@kernel.org>2019-06-24 13:19:26 -0400
commit8b12b812f5367c2469fb937da7e28dd321ad8d7b (patch)
treedcb3e8ab0badafb891faff3e5da24ec8dccbb344
parentcd6b984f6d8cd615755b5404a51b7efe45215f28 (diff)
perf/x86/regs: Use PERF_REG_EXTENDED_MASK
Use the macro defined in kernel ABI header to replace the local name. No functional change. 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-5-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--tools/arch/x86/include/uapi/asm/perf_regs.h3
-rw-r--r--tools/perf/arch/x86/include/perf_regs.h1
-rw-r--r--tools/perf/arch/x86/util/perf_regs.c4
3 files changed, 5 insertions, 3 deletions
diff --git a/tools/arch/x86/include/uapi/asm/perf_regs.h b/tools/arch/x86/include/uapi/asm/perf_regs.h
index ac67bbea10ca..7c9d2bb3833b 100644
--- a/tools/arch/x86/include/uapi/asm/perf_regs.h
+++ b/tools/arch/x86/include/uapi/asm/perf_regs.h
@@ -52,4 +52,7 @@ enum perf_event_x86_regs {
52 /* These include both GPRs and XMMX registers */ 52 /* These include both GPRs and XMMX registers */
53 PERF_REG_X86_XMM_MAX = PERF_REG_X86_XMM15 + 2, 53 PERF_REG_X86_XMM_MAX = PERF_REG_X86_XMM15 + 2,
54}; 54};
55
56#define PERF_REG_EXTENDED_MASK (~((1ULL << PERF_REG_X86_XMM0) - 1))
57
55#endif /* _ASM_X86_PERF_REGS_H */ 58#endif /* _ASM_X86_PERF_REGS_H */
diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h
index b7cd91a9014f..b7321337d100 100644
--- a/tools/perf/arch/x86/include/perf_regs.h
+++ b/tools/perf/arch/x86/include/perf_regs.h
@@ -9,7 +9,6 @@
9void perf_regs_load(u64 *regs); 9void perf_regs_load(u64 *regs);
10 10
11#define PERF_REGS_MAX PERF_REG_X86_XMM_MAX 11#define PERF_REGS_MAX PERF_REG_X86_XMM_MAX
12#define PERF_XMM_REGS_MASK (~((1ULL << PERF_REG_X86_XMM0) - 1))
13#ifndef HAVE_ARCH_X86_64_SUPPORT 12#ifndef HAVE_ARCH_X86_64_SUPPORT
14#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1) 13#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)
15#define PERF_SAMPLE_REGS_ABI PERF_SAMPLE_REGS_ABI_32 14#define PERF_SAMPLE_REGS_ABI PERF_SAMPLE_REGS_ABI_32
diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c
index 7886ca5263e3..3666c0076df9 100644
--- a/tools/perf/arch/x86/util/perf_regs.c
+++ b/tools/perf/arch/x86/util/perf_regs.c
@@ -277,7 +277,7 @@ uint64_t arch__intr_reg_mask(void)
277 .type = PERF_TYPE_HARDWARE, 277 .type = PERF_TYPE_HARDWARE,
278 .config = PERF_COUNT_HW_CPU_CYCLES, 278 .config = PERF_COUNT_HW_CPU_CYCLES,
279 .sample_type = PERF_SAMPLE_REGS_INTR, 279 .sample_type = PERF_SAMPLE_REGS_INTR,
280 .sample_regs_intr = PERF_XMM_REGS_MASK, 280 .sample_regs_intr = PERF_REG_EXTENDED_MASK,
281 .precise_ip = 1, 281 .precise_ip = 1,
282 .disabled = 1, 282 .disabled = 1,
283 .exclude_kernel = 1, 283 .exclude_kernel = 1,
@@ -293,7 +293,7 @@ uint64_t arch__intr_reg_mask(void)
293 fd = sys_perf_event_open(&attr, 0, -1, -1, 0); 293 fd = sys_perf_event_open(&attr, 0, -1, -1, 0);
294 if (fd != -1) { 294 if (fd != -1) {
295 close(fd); 295 close(fd);
296 return (PERF_XMM_REGS_MASK | PERF_REGS_MASK); 296 return (PERF_REG_EXTENDED_MASK | PERF_REGS_MASK);
297 } 297 }
298 298
299 return PERF_REGS_MASK; 299 return PERF_REGS_MASK;