diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-11 18:56:50 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-11 18:56:50 +0200 |
commit | 68ddbc00843db44618eaa671e7aa27c1749f7faa (patch) | |
tree | ac9008d6c23a72f90bcff9f0e1dfc974dbf10786 | |
parent | 3a65e9107e3e34e0b067240771b9fe38b5651d6e (diff) | |
download | serenity-68ddbc00843db44618eaa671e7aa27c1749f7faa.zip |
ProfileViewer: Highlight instructions with >0 samples in yellow
-rw-r--r-- | DevTools/ProfileViewer/DisassemblyModel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/DevTools/ProfileViewer/DisassemblyModel.cpp b/DevTools/ProfileViewer/DisassemblyModel.cpp index 594c237018..e4111eb8e5 100644 --- a/DevTools/ProfileViewer/DisassemblyModel.cpp +++ b/DevTools/ProfileViewer/DisassemblyModel.cpp @@ -103,6 +103,13 @@ GUI::Model::ColumnMetadata DisassemblyModel::column_metadata(int column) const GUI::Variant DisassemblyModel::data(const GUI::ModelIndex& index, Role role) const { auto& insn = m_instructions[index.row()]; + + if (role == Role::BackgroundColor) { + if (insn.event_count > 0) + return Color(Color::Yellow); + return {}; + } + if (role == Role::Display) { if (index.column() == Column::SampleCount) { if (m_profile.show_percentages()) |