[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190522135850.GB16275@worktop.programming.kicks-ass.net>
Date: Wed, 22 May 2019 15:58:50 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Song Liu <songliubraving@...com>
Cc: linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
kernel-team@...com, Kairui Song <kasong@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH] perf/x86: always include regs->ip in callchain
On Tue, May 21, 2019 at 01:48:13PM -0700, Song Liu wrote:
> Commit d15d356887e7 removes regs->ip for !perf_hw_regs(regs) case. This
> breaks tests like test_stacktrace_map from selftests/bpf/tests_prog.
That test is broken by something else; just the one entry is wrong too.
That said, yes the patch below is actually correct, but the above
description is misleading at best.
> This patch adds regs->ip back.
>
> Fixes: d15d356887e7 ("perf/x86: Make perf callchains work without CONFIG_FRAME_POINTER")
> Cc: Kairui Song <kasong@...hat.com>
> Cc: Peter Zijlstra (Intel) <peterz@...radead.org>
> Signed-off-by: Song Liu <songliubraving@...com>
> ---
> arch/x86/events/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index f315425d8468..7b8a9eb4d5fd 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -2402,9 +2402,9 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
> return;
> }
>
> + if (perf_callchain_store(entry, regs->ip))
> + return;
> if (perf_hw_regs(regs)) {
> - if (perf_callchain_store(entry, regs->ip))
> - return;
> unwind_start(&state, current, regs, NULL);
> } else {
> unwind_start(&state, current, NULL, (void *)regs->sp);
> --
> 2.17.1
>
Powered by blists - more mailing lists