bpf: Allow bpf_get_current_ancestor_cgroup_id for tracing

Allow the helper to be called from tracing programs. This is needed to
handle cgroup hiererachies in the program.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210627153627.824198-1-namhyung@kernel.org
This commit is contained in:
Namhyung Kim 2021-06-27 08:36:27 -07:00 committed by Daniel Borkmann
parent 328aac5ecd
commit 95b861a793
1 changed files with 2 additions and 0 deletions

View File

@ -1017,6 +1017,8 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
#ifdef CONFIG_CGROUPS #ifdef CONFIG_CGROUPS
case BPF_FUNC_get_current_cgroup_id: case BPF_FUNC_get_current_cgroup_id:
return &bpf_get_current_cgroup_id_proto; return &bpf_get_current_cgroup_id_proto;
case BPF_FUNC_get_current_ancestor_cgroup_id:
return &bpf_get_current_ancestor_cgroup_id_proto;
#endif #endif
case BPF_FUNC_send_signal: case BPF_FUNC_send_signal:
return &bpf_send_signal_proto; return &bpf_send_signal_proto;