I'm currently working on a use case where I'm running an eBPF program inside a Docker container. I want to filter requests based on the process ID (PID), but I've encountered an issue with the pids obtained from my hooks(refer). Specifically, I've put a hook on cgroup/connect4, but when I try to load the program, I receive the error message unknown func bpf_get_ns_current_pid_tgid#120
.
However, when I use the bpf_get_ns_current_pid_tgid function within a kprobe method, it works fine. I suspect that bpf_get_ns_current_pid_tgid might not be supported in every eBPF program type.
Could anyone provide information on which eBPF program types support the bpf_get_ns_current_pid_tgid helper function? I would greatly appreciate any insights or references to documentation that can help clarify this compatibility issue.
Thank you in advance for your assistance!