summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinyuny <linyuny@google.com>2023-09-12 00:49:16 +0000
committerYunyun Lin <linyuny@google.com>2023-09-15 23:55:11 +0000
commit6e354f04cd43d280617bfc0d6b12d54f4d30361c (patch)
tree6c2254464e4c9a7cd8ead4fa81a1c7d25b5acbb8
parent8d1468ba08be1259e4f17e0de210d4d771cf1ef8 (diff)
downloadlwis-6e354f04cd43d280617bfc0d6b12d54f4d30361c.tar.gz
LWIS: Add section to enable gcov for lwis code coverage purpose based on env.
Bug: 267775002 TESTED: https://acma.teams.x20web.corp.google.com/lwis_coverages/lwis_coverage.info Change-Id: I4380778280ec1e6c45dc3b89377425c337f20e75 Signed-off-by: linyuny <linyuny@google.com>
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7bd0636..0262886 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,14 @@ KBUILD_OPTIONS += CONFIG_LWIS=m
include $(KERNEL_SRC)/../private/google-modules/soc/gs/Makefile.include
+KBUILD_CFLAGS += -Wall -Werror
+
+ifeq ($(CONFIG_GCOV_KERNEL),y)
+ KBUILD_CFLAGS += $(call cc-option, -ftest-coverage)
+ KBUILD_CFLAGS += $(call cc-option, -fprofile-arcs)
+ EXTRA_CFLAGS += -DGCOV_PROFILE=1
+endif
+
modules modules_install clean:
$(MAKE) -C $(KERNEL_SRC) M=$(M) W=1 \
$(KBUILD_OPTIONS) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(EXTRA_SYMBOLS)" $(@)