diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-12-01 17:10:16 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-12-07 13:48:56 +0000 |
commit | 85a6acf73c4fd8c720cb920547422a30d42e2d5e (patch) | |
tree | db3d52192d81074cc081f63f610167490b661c26 | |
parent | 1056f22c0516cbed2d557eb6491ae4349f68b09d (diff) |
Add new members for perf event attributes struct
Change-Id: I27ac48161d1db55efe808dbefb37ad28d0981ed2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | app/perfattributes.cpp | 16 | ||||
-rw-r--r-- | app/perfattributes.h | 27 |
2 files changed, 38 insertions, 5 deletions
diff --git a/app/perfattributes.cpp b/app/perfattributes.cpp index 6e6aa61..7d6e24f 100644 --- a/app/perfattributes.cpp +++ b/app/perfattributes.cpp @@ -48,7 +48,13 @@ QDataStream &operator>>(QDataStream &stream, PerfEventAttributes &attrs) stream >> attrs.m_branchSampleType; if (attrs.m_size > PerfEventAttributes::SIZE_VER2) - stream >> attrs.m_sampleRegsUser >> attrs.m_sampleStackUser >> attrs.m_reserved2; + stream >> attrs.m_sampleRegsUser >> attrs.m_sampleStackUser >> attrs.m_clockid; + + if (attrs.m_size > PerfEventAttributes::SIZE_VER3) + stream >> attrs.m_sampleRegsIntr; + + if (attrs.m_size > PerfEventAttributes::SIZE_VER4) + stream >> attrs.m_auxWatermark >> attrs.m_sampleMaxStack >> attrs.m_reserved2; if (static_cast<QSysInfo::Endian>(stream.byteOrder()) != QSysInfo::ByteOrder) { // bit fields are saved in byte order; who came up with that BS? @@ -62,9 +68,9 @@ QDataStream &operator>>(QDataStream &stream, PerfEventAttributes &attrs) *(&attrs.m_readFormat + 1) = flags; - if (attrs.m_size > PerfEventAttributes::SIZE_VER3) { + if (attrs.m_size > PerfEventAttributes::SIZE_VER5) { static const int intMax = std::numeric_limits<int>::max(); - quint32 skip = attrs.m_size - PerfEventAttributes::SIZE_VER3; + quint32 skip = attrs.m_size - PerfEventAttributes::SIZE_VER5; if (skip > intMax) { stream.skipRawData(intMax); skip -= intMax; @@ -206,6 +212,10 @@ bool PerfEventAttributes::operator==(const PerfEventAttributes &rhs) const && m_branchSampleType == rhs.m_branchSampleType && m_sampleRegsUser == rhs.m_sampleRegsUser && m_sampleStackUser == rhs.m_sampleStackUser + && m_clockid == rhs.m_clockid + && m_sampleRegsIntr == rhs.m_sampleRegsIntr + && m_auxWatermark == rhs.m_auxWatermark + && m_sampleMaxStack == rhs.m_sampleMaxStack && m_reserved2 == rhs.m_reserved2; } diff --git a/app/perfattributes.h b/app/perfattributes.h index 2263459..5d60852 100644 --- a/app/perfattributes.h +++ b/app/perfattributes.h @@ -34,6 +34,8 @@ public: SIZE_VER1 = 72, /* add: config2 */ SIZE_VER2 = 80, /* add: branch_sample_type */ SIZE_VER3 = 96, /* add: sample_regs_user, sample_stack_user */ + SIZE_VER4 = 104, /* add: sample_regs_intr */ + SIZE_VER5 = 112, /* add: aux_watermark */ }; PerfEventAttributes(); @@ -236,7 +238,10 @@ private: m_excludeHost : 1, /* don't count in host */ m_excludeGuest : 1, /* don't count in guest */ - m_reserved1 : 43; + m_excludeCallchainKernel : 1, /* exclude kernel callchains */ + m_excludeCallchainUser : 1, /* exclude user callchains */ + + m_reserved1 : 41; union { quint32 m_wakeupEvents; /* wakeup every n events */ @@ -267,8 +272,26 @@ private: */ quint32 m_sampleStackUser; + qint32 m_clockid; + + /* + * Defines set of regs to dump for each sample + * state captured on: + * - precise = 0: PMU interrupt + * - precise > 0: sampled instruction + * + * See asm/perf_regs.h for details. + */ + quint64 m_sampleRegsIntr; + + /* + * Wakeup watermark for AUX area + */ + quint32 m_auxWatermark; + quint16 m_sampleMaxStack; + /* Align to u64. */ - quint32 m_reserved2; + quint16 m_reserved2; friend QDataStream &operator>>(QDataStream &stream, PerfEventAttributes &attrs); }; |