Re: [PATCH v4 32/39] perf: Remove get_perf_callchain() 'crosstask' argument

Josh Poimboeuf <[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 <20250124220045.hduc3az4neoutebq@jpoimboe>
On Fri, Jan 24, 2025 at 10:13:23AM -0800, Andrii Nakryiko wrote:
> On Tue, Jan 21, 2025 at 6:32 PM Josh Poimboeuf <[email protected]> wrote:
> > @@ -430,10 +429,8 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
> >         if (task && user && !user_mode(regs))
> >                 goto err_fault;
> >
> > -       /* get_perf_callchain does not support crosstask user stack walking
> > -        * but returns an empty stack instead of NULL.
> > -        */
> > -       if (crosstask && user) {
> > +       /* get_perf_callchain() does not support crosstask stack walking */
> > +       if (crosstask) {
> 
> crosstask stack trace is supported for kernel stack traces (see
> get_callchain_entry_for_task() call), so this is breaking that case

Oh I see, thanks.

BTW, that seems dubious, does it do anything to ensure the task isn't
running?   Otherwise the unwind is going to be a wild ride.

-- 
Josh
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.