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

Using bpf_for_each_map_elem helper with BCC #3418

Open
sebymiano opened this issue May 10, 2021 · 4 comments
Open

Using bpf_for_each_map_elem helper with BCC #3418

sebymiano opened this issue May 10, 2021 · 4 comments

Comments

@sebymiano
Copy link
Contributor

Hi all,
I was trying to use the new bpf_for_each_map_elem helper within a BCC-based application.
I have modified the rewriter to support a new function so that the helper can be called in this way:

map.for_each_elem(callback_function, &data, 0);

However, I get the following error when trying to deploy the program (kernel 5.13rc1, LLVM10):

HINT: The 'unknown opcode' can happen if you reference a global or static variable, or data in read-only section.

I guess the problem is within the "callback_function", which is not correctly relocated.
Does anyone have an idea of how to solve this issue?

@yonghong-song
Copy link
Collaborator

@sebymiano Yes, currently bcc does not support callback functions. @davemarchevsky is working on bcc trying to incorporate more functionalities from libbpf repo to bcc. Once libbpf is "fully" available to bcc, we should be able to resolve this issue. Thanks!

@sebymiano
Copy link
Contributor Author

@yonghong-song thanks a lot for the reply.
If I can help you or @davemarchevsky in porting additional functionalities from libbpf to BCC I will be happy to do it, just let me know.

@ek-nath
Copy link

ek-nath commented Jan 6, 2023

👋 Is this available now?

@yonghong-song
Copy link
Collaborator

Not yet. Currently, there is an effort to utilize the libbpf infrastructure (#4405) which should be able to address this issue.

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

No branches or pull requests

3 participants