Re: [PATCH 09/15] sched/headers: Introduce kernel/sched/build_policy.c and build multiple .c files there
From: Thomas Gleixner
Date: Wed Aug 24 2022 - 11:50:15 EST
On Tue, Aug 23 2022 at 15:47, suhui kernel wrote:
> Hi Ingo, Since commit f96eca432015ddc1b621632488ebc345bca06791 merged, the
> scripts/clang-tools/gen_compile_commands.py can't work very well.
>
> In this patch the build_policy.c and build_utility.c include kernel/sched/xxx.c(
> such as rt.c idle.c...), so it compile the build_utility.o build_policy.o directly,
> and it won't generate kernel/sched/xxx.c(such as rt.o idle.o), so the gen_compile_commands.py
> can't work.
gen_compile_commands.py works perfectly fine and generates the entries
for build_policy.o and built_utility.o as expected.
gen_compile_commands.py scans the build tree for .cmd files and extracts
the command line from those files into the the json file. As there is no
.cmd file for the .c files which are included into build_*.c there wont
be entries in the json file either.
> It will report "[8/23/2022, 3:24:06 PM] "rt.c" not found in "${workspaceFolder}/compile_commands.json".
> 'includePath' from c_cpp_properties.json in folder 'linux' will be
> used for this file instead.".
No idea where this message comes from, but certainly not from
gen_compile_commands.py because that generates the file.
The clang-tidy kernel build target generates and uses that file and that
works perfectly fine.
So what exactly broke?
Thanks,
tglx