Skip to content
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

btf: support both elf and raw BTF in loadKernelSpec #1177

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

wxx213
Copy link
Contributor

@wxx213 wxx213 commented Oct 19, 2023

We use the cilium ebpf library in some old centos 4.18 kernel and the btf file generated by phaloe tools for CO-RE,the error occurs as like "apply CO-RE relocations: bad magic number '[159 235 1 0]' in record at byte 0x0", since the btf file we used is raw format when the cilium ebpf library only support parse elf format btf file。

Support both elf and raw BTF parse will make the cilium library be available in old centos 4.18 kernel(centos 8.0 or centos 8.1 kernel).

What's more, I see the libbpf added the same feature: libbpf/libbpf@0420f75

The similar commit in cilium library: 48bf2ba

@lmb
Copy link
Collaborator

lmb commented Oct 19, 2023

Hi, can you tell me why you need this?

@wxx213
Copy link
Contributor Author

wxx213 commented Oct 20, 2023

Hi, can you tell me why you need this?

Okay, I added it in my first comment just now.

@wxx213
Copy link
Contributor Author

wxx213 commented Oct 26, 2023

Hi, can you tell me why you need this?

Okay, I added it in my first comment just now.

@lmb Hi, could you help to check this?

@ti-mo ti-mo requested a review from lmb October 30, 2023 12:19
@ti-mo
Copy link
Collaborator

ti-mo commented Oct 30, 2023

Makes sense to me. I was always under the impression the binaries in the search paths were raw BTF, but apparently not. @wxx213 Code doesn't compile, though. 🙂

@wxx213
Copy link
Contributor Author

wxx213 commented Oct 31, 2023

Makes sense to me. I was always under the impression the binaries in the search paths were raw BTF, but apparently not. @wxx213 Code doesn't compile, though. 🙂

@ti-mo Sorry, I didn't notice the compile issue, fix done. Please help to check once again

Signed-off-by: Wang Xingxing <stellarwxx@gmail.com>
@lmb lmb merged commit 78e76c9 into cilium:main Nov 1, 2023
13 checks passed
@lmb
Copy link
Collaborator

lmb commented Nov 1, 2023

Thanks for the explanation, I updated your commit message with the details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants