Re: [PATCH v4 11/39] unwind_user: Add user space unwinding API

Andrii Nakryiko <[email protected]>
Newsgroups org.kernel.vger.linux-toolchains,org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-trace-kernel
Message-ID <CAEf4BzbG3C5=8bB0DKrVdMHDxADbZxnAwku46QAqt8qLW6ngOA@mail.gmail.com>
On Tue, Jan 21, 2025 at 6:32 PM Josh Poimboeuf <[email protected]> wrote:
>
> Introduce a generic API for unwinding user stacks.
>
> Signed-off-by: Josh Poimboeuf <[email protected]>
> ---
>  arch/Kconfig                      |  3 ++
>  include/linux/unwind_user.h       | 15 ++++++++
>  include/linux/unwind_user_types.h | 31 ++++++++++++++++
>  kernel/Makefile                   |  1 +
>  kernel/unwind/Makefile            |  1 +
>  kernel/unwind/user.c              | 59 +++++++++++++++++++++++++++++++
>  6 files changed, 110 insertions(+)
>  create mode 100644 include/linux/unwind_user.h
>  create mode 100644 include/linux/unwind_user_types.h
>  create mode 100644 kernel/unwind/Makefile
>  create mode 100644 kernel/unwind/user.c
>

[...]

> --- /dev/null
> +++ b/kernel/unwind/user.c
> @@ -0,0 +1,59 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> +* Generic interfaces for unwinding user space
> +*/
> +#include <linux/kernel.h>
> +#include <linux/sched.h>
> +#include <linux/sched/task_stack.h>
> +#include <linux/unwind_user.h>
> +
> +int unwind_user_next(struct unwind_user_state *state)
> +{
> +       struct unwind_user_frame _frame;
> +       struct unwind_user_frame *frame = &_frame;
> +       unsigned long cfa = 0, fp, ra = 0;

wouldn't all the above generate compilation warnings about unused
variables, potentially breaking bisection?

> +
> +       /* no implementation yet */
> +       -EINVAL;

return missing?

> +}

[...]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.