Skip to content

Commit 95b861a

Browse files
namhyungborkmann
authored andcommitted
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 <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 328aac5 commit 95b861a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/bpf_trace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,8 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
10171017
#ifdef CONFIG_CGROUPS
10181018
case BPF_FUNC_get_current_cgroup_id:
10191019
return &bpf_get_current_cgroup_id_proto;
1020+
case BPF_FUNC_get_current_ancestor_cgroup_id:
1021+
return &bpf_get_current_ancestor_cgroup_id_proto;
10201022
#endif
10211023
case BPF_FUNC_send_signal:
10221024
return &bpf_send_signal_proto;

0 commit comments

Comments
 (0)