[PATCH 1/2] arch: um: Add Clang coverage support

David Gow davidgow at google.com
Wed Oct 25 01:25:56 PDT 2023


On Fri, 20 Oct 2023 at 17:22, Michał Winiarski
<michal.winiarski at intel.com> wrote:
>
> Clang uses a different set of command line arguments for enabling
> coverage.
>
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> ---

This works brilliantly here -- I'm very glad to finally be able to use
something newer than gcc 6!

I assume this will go in via the UML tree, but if you want, we can
take it via KUnit.

Tested-by: David Gow <davidgow at google.com>

Cheers,
-- David


>  arch/um/Makefile-skas | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/um/Makefile-skas b/arch/um/Makefile-skas
> index ac35de5316a6..67323b028999 100644
> --- a/arch/um/Makefile-skas
> +++ b/arch/um/Makefile-skas
> @@ -4,7 +4,12 @@
>  #
>
>  GPROF_OPT += -pg
> +
> +ifdef CONFIG_CC_IS_CLANG
> +GCOV_OPT += -fprofile-instr-generate -fcoverage-mapping
> +else
>  GCOV_OPT += -fprofile-arcs -ftest-coverage
> +endif
>
>  CFLAGS-$(CONFIG_GCOV) += $(GCOV_OPT)
>  CFLAGS-$(CONFIG_GPROF) += $(GPROF_OPT)
> --
> 2.42.0
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4003 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/linux-um/attachments/20231025/9affd629/attachment.p7s>


More information about the linux-um mailing list