linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>, Song Liu <song@kernel.org>,
	bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	x86@kernel.org, Yonghong Song <yhs@fb.com>,
	Song Liu <songliubraving@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCHv2 1/4] Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"
Date: Thu, 6 Nov 2025 13:27:11 +0100	[thread overview]
Message-ID: <20251106122711.GV4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20251103220924.36371-2-jolsa@kernel.org>

On Mon, Nov 03, 2025 at 11:09:21PM +0100, Jiri Olsa wrote:
> This reverts commit 83f44ae0f8afcc9da659799db8693f74847e66b3.
> 
> Currently we store initial stacktrace entry twice for non-HW ot_regs, which
> means callers that fail perf_hw_regs(regs) condition in perf_callchain_kernel.
> 
> It's easy to reproduce this bpftrace:
> 
>   # bpftrace -e 'tracepoint:sched:sched_process_exec { print(kstack()); }'
>   Attaching 1 probe...
> 
>         bprm_execve+1767
>         bprm_execve+1767
>         do_execveat_common.isra.0+425
>         __x64_sys_execve+56
>         do_syscall_64+133
>         entry_SYSCALL_64_after_hwframe+118
> 
> When perf_callchain_kernel calls unwind_start with first_frame, AFAICS
> we do not skip regs->ip, but it's added as part of the unwind process.
> Hence reverting the extra perf_callchain_store for non-hw regs leg.
> 
> I was not able to bisect this, so I'm not really sure why this was needed
> in v5.2 and why it's not working anymore, but I could see double entries
> as far as v5.10.

Probably some ftrace/bpf glue code that doesn't adhere to the contract
set by perf_hw_regs(); as you find in the next patch.

  reply	other threads:[~2025-11-06 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 22:09 [PATCHv2 0/4] x86/fgraph,bpf: Fix ORC stack unwind from return probe Jiri Olsa
2025-11-03 22:09 ` [PATCHv2 1/4] Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()" Jiri Olsa
2025-11-06 12:27   ` Peter Zijlstra [this message]
2025-11-03 22:09 ` [PATCHv2 2/4] x86/fgraph,bpf: Fix stack ORC unwind from kprobe_multi return probe Jiri Olsa
2025-11-03 23:47   ` bot+bpf-ci
2025-11-04  9:27     ` Jiri Olsa
2025-11-06 12:29   ` Peter Zijlstra
2025-11-07 22:22     ` Alexei Starovoitov
2025-11-03 22:09 ` [PATCHv2 3/4] selftests/bpf: Add stacktrace ips test for kprobe_multi/kretprobe_multi Jiri Olsa
2025-11-03 22:09 ` [PATCHv2 4/4] selftests/bpf: Add stacktrace ips test for raw_tp Jiri Olsa
2025-11-03 23:47   ` bot+bpf-ci
2025-11-04  8:35     ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251106122711.GV4067720@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=song@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=x86@kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).