@@ -1329,6 +1329,13 @@ char *get_page_size_name(u64 size, char *str)
return str;
}
+static void ptrauth__printf(struct ptrauth_info *ptrauth)
+{
+ printf(" . ptrauth enabled keys: 0x%016"PRIx64"\n", ptrauth->enabled_keys);
+ printf(" . ptrauth instruction mask: 0x%016"PRIx64"\n", ptrauth->insn_mask);
+ printf(" . ptrauth data mask: 0x%016"PRIx64"\n", ptrauth->data_mask);
+}
+
static void dump_sample(struct evsel *evsel, union perf_event *event,
struct perf_sample *sample, const char *arch)
{
@@ -1385,6 +1392,14 @@ static void dump_sample(struct evsel *evsel, union perf_event *event,
if (sample_type & PERF_SAMPLE_READ)
sample_read__printf(sample, evsel->core.attr.read_format);
+
+ if (sample_type & PERF_SAMPLE_ARCH_1) {
+ const char *normlzd_arch = perf_env__arch(evsel->evlist->env);
+
+ if (normlzd_arch && strcmp(normlzd_arch, "arm64") == 0)
+ ptrauth__printf(&sample->ptrauth);
+ }
+
}
static void dump_read(struct evsel *evsel, union perf_event *event)
This patch prints a perf sample's ptrauth struct so that the PAC masks can be seen. To aid debugging. Signed-off-by: Andrew Kilroy <andrew.kilroy@arm.com> --- tools/perf/util/session.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)