From 865e05b5b47d3e27e8fe4458662e751e492a0f51 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Jan 2021 14:55:13 +0300 Subject: Make printin the backtrace more convenient --- crates/profile/Cargo.toml | 2 -- crates/profile/src/lib.rs | 15 --------------- 2 files changed, 17 deletions(-) (limited to 'crates/profile') diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml index c5dfdff32..4951f1835 100644 --- a/crates/profile/Cargo.toml +++ b/crates/profile/Cargo.toml @@ -13,7 +13,6 @@ doctest = false once_cell = "1.3.1" cfg-if = "1" libc = "0.2.73" -backtrace = { version = "0.3.44", optional = true } arena = { path = "../arena", version = "0.0.0" } @@ -24,5 +23,4 @@ perf-event = "0.4" cpu_profiler = [] # Uncomment to enable for the whole crate graph -# default = [ "backtrace" ] # default = [ "cpu_profiler" ] diff --git a/crates/profile/src/lib.rs b/crates/profile/src/lib.rs index ab19271c7..aa6ccc36c 100644 --- a/crates/profile/src/lib.rs +++ b/crates/profile/src/lib.rs @@ -15,21 +15,6 @@ pub use crate::{ stop_watch::{StopWatch, StopWatchSpan}, }; -/// Prints backtrace to stderr, useful for debugging. -#[cfg(feature = "backtrace")] -pub fn print_backtrace() { - let bt = backtrace::Backtrace::new(); - eprintln!("{:?}", bt); -} -#[cfg(not(feature = "backtrace"))] -pub fn print_backtrace() { - eprintln!( - r#"enable the backtrace feature: - profile = {{ path = "../profile", features = [ "backtrace"] }} -"# - ); -} - thread_local!(static IN_SCOPE: RefCell = RefCell::new(false)); /// Allows to check if the current code is withing some dynamic scope, can be -- cgit v1.2.3