diff options
-rw-r--r-- | app/perfdata.cpp | 18 | ||||
-rw-r--r-- | app/perfdata.h | 17 |
2 files changed, 35 insertions, 0 deletions
diff --git a/app/perfdata.cpp b/app/perfdata.cpp index 2dfbc6c..27a2095 100644 --- a/app/perfdata.cpp +++ b/app/perfdata.cpp @@ -253,6 +253,14 @@ PerfData::ReadStatus PerfData::processEvents(QDataStream &stream) m_destination->contextSwitch(switchEvent); break; } + case PERF_RECORD_SWITCH_CPU_WIDE: { + PerfRecordContextSwitchCpuWide switchEvent(&m_eventHeader, sampleType, sampleIdAll); + stream >> switchEvent; + // TODO: also send prevNext{T,P}id, that would allow switch markers in the GUI to + // show where a switch comes from/goes to + m_destination->contextSwitch(switchEvent); + break; + } #ifdef HAVE_ZSTD case PERF_RECORD_COMPRESSED: { @@ -801,3 +809,13 @@ QDataStream &operator>>(QDataStream &stream, PerfRecordContextSwitch &record) { return stream >> record.m_sampleId; } + +PerfRecordContextSwitchCpuWide::PerfRecordContextSwitchCpuWide(PerfEventHeader *header, quint64 sampleType, bool sampleIdAll) : + PerfRecordContextSwitch(header, sampleType, sampleIdAll) +{ +} + +QDataStream &operator>>(QDataStream &stream, PerfRecordContextSwitchCpuWide &record) +{ + return stream >> record.m_nextPrevPid >> record.m_nextPrevTid >> record.m_sampleId; +} diff --git a/app/perfdata.h b/app/perfdata.h index 942de34..6b2d913 100644 --- a/app/perfdata.h +++ b/app/perfdata.h @@ -603,6 +603,23 @@ private: QDataStream &operator>>(QDataStream &stream, PerfRecordContextSwitch &record); +class PerfRecordContextSwitchCpuWide : public PerfRecordContextSwitch +{ +public: + PerfRecordContextSwitchCpuWide(PerfEventHeader *header = 0, quint64 sampleType = 0, + bool sampleIdAll = false); + + qint32 nextPrevPid() const { return m_nextPrevPid; } + qint32 nextPrevTid() const { return m_nextPrevTid; } + +private: + qint32 m_nextPrevPid; + qint32 m_nextPrevTid; + friend QDataStream &operator>>(QDataStream &stream, PerfRecordContextSwitchCpuWide &record); +}; + +QDataStream &operator>>(QDataStream &stream, PerfRecordContextSwitchCpuWide &record); + class PerfUnwind; class PerfData : public QObject { |