1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:37:44 +00:00

Profiler: Let the user ignore context switches

Now that the profiling timer is independent from the scheduler the
user will get quite a few CPU samples from "within" the scheduler.
These events are less useful when just profiling a user-mode process
rather than the whole system. This patch adds an option to Profiler to
hide these events.
This commit is contained in:
Gunnar Beutner 2021-05-13 22:11:44 +02:00 committed by Andreas Kling
parent c534f176bc
commit d6b3513aab
4 changed files with 34 additions and 0 deletions

View file

@ -209,6 +209,15 @@ int main(int argc, char** argv)
percent_action->set_checked(false);
view_menu.add_action(percent_action);
auto scheduler_action = GUI::Action::create_checkable("Show &Context Switches", { Mod_Ctrl, Key_C }, [&](auto& action) {
profile->set_show_scheduler(action.is_checked());
tree_view.update();
disassembly_view.update();
timeline_container.update();
});
scheduler_action->set_checked(true);
view_menu.add_action(scheduler_action);
auto& help_menu = menubar->add_menu("&Help");
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Profiler.md"), "/bin/Help");