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

Support calling kfuncs #3169

Open
jfernandez opened this issue May 15, 2024 · 0 comments
Open

Support calling kfuncs #3169

jfernandez opened this issue May 15, 2024 · 0 comments
Labels
enhancement New feature or request, changes on existing features

Comments

@jfernandez
Copy link

Is your feature request related to a problem? Please describe.

There are some instrumentation use-cases where calling a kfunc would be useful. For example, when you want to get the cgroup struct from an ID using bpf_cgroup_from_id, or when you want to grab a task_struct when only a pid is available, via bpf_task_from_pid.

Today, I need to write my own BPF program to achieve this type of instrumentation.

Describe the solution you'd like

In BPF, you need to explicitly define which kfunc's your program will call, ie:

extern struct task_struct *bpf_task_from_pid(s32 pid);

bpftrace should also have something similar.

Describe alternative solutions or features you've considered

Writing my own bpf program.

@jfernandez jfernandez added the enhancement New feature or request, changes on existing features label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request, changes on existing features
Projects
None yet
Development

No branches or pull requests

1 participant