[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250618112939.76f4bb87@gandalf.local.home>
Date: Wed, 18 Jun 2025 11:29:39 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
bpf@...r.kernel.org, x86@...nel.org, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Josh Poimboeuf <jpoimboe@...nel.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>, Jens Remus <jremus@...ux.ibm.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, Andrew Morton
<akpm@...ux-foundation.org>
Subject: Re: [PATCH v10 04/14] unwind_user/deferred: Add
unwind_deferred_trace()
On Wed, 18 Jun 2025 16:02:47 +0200
Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, Jun 10, 2025 at 08:54:25PM -0400, Steven Rostedt wrote:
> > +/**
> > + * unwind_deferred_trace - Produce a user stacktrace in faultable context
> > + * @trace: The descriptor that will store the user stacktrace
> > + *
> > + * This must be called in a known faultable context (usually when entering
> > + * or exiting user space). Depending on the available implementations
> > + * the @trace will be loaded with the addresses of the user space stacktrace
> > + * if it can be found.
>
> I am confused -- why would we ever want to call this on exiting
> user-space, or rather kernel entry?
>
> I thought the whole point was to request a user trace while in-kernel,
> and defer that to return-to-user.
This code was broken out of the unwind deferred trace to be more stand
alone. Actually, it should be renamed to unwind_faultable_trace() or
something to denote that it must be called from a faultable context.
When Josh made perf use the task_work directly, it used this function to do
the trace as it handled the deferring.
Note, a request from the gcc folks is to add a system call that gives the
user space application a backtrace from its current location. This can be
handy for debugging as it would be similar to how we use dump_stack().
This function would be used for that.
-- Steve
Powered by blists - more mailing lists