public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Kajol Jain <kjain@linux.ibm.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	acme@kernel.org, songliubraving@fb.com, andrii@kernel.org,
	kafai@fb.com, yhs@fb.com, john.fastabend@gmail.com,
	davem@davemloft.net, kpsingh@kernel.org, hawk@kernel.org,
	kuba@kernel.org, maddy@linux.ibm.com,
	atrajeev@linux.vnet.ibm.com, linux-perf-users@vger.kernel.org,
	rnsastry@linux.ibm.com
Subject: Re: [PATCH] bpf: Enable bpf support for reading branch records in powerpc
Date: Tue, 16 Nov 2021 09:34:54 +0100	[thread overview]
Message-ID: <20211116083454.GY174703@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <5a185d6b-7090-23f0-1ec9-140a31ee5fb4@iogearbox.net>

On Tue, Nov 16, 2021 at 12:30:07AM +0100, Daniel Borkmann wrote:

> > diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
> > index fdd14072fc3b..2b7343b64bb7 100644
> > --- a/kernel/trace/bpf_trace.c
> > +++ b/kernel/trace/bpf_trace.c
> > @@ -1245,7 +1245,7 @@ static const struct bpf_func_proto bpf_perf_prog_read_value_proto = {
> >   BPF_CALL_4(bpf_read_branch_records, struct bpf_perf_event_data_kern *, ctx,
> >   	   void *, buf, u32, size, u64, flags)
> >   {
> > -#ifndef CONFIG_X86
> > +#if !(defined(CONFIG_X86) || defined(CONFIG_PPC64))
> 
> Can this really be enabled generically? Looking at 3925f46bb590 ("powerpc/perf: Enable
> branch stack sampling framework") it says POWER8 [and beyond]. Should there be a generic
> Kconfig symbol like ARCH_HAS_BRANCH_RECORDS that can be selected by archs instead?

I conplained about it before as well. I'd just take it out entirely.

If perf_snapshot_branch_stack isn't implemnted it'll return 0 and then
we'll -Esomething anyway.



  reply	other threads:[~2021-11-16  8:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  4:44 [PATCH] bpf: Enable bpf support for reading branch records in powerpc Kajol Jain
2021-11-15 23:30 ` Daniel Borkmann
2021-11-16  8:34   ` Peter Zijlstra [this message]
2021-11-16 15:21     ` kajoljain

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=20211116083454.GY174703@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kjain@linux.ibm.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=rnsastry@linux.ibm.com \
    --cc=songliubraving@fb.com \
    --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