Re: [RFC PATCH 1/3] llvm-cov: add Clang's Source-based Code Coverage support

Thomas Gleixner
2024-08-25T11:52:28Z

On Sat, Aug 24 2024 at 18:06, Wentao Zhang wrote:
> Makefile | 3 +
> arch/Kconfig | 1 +
> arch/x86/Kconfig | 1 +
> arch/x86/kernel/vmlinux.lds.S | 2 +
> include/asm-generic/vmlinux.lds.h | 38 +++++
> kernel/Makefile | 1 +
> kernel/llvm-cov/Kconfig | 29 ++++
> kernel/llvm-cov/Makefile | 5 +
> kernel/llvm-cov/fs.c | 253 ++++++++++++++++++++++++++++++
> kernel/llvm-cov/llvm-cov.h | 156 ++++++++++++++++++
> scripts/Makefile.lib | 10 ++
> scripts/mod/modpost.c | 2 +

Please split this into two parts:

1) Add the infrastructure
2) Enable it on x86

Also the ordering of this patch series is wrong.

First you enable it on x86 and then you mark the places which cannot be
instrumented. You really want to do this in this order:

1) Add the infrastructure
2) Prevent instrumentation in drivers/firmware
3) Prevent instrumentation in kernel/trace
4) Prevent instrumentation in modfinal
5) Prevent instrumentation in x86
6) Enable it on x86

Thanks,

tglx