QmlProfiler: Allow preselection of events to be recorded

This allows us to reduce the amount of data we need to handle
if the user isn't interested in certain categories.

Task-number: QTBUG-41118
Change-Id: Ieaac12fb1dec29d6035642f433bc1a1d49e545c2
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-09 18:22:58 +02:00
parent 7290c43da1
commit 6d58de0bad
17 changed files with 214 additions and 19 deletions

View File

@@ -40,6 +40,7 @@ public:
, inProgressRanges(0)
, maximumTime(0)
, recording(false)
, features(0)
{
::memset(rangeCount, 0, MaximumRangeType * sizeof(int));
}
@@ -56,6 +57,7 @@ public:
int rangeCount[MaximumRangeType];
qint64 maximumTime;
bool recording;
quint64 features;
};
} // namespace QmlDebug
@@ -68,16 +70,17 @@ void QmlProfilerTraceClientPrivate::sendRecordingStatus(int engineId)
{
QByteArray ba;
QDataStream stream(&ba, QIODevice::WriteOnly);
stream << recording;
if (engineId != -1)
stream << engineId;
stream << recording << engineId; // engineId -1 is OK. It means "all of them"
if (recording)
stream << features;
q->sendMessage(ba);
}
QmlProfilerTraceClient::QmlProfilerTraceClient(QmlDebugConnection *client)
QmlProfilerTraceClient::QmlProfilerTraceClient(QmlDebugConnection *client, quint64 features)
: QmlDebugClient(QLatin1String("CanvasFrameRate"), client)
, d(new QmlProfilerTraceClientPrivate(this, client))
{
d->features = features;
connect(&d->engineControl, SIGNAL(engineAboutToBeAdded(int,QString)),
this, SLOT(sendRecordingStatus(int)));
}
@@ -131,6 +134,11 @@ void QmlProfilerTraceClient::setRecording(bool v)
emit recordingChanged(v);
}
void QmlProfilerTraceClient::setFeatures(quint64 features)
{
d->features = features;
}
void QmlProfilerTraceClient::setRecordingFromServer(bool v)
{
if (v == d->recording)