[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241002223125.2d610510@gandalf.local.home>
Date: Wed, 2 Oct 2024 22:31:25 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, x86@...nel.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>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH v2 00/11] unwind, perf: sframe user space unwinding,
deferred perf callchains
On Mon, 16 Sep 2024 17:39:53 +0200
Josh Poimboeuf <jpoimboe@...nel.org> wrote:
> Completely untested patch here that I hacked up today:
I can tell it wasn't tested ;-)
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git sframe-2.1
>
> To avoid races, unwind_user_deferred() can't be called from NMI. The
> tracers will need to trigger irq_work to call it.
diff --git a/kernel/unwind/user.c b/kernel/unwind/user.c
index 7edb0833fe46..c56cf5d564df 100644
--- a/kernel/unwind/user.c
+++ b/kernel/unwind/user.c
@@ -177,7 +181,8 @@ int unwind_user_deferred(struct unwind_callback *callback, u64 *ctx_cookie)
cookie = __this_cpu_read(ctx_ctr);
cookie &= ((1UL << 48) - 1);
- cookie |= ((cpu << 48) + 1);
+ cookie |= cpu << 48;
+ cookie++;
__this_cpu_write(ctx_ctr, cookie);
current->unwind_ctx_cookie = cookie;
As the cookie never got incremented.
That was just one issue. Things are still not working but I'll debug the
rest later.
-- Steve
Powered by blists - more mailing lists