Also show total bytes allocated over time.
authorMilian Wolff <mail@milianw.de>
Mon, 15 Jun 2015 23:37:37 +0000 (01:37 +0200)
committerMilian Wolff <mail@milianw.de>
Mon, 15 Jun 2015 23:37:37 +0000 (01:37 +0200)
gui/chartmodel.cpp
gui/chartmodel.h
gui/mainwindow.cpp
gui/mainwindow.ui
gui/parser.cpp

index 40c74f4..8c7e33c 100644 (file)
@@ -90,14 +90,16 @@ QVariant ChartModel::data(const QModelIndex& index, int role) const
         return data.timeStamp;
     } else if (index.column() == 1) {
         return data.leaked;
-    } else {
+    } else if (index.column() == 2) {
         return data.allocations;
+    } else {
+        return data.allocated;
     }
 }
 
 int ChartModel::columnCount(const QModelIndex& /*parent*/) const
 {
-    return 3;
+    return 4;
 }
 
 int ChartModel::rowCount(const QModelIndex& parent) const
index 7f566fd..c292043 100644 (file)
@@ -28,6 +28,7 @@ struct ChartRow
     quint64 timeStamp;
     quint64 leaked;
     quint64 allocations;
+    quint64 allocated;
 };
 
 Q_DECLARE_TYPEINFO(ChartRow, Q_MOVABLE_TYPE);
index d558bf8..783deb3 100644 (file)
@@ -49,14 +49,18 @@ MainWindow::MainWindow(QWidget* parent)
     m_ui->loadingProgress->setMinimum(0);
     m_ui->loadingProgress->setMaximum(0);
 
-    auto memoryConsumptionProxy = new ChartProxy(i18n("Memory Consumption"), 1, this);
-    memoryConsumptionProxy->setSourceModel(m_chartModel);
-    m_ui->memoryConsumptionTab->setModel(memoryConsumptionProxy);
+    auto leakedProxy = new ChartProxy(i18n("Memory Leaked"), 1, this);
+    leakedProxy->setSourceModel(m_chartModel);
+    m_ui->leakedTab->setModel(leakedProxy);
 
     auto allocationsProxy = new ChartProxy(i18n("Memory Allocations"), 2, this);
     allocationsProxy->setSourceModel(m_chartModel);
     m_ui->allocationsTab->setModel(allocationsProxy);
 
+    auto allocatedProxy = new ChartProxy(i18n("Memory Allocated"), 3, this);
+    allocatedProxy->setSourceModel(m_chartModel);
+    m_ui->allocatedTab->setModel(allocatedProxy);
+
     connect(m_parser, &Parser::bottomUpDataAvailable,
             m_bottomUpModel, &BottomUpModel::resetData);
     connect(m_parser, &Parser::chartDataAvailable,
index d3a3091..97227e4 100644 (file)
            <zorder>widget</zorder>
            <zorder>results</zorder>
           </widget>
-          <widget class="ChartWidget" name="memoryConsumptionTab">
+          <widget class="ChartWidget" name="leakedTab">
            <attribute name="title">
-            <string>Memory Consumption</string>
+            <string>Leaked</string>
            </attribute>
           </widget>
           <widget class="ChartWidget" name="allocationsTab">
             <string>Allocations</string>
            </attribute>
           </widget>
+          <widget class="ChartWidget" name="allocatedTab">
+           <attribute name="title">
+            <string>Allocated</string>
+           </attribute>
+          </widget>
          </widget>
         </item>
        </layout>
index 87cb7d7..ecb89c7 100644 (file)
@@ -40,7 +40,7 @@ struct ParserData final : public AccumulatedTraceData
 
     void handleTimeStamp(size_t /*newStamp*/, size_t oldStamp)
     {
-        chartData.push_back({oldStamp, timestampData.leaked, totalAllocations});
+        chartData.push_back({oldStamp, timestampData.leaked, totalAllocations, totalAllocated});
         timestampData = {};
     }