bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>, Kairui Song <kasong@redhat.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH] perf/x86: always include regs->ip in callchain
Date: Wed, 22 May 2019 16:12:49 +0000	[thread overview]
Message-ID: <305A8E31-13BC-4891-A9F2-30A25264771C@fb.com> (raw)
In-Reply-To: <20190522135850.GB16275@worktop.programming.kicks-ass.net>



> On May 22, 2019, at 6:58 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> 
> 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.

How about we change it to: 

Commit d15d356887e7 removes regs->ip for !perf_hw_regs(regs) case. This
patch adds regs->ip back.


Shall I send v2 with the change? 

Thanks,
Song

> 
>> This patch adds regs->ip back.
>> 
>> Fixes: d15d356887e7 ("perf/x86: Make perf callchains work without CONFIG_FRAME_POINTER")
>> Cc: Kairui Song <kasong@redhat.com>
>> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
>> Signed-off-by: Song Liu <songliubraving@fb.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
>> 


      reply	other threads:[~2019-05-22 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 20:48 [PATCH] perf/x86: always include regs->ip in callchain Song Liu
2019-05-22 13:58 ` Peter Zijlstra
2019-05-22 16:12   ` Song Liu [this message]

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=305A8E31-13BC-4891-A9F2-30A25264771C@fb.com \
    --to=songliubraving@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=kasong@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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).