aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_prof
diff options
context:
space:
mode:
authorDmitry <[email protected]>2020-02-16 17:36:48 +0000
committerDmitry <[email protected]>2020-02-16 17:36:48 +0000
commit58e15d12e4211306273b0128cb4a80b552889543 (patch)
tree70e129b7cd76c55d5cb86f9b084db001f73a2003 /crates/ra_prof
parentb446384956243ce6bdcef2a869123a2605e597ed (diff)
parent742b3b5744fbca1a5587e2898cd5b74d55853a47 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'crates/ra_prof')
-rw-r--r--crates/ra_prof/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs
index d38ff397e..c0bfbc2ee 100644
--- a/crates/ra_prof/src/lib.rs
+++ b/crates/ra_prof/src/lib.rs
@@ -26,6 +26,13 @@ pub use crate::memory_usage::{Bytes, MemoryUsage};
26#[global_allocator] 26#[global_allocator]
27static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; 27static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
28 28
29pub fn init() {
30 set_filter(match std::env::var("RA_PROFILE") {
31 Ok(spec) => Filter::from_spec(&spec),
32 Err(_) => Filter::disabled(),
33 });
34}
35
29/// Set profiling filter. It specifies descriptions allowed to profile. 36/// Set profiling filter. It specifies descriptions allowed to profile.
30/// This is helpful when call stack has too many nested profiling scopes. 37/// This is helpful when call stack has too many nested profiling scopes.
31/// Additionally filter can specify maximum depth of profiling scopes nesting. 38/// Additionally filter can specify maximum depth of profiling scopes nesting.