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,19 @@
namespace QmlProfiler {
namespace Internal {
static const char *ProfileFeatureNames[QmlDebug::MaximumProfileFeature] = {
QT_TRANSLATE_NOOP("MainView", "JavaScript"),
QT_TRANSLATE_NOOP("MainView", "Memory Usage"),
QT_TRANSLATE_NOOP("MainView", "Pixmap Cache"),
QT_TRANSLATE_NOOP("MainView", "Scene Graph"),
QT_TRANSLATE_NOOP("MainView", "Animations"),
QT_TRANSLATE_NOOP("MainView", "Painting"),
QT_TRANSLATE_NOOP("MainView", "Compiling"),
QT_TRANSLATE_NOOP("MainView", "Creating"),
QT_TRANSLATE_NOOP("MainView", "Binding"),
QT_TRANSLATE_NOOP("MainView", "Handling Signal"),
QT_TRANSLATE_NOOP("MainView", "Input Events")
};
/////////////////////////////////////////////////////////////////////
QmlProfilerDataState::QmlProfilerDataState(QmlProfilerModelManager *modelManager, QObject *parent)
@@ -163,6 +176,8 @@ public:
QVector <double> partialCounts;
QVector <int> partialCountWeights;
quint64 features;
int totalWeight;
double progress;
double previousProgress;
@@ -251,6 +266,25 @@ void QmlProfilerModelManager::modelProxyCountUpdated(int proxyId, qint64 count,
}
}
void QmlProfilerModelManager::announceFeatures(int proxyId, quint64 features)
{
Q_UNUSED(proxyId); // Will use that later to optimize the event dispatching on loading.
if ((features & d->features) != features) {
d->features |= features;
emit availableFeaturesChanged(d->features);
}
}
quint64 QmlProfilerModelManager::availableFeatures()
{
return d->features;
}
const char *QmlProfilerModelManager::featureName(QmlDebug::ProfileFeature feature)
{
return ProfileFeatureNames[feature];
}
qint64 QmlProfilerModelManager::estimatedProfilingTime() const
{
return d->estimatedTime;