diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2018-10-23 21:31:45 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-03 12:43:45 +0000 |
commit | a69e6a514390640b6a1d06372f5e3dcc5de9d165 (patch) | |
tree | 59cf24c15467b645726b36d0d96377dba7fe86e0 | |
parent | 9bcb42b50e2c12d873c50c3d33c3d90befa35c8f (diff) |
Correctly parse BranchFlags in BranchEntry
Fixes parsing of perf data files with LBR stacks, i.e. files
generated with `perf record --call-graph lbr`.
Change-Id: I7e75d655e8a09f484fe207298ce44a871c1f4903
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r-- | app/perfdata.cpp | 1 | ||||
-rw-r--r-- | app/perfdata.h | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/app/perfdata.cpp b/app/perfdata.cpp index b3f18c8..eea52b6 100644 --- a/app/perfdata.cpp +++ b/app/perfdata.cpp @@ -554,6 +554,7 @@ QDataStream &operator>>(QDataStream &stream, PerfRecordSample &record) PerfRecordSample::BranchEntry entry; while (numBranches-- > 0) { stream >> entry.from >> entry.to; + stream.readRawData(reinterpret_cast<char*>(&entry.flags), sizeof(entry.flags)); record.m_branchStack << entry; } } diff --git a/app/perfdata.h b/app/perfdata.h index 3a7b421..d841843 100644 --- a/app/perfdata.h +++ b/app/perfdata.h @@ -410,9 +410,20 @@ public: private: + struct BranchFlags { + quint64 mispred: 1; + quint64 predicted: 1; + quint64 in_tx: 1; + quint64 abort: 1; + quint64 cycles: 16; + quint64 type: 4; + quint64 reserved: 40; + }; + struct BranchEntry { quint64 from; quint64 to; + BranchFlags flags; }; quint64 m_readFormat; |