Tracing: Generalize event filtering

This allows us to not only filter by ranges, but potentially also by
other criteria.

Change-Id: I7349ceeabbb2781473a3a4c803dab1006b7b8e50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-07 17:08:12 +02:00
parent 7e9b6f62c6
commit 95d7be1b28
8 changed files with 119 additions and 91 deletions

View File

@@ -102,9 +102,10 @@ void QmlProfilerStatisticsModel::restrictToFeatures(quint64 features)
clear();
QFutureInterface<void> future;
m_modelManager->replayQmlEvents(m_modelManager->traceStart(), m_modelManager->traceEnd(),
std::bind(&QmlProfilerStatisticsModel::loadEvent, this,
std::placeholders::_1, std::placeholders::_2),
auto filter = m_modelManager->rangeFilter(m_modelManager->traceStart(),
m_modelManager->traceEnd());
m_modelManager->replayQmlEvents(filter(std::bind(&QmlProfilerStatisticsModel::loadEvent, this,
std::placeholders::_1, std::placeholders::_2)),
std::bind(&QmlProfilerStatisticsModel::beginResetModel, this),
[this]() {
finalize();