From e59f0f66fca09c641cc92baeebecdb1c8acf9bba Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Tue, 8 Jun 2021 15:38:26 -0700 Subject: [PATCH] Enable continuous coverage: use '%c' specifier in LLVM_PROFILE_FILE Bug: http://b/194128476 Bug: http://b/210012154 - Do not use %c if coverage is enabled for bionic/libc. 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: Id1ade9c6f45d69a1da912e3e57acd1d0197c11b5 --- rootdir/Android.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 9b80575ef..993d64214 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -75,9 +75,14 @@ ifeq ($(NATIVE_COVERAGE),true) EXPORT_GLOBAL_GCOV_OPTIONS := export GCOV_PREFIX /data/misc/trace endif -EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS := ifeq ($(CLANG_COVERAGE),true) - EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS := export LLVM_PROFILE_FILE /data/misc/trace/clang-%20m.profraw + ifeq ($(BIONIC_COVERAGE),false) + # http://b/210012154 Disable continuous coverage if instrumentation is on + # for bionic/libc + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS := export LLVM_PROFILE_FILE /data/misc/trace/clang%c-%20m.profraw + else + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS := export LLVM_PROFILE_FILE /data/misc/trace/clang-%20m.profraw + endif endif # Put it here instead of in init.rc module definition,