Re: linux-next: build failure after merge of the tip tree

Peter Zijlstra
2015-04-07T08:54:05Z

On Tue, Apr 07, 2015 at 05:18:58PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the tip tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> kernel/events/core.c: In function 'perf_event_set_bpf_prog':
> kernel/events/core.c:6732:15: error: 'struct bpf_prog_aux' has no member named 'prog_type'
> if (prog->aux->prog_type != BPF_PROG_TYPE_KPROBE) {
> ^
>
> Caused by commit 2541517c32be ("tracing, perf: Implement BPF programs
> attached to kprobes").
>
> I have used the tip tree from next-20150402 for today.

Hmm, tip/master builds fine on ppc64 for me, but does something like the
below help?

---
Subject: perf: Fix BPF filter crud

The BPF filter crud got its CONFIG deps wrong, fix it.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/events/core.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 06917d5..1d94b92 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6711,6 +6711,25 @@ static void perf_event_free_filter(struct perf_event *event)
ftrace_profile_free_filter(event);
}

+#else /* EVENT_TRACING */
+
+static inline void perf_tp_register(void)
+{
+}
+
+static int perf_event_set_filter(struct perf_event *event, void __user *arg)
+{
+ return -ENOENT;
+}
+
+static void perf_event_free_filter(struct perf_event *event)
+{
+}
+
+#endif /* EVENT_TRACING */
+
+#if defined CONFIG_BPF_EVENTS && defined CONFIG_EVENT_TRACING
+
static int perf_event_set_bpf_prog(struct perf_event *event, u32 prog_fd)
{
struct bpf_prog *prog;
@@ -6754,20 +6773,7 @@ static void perf_event_free_bpf_prog(struct perf_event *event)
}
}

-#else
-
-static inline void perf_tp_register(void)
-{
-}
-
-static int perf_event_set_filter(struct perf_event *event, void __user *arg)
-{
- return -ENOENT;
-}
-
-static void perf_event_free_filter(struct perf_event *event)
-{
-}
+#else /* BPF_EVENTS && EVENT_TRACING */

static int perf_event_set_bpf_prog(struct perf_event *event, u32 prog_fd)
{
@@ -6777,7 +6783,8 @@ static int perf_event_set_bpf_prog(struct perf_event *event, u32 prog_fd)
static void perf_event_free_bpf_prog(struct perf_event *event)
{
}
-#endif /* CONFIG_EVENT_TRACING */
+
+#endif /* BPF_EVENTS && EVENT_TRACING */

#ifdef CONFIG_HAVE_HW_BREAKPOINT
void perf_bp_event(struct perf_event *bp, void *data)