mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
ProfileViewer: Add an instruction-level sample viewer
When you select a function in the profile tree, we will now display a per-instruction breakdown of aggregated samples in that function. This allows us to look much closer at what our code is doing! :^)
This commit is contained in:
parent
5b91d848a7
commit
69583f07e0
7 changed files with 267 additions and 6 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
#include <LibGUI/TreeView.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <stdio.h>
|
||||
|
@ -63,11 +64,22 @@ int main(int argc, char** argv)
|
|||
|
||||
main_widget.add<ProfileTimelineWidget>(*profile);
|
||||
|
||||
auto& tree_view = main_widget.add<GUI::TreeView>();
|
||||
auto& bottom_container = main_widget.add<GUI::Widget>();
|
||||
bottom_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto& tree_view = bottom_container.add<GUI::TreeView>();
|
||||
tree_view.set_headers_visible(true);
|
||||
tree_view.set_size_columns_to_fit_content(true);
|
||||
tree_view.set_model(profile->model());
|
||||
|
||||
auto& disassembly_view = bottom_container.add<GUI::TableView>();
|
||||
disassembly_view.set_size_columns_to_fit_content(true);
|
||||
|
||||
tree_view.on_selection = [&](auto& index) {
|
||||
profile->set_disassembly_index(index);
|
||||
disassembly_view.set_model(profile->disassembly_model());
|
||||
};
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
auto& app_menu = menubar->add_menu("ProfileViewer");
|
||||
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app.quit(); }));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue