pixie-demos icon indicating copy to clipboard operation
pixie-demos copied to clipboard

Error when compiling the ebpf-profiler

Open mingleiw opened this issue 4 years ago • 1 comments

I am using UBuntu 18.04 and I was able to use bcc/profile.py. When I was trying to make the ebpf-profiler, I ran into the following error:

clang++ --std=c++17 -o perf_profiler perf_profiler.cc -lbcc
/tmp/perf_profiler-0943c5.o: In function `ebpf::BPF::BPF(unsigned int, ebpf::TableStorage*)':
perf_profiler.cc:(.text._ZN4ebpf3BPFC2EjPNS_12TableStorageE[_ZN4ebpf3BPFC2EjPNS_12TableStorageE]+0x56): undefined reference to `ebpf::BPFModule::BPFModule(unsigned int, ebpf::TableStorage*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:21: recipe for target 'perf_profiler' failed
make: *** [perf_profiler] Error 1

Is this supported by ubuntu?

mingleiw avatar Oct 26 '21 01:10 mingleiw

I stumbled this, and did a quick check.

This should be BCC's version on your host is too new (or too old). I used 0.16.17-3.3 bcc version, and make is OK. Could you check your bcc version, with:

dpkg -l bcc

If you are using ubuntu. Other OS distros have their own package command for checking version. But you might need to find that yourself.

yzhao1012 avatar Jan 13 '22 22:01 yzhao1012