From aa966c56301ab5ec0f9e096f8a2938c963368426 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Tue, 18 Jan 2022 13:02:05 -0800 Subject: [PATCH] Revert memory mapped coverage Bug: http://b/194128476 Bug: http://b/210012154 Reverts: e6840726bd255f141ae3dba614c9286528d71281 "[coverage] Override -Wframe-larger-than" 71d697c5cbaa6ad0b2d92ab70f3dd5b91d039582 "Enable memory-mapped coverage instrumentation" Coverage metrics dropped for ~10 of the 40 modules. There are also regressions in mainline when running tests on older platform builds. Test: presubmit Change-Id: I4a2b005d3b54764b762b5422e03b7a9ec8727227 --- cc/coverage.go | 14 -------------- rust/coverage.go | 5 ----- 2 files changed, 19 deletions(-) diff --git a/cc/coverage.go b/cc/coverage.go index cd7b199d8..8dd2db19d 100644 --- a/cc/coverage.go +++ b/cc/coverage.go @@ -22,7 +22,6 @@ import ( "android/soong/android" ) -// Add '%c' to default specifier after we resolve http://b/210012154 const profileInstrFlag = "-fprofile-instr-generate=/data/misc/trace/clang-%p-%m.profraw" type CoverageProperties struct { @@ -78,11 +77,6 @@ func (cov *coverage) deps(ctx DepsContext, deps Deps) Deps { return deps } -func EnableContinuousCoverage(ctx android.BaseModuleContext) bool { - // http://b/210012154 Disable continuous coverage if we're instrumenting bionic/libc. - return !ctx.DeviceConfig().NativeCoverageEnabledForPath("bionic/libc") -} - func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags, PathDeps) { clangCoverage := ctx.DeviceConfig().ClangCoverageEnabled() gcovCoverage := ctx.DeviceConfig().GcovCoverageEnabled() @@ -104,11 +98,6 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags } else if clangCoverage { flags.Local.CommonFlags = append(flags.Local.CommonFlags, profileInstrFlag, "-fcoverage-mapping", "-Wno-pass-failed", "-D__ANDROID_CLANG_COVERAGE__") - // Override -Wframe-larger-than that a module may use. - flags.Local.CFlags = append(flags.Local.CFlags, "-Wno-frame-larger-than=") - if EnableContinuousCoverage(ctx) { - flags.Local.CommonFlags = append(flags.Local.CommonFlags, "-mllvm", "-runtime-counter-relocation") - } } } @@ -160,9 +149,6 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,--wrap,getenv") } else if clangCoverage { flags.Local.LdFlags = append(flags.Local.LdFlags, profileInstrFlag) - if EnableContinuousCoverage(ctx) { - flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-mllvm=-runtime-counter-relocation") - } coverage := ctx.GetDirectDepWithTag(getClangProfileLibraryName(ctx), CoverageDepTag).(*Module) deps.WholeStaticLibs = append(deps.WholeStaticLibs, coverage.OutputFile().Path()) diff --git a/rust/coverage.go b/rust/coverage.go index 91d34acce..8fdfa2342 100644 --- a/rust/coverage.go +++ b/rust/coverage.go @@ -22,7 +22,6 @@ import ( var CovLibraryName = "libprofile-clang-extras" -// Add '%c' to default specifier after we resolve http://b/210012154 const profileInstrFlag = "-fprofile-instr-generate=/data/misc/trace/clang-%p-%m.profraw" type coverage struct { @@ -71,10 +70,6 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags "-Wl,-z,nostart-stop-gc", ) deps.StaticLibs = append(deps.StaticLibs, coverage.OutputFile().Path()) - if cc.EnableContinuousCoverage(ctx) { - flags.RustFlags = append(flags.RustFlags, "-C llvm-args=--runtime-counter-relocation") - flags.LinkFlags = append(flags.LinkFlags, "-Wl,-mllvm,-runtime-counter-relocation") - } } return flags, deps