1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 11:57:35 +00:00

ProfileViewer: Add the ability to invert the profile tree

Inverting the tree turns all of the innermost stack frames into roots,
allowing them to accumulate their total sample counts with other
instances of the same frame being innermost. This is an essential
feature of any cool profiler, and now we have it. :^)
This commit is contained in:
Andreas Kling 2019-12-16 18:21:05 +01:00
parent 5ddb747038
commit fe421bd7b4
3 changed files with 57 additions and 16 deletions

View file

@ -48,6 +48,17 @@ int main(int argc, char** argv)
menubar->add_menu(move(app_menu));
auto view_menu = GMenu::construct("View");
auto invert_action = GAction::create("Invert tree", { Mod_Ctrl, Key_I }, [&](auto& action) {
action.set_checked(!action.is_checked());
profile->set_inverted(action.is_checked());
});
invert_action->set_checkable(true);
invert_action->set_checked(true);
view_menu->add_action(invert_action);
menubar->add_menu(move(view_menu));
app.set_menubar(move(menubar));
window->show();