gobpf icon indicating copy to clipboard operation
gobpf copied to clipboard

Am i missing BPF_PROG_TYPE_RAW_TRACEPOINT from ubuntu bionic ?

Open ymolists opened this issue 6 years ago • 2 comments

I am trying to build the bcc examples inside a docker container defined as:

FROM ubuntu:bionic

RUN \
  apt-get update -qq && apt-get install -y \
  git gcc wget libbpfcc-dev lsb-release linux-headers-$(uname -r)

here is what i am running inside my docker container

root@a0de91a49c54:/src# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

root@a0de91a49c54:/src# uname -r
4.15.0-43-generic

root@a0de91a49c54:/src# go version
go version go1.11 linux/amd64

Here is the error i am getting when i try to build inside that container:

exec: go build -x -o /build/readline ./demos/readline
WORK=/tmp/go-build247496246
mkdir -p $WORK/b028/
cd /opt/go/go1.11.packages/pkg/mod/github.com/iovisor/[email protected]/bcc
CGO_LDFLAGS='"-g" "-O2" "-lbcc" "-lbcc" "-lbcc" "-lbcc"' /opt/go/go1.11/pkg/tool/linux_amd64/cgo -objdir $WORK/b028/ -importpath github.com/iovisor/gobpf/bcc -- -I $WORK/b028/ -g -O2 -I/usr/include/bcc/compat -I/usr/include/bcc/compat -I/usr/include/bcc/compat -I/usr/include/bcc/compat ./module.go ./perf.go ./symbol.go ./table.go
# github.com/iovisor/gobpf/bcc
/opt/go/go1.11.packages/pkg/mod/github.com/iovisor/[email protected]/bcc/module.go:187:24: could not determine kind of name for C.BPF_PROG_TYPE_RAW_TRACEPOINT
/opt/go/go1.11.packages/pkg/mod/github.com/iovisor/[email protected]/bcc/module.go:322:14: could not determine kind of name for C.bpf_attach_raw_tracepoint
Error: running "go build -x -o /build/readline ./demos/readline" failed with exit code 2

ymolists avatar Jan 07 '19 05:01 ymolists

@ymolists I was able to get around this by installing https://github.com/iovisor/bcc from source.

ehazlett avatar Jan 18 '19 04:01 ehazlett

Hi, I'm facing same issue. I installed bcc from latest source.

Could you help resolve this issue?

Environment

root@vm1:~# uname -a
Linux vm1 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
root@vm1:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic
root@vm1:~# go version
go version go1.13.5 linux/amd64

Error

root@vm1:~/gobpf# go run examples/bcc/perf/perf.go
# github.com/iovisor/gobpf/bcc
/usr/local/go/src/github.com/iovisor/gobpf/bcc/module.go:187:24: could not determine kind of name for C.BPF_PROG_TYPE_RAW_TRACEPOINT
root@vm1:~/gobpf#

I have noticed that doesn't describe BPF_PROG_TYPE_RAW_TRACEPOINT in /usr/include/linux/bpf.h.

I think that this header file is old, so if update, it will sucess.

tsubasaxZZZ avatar Dec 22 '19 17:12 tsubasaxZZZ