diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-11-14 14:12:47 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-11-15 10:20:16 +0000 |
commit | 98f366fa62f2e71524ccbcc8e884ee1025f3064b (patch) | |
tree | b0bfa83ea95dfed697f977a07e8a89f64cb9b26d | |
parent | 2d05ee7e3b2579d8f9dcbf6fd919fad78434e8ef (diff) |
Finish the round when manually finalizing a session
This allows us to use incomplete perf.data files in tests.
Change-Id: Icddfc0b62cb96ac9d5f9dcee2e1c44b4f3e28dff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | app/perfunwind.h | 6 | ||||
-rw-r--r-- | tests/auto/perfdata/tst_perfdata.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/perfunwind.h b/app/perfunwind.h index 57ca7f0..b4959f4 100644 --- a/app/perfunwind.h +++ b/app/perfunwind.h @@ -209,7 +209,11 @@ public: QString debugPath() const { return m_debugPath; } Stats stats() const { return m_stats; } - void flushEventBuffer() { flushEventBuffer(0); } + void finalize() + { + finishedRound(); + flushEventBuffer(0); + } private: diff --git a/tests/auto/perfdata/tst_perfdata.cpp b/tests/auto/perfdata/tst_perfdata.cpp index 08ef47d..22dbcb2 100644 --- a/tests/auto/perfdata/tst_perfdata.cpp +++ b/tests/auto/perfdata/tst_perfdata.cpp @@ -53,13 +53,13 @@ void TestPerfData::testTraceDataHeaderEvent() header.read(); QCOMPARE(spy.count(), 1); - unwind.flushEventBuffer(); + unwind.finalize(); const PerfUnwind::Stats stats = unwind.stats(); QCOMPARE(stats.numSamples, 1u); QCOMPARE(stats.numMmaps, 120u); - QCOMPARE(stats.numRounds, 1u); - QCOMPARE(stats.numBufferFlushes, 1u); + QCOMPARE(stats.numRounds, 2u); + QCOMPARE(stats.numBufferFlushes, 2u); QCOMPARE(stats.numTimeViolatingSamples, 0u); QCOMPARE(stats.numTimeViolatingMmaps, 0u); QCOMPARE(stats.maxBufferSize, 15488u); |