Re: [RFC PATCH v2 2/6] kcov: add build system support for dataflow instrumentation
Peter Zijlstra <[email protected]> Thu, 4 Jun 2026 10:45:19 +0200
| Newsgroups | org.kernel.vger.workflows,dev.linux.lists.llvm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jun 03, 2026 at 07:43:29PM +0200, Yunseong Kim wrote: > Add CFLAGS_KCOV_DATAFLOW and RUSTFLAGS_KCOV_DATAFLOW exports to > scripts/Makefile.kcov, containing: > -fsanitize-coverage=dataflow-args,dataflow-ret -g > (with optional -fno-inline via CONFIG_KCOV_DATAFLOW_NO_INLINE) > > scripts/Makefile.lib applies these flags when a module's Makefile sets: > KCOV_DATAFLOW_file.o := y (per-file) > KCOV_DATAFLOW := y (per-directory) > > Also supports CONFIG_KCOV_DATAFLOW_INSTRUMENT_ALL for global enablement. > The flags are only applied to kernel objects (same guard as basic KCOV). > > Signed-off-by: Yunseong Kim <[email protected]> > --- > scripts/Makefile.kcov | 6 ++++++ > scripts/Makefile.lib | 7 +++++++ > 2 files changed, 13 insertions(+) > > diff --git a/scripts/Makefile.kcov b/scripts/Makefile.kcov > index 78305a84ba9d..101173fe194b 100644 > --- a/scripts/Makefile.kcov > +++ b/scripts/Makefile.kcov > @@ -2,10 +2,16 @@ > kcov-flags-y += -fsanitize-coverage=trace-pc > kcov-flags-$(CONFIG_KCOV_ENABLE_COMPARISONS) += -fsanitize-coverage=trace-cmp > > +# KCOV dataflow: trace function args and return values > +kcov-dataflow-flags-y := -fsanitize-coverage=dataflow-args,dataflow-ret -g > +kcov-dataflow-flags-$(CONFIG_KCOV_DATAFLOW_NO_INLINE) += -fno-inline https://clang.llvm.org/docs/ClangCommandLineReference.html Has no mention of -fno-inline, furthermore, what are the exact semantics? Does it inhibit __always_inline?