[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5e45b11b-853d-49e6-a355-251dc1362676@app.fastmail.com>
Date: Fri, 20 Oct 2023 22:06:56 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Alexei Starovoitov" <alexei.starovoitov@...il.com>,
"Arnd Bergmann" <arnd@...nel.org>
Cc: "Yonghong Song" <yonghong.song@...ux.dev>,
"Alexei Starovoitov" <ast@...nel.org>,
"Daniel Borkmann" <daniel@...earbox.net>,
"Andrii Nakryiko" <andrii@...nel.org>,
"Chuyi Zhou" <zhouchuyi@...edance.com>,
"Tejun Heo" <tj@...nel.org>,
"Martin KaFai Lau" <martin.lau@...ux.dev>,
"Song Liu" <song@...nel.org>,
"John Fastabend" <john.fastabend@...il.com>,
"KP Singh" <kpsingh@...nel.org>,
"Stanislav Fomichev" <sdf@...gle.com>,
"Hao Luo" <haoluo@...gle.com>, "Jiri Olsa" <jolsa@...nel.org>,
"Oleg Nesterov" <oleg@...hat.com>, bpf <bpf@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] bpf: hide cgroup functions for configs without cgroups
On Fri, Oct 20, 2023, at 19:26, Alexei Starovoitov wrote:
> On Fri, Oct 20, 2023 at 6:27 AM Arnd Bergmann <arnd@...nel.org> wrote:
>> @@ -904,6 +904,7 @@ __diag_push();
>> __diag_ignore_all("-Wmissing-prototypes",
>> "Global functions as their definitions will be in vmlinux BTF");
>>
>> +#ifdef CONFIG_CGROUPS
>> __bpf_kfunc int bpf_iter_css_task_new(struct bpf_iter_css_task *it,
>> struct cgroup_subsys_state *css, unsigned int flags)
>> {
>> @@ -947,6 +948,7 @@ __bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)
>> css_task_iter_end(kit->css_it);
>> bpf_mem_free(&bpf_global_ma, kit->css_it);
>> }
>> +#endif
>
> Did you actually test build it without cgroups and with bpf+btf?
> I suspect the resolve_btfid step should be failing the build.
> It needs
> #ifdef CONFIG_CGROUPS
> around BTF_ID_FLAGS(func, bpf_iter_css_task*
No, I did test with a few hundred random configurations, but it
looks like CONFIG_DEBUG_INFO_BTF is always disabled
in my builds because I force-disable CONFIG_DEBUG_INFO
to speed up my builds.
I tried reproducing it with CONFIG_DEBUG_INFO_BTF enabled
and it didn't immediately fail but it clearly makes sense that
we'd need another #ifdef.
Arnd
Powered by blists - more mailing lists