]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bpf: Allow bpf_get_current_ancestor_cgroup_id for tracing
authorNamhyung Kim <namhyung@kernel.org>
Sun, 27 Jun 2021 15:36:27 +0000 (08:36 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 28 Jun 2021 13:43:02 +0000 (15:43 +0200)
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
kernel/trace/bpf_trace.c

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