[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79e489ab275f6df5bf200747a0e9b878469301d4.1726268190.git.jpoimboe@kernel.org>
Date: Sat, 14 Sep 2024 01:02:13 +0200
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: x86@...nel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
linux-kernel@...r.kernel.org,
Indu Bhagat <indu.bhagat@...cle.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users@...r.kernel.org,
Mark Brown <broonie@...nel.org>,
linux-toolchains@...r.kernel.org,
Jordan Rome <jordalgo@...a.com>,
Sam James <sam@...too.org>
Subject: [PATCH v2 11/11] perf/x86: Enable SFrame unwinding for deferred user callchains
Use SFrame for deferred user callchains, if available.
Non-deferred user callchains still need to use frame pointers, as SFrame
is likely to fault when it pages in the .sframe section.
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
arch/x86/events/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index d6ea265d9aa8..d618c50865d3 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2861,6 +2861,7 @@ static int __perf_callchain_user32(struct pt_regs *regs,
static void __perf_callchain_user(struct perf_callchain_entry_ctx *entry,
struct pt_regs *regs, bool atomic)
{
+ bool unwind_type = USER_UNWIND_TYPE_AUTO;
struct user_unwind_state state;
if (perf_guest_state()) {
@@ -2879,13 +2880,14 @@ static void __perf_callchain_user(struct perf_callchain_entry_ctx *entry,
if (atomic) {
if (!nmi_uaccess_okay())
return;
+ unwind_type = USER_UNWIND_TYPE_FP;
pagefault_disable();
}
if (__perf_callchain_user32(regs, entry))
goto done;
- for_each_user_frame(&state, USER_UNWIND_TYPE_FP) {
+ for_each_user_frame(&state, unwind_type) {
if (perf_callchain_store(entry, state.ip))
goto done;
}
--
2.46.0
Powered by blists - more mailing lists