On Mon, May 19, 2025 at 11:06 PM Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > While testing the BPF based THP adjustment feature, I noticed > bpf_get_current_comm() isn't available in bpf_base_func_proto. As this is a > commonly used helper, we should add it to bpf_base_func_proto. > > Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx> > --- > kernel/bpf/cgroup.c | 2 -- > kernel/bpf/helpers.c | 2 ++ > 2 files changed, 2 insertions(+), 2 deletions(-) > please rebase, there were changes in this area and bpf_get_current_comm is already in bpf_base_func_proto (and cgroup_current_func_proto is gone) > diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c > index 84f58f3d028a..22cd4f54d023 100644 > --- a/kernel/bpf/cgroup.c > +++ b/kernel/bpf/cgroup.c > @@ -2609,8 +2609,6 @@ cgroup_current_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) > switch (func_id) { > case BPF_FUNC_get_current_uid_gid: > return &bpf_get_current_uid_gid_proto; > - case BPF_FUNC_get_current_comm: > - return &bpf_get_current_comm_proto; > #ifdef CONFIG_CGROUP_NET_CLASSID > case BPF_FUNC_get_cgroup_classid: > return &bpf_get_cgroup_classid_curr_proto; > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c > index e3a2662f4e33..2a60522cd66f 100644 > --- a/kernel/bpf/helpers.c > +++ b/kernel/bpf/helpers.c > @@ -1965,6 +1965,8 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) > return &bpf_get_current_pid_tgid_proto; > case BPF_FUNC_get_ns_current_pid_tgid: > return &bpf_get_ns_current_pid_tgid_proto; > + case BPF_FUNC_get_current_comm: > + return &bpf_get_current_comm_proto; > default: > break; > } > -- > 2.43.5 >