-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ebpf exporter to support CORE #130
Conversation
@bobrik Can you help to take a look? thanks. |
There are lots of changes here and many of them are unrelated:
Could you take care of this first to make it easier to look at the actual changes? There are SPDX headers for LGPL, I'll need to ask legal people whether we can accept it. I would also like to see some documentation in the README on how to use this. |
@bobrik Thanks for the suggestion. I will take care of them. |
ad9fcd3
to
2347e3c
Compare
How to run ebpf_exporter with CORE mode?
docker run -d --net=host --privileged -v /sys/kernel/debug:/sys/kernel/debug ebpf-exporter:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I was not able to build this either with the Dockerfile or in a Debian Bullseye VM with libbpf from backports. Happy to have another look when I can build and run it myself.
8c0e953
to
d66bcf3
Compare
@bobrik I addressed some comments today but not finished all of these, will continue to do this tomorrow. |
Due to not wanting to install Docker on all machines I intend to run ebpf_exporter on I tried to build on Bullseye vm as well. When running "./scripts/build-deb.sh release" I got:
When trying to install python-netaddr:
Installing python3-netaddr works fine on Bullseye, but that doesn't address the dependency issue which comes from ./debian/control:
I tried changing to python3-netaddr, but still get the same error. |
@rob-scheepens, I think bcc build script checks out Not sure how it's related to CO-RE. |
@bobrik : Using the Dockerfile from https://github.com/wenlxie/ebpf_exporter/blob/upstream.master.core/Dockerfile I attempted to convert this to commands that can be scripted and run on a Debian Bullseye vm. All commands for now assume the user is root.
At this point a modification to the debian/control file is needed, see rob-scheepens/bcc@6335995 and my previous commit on that file, changing python2 dependencies as these do not work on Bullseye anymore. Script to make the changes and commit them (since the build-deb.sh script checks out HEAD):
This gets me up to the point where I run into the issue described in aquasecurity/libbpfgo#1, where "go install" failed. Closer inspection learned that the -I include path in CFLAGS did not exist. Changing it to /root/libbpf/src/ made things progress more, up to the point where it fails on vmlinux.h missing:
Using bpftool I generated vmlinux.h and put it in /tmp/libbpf-tools/ (is that correct?). Then I still got the C.BPF* errors as seen above:
Digging further... updating libbpf-dev from bullseye-backports got rid of the above warnings, but still ebpf_exporter is not built:
Checking under vendor shows there is no cloudflare (yet):
Is that the reason the build is not complete? Turns out ebpf_exporter binary is under /root/go/bin. :) Running it with config.yaml gives me this error:
The above error was resolved by running "make all" in examples/CORE. Then, when running, I got this error:
This seems to be an issue with the config.yaml, when using biolatency.yaml it works:
|
@bobrik : for now, this is the script I use to get it working on Bullseye:
cc: @wenlxie |
d66bcf3
to
1a70e5d
Compare
I update the code:
@bobrik @rob-scheepens
Appreciate that if you can help to have a try of this. |
1a70e5d
to
a27ff34
Compare
@wenlxie : using your latest upstream.master.core I checked again and the script above still works. When you say "Remove bcc dependency", does that mean that there is no need to have bcc installed/built anymore, and that I can remove it from the script? When I tested that, things failed. |
It means remove the bcc codes from the code/vendor But it still need the header file in bcc to compile the bpf binary. |
I was able to build this locally with some modifications. My plan is to clean this up and see how we can get this merged. Apologies for the delay. |
decd677
to
9e5ec3e
Compare
f6ef166
to
5fd530b
Compare
aquasecurity/libbpfgo#258 looks like it could be a good replacement for kaddr (or any argument) passing. Not sure if we should wait for it though. |
Many thanks @wenlxie! I'll try to roll it out internally to iron any kinks before tagging a proper v2.0.0 release. |
This PR is for ebpf exporter to support CORE.
This can make ebpf exporter to get CORE benefits and tolerate kernel changes.
I'd believe that there are more things need to do with this so please share your suggestions. Thanks.