Skip to content

Commit

Permalink
perf/x86/regs: Use PERF_REG_EXTENDED_MASK
Browse files Browse the repository at this point in the history
Use the macro defined in kernel ABI header to replace the local name.

No functional change.

Signed-off-by: Kan Liang <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Kan Liang authored and Ingo Molnar committed Jun 24, 2019
1 parent cd6b984 commit 8b12b81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tools/arch/x86/include/uapi/asm/perf_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ enum perf_event_x86_regs {
/* These include both GPRs and XMMX registers */
PERF_REG_X86_XMM_MAX = PERF_REG_X86_XMM15 + 2,
};

#define PERF_REG_EXTENDED_MASK (~((1ULL << PERF_REG_X86_XMM0) - 1))

#endif /* _ASM_X86_PERF_REGS_H */
1 change: 0 additions & 1 deletion tools/perf/arch/x86/include/perf_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
void perf_regs_load(u64 *regs);

#define PERF_REGS_MAX PERF_REG_X86_XMM_MAX
#define PERF_XMM_REGS_MASK (~((1ULL << PERF_REG_X86_XMM0) - 1))
#ifndef HAVE_ARCH_X86_64_SUPPORT
#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)
#define PERF_SAMPLE_REGS_ABI PERF_SAMPLE_REGS_ABI_32
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/arch/x86/util/perf_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ uint64_t arch__intr_reg_mask(void)
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES,
.sample_type = PERF_SAMPLE_REGS_INTR,
.sample_regs_intr = PERF_XMM_REGS_MASK,
.sample_regs_intr = PERF_REG_EXTENDED_MASK,
.precise_ip = 1,
.disabled = 1,
.exclude_kernel = 1,
Expand All @@ -293,7 +293,7 @@ uint64_t arch__intr_reg_mask(void)
fd = sys_perf_event_open(&attr, 0, -1, -1, 0);
if (fd != -1) {
close(fd);
return (PERF_XMM_REGS_MASK | PERF_REGS_MASK);
return (PERF_REG_EXTENDED_MASK | PERF_REGS_MASK);
}

return PERF_REGS_MASK;
Expand Down

0 comments on commit 8b12b81

Please sign in to comment.