-
Notifications
You must be signed in to change notification settings - Fork 274
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
Unable to run kprobe example #83
Comments
yes, you need kernel BTF for CO-RE to work. You can work around that for such trivial example by adding
before vmlinux.h include, but is there any reason why you can't upgrade your Ubuntu to something a bit more modern that will restrict you less in what you can do with BPF? |
Yes, I have a huge set of BCC-style kprobes that we are using with Centos 7/RHEL servers, amazon Linux 1 & 2, ubuntu 18.04 +, etc. The goal is to migrate these to libbpf and BPF CO-RE using btfhub files for the older kernels. I assumed this would be possible after seeing the BTF files for the kernels we currently support via BCC and kernel headers. |
BTW, I did modify this kprobe example to load the BTF for my kernel using the opts: struct bpf_object_open_opts openopts = {}; /tmp/vmlinux.btf is the file I obtained for my kernel from btfhub-archives. |
Adding this define did not resolve the issue. |
Even after adding
there is still a problem due to, I believe, the usage of BPF_CORE_READ:
When I code around this using bpf_probe_read_user, I am able to get things to work. This brings me back to a core question (no pun intented), are the bpf core helpers not going to work on older kernels even if you have the BTF for that kernel available? |
it should work with btf_custom_path. What's the libbpf debug log output once you specify custom BTF? |
I got this working. My BTF file didn't have all of the symbols I needed for this. I have run this example on 4.15.0-180-generic and on 3.10.0-957 (centos 7.6). |
I commented on #68 about how I could not get this to run on ubuntu 18.04. I was able to get minimal working, by removing the global variable. I am using kernel version 4.15.0-180-generic. The kprobe example, however, is not running for some other reason:
The text was updated successfully, but these errors were encountered: