diff options
author | Aleksey Kladov <[email protected]> | 2019-06-01 08:41:47 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-06-01 08:41:47 +0100 |
commit | 4dd7faed3400c8ed204c6879258707ce6f7a90d4 (patch) | |
tree | 7373b692a08a9991d04d2ffd900c18ed2ea3db73 /crates/ra_prof | |
parent | bf801953a3d41e781c136b74815244d07c6cad03 (diff) |
apply profile filter to top-level entries only
Diffstat (limited to 'crates/ra_prof')
-rw-r--r-- | crates/ra_prof/src/lib.rs | 13 |
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 | ||