From b1b4e1e38b3a1d094de5515eaae2c7e6b6e542ed Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Fri, 10 Dec 2021 15:26:16 -0800 Subject: [PATCH] Set a BIONIC_COVERAGE .mk variable Bug: http://b/194128476 Bug: http://b/210012154 Set BIONIC_COVERAGE to true if coverage instrumentation is enabled for bionic/libc. This is used in system/core/rootdir/Android.mk to set the default LLVM_PROFILE_FILE environment. Test: Run tests with this topic and verify coverage still works and also test memory-mapped coverage (death tests, JNI code in CTS) Change-Id: I585f3e43dfcb82dd3c211051d354dd79ee77b1fb --- core/config.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/config.mk b/core/config.mk index 4794816bd0..11c5906c6c 100644 --- a/core/config.mk +++ b/core/config.mk @@ -331,6 +331,22 @@ else JAVA_TMPDIR_ARG := endif +# http://b/210012154 Set BIONIC_COVERAGE if coverage is enabled for bionic. This +# disable continuous coverage and removes '%c' from init.environ.rc:LLVM_PROFILE_FILE +ifeq ($(NATIVE_COVERAGE_PATHS),*) + ifeq ($(filter bionic%,$(NATIVE_COVERAGE_EXCLUDE_PATHS)),) + BIONIC_COVERAGE := true + else + BIONIC_COVERAGE := false + endif +else + ifeq ($(filter bionic%,$(NATIVE_COVERAGE_PATHS)),) + BIONIC_COVERAGE := false + else + BIONIC_COVERAGE := true + endif +endif + # ############################################################### # Include sub-configuration files # ###############################################################