nikomatsakis / perf-focus

A perf script for helping to answer queries about how much time a given function occupies, where it is called from, and so forth.
38 stars 1 forks source link

add a cursive-based screen to view tree results #3

Open nikomatsakis opened 6 years ago

nikomatsakis commented 6 years ago

Perhaps a good starting point for #2:

nikomatsakis commented 6 years ago

Example of cursive tree view:

https://github.com/BonsaiDen/cursive_tree_view

nikomatsakis commented 6 years ago

Example of tree view as it is today (with some kinda' dirty data, hence lots of "unknown" frames):

lunch-box. perf focus --tree-callees --relative '{mir_validated}' --tree-min-percent 20
Matcher    : {mir_validated}
Matches    : 1096
Not Matches: 8993
Percentage : 100%

Tree
| matched `{mir_validated}` (100% total, 0% self)
: | [unknown] (84% total, 0% self)
: : | [unknown] (84% total, 0% self)
: : : | [unknown] (84% total, 0% self)
: : : : | [unknown] (84% total, 0% self)
: : : : : | [unknown] (84% total, 0% self)
: : : : : : | [unknown] (84% total, 0% self)
: : : : : : : | [unknown] (84% total, 0% self)
: : : : : : : : | [unknown] (84% total, 0% self)
: : : : : : : : : | rustc_mir::transform::mir_const (84% total, 0% self)
: : : : : : : : : : | rustc_mir::transform::mir_const::_$u7b$$u7b$closure$u7d$$u7d$::h87d8243f26931557 (68% total, 0% self)
: : : : : : : : : : : | <rustc_mir::borrow_check::nll::type_check::TypeckMir as rustc_mir::transform::MirPass>::run_pass (65% total, 0% self)
: : : : : : : : : : : : | rustc::ty::context::GlobalCtxt::enter_local (65% total, 0% self)
: : : : : : : : : : : : : | <std::thread::local::LocalKey<T>>::with (65% total, 0% self)
: : : : : : : : : : : : : : | rustc_mir::borrow_check::nll::type_check::type_check_internal (64% total, 0% self)
: : : : : : : : : : : : : : : | <rustc_mir::borrow_check::nll::type_check::TypeVerifier<'a, 'b, 'gcx, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_mir (32% total, 0% self)
: : : : : : : : : : : : : : : : | <rustc_mir::borrow_check::nll::type_check::TypeVerifier<'a, 'b, 'gcx, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_constant (28% total, 0% self)
: : : : : : : : : : : : : : : | rustc_mir::borrow_check::nll::type_check::TypeChecker::typeck_mir (31% total, 0% self)
nikomatsakis commented 6 years ago

Probably a starting point would be to work through the cursive tutorials:

https://github.com/gyscos/Cursive#tutorials