diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-05-18 13:17:22 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-05-22 11:03:57 +0000 |
commit | 15e0c94820acdb276e5a6285cdf203dfb5df8107 (patch) | |
tree | 8363ed48adab5de36bb6afa7cf2e8a8463686b7b /app/perfunwind.h | |
parent | 01b4d7d8c98a13df10ce22dd86188806b99205f3 (diff) |
Adapt event buffering to time order violations
When a time order violation occurs, we double the event buffer size.
This makes further time order violations less likely. Furthermore, if we
were running in automatic buffer mode (by FINISHED_ROUND) and catch a
violation, then we switch back to dynamic buffer mode. A new command
line option is introduced to limit the maximum buffer size.
Change-Id: I1f1c4d3f630ecec420babe09e737e2dbd8bb25ca
Task-number: QTCREATORBUG-20455
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'app/perfunwind.h')
-rw-r--r-- | app/perfunwind.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/perfunwind.h b/app/perfunwind.h index 82713a3..b5bff8b 100644 --- a/app/perfunwind.h +++ b/app/perfunwind.h @@ -157,7 +157,10 @@ public: void setIgnoreKallsymsBuildId(bool ignore) { m_ignoreKallsymsBuildId = ignore; } uint maxEventBufferSize() const { return m_maxEventBufferSize; } - void setMaxEventBufferSize(uint size) { m_maxEventBufferSize = size; } + void setMaxEventBufferSize(uint size); + + uint targetEventBufferSize() const { return m_targetEventBufferSize; } + void setTargetEventBufferSize(uint size); int maxUnwindFrames() const { return m_currentUnwind.maxFrames; } void setMaxUnwindFrames(int maxUnwindFrames) { m_currentUnwind.maxFrames = maxUnwindFrames; } @@ -277,8 +280,13 @@ private: QVector<PerfEventAttributes> m_attributes; QHash<QByteArray, QByteArray> m_buildIds; + uint m_lastEventBufferSize; uint m_maxEventBufferSize; + uint m_targetEventBufferSize; uint m_eventBufferSize; + + uint m_timeOrderViolations; + quint64 m_lastFlushMaxTime; QSysInfo::Endian m_byteOrder = QSysInfo::LittleEndian; @@ -299,6 +307,9 @@ private: void flushEventBuffer(uint desiredBufferSize); QVariant readTraceData(const QByteArray &data, const FormatField &field, bool byteSwap); + void forwardMmapBuffer(QList<PerfRecordMmap>::Iterator &it, + const QList<PerfRecordMmap>::Iterator &mmapEnd, + quint64 timestamp); }; uint qHash(const PerfUnwind::Location &location, uint seed = 0); |