diff --git a/src/libs/qmldebug/qmldebug-lib.pri b/src/libs/qmldebug/qmldebug-lib.pri
index 9afd866e79956cfe294f7bdd2ce3e26dd4fba5ee..2b247f9cf27f9222ee05b11cd91e2118876cc74a 100644
--- a/src/libs/qmldebug/qmldebug-lib.pri
+++ b/src/libs/qmldebug/qmldebug-lib.pri
@@ -21,7 +21,8 @@ HEADERS += \
     $$PWD/qmlenginedebugclient.h \
     $$PWD/basetoolsclient.h \
     $$PWD/declarativetoolsclient.h \
-    $$PWD/qmltoolsclient.h
+    $$PWD/qmltoolsclient.h \
+    $$PWD/qmlenginecontrolclient.h
 
 SOURCES += \
     $$PWD/qmldebugclient.cpp \
@@ -34,5 +35,6 @@ SOURCES += \
     $$PWD/basetoolsclient.cpp \
     $$PWD/declarativetoolsclient.cpp \
     $$PWD/qmltoolsclient.cpp \
-    $$PWD/declarativeenginedebugclient.cpp
+    $$PWD/declarativeenginedebugclient.cpp \
+    $$PWD/qmlenginecontrolclient.cpp
 
diff --git a/src/libs/qmldebug/qmlenginecontrolclient.cpp b/src/libs/qmldebug/qmlenginecontrolclient.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a9ade62bf85a43f261f166ae410ff44c6796a543
--- /dev/null
+++ b/src/libs/qmldebug/qmlenginecontrolclient.cpp
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "qmlenginecontrolclient.h"
+#include "utils/qtcassert.h"
+
+namespace QmlDebug {
+
+QmlEngineControlClient::QmlEngineControlClient(QmlDebugConnection *client)
+    : QmlDebugClient(QLatin1String("EngineControl"), client)
+{
+}
+
+/*!
+ * Block the staring or stopping of the engine with id \a engineId for now. By calling releaseEngine
+ * later the block can be lifted again. In the debugged application the engine control server waits
+ * until a message is received before continuing. So by not sending a message here we delay the
+ * process. Blocks add up. You have to call releaseEngine() as often as you've called blockEngine
+ * before. The intention of that is to allow different debug clients to use the same engine control
+ * and communicate with their respective counterparts before the QML engine starts or shuts down.
+ */
+void QmlEngineControlClient::blockEngine(int engineId)
+{
+    QTC_ASSERT(m_blockedEngines.contains(engineId), return);
+    m_blockedEngines[engineId].blockers++;
+}
+
+/*!
+ * Release the engine with id \a engineId. If no other blocks are present, depending on what the
+ * engine is waiting for, the start or stop command is sent to the process being debugged.
+ */
+void QmlEngineControlClient::releaseEngine(int engineId)
+{
+    QTC_ASSERT(m_blockedEngines.contains(engineId), return);
+
+    EngineState &state = m_blockedEngines[engineId];
+    if (--state.blockers == 0) {
+        QTC_ASSERT(state.releaseCommand != InvalidCommand, return);
+        sendMessage(state.releaseCommand, engineId);
+        m_blockedEngines.remove(engineId);
+    }
+}
+
+void QmlEngineControlClient::messageReceived(const QByteArray &data)
+{
+    QDataStream stream(data);
+    int message;
+    int id;
+    QString name;
+
+    stream >> message >> id;
+
+    if (!stream.atEnd())
+        stream >> name;
+
+    EngineState &state = m_blockedEngines[id];
+    QTC_ASSERT(state.blockers == 0 && state.releaseCommand == InvalidCommand, /**/);
+
+    switch (message) {
+    case EngineAboutToBeAdded:
+        state.releaseCommand = StartWaitingEngine;
+        emit engineAboutToBeAdded(id, name);
+        break;
+    case EngineAdded:
+        emit engineAdded(id, name);
+        break;
+    case EngineAboutToBeRemoved:
+        state.releaseCommand = StopWaitingEngine;
+        emit engineAboutToBeRemoved(id, name);
+        break;
+    case EngineRemoved:
+        emit engineRemoved(id, name);
+        break;
+    }
+
+    if (state.blockers == 0 && state.releaseCommand != InvalidCommand) {
+        sendMessage(state.releaseCommand, id);
+        m_blockedEngines.remove(id);
+    }
+}
+
+void QmlEngineControlClient::sendMessage(QmlEngineControlClient::CommandType command, int engineId)
+{
+    QByteArray data;
+    QDataStream stream(&data, QIODevice::WriteOnly);
+    stream << command << engineId;
+    QmlDebugClient::sendMessage(data);
+}
+
+}
diff --git a/src/libs/qmldebug/qmlenginecontrolclient.h b/src/libs/qmldebug/qmlenginecontrolclient.h
new file mode 100644
index 0000000000000000000000000000000000000000..44d36fbc21e67bbd50268bd5fa83f8769a102c11
--- /dev/null
+++ b/src/libs/qmldebug/qmlenginecontrolclient.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef QMLENGINECONTROLCLIENT_H
+#define QMLENGINECONTROLCLIENT_H
+
+#include "qmldebugclient.h"
+
+namespace QmlDebug {
+
+class QMLDEBUG_EXPORT QmlEngineControlClient : public QmlDebugClient
+{
+    Q_OBJECT
+public:
+    explicit QmlEngineControlClient(QmlDebugConnection *client);
+
+    enum MessageType {
+        EngineAboutToBeAdded,
+        EngineAdded,
+        EngineAboutToBeRemoved,
+        EngineRemoved
+    };
+
+    enum CommandType {
+        StartWaitingEngine,
+        StopWaitingEngine,
+        InvalidCommand
+    };
+
+
+    void blockEngine(int engineId);
+    void releaseEngine(int engineId);
+
+signals:
+    void engineAboutToBeAdded(int engineId, const QString &name);
+    void engineAdded(int engineId, const QString &name);
+    void engineAboutToBeRemoved(int engineId, const QString &name);
+    void engineRemoved(int engineId, const QString &name);
+
+protected:
+    void messageReceived(const QByteArray &);
+    void sendMessage(CommandType command, int engineId);
+
+    struct EngineState {
+        EngineState(CommandType command = InvalidCommand) : releaseCommand(command), blockers(0) {}
+        CommandType releaseCommand;
+        int blockers;
+    };
+
+    QMap<int, EngineState> m_blockedEngines;
+};
+
+}
+
+#endif // QMLENGINECONTROLCLIENT_H
diff --git a/src/libs/qmldebug/qmlprofilertraceclient.cpp b/src/libs/qmldebug/qmlprofilertraceclient.cpp
index 92b01c4817b70d829adf2595fd4df17b8358f54a..64d505068c729abe9d733ad94c1765e8f19b3976 100644
--- a/src/libs/qmldebug/qmlprofilertraceclient.cpp
+++ b/src/libs/qmldebug/qmlprofilertraceclient.cpp
@@ -28,13 +28,15 @@
 ****************************************************************************/
 
 #include "qmlprofilertraceclient.h"
+#include "qmlenginecontrolclient.h"
 
 namespace QmlDebug {
 
 class QmlProfilerTraceClientPrivate {
 public:
-    QmlProfilerTraceClientPrivate(QmlProfilerTraceClient *_q)
+    QmlProfilerTraceClientPrivate(QmlProfilerTraceClient *_q, QmlDebugConnection *client)
         : q(_q)
+        , engineControl(client)
         ,  inProgressRanges(0)
         , maximumTime(0)
         , recording(false)
@@ -42,9 +44,10 @@ public:
         ::memset(rangeCount, 0, MaximumRangeType * sizeof(int));
     }
 
-    void sendRecordingStatus();
+    void sendRecordingStatus(int engineId);
 
     QmlProfilerTraceClient *q;
+    QmlEngineControlClient engineControl;
     qint64 inProgressRanges;
     QStack<qint64> rangeStartTimes[MaximumRangeType];
     QStack<QString> rangeDatas[MaximumRangeType];
@@ -61,18 +64,22 @@ using namespace QmlDebug;
 
 static const int GAP_TIME = 150;
 
-void QmlProfilerTraceClientPrivate::sendRecordingStatus()
+void QmlProfilerTraceClientPrivate::sendRecordingStatus(int engineId)
 {
     QByteArray ba;
     QDataStream stream(&ba, QIODevice::WriteOnly);
     stream << recording;
+    if (engineId != -1)
+        stream << engineId;
     q->sendMessage(ba);
 }
 
 QmlProfilerTraceClient::QmlProfilerTraceClient(QmlDebugConnection *client)
     : QmlDebugClient(QLatin1String("CanvasFrameRate"), client)
-    , d(new QmlProfilerTraceClientPrivate(this))
+    , d(new QmlProfilerTraceClientPrivate(this, client))
 {
+    connect(&d->engineControl, SIGNAL(engineAboutToBeAdded(int,QString)),
+            this, SLOT(sendRecordingStatus(int)));
 }
 
 QmlProfilerTraceClient::~QmlProfilerTraceClient()
@@ -96,9 +103,9 @@ void QmlProfilerTraceClient::clearData()
     emit cleared();
 }
 
-void QmlProfilerTraceClient::sendRecordingStatus()
+void QmlProfilerTraceClient::sendRecordingStatus(int engineId)
 {
-    d->sendRecordingStatus();
+    d->sendRecordingStatus(engineId);
 }
 
 bool QmlProfilerTraceClient::isEnabled() const
@@ -164,7 +171,13 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
             setRecordingFromServer(true);
 
         if (event == EndTrace) {
-            emit this->traceFinished(time);
+            QList<int> engineIds;
+            while (!stream.atEnd()) {
+                int id;
+                stream >> id;
+                engineIds << id;
+            }
+            emit this->traceFinished(time, engineIds);
             d->maximumTime = time;
             d->maximumTime = qMax(time, d->maximumTime);
         } else if (event == AnimationFrame) {
@@ -179,7 +192,13 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
                              QmlDebug::QmlEventLocation(), frameRate, animationCount, threadId,0,0);
             d->maximumTime = qMax(time, d->maximumTime);
         } else if (event == StartTrace) {
-            emit this->traceStarted(time);
+            QList<int> engineIds;
+            while (!stream.atEnd()) {
+                int id;
+                stream >> id;
+                engineIds << id;
+            }
+            emit this->traceStarted(time, engineIds);
             d->maximumTime = time;
         } else if (event < MaximumEventType) {
             emit this->event((EventType)event, time);
diff --git a/src/libs/qmldebug/qmlprofilertraceclient.h b/src/libs/qmldebug/qmlprofilertraceclient.h
index 92c2c2ae46c0590aa85e06071c57002885eac20a..2f56921645fd4aff2ad7ddae348764abba83d1aa 100644
--- a/src/libs/qmldebug/qmlprofilertraceclient.h
+++ b/src/libs/qmldebug/qmlprofilertraceclient.h
@@ -59,14 +59,14 @@ public:
 
 public slots:
     void clearData();
-    void sendRecordingStatus();
+    void sendRecordingStatus(int engineId = -1);
 
 signals:
     void complete(qint64 maximumTime);
     void gap(qint64 time);
     void event(int event, qint64 time);
-    void traceFinished( qint64 time );
-    void traceStarted( qint64 time );
+    void traceFinished(qint64 time, const QList<int> &engineIds);
+    void traceStarted(qint64 time, const QList<int> &engineIds);
     void rangedEvent(QmlDebug::Message, QmlDebug::RangeType, int detailType, qint64 startTime,
                      qint64 length, const QString &data,
                      const QmlDebug::QmlEventLocation &location, qint64 param1, qint64 param2,
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
index e07727348422011856098dbb8e918d0c24904046..2d209f6f9f4a8e9f153871fe301783bd8d71438b 100644
--- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
@@ -182,10 +182,10 @@ void QmlProfilerClientManager::connectClientSignals()
                 SLOT(addQmlEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
                                  QString,QmlDebug::QmlEventLocation,qint64,qint64,qint64,qint64,
                                  qint64)));
-        connect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)),
-                d->modelManager->traceTime(), SLOT(setEndTime(qint64)));
-        connect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64)),
-                d->modelManager->traceTime(), SLOT(setStartTime(qint64)));
+        connect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64,QList<int>)),
+                d->modelManager->traceTime(), SLOT(increaseEndTime(qint64)));
+        connect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64,QList<int>)),
+                d->modelManager->traceTime(), SLOT(decreaseStartTime(qint64)));
         connect(d->qmlclientplugin.data(), SIGNAL(enabledChanged()),
                 d->qmlclientplugin.data(), SLOT(sendRecordingStatus()));
         // fixme: this should be unified for both clients
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index 8f38bb884e79c8069c58e3e87fb3c192c6796cc5..c7bcd297ae46f26e421a183d456fc423148ffada 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -132,6 +132,18 @@ void QmlProfilerTraceTime::setEndTime(qint64 time)
     }
 }
 
+void QmlProfilerTraceTime::decreaseStartTime(qint64 time)
+{
+    if (m_startTime > time)
+        setStartTime(time);
+}
+
+void QmlProfilerTraceTime::increaseEndTime(qint64 time)
+{
+    if (m_endTime < time)
+        setEndTime(time);
+}
+
 
 } // namespace Internal
 
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
index 1b4a8a3b1a40ec1a7111867cc977595b7ce7febd..2479eb037e388c29207c80d06a38f94c59a573f8 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
@@ -94,6 +94,9 @@ public slots:
     void setStartTime(qint64 time);
     void setEndTime(qint64 time);
 
+    void decreaseStartTime(qint64 time);
+    void increaseEndTime(qint64 time);
+
 private:
     qint64 m_startTime;
     qint64 m_endTime;