netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Kaixu Xia <xiakaixu@huawei.com>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Wang Nan <wangnan0@huawei.com>,
	netdev@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH, REPORT] bpf_trace: build error without PERF_EVENTS
Date: Tue, 10 Nov 2015 18:23:14 +0100	[thread overview]
Message-ID: <56422802.5050901@iogearbox.net> (raw)
In-Reply-To: <20151110171421.GA21650@ast-mbp.thefacebook.com>

On 11/10/2015 06:14 PM, Alexei Starovoitov wrote:
> On Tue, Nov 10, 2015 at 09:25:01AM -0500, Steven Rostedt wrote:
>> On Tue, 10 Nov 2015 14:31:38 +0100
>> Daniel Borkmann <daniel@iogearbox.net> wrote:
>>
>>> On 11/10/2015 01:55 PM, Arnd Bergmann wrote:
>>>> In my ARM randconfig tests, I'm getting a build error for
>>>> newly added code in bpf_perf_event_read and bpf_perf_event_output
>>>> whenever CONFIG_PERF_EVENTS is disabled:
>>>>
>>>> kernel/trace/bpf_trace.c: In function 'bpf_perf_event_read':
>>>> kernel/trace/bpf_trace.c:203:11: error: 'struct perf_event' has no member named 'oncpu'
>>>> if (event->oncpu != smp_processor_id() ||
>>>>            ^
>>>> kernel/trace/bpf_trace.c:204:11: error: 'struct perf_event' has no member named 'pmu'
>>>>         event->pmu->count)
>>>>
>>>> This can happen when UPROBE_EVENT is enabled but KPROBE_EVENT
>>>> is disabled. I'm not sure if that is a configuration we care
>>>> about, otherwise we could prevent this case from occuring by
>>>> adding Kconfig dependencies.
>>>
>>> I think that seems better than spreading #if IS_ENABLEDs into the code.
>>> Probably enough to add a 'depends on PERF_EVENTS' to config BPF_EVENTS,
>>> so it's also explicitly documented.
>>>
>>
>> So just do the following then?
>>
>> -- Steve
>>
>> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
>> index 8d6363f42169..f5aecff2d243 100644
>> --- a/kernel/trace/Kconfig
>> +++ b/kernel/trace/Kconfig
>> @@ -434,7 +434,7 @@ config UPROBE_EVENT
>>
>>   config BPF_EVENTS
>>   	depends on BPF_SYSCALL
>> -	depends on KPROBE_EVENT || UPROBE_EVENT
>> +	depends on KPROBE_EVENT && UPROBE_EVENT
>
> yeah that's definitely cleaner and avoids ifdef creep in the future.

Agreed, that's better.

      reply	other threads:[~2015-11-10 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 12:55 [PATCH, REPORT] bpf_trace: build error without PERF_EVENTS Arnd Bergmann
2015-11-10 13:31 ` Daniel Borkmann
2015-11-10 14:25   ` Steven Rostedt
2015-11-10 17:14     ` Alexei Starovoitov
2015-11-10 17:23       ` Daniel Borkmann [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=56422802.5050901@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=acme@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=wangnan0@huawei.com \
    --cc=xiakaixu@huawei.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).