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

Profiler: Present read event info in tree structure

This commit adds "Filesystem Events" View to the Profiler. This tab
 will present combined information for recorded Filesystem events.
Currently only accumulated count and duration is presented.
Duration amount currently only shows events that took over 1ms,
which means that in most cases 0 is show.
This commit is contained in:
Jakub Berkop 2022-02-17 22:26:20 +01:00 committed by Andreas Kling
parent bc82b3eaec
commit d084f8d90a
6 changed files with 323 additions and 0 deletions

View file

@ -252,6 +252,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
timeline_view->on_selection_change = [&] { statusbar_update(); };
flamegraph_view->on_hover_change = [&] { statusbar_update(); };
auto filesystem_events_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Filesystem events"));
filesystem_events_tab->set_layout<GUI::VerticalBoxLayout>();
filesystem_events_tab->layout()->set_margins(4);
auto filesystem_events_tree_view = TRY(filesystem_events_tab->try_add<GUI::TreeView>());
filesystem_events_tree_view->set_should_fill_selected_rows(true);
filesystem_events_tree_view->set_column_headers_visible(true);
filesystem_events_tree_view->set_selection_behavior(GUI::TreeView::SelectionBehavior::SelectRows);
filesystem_events_tree_view->set_model(profile->file_event_model());
auto file_menu = TRY(window->try_add_menu("&File"));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));