forked from qt-creator/qt-creator
QmlProfiler: Don't trust in externally provided timestamps
We might get timestamps that are outside the trace time, negative timestamps, ranges that go backwards, and other insane things. In order to deal with this, we clamp all negative timestamps to 0, and treat the specified trace time as minimum range, that can be overridden by events. Change-Id: Iba661f2a4346077871fc62a46759e169b2aad49d Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
This commit is contained in:
@@ -247,7 +247,7 @@ void QmlProfilerTraceClient::setRequestedFeatures(quint64 features)
|
||||
const QmlDebug::QDebugContextInfo &context)
|
||||
{
|
||||
d->updateFeatures(ProfileDebugMessages);
|
||||
d->currentEvent.event.setTimestamp(context.timestamp);
|
||||
d->currentEvent.event.setTimestamp(context.timestamp > 0 ? context.timestamp : 0);
|
||||
d->currentEvent.event.setTypeIndex(-1);
|
||||
d->currentEvent.event.setString(text);
|
||||
d->currentEvent.type = QmlEventType(DebugMessage, MaximumRangeType, type,
|
||||
|
||||
Reference in New Issue
Block a user