summaryrefslogtreecommitdiff
path: root/tools/perf/util/perf_regs.c
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2019-05-14 13:19:33 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-05-16 14:17:12 -0300
commitaf785e75bf616704cab031e66403b6adcf5b700a (patch)
tree81ed2903ef6d25c9195a6f50f6665da321c9a5ac /tools/perf/util/perf_regs.c
parentaeea9062d949584ac1f2f9a20f0e5ed306539a3e (diff)
downloadlwn-af785e75bf616704cab031e66403b6adcf5b700a.tar.gz
lwn-af785e75bf616704cab031e66403b6adcf5b700a.zip
perf parse-regs: Add generic support for arch__intr/user_reg_mask()
There may be different register mask for use with intr or user on some platforms, e.g. Icelake. Add weak functions arch__intr_reg_mask() and arch__user_reg_mask() to return intr and user register mask respectively. Check mask before printing or comparing the register name. Generic code always return PERF_REGS_MASK. No functional change. Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Tested-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/1557865174-56264-2-git-send-email-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/perf_regs.c')
-rw-r--r--tools/perf/util/perf_regs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
index 2acfcc527cac..2774cec1f15f 100644
--- a/tools/perf/util/perf_regs.c
+++ b/tools/perf/util/perf_regs.c
@@ -13,6 +13,16 @@ int __weak arch_sdt_arg_parse_op(char *old_op __maybe_unused,
return SDT_ARG_SKIP;
}
+uint64_t __weak arch__intr_reg_mask(void)
+{
+ return PERF_REGS_MASK;
+}
+
+uint64_t __weak arch__user_reg_mask(void)
+{
+ return PERF_REGS_MASK;
+}
+
#ifdef HAVE_PERF_REGS_SUPPORT
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
{