diff options
author | 2022-01-26 22:14:32 -0800 | |
---|---|---|
committer | 2022-03-04 14:07:53 -0800 | |
commit | b37ae58a3d88416f61b72911d2e656d89c49490b (patch) | |
tree | f8ce9d58a7701ab1725a927f3980f2dabd3cd153 /rust/coverage.go | |
parent | 7010c53c5057fdbc7b035b6768291eac7968fcb3 (diff) |
Memory mapped coverage (take 2)
Add a build variable, CLANG_COVERAGE_CONTINUOUS_MODE, instead of
selecting based on paths.
Test: CLANG_COVERAGE_CONTINUOUS_MODE=true m and verify continuous mode works
Change-Id: I731172fc1f00e1cabff8efcf8b99f9a48210b446
Diffstat (limited to 'rust/coverage.go')
-rw-r--r-- | rust/coverage.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/coverage.go b/rust/coverage.go index 050b811c7..651ce6e16 100644 --- a/rust/coverage.go +++ b/rust/coverage.go @@ -22,6 +22,7 @@ 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 { @@ -59,6 +60,10 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags flags.LinkFlags = append(flags.LinkFlags, profileInstrFlag, "-g", coverage.OutputFile().Path().String(), "-Wl,--wrap,open") 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 |