Commit 2cb2290d authored by Christiaan Janssen's avatar Christiaan Janssen Committed by Qt by Nokia
Browse files

QmlProfiler: sending start profiling message


Will be used by the client to show status in the GUI.
When profiling is stopped, data is sent immediately,
therefore no "stop profiling" message.

Change-Id: Idd12069a9707296b87e305e8b3cbf8e324989a3f
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 5f0013ee
No related merge requests found
Showing with 17 additions and 1 deletion
...@@ -124,6 +124,11 @@ bool QDeclarativeProfilerService::stopProfiling() ...@@ -124,6 +124,11 @@ bool QDeclarativeProfilerService::stopProfiling()
return profilerInstance()->stopProfilingImpl(); return profilerInstance()->stopProfilingImpl();
} }
void QDeclarativeProfilerService::sendStartedProfilingMessage()
{
profilerInstance()->sendStartedProfilingMessageImpl();
}
void QDeclarativeProfilerService::addEvent(EventType t) void QDeclarativeProfilerService::addEvent(EventType t)
{ {
profilerInstance()->addEventImpl(t); profilerInstance()->addEventImpl(t);
...@@ -174,7 +179,7 @@ bool QDeclarativeProfilerService::startProfilingImpl() ...@@ -174,7 +179,7 @@ bool QDeclarativeProfilerService::startProfilingImpl()
bool success = false; bool success = false;
if (!profilingEnabled()) { if (!profilingEnabled()) {
setProfilingEnabled(true); setProfilingEnabled(true);
addEventImpl(StartTrace); sendStartedProfilingMessageImpl();
success = true; success = true;
} }
return success; return success;
...@@ -191,6 +196,15 @@ bool QDeclarativeProfilerService::stopProfilingImpl() ...@@ -191,6 +196,15 @@ bool QDeclarativeProfilerService::stopProfilingImpl()
return success; return success;
} }
void QDeclarativeProfilerService::sendStartedProfilingMessageImpl()
{
if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled)
return;
QDeclarativeProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)StartTrace, QString(), -1, -1, 0, 0};
QDeclarativeDebugService::sendMessage(ed.toByteArray());
}
void QDeclarativeProfilerService::addEventImpl(EventType event) void QDeclarativeProfilerService::addEventImpl(EventType event)
{ {
if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled)
......
...@@ -130,6 +130,7 @@ public: ...@@ -130,6 +130,7 @@ public:
static bool startProfiling(); static bool startProfiling();
static bool stopProfiling(); static bool stopProfiling();
static void sendStartedProfilingMessage();
static void addEvent(EventType); static void addEvent(EventType);
static void startRange(RangeType); static void startRange(RangeType);
static void rangeData(RangeType, const QString &); static void rangeData(RangeType, const QString &);
...@@ -151,6 +152,7 @@ protected: ...@@ -151,6 +152,7 @@ protected:
private: private:
bool startProfilingImpl(); bool startProfilingImpl();
bool stopProfilingImpl(); bool stopProfilingImpl();
void sendStartedProfilingMessageImpl();
void addEventImpl(EventType); void addEventImpl(EventType);
void startRangeImpl(RangeType); void startRangeImpl(RangeType);
void rangeDataImpl(RangeType, const QString &); void rangeDataImpl(RangeType, const QString &);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment