summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/perf_regs.h
diff options
context:
space:
mode:
authorGerman Gomez <german.gomez@arm.com>2021-12-17 15:45:19 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-12-21 18:35:44 -0300
commitffc60350489db9f6e3010ac1e795078cb0d06efe (patch)
tree96ca13baecdc050fa9bb1ee13ddb0b49d77e6478 /tools/perf/util/perf_regs.h
parentaa8db3e41dae953b636ff68e944479900d149a37 (diff)
downloadlinux-ffc60350489db9f6e3010ac1e795078cb0d06efe.tar.bz2
perf tools: Refactor SMPL_REG macro in perf_regs.h
Refactor the SAMPL_REG macro so that it can be used in a followup commit to obtain the masks for ARM64 registers. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: German Gomez <german.gomez@arm.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: John Garry <john.garry@huawei.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-6-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/perf_regs.h')
-rw-r--r--tools/perf/util/perf_regs.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h
index 4e6b1299c571..ce1127af05e4 100644
--- a/tools/perf/util/perf_regs.h
+++ b/tools/perf/util/perf_regs.h
@@ -11,8 +11,11 @@ struct sample_reg {
const char *name;
uint64_t mask;
};
-#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
-#define SMPL_REG2(n, b) { .name = #n, .mask = 3ULL << (b) }
+
+#define SMPL_REG_MASK(b) (1ULL << (b))
+#define SMPL_REG(n, b) { .name = #n, .mask = SMPL_REG_MASK(b) }
+#define SMPL_REG2_MASK(b) (3ULL << (b))
+#define SMPL_REG2(n, b) { .name = #n, .mask = SMPL_REG2_MASK(b) }
#define SMPL_REG_END { .name = NULL }
enum {