aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_prof
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-06-01 08:46:15 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-06-01 08:46:15 +0100
commit35e79bf4225949d3666551246bf85f8198707e3c (patch)
tree7373b692a08a9991d04d2ffd900c18ed2ea3db73 /crates/ra_prof
parent5023860a55328db5ef024225263ed71f46a19350 (diff)
parent4dd7faed3400c8ed204c6879258707ce6f7a90d4 (diff)
Merge #1358
1358: apply profile filter to top-level entries only r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_prof')
-rw-r--r--crates/ra_prof/src/lib.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs
index 031405879..e681b8e0b 100644
--- a/crates/ra_prof/src/lib.rs
+++ b/crates/ra_prof/src/lib.rs
@@ -76,17 +76,16 @@ pub fn profile(desc: &str) -> Profiler {
76 } 76 }
77 }; 77 };
78 } 78 }
79
80 if stack.starts.len() > stack.filter_data.depth { 79 if stack.starts.len() > stack.filter_data.depth {
81 return Profiler { desc: None }; 80 return Profiler { desc: None };
82 } 81 }
83 82 let allowed = &stack.filter_data.allowed;
84 if stack.filter_data.allowed.is_empty() || stack.filter_data.allowed.contains(desc) { 83 if stack.starts.is_empty() && !allowed.is_empty() && !allowed.contains(desc) {
85 stack.starts.push(Instant::now()); 84 return Profiler { desc: None };
86 Profiler { desc: Some(desc.to_string()) }
87 } else {
88 Profiler { desc: None }
89 } 85 }
86
87 stack.starts.push(Instant::now());
88 Profiler { desc: Some(desc.to_string()) }
90 }) 89 })
91} 90}
92 91