Tracing: Move event storage out of trace manager

This is a step toward making the trace manager non-virtual. It should
just juggle the storages for types and events, and manage the threads to
access them. It doesn't need to know what exactly it stores.

Change-Id: I45093c60d8ae921e68aeb09bd48d24d5877ce306
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-07 13:26:05 +02:00
parent e6d583913e
commit 916883e70f
17 changed files with 218 additions and 136 deletions

View File

@@ -70,6 +70,11 @@ void QmlProfilerTraceClientTest::testMessageReceived()
traceClient.stateChanged(QmlDebug::QmlDebugClient::NotConnected);
QFutureInterface<void> future;
QString lastError;
connect(&modelManager, &Timeline::TimelineTraceManager::error,
this, [&](const QString &message) { lastError = message; });
modelManager.replayQmlEvents([&](const QmlEvent &event, const QmlEventType &type) {
qint64 timestamp;
qint32 message;
@@ -81,14 +86,16 @@ void QmlProfilerTraceClientTest::testMessageReceived()
}, nullptr, [this]() {
modelManager.clearAll();
traceClient.clear();
}, [this](const QString &message) {
if (message == QmlProfilerModelManager::tr("Read past end in temporary trace file")) {
}, [this, &lastError](const QString &message) {
QVERIFY(!message.isEmpty());
if (lastError == QmlProfilerModelManager::tr("Read past end in temporary trace file")) {
// Ignore read-past-end errors: Our test traces are somewhat dirty and don't end on
// packet boundaries
modelManager.clearAll();
traceClient.clear();
lastError.clear();
} else {
QFAIL(message.toUtf8().constData());
QFAIL((message + " " + lastError).toUtf8().constData());
}
}, future);
}