Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit a040aa2

Browse files
ranweilerPorges
andauthored
Skip entire function if entry offset excluded (#3172)
Co-authored-by: George Pollard <[email protected]>
1 parent 300a3e2 commit a040aa2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/agent/coverage/src/binary.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ pub fn find_coverage_sites(
120120
let mut offsets = BTreeSet::new();
121121

122122
for function in debuginfo.functions() {
123+
if let Some(location) = symcache.lookup(function.offset.0).next() {
124+
if let Some(file) = location.file() {
125+
if !allowlist.source_files.is_allowed(file.full_path()) {
126+
debug!(
127+
"skipping sweep of `{}:{}` due to excluded source path `{}`",
128+
module.executable_path(),
129+
function.name,
130+
file.full_path(),
131+
);
132+
continue;
133+
}
134+
}
135+
}
136+
123137
let blocks = block::sweep_region(module, &debuginfo, function.offset, function.size)?;
124138

125139
for block in &blocks {

0 commit comments

Comments
 (0)