[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4dd5okskro2h45zmqgg3etj6uwici2hoop2uaf6iqrlaej7yh@xlduwjqke4ec>
Date: Wed, 16 Jul 2025 19:06:02 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Jens Remus <jremus@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
bpf@...r.kernel.org, x86@...nel.org, Steven Rostedt <rostedt@...nel.org>,
Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>, Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Andrii Nakryiko <andrii@...nel.org>,
Indu Bhagat <indu.bhagat@...cle.com>, "Jose E. Marchesi" <jemarch@....org>,
Beau Belgrave <beaub@...ux.microsoft.com>, Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>, Jens Axboe <axboe@...nel.dk>,
Florian Weimer <fweimer@...hat.com>, Sam James <sam@...too.org>
Subject: Re: [RFC PATCH v1 12/16] unwind_user/backchain: Introduce back chain
user space unwinding
On Thu, Jul 10, 2025 at 06:35:18PM +0200, Jens Remus wrote:
> @@ -66,12 +73,20 @@ static int unwind_user_next(struct unwind_user_state *state)
> /* sframe expects the frame to be local storage */
> frame = &_frame;
> if (sframe_find(state->ip, frame, topmost)) {
> - if (!IS_ENABLED(CONFIG_HAVE_UNWIND_USER_FP))
> - goto done;
> - frame = &fp_frame;
> + if (IS_ENABLED(CONFIG_HAVE_UNWIND_USER_FP)) {
> + frame = &fp_frame;
> + } else if (IS_ENABLED(CONFIG_HAVE_UNWIND_USER_BACKCHAIN)) {
> + if (unwind_user_backchain_next(state))
> + goto done;
> + goto done_backchain;
> + }
> }
> } else if (fp_state(state)) {
> frame = &fp_frame;
> + } else if (backchain_state(state)) {
> + if (unwind_user_backchain_next(state))
> + goto done;
> + goto done_backchain;
> } else {
> goto done;
> }
> @@ -153,6 +168,7 @@ static int unwind_user_next(struct unwind_user_state *state)
>
> arch_unwind_user_next(state);
>
> +done_backchain:
> state->topmost = false;
> return 0;
This feels very grafted on, is there not some way to make it more
generic, i.e., to just work with CONFIG_HAVE_UNWIND_USER_FP?
Also, if distros aren't even compiling with -mbackchain, I wonder if we
can just not do this altogether :-)
--
Josh
Powered by blists - more mailing lists