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

Skip entire function if entry offset excluded #3172

Merged
merged 4 commits into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/agent/coverage/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ pub fn find_coverage_sites(
let mut offsets = BTreeSet::new();

for function in debuginfo.functions() {
if let Some(location) = symcache.lookup(function.offset.0).next() {
if let Some(file) = location.file() {
if !allowlist.source_files.is_allowed(file.full_path()) {
debug!(
"skipping sweep of `{}:{}` due to excluded source path `{}`",
module.executable_path(),
function.name,
file.full_path(),
);
continue;
}
}
}

let blocks = block::sweep_region(module, &debuginfo, function.offset, function.size)?;

for block in &blocks {
Expand Down