Backtrace::strip
fn strip(
self: Backtrace
) -> Backtrace
Strips out useless junk from the backtrace.
Examples
let groups = allocations().group_by_backtrace().sort_by_size();
let backtrace = groups[0][0].backtrace();
println("Before:");
println(backtrace);
println();
println("After:");
println(backtrace.strip());
Before:
#00 [simulation] _start [start.S:115]
#01 [libc.so.6] __libc_start_main
#02 [libc.so.6] 7f8bb4f5128f
#03 [simulation] main
#04 [simulation] std::rt::lang_start [rt.rs:165]
#05 [simulation] std::rt::lang_start_internal [rt.rs:148]
#06 [simulation] std::panic::catch_unwind [panic.rs:137]
#07 [simulation] std::panicking::try [panicking.rs:447]
#08 [simulation] std::panicking::try::do_call [panicking.rs:483]
#09 [simulation] std::rt::lang_start_internal::{{closure}} [rt.rs:148]
#10 [simulation] std::panic::catch_unwind [panic.rs:137]
#11 [simulation] std::panicking::try [panicking.rs:447]
#12 [simulation] std::panicking::try::do_call [panicking.rs:483]
#13 [simulation] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once [function.rs:286]
#14 [simulation] std::rt::lang_start::{{closure}} [rt.rs:166]
#15 [simulation] std::sys_common::backtrace::__rust_begin_short_backtrace [backtrace.rs:122]
#16 [simulation] core::ops::function::FnOnce::call_once [function.rs:251]
#17 [simulation] simulation::main [main.rs:121]
#18 [simulation] simulation::allocate_temporary [main.rs:16]
#19 [simulation] alloc::vec::Vec<T,A>::resize [mod.rs:2366]
#20 [simulation] alloc::vec::Vec<T,A>::extend_with [mod.rs:2510]
#21 [simulation] alloc::vec::Vec<T,A>::reserve [mod.rs:906]
#22 [simulation] alloc::raw_vec::RawVec<T,A>::reserve [raw_vec.rs:289]
#23 [simulation] alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle [raw_vec.rs:285]
#24 [simulation] alloc::raw_vec::RawVec<T,A>::grow_amortized [raw_vec.rs:400]
#25 [simulation] alloc::raw_vec::finish_grow [raw_vec.rs:469]
#26 [simulation] <alloc::alloc::Global as core::alloc::Allocator>::allocate [alloc.rs:241]
#27 [simulation] alloc::alloc::Global::alloc_impl [alloc.rs:181]
#28 [simulation] alloc::alloc::alloc [alloc.rs:181]
#29 [libbytehound.so] malloc [api.rs:293]
After:
#00 [simulation] _start [start.S:115]
#01 [libc.so.6] __libc_start_main
#02 [libc.so.6] 7f8bb4f5128f
#03 [simulation] main
#17 [simulation] simulation::main [main.rs:121]
#18 [simulation] simulation::allocate_temporary [main.rs:16]
#19 [simulation] alloc::vec::Vec<T,A>::resize [mod.rs:2366]