Re: [PATCH v8 15/18] perf: Have get_perf_callchain() return NULL if crosstask and user are set

From: Steven Rostedt
Date: Sat May 10 2025 - 09:46:34 EST


On Fri, 9 May 2025 14:53:38 -0700
Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote:

> > @@ -224,6 +224,10 @@ get_perf_callchain(struct pt_regs *regs, bool kernel, bool user,
> > struct perf_callchain_entry_ctx ctx;
> > int rctx, start_entry_idx;
> >
> > + /* crosstask is not supported for user stacks */
> > + if (crosstask && user)
> > + return NULL;
>
> I think get_perf_callchain() supports requesting both user and kernel
> stack traces, and if it's crosstask, you can still get kernel (but not
> user) stack, if I'm reading the code correctly.
>
> So by just returning NULL early you will change this behavior, no?

Basically you are saying that one could ask for a kernel/user stack trace
with crosstask enabled and still just get the kernel trace?

If this is the case, then I think it may be best to remove patches 15-18
from this series and work on them in the "perf specific" series, as this
doesn't have anything to do with the unwind infrastructure itself.

Actually, patch 14 doesn't either, so I may move that one too (and keep the
acks to it).

Thanks,

-- Steve


>
> > +
> > entry = get_callchain_entry(&rctx);
> > if (!entry)
> > return NULL;