diff --git a/src/declarative/debugger/qdeclarativeprofilerservice.cpp b/src/declarative/debugger/qdeclarativeprofilerservice.cpp index c5b6b65031c94d3901b9ae81b1df1d8b9c97d1e7..17ee3e5836b45cdf5de7de6b5e85a178a8348d62 100644 --- a/src/declarative/debugger/qdeclarativeprofilerservice.cpp +++ b/src/declarative/debugger/qdeclarativeprofilerservice.cpp @@ -124,6 +124,11 @@ bool QDeclarativeProfilerService::stopProfiling() return profilerInstance()->stopProfilingImpl(); } +void QDeclarativeProfilerService::sendStartedProfilingMessage() +{ + profilerInstance()->sendStartedProfilingMessageImpl(); +} + void QDeclarativeProfilerService::addEvent(EventType t) { profilerInstance()->addEventImpl(t); @@ -174,7 +179,7 @@ bool QDeclarativeProfilerService::startProfilingImpl() bool success = false; if (!profilingEnabled()) { setProfilingEnabled(true); - addEventImpl(StartTrace); + sendStartedProfilingMessageImpl(); success = true; } return success; @@ -191,6 +196,15 @@ bool QDeclarativeProfilerService::stopProfilingImpl() 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) { if (!QDeclarativeDebugService::isDebuggingEnabled() || !m_enabled) diff --git a/src/declarative/debugger/qdeclarativeprofilerservice_p.h b/src/declarative/debugger/qdeclarativeprofilerservice_p.h index f5ca8ec2941010468c9538cd7aa05974b5bdc5b7..d29690b6d6f5abc0e76d85f069fe56364f21a3a4 100644 --- a/src/declarative/debugger/qdeclarativeprofilerservice_p.h +++ b/src/declarative/debugger/qdeclarativeprofilerservice_p.h @@ -130,6 +130,7 @@ public: static bool startProfiling(); static bool stopProfiling(); + static void sendStartedProfilingMessage(); static void addEvent(EventType); static void startRange(RangeType); static void rangeData(RangeType, const QString &); @@ -151,6 +152,7 @@ protected: private: bool startProfilingImpl(); bool stopProfilingImpl(); + void sendStartedProfilingMessageImpl(); void addEventImpl(EventType); void startRangeImpl(RangeType); void rangeDataImpl(RangeType, const QString &);