Browse Source

ProfileViewer: Highlight instructions with >0 samples in yellow

Andreas Kling 5 years ago
parent
commit
68ddbc0084
1 changed files with 7 additions and 0 deletions
  1. 7 0
      DevTools/ProfileViewer/DisassemblyModel.cpp

+ 7 - 0
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())