From 5be34768b1dddfd60c80e42d5b89f305c3c2ec5a Mon Sep 17 00:00:00 2001 From: Joe Ranweiler Date: Tue, 20 Apr 2021 19:16:15 +0000 Subject: [PATCH 1/2] Accept `IntoIterator` in coverage ctors --- src/agent/coverage/src/block.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/coverage/src/block.rs b/src/agent/coverage/src/block.rs index 7ac6f0a36e..cb7c258967 100644 --- a/src/agent/coverage/src/block.rs +++ b/src/agent/coverage/src/block.rs @@ -26,7 +26,7 @@ impl CommandBlockCov { /// Returns `true` if the module was newly-inserted (which initializes its /// block coverage map). Otherwise, returns `false`, and no re-computation /// is performed. - pub fn insert(&mut self, path: &ModulePath, offsets: impl Iterator) -> bool { + pub fn insert(&mut self, path: &ModulePath, offsets: impl IntoIterator) -> bool { use std::collections::btree_map::Entry; match self.modules.entry(path.clone()) { @@ -100,8 +100,8 @@ pub struct ModuleCov { } impl ModuleCov { - pub fn new(offsets: impl Iterator) -> Self { - let blocks = offsets.map(|o| (o, BlockCov::new(o))).collect(); + pub fn new(offsets: impl IntoIterator) -> Self { + let blocks = offsets.into_iter().map(|o| (o, BlockCov::new(o))).collect(); Self { blocks } } From 1f87724e49b0d4d2747a42c9d16582672765f07d Mon Sep 17 00:00:00 2001 From: Joe Ranweiler Date: Tue, 20 Apr 2021 19:18:15 +0000 Subject: [PATCH 2/2] Reduce log levels for coverage --- src/agent/coverage/src/block.rs | 2 +- src/agent/coverage/src/block/windows.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/coverage/src/block.rs b/src/agent/coverage/src/block.rs index cb7c258967..92621256e9 100644 --- a/src/agent/coverage/src/block.rs +++ b/src/agent/coverage/src/block.rs @@ -42,7 +42,7 @@ impl CommandBlockCov { let entry = self.modules.entry(path.clone()); if let btree_map::Entry::Vacant(_) = entry { - log::warn!( + log::debug!( "initializing missing module when incrementing coverage at {}+{:x}", path, offset diff --git a/src/agent/coverage/src/block/windows.rs b/src/agent/coverage/src/block/windows.rs index c11461f575..bbd41f3ba4 100644 --- a/src/agent/coverage/src/block/windows.rs +++ b/src/agent/coverage/src/block/windows.rs @@ -184,10 +184,10 @@ impl<'c> Recorder<'c> { log::debug!("set {} breakpoints for module {}", info.blocks.len(), path); } Ok(None) => { - log::warn!("could not find module: {}", path); + log::debug!("could not find module: {}", path); } Err(err) => { - log::warn!("could not disassemble module {}: {:?}", path, err); + log::debug!("could not disassemble module {}: {:?}", path, err); } }