diff options
-rw-r--r-- | src/plugins/perfprofiler/perfevent.h | 2 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfeventtype.h | 1 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilertracefile.cpp | 8 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilertracemanager.cpp | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/perfprofiler/perfevent.h b/src/plugins/perfprofiler/perfevent.h index e57712a722..dcee855e38 100644 --- a/src/plugins/perfprofiler/perfevent.h +++ b/src/plugins/perfprofiler/perfevent.h @@ -51,7 +51,7 @@ public: ThreadEndTypeId = -3, LostTypeId = -4, ContextSwitchTypeId = -5, - LastSpecialTypeId = -256 + LastSpecialTypeId = -6 }; int numAttributes() const { return m_values.length() + 1; } diff --git a/src/plugins/perfprofiler/perfeventtype.h b/src/plugins/perfprofiler/perfeventtype.h index 245b25991a..457b6afeb2 100644 --- a/src/plugins/perfprofiler/perfeventtype.h +++ b/src/plugins/perfprofiler/perfeventtype.h @@ -143,6 +143,7 @@ public: case ThreadEnd: case LostDefinition: case ContextSwitchDefinition: + case InvalidFeature: return true; default: return false; diff --git a/src/plugins/perfprofiler/perfprofilertracefile.cpp b/src/plugins/perfprofiler/perfprofilertracefile.cpp index cccdc6f7da..c6ea883c79 100644 --- a/src/plugins/perfprofiler/perfprofilertracefile.cpp +++ b/src/plugins/perfprofiler/perfprofilertracefile.cpp @@ -177,6 +177,14 @@ void PerfProfilerTraceFile::readMessages(const QByteArray &buffer) case PerfEventType::LocationDefinition: { PerfEventType location(PerfEventType::LocationDefinition); dataStream >> id >> location; + for (int parent = location.location().parentLocationId; parent != -1; + parent = traceManager->location(parent).parentLocationId) { + if (parent == id) { + qWarning() << "A location cannot be its own parent location:" << id; + location = PerfEventType(PerfEventType::LocationDefinition); + break; + } + } traceManager->setEventType(id, std::move(location)); break; } diff --git a/src/plugins/perfprofiler/perfprofilertracemanager.cpp b/src/plugins/perfprofiler/perfprofilertracemanager.cpp index 6f93a4797d..75c31af32a 100644 --- a/src/plugins/perfprofiler/perfprofilertracemanager.cpp +++ b/src/plugins/perfprofiler/perfprofilertracemanager.cpp @@ -219,6 +219,8 @@ void PerfProfilerTraceManager::resetAttributes() tr("Samples lost"))); setEventType(PerfEvent::ContextSwitchTypeId, PerfEventType(PerfEventType::ContextSwitchDefinition, tr("Context switch"))); + setEventType(PerfEvent::LastSpecialTypeId, + PerfEventType(PerfEventType::InvalidFeature, tr("Invalid"))); } void PerfProfilerTraceManager::finalize() |