[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220704145333.22557-7-andrew.kilroy@arm.com>
Date: Mon, 4 Jul 2022 15:53:30 +0100
From: Andrew Kilroy <andrew.kilroy@....com>
To: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
acme@...nel.org
Cc: Andrew Kilroy <andrew.kilroy@....com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Tom Rix <trix@...hat.com>,
linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, llvm@...ts.linux.dev
Subject: [PATCH 6/8] perf libunwind: arm64 pointer authentication
Make use of new changes in libunwind to decode a pointer which has a
pointer authentication code (PAC) in it.
Before this patch, perf is not able to produce stack traces where the
instruction addresses had PACs in them.
This commit has a dependency on a libunwind pull request:
https://github.com/libunwind/libunwind/pull/360
Signed-off-by: Andrew Kilroy <andrew.kilroy@....com>
---
tools/perf/util/unwind-libunwind-local.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 6e5b8cce47bf..6983a3e76a71 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -652,6 +652,15 @@ static void display_error(int err)
}
}
+#ifndef NO_LIBUNWIND_ARM64_PTRAUTH
+static unw_word_t get_insn_mask(unw_addr_space_t addr_space __maybe_unused, void *unwind_info_ptr)
+{
+ struct unwind_info *ui = unwind_info_ptr;
+ unw_word_t mask = ui->sample->ptrauth.insn_mask;
+ return mask;
+}
+#endif
+
static unw_accessors_t accessors = {
.find_proc_info = find_proc_info,
.put_unwind_info = put_unwind_info,
@@ -661,6 +670,9 @@ static unw_accessors_t accessors = {
.access_fpreg = access_fpreg,
.resume = resume,
.get_proc_name = get_proc_name,
+#ifndef NO_LIBUNWIND_ARM64_PTRAUTH
+ .ptrauth_insn_mask = get_insn_mask,
+#endif
};
static int _unwind__prepare_access(struct maps *maps)
--
2.17.1
Powered by blists - more mailing lists