Comment 4 for bug 2021481

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

I tried to call bpftool directly instead of using the /usr/sbin/bpftool script: https://git.launchpad.net/~danilogondolfo/ubuntu/+source/delve/commit/?h=ubuntu/devel&id=2cf86a5394786f9ec8b2931d0c4c05af992be1c2

It kinda worked but then the build failed with:

In file included from /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/trace.bpf.c:1:
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/include/trace.bpf.h:10:17: error: use of undeclared identifier 'BPF_MAP_TYPE_RINGBUF'
   __uint(type, BPF_MAP_TYPE_RINGBUF);
                ^
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/include/trace.bpf.h:15:17: error: use of undeclared identifier 'BPF_MAP_TYPE_RINGBUF'
   __uint(type, BPF_MAP_TYPE_RINGBUF);
                ^
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/trace.bpf.c:243:37: error: use of undeclared identifier 'BPF_RB_FORCE_WAKEUP'
    bpf_ringbuf_submit(parsed_args, BPF_RB_FORCE_WAKEUP);
                                    ^
3 errors generated.
Error: clang: exit status 1

Looks like pkg/proc/internal/ebpf/bpf/include/trace.bpf.h is missing a #include <linux/bpf.h>

Maybe there is a better solution than this hack...