From c8e431a193df360f4d67b309f88e83d7fc2f9f40 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Thu, 22 Feb 2018 18:06:51 +0000 Subject: [PATCH] Add logs to check the messages processed by the update thread Change-Id: I5ed701e2d61abfd6c390203381c4e85de26bd2ad --- dali/internal/common/message.h | 39 ++++++++++++++++++++++ .../internal/render/shaders/scene-graph-shader.cpp | 6 +++- .../update/animation/scene-graph-animation.cpp | 10 ++++++ .../internal/update/queue/update-message-queue.cpp | 29 ++++++++++++++++ packaging/dali.spec | 2 +- 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/dali/internal/common/message.h b/dali/internal/common/message.h index 73ad04a..8c7ff90 100644 --- a/dali/internal/common/message.h +++ b/dali/internal/common/message.h @@ -18,10 +18,13 @@ * */ +#include + // INTERNAL INCLUDES #include #include #include +#include namespace Dali { @@ -100,6 +103,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)(); } @@ -154,6 +160,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( param1 ); } @@ -215,6 +224,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( param1, param2 ); } @@ -280,6 +292,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( param1, param2, param3 ); } @@ -350,6 +365,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( param1, param2, param3, param4 ); } @@ -425,6 +443,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( param1, param2, param3, param4, param5 ); } @@ -506,6 +527,9 @@ public: virtual void Process( BufferIndex /*bufferIndex*/ ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( param1, param2, param3, param4, param5, param6 ); } @@ -561,6 +585,9 @@ public: virtual void Process( BufferIndex bufferIndex ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( bufferIndex ); } @@ -618,6 +645,9 @@ public: virtual void Process( BufferIndex bufferIndex ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( bufferIndex, param ); } @@ -679,6 +709,9 @@ public: virtual void Process( BufferIndex bufferIndex ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( bufferIndex, param2, param3 ); } @@ -747,6 +780,9 @@ public: virtual void Process( BufferIndex bufferIndex ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( bufferIndex, param2, param3, param4 ); } @@ -818,6 +854,9 @@ public: virtual void Process( BufferIndex bufferIndex ) { DALI_ASSERT_DEBUG( object && "Message does not have an object" ); + + DALI_LOG_ERROR("Message::Process: object: %s, function pointer: %p\n", typeid(object).name(), memberFunction); + (object->*memberFunction)( bufferIndex, param2, param3, param4, param5 ); } diff --git a/dali/internal/render/shaders/scene-graph-shader.cpp b/dali/internal/render/shaders/scene-graph-shader.cpp index dc78aed..c574a25 100644 --- a/dali/internal/render/shaders/scene-graph-shader.cpp +++ b/dali/internal/render/shaders/scene-graph-shader.cpp @@ -24,7 +24,7 @@ #include #include #include - +#include namespace Dali { @@ -75,7 +75,11 @@ void Shader::AddConnectionObserver( ConnectionChangePropagator::Observer& observ void Shader::RemoveConnectionObserver( ConnectionChangePropagator::Observer& observer ) { + DALI_LOG_ERROR("+++ Scene Graph Shader::RemoveConnectionObserver\n"); + mConnectionObservers.Remove(observer); + + DALI_LOG_ERROR("--- Scene Graph Shader::RemoveConnectionObserver\n"); } void Shader::UniformMappingsChanged( const UniformMap& mappings ) diff --git a/dali/internal/update/animation/scene-graph-animation.cpp b/dali/internal/update/animation/scene-graph-animation.cpp index 260be92..1fed088 100644 --- a/dali/internal/update/animation/scene-graph-animation.cpp +++ b/dali/internal/update/animation/scene-graph-animation.cpp @@ -25,6 +25,8 @@ #include #include #include +#include + namespace //Unnamed namespace { //Memory pool used to allocate new animations. Memory used by this pool will be released when shutting down DALi @@ -151,9 +153,13 @@ void Animation::SetPlayRange( const Vector2& range ) void Animation::Play() { + DALI_LOG_ERROR("Scene Graph Animation::Play: Before stable_sort\n"); + // Sort according to end time with earlier end times coming first, if the end time is the same, then the animators are not moved std::stable_sort( mAnimators.Begin(), mAnimators.End(), CompareAnimatorEndTimes ); + DALI_LOG_ERROR("Scene Graph Animation::Play: After stable_sort\n"); + mState = Playing; if ( mSpeedFactor < 0.0f && mElapsedSeconds <= mPlayRange.x*mDurationSeconds ) @@ -161,8 +167,12 @@ void Animation::Play() mElapsedSeconds = mPlayRange.y * mDurationSeconds; } + DALI_LOG_ERROR("Scene Graph Animation::Play: Before SetAnimatorsActive\n"); + SetAnimatorsActive( true ); + DALI_LOG_ERROR("Scene Graph Animation::Play: After SetAnimatorsActive\n"); + mCurrentLoop = 0; } diff --git a/dali/internal/update/queue/update-message-queue.cpp b/dali/internal/update/queue/update-message-queue.cpp index 330234d..fde103a 100644 --- a/dali/internal/update/queue/update-message-queue.cpp +++ b/dali/internal/update/queue/update-message-queue.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -251,6 +252,14 @@ bool MessageQueue::ProcessMessages( BufferIndex updateBufferIndex ) MessageQueueMutex::ScopedLock lock( mImpl->queueMutex ); const MessageBufferIter processQueueEndIter = mImpl->processQueue.end(); + + bool enableLog = ( mImpl->processQueue.begin() != processQueueEndIter ); + + if ( enableLog ) + { + DALI_LOG_ERROR("+++ MessageQueue::ProcessMessages: Mutex locked\n"); + } + for ( MessageBufferIter iter = mImpl->processQueue.begin(); iter != processQueueEndIter ; ++iter ) { MessageBuffer* buffer = *iter; @@ -259,8 +268,18 @@ bool MessageQueue::ProcessMessages( BufferIndex updateBufferIndex ) { MessageBase* message = reinterpret_cast< MessageBase* >( iter.Get() ); + if ( enableLog ) + { + DALI_LOG_ERROR("Before message->Process\n"); + } + message->Process( updateBufferIndex ); + if ( enableLog ) + { + DALI_LOG_ERROR("After message->Process\n"); + } + // Call virtual destructor explictly; since delete will not be called after placement new message->~MessageBase(); } @@ -270,6 +289,11 @@ bool MessageQueue::ProcessMessages( BufferIndex updateBufferIndex ) mImpl->recycleQueue.push_back( buffer ); } + if ( enableLog ) + { + DALI_LOG_ERROR("Outside message queue process\n"); + } + mImpl->sceneUpdate >>= 1; mImpl->queueWasEmpty = mImpl->processQueue.empty(); // Flag whether we processed anything @@ -278,6 +302,11 @@ bool MessageQueue::ProcessMessages( BufferIndex updateBufferIndex ) PERF_MONITOR_END(PerformanceMonitor::PROCESS_MESSAGES); + if ( enableLog ) + { + DALI_LOG_ERROR("--- MessageQueue::ProcessMessages: Mutex unlocked\n"); + } + return ( mImpl->sceneUpdate & 0x01 ); // if it was previously 2, scene graph was updated. } diff --git a/packaging/dali.spec b/packaging/dali.spec index aab5766..1696181 100755 --- a/packaging/dali.spec +++ b/packaging/dali.spec @@ -105,7 +105,7 @@ Integration development package for DALi 3D Engine - headers for integrating wit %build PREFIX="/usr" CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections " -LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -Wl,-Bsymbolic-functions " +LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -Wl,-Bsymbolic-functions -Wl,-Map=output.map " %ifarch %{arm} CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon" -- 2.7.4