From 457a2043c757cc7e989e2fdbcd3869ae4c40602e Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Tue, 20 Feb 2024 12:53:40 +0900 Subject: [PATCH] [Tizen] Reduce the line of trace logs Let we print the trace log only for end. Change-Id: I8acbce1bcc723ecb91b8df40c25bd62a8a66eeb2 Signed-off-by: Eunki, Hong --- dali/internal/render/common/render-algorithms.cpp | 22 +-- dali/internal/render/common/render-manager.cpp | 67 +++++---- dali/internal/render/queue/render-queue.cpp | 11 +- .../update/animation/scene-graph-animation.cpp | 3 - .../update/manager/frame-callback-processor.cpp | 27 ++-- .../update/manager/render-task-processor.cpp | 7 +- .../update/manager/scene-graph-traveler.cpp | 13 +- dali/internal/update/manager/transform-manager.cpp | 27 ++-- dali/internal/update/manager/update-algorithms.cpp | 10 -- dali/internal/update/manager/update-manager.cpp | 154 ++++++++++++++------- .../internal/update/queue/update-message-queue.cpp | 25 ++-- 11 files changed, 224 insertions(+), 142 deletions(-) diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index 4e872f5..cff3c31 100644 --- a/dali/internal/render/common/render-algorithms.cpp +++ b/dali/internal/render/common/render-algorithms.cpp @@ -650,9 +650,6 @@ inline void RenderAlgorithms::ProcessRenderList(const RenderList& uint32_t renderCallCount = 0u; - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_LIST_PROCESS", [&](std::ostringstream& oss) { - oss << "[" << count << "]"; - }); // Loop through all RenderItems in the RenderList, set up any prerequisites to render them, then perform the render. for(uint32_t index = 0u; index < count; ++index) { @@ -710,9 +707,12 @@ inline void RenderAlgorithms::ProcessRenderList(const RenderList& } } } - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_LIST_PROCESS", [&](std::ostringstream& oss) { - oss << "[renderCallCount:" << renderCallCount << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_LIST_PROCESS [%u]\n", renderCallCount); + } +#endif } RenderAlgorithms::RenderAlgorithms(Graphics::Controller& graphicsController) @@ -756,9 +756,6 @@ void RenderAlgorithms::ProcessRenderInstruction(const RenderInstruction& int orientation, const Uint16Pair& sceneSize) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_INSTRUCTION_PROCESS", [&](std::ostringstream& oss) { - oss << "[" << instruction.RenderListCount() << "]"; - }); DALI_PRINT_RENDER_INSTRUCTION(instruction, bufferIndex); const Matrix* viewMatrix = instruction.GetViewMatrix(bufferIndex); @@ -805,7 +802,12 @@ void RenderAlgorithms::ProcessRenderInstruction(const RenderInstruction& mGraphicsCommandBuffer->ExecuteCommandBuffers(std::move(buffers)); } } - DALI_TRACE_END(gTraceFilter, "DALI_RENDER_INSTRUCTION_PROCESS"); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_INSTRUCTION_PROCESS\n"); + } +#endif } } // namespace Render diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index cfd7cfb..010fd32 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -478,8 +478,6 @@ void RenderManager::RemoveRenderTracker(Render::RenderTracker* renderTracker) void RenderManager::PreRender(Integration::RenderStatus& status, bool forceClear) { - DALI_TRACE_BEGIN(gTraceFilter, "DALI_RENDER_PRE_RENDER"); - DALI_PRINT_RENDER_START(mImpl->renderBufferIndex); DALI_LOG_INFO(gLogFilter, Debug::Verbose, "\n\nNewFrame %d\n", mImpl->frameCount); @@ -525,9 +523,12 @@ void RenderManager::PreRender(Integration::RenderStatus& status, bool forceClear mImpl->commandBufferSubmitted = false; - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_PRE_RENDER", [&](std::ostringstream& oss) { - oss << "[" << totalInstructionCount << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_PRE_RENDER [%u]\n", totalInstructionCount); + } +#endif } void RenderManager::PreRender(Integration::Scene& scene, std::vector>& damagedRects) @@ -600,10 +601,6 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector>& return; } - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_DIRTY_RECT", [&](std::ostringstream& oss) { - oss << "[" << itemsDirtyRects.size() << "]"; - }); - uint32_t renderItemCount = 0u; // Mark previous dirty rects in the std::unordered_map. @@ -796,11 +793,17 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector>& { damagedRectCleaner.SetCleanOnReturn(false); } - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_DIRTY_RECT", [&](std::ostringstream& oss) { + +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + std::ostringstream oss; oss << "[" << itemsDirtyRects.size() << ","; oss << "itemCount:" << renderItemCount << ","; oss << "damagedRects:" << damagedRects.size() << "]"; - }); + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_DIRTY_RECT [%s]\n", oss.str().c_str()); + } +#endif } void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo) @@ -850,7 +853,6 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration:: clippingRect = Rect(); } - DALI_TRACE_BEGIN(gTraceFilter, "DALI_RENDER_UBO"); // Prefetch programs before we start rendering so reflection is // ready, and we can pull exact size of UBO needed (no need to resize during drawing) auto totalSizeCPU = 0u; @@ -920,10 +922,15 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration:: DALI_LOG_INFO(gLogFilter, Debug::Verbose, "GPU buffer: nil\n"); } #endif - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_UBO", [&](std::ostringstream& oss) { +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + std::ostringstream oss; oss << "[cpuMemory:" << totalSizeCPU << ","; oss << "gpuMemory:" << totalSizeGPU << "]"; - }); + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_UBO [%s]\n", oss.str().c_str()); + } +#endif for(uint32_t i = 0; i < instructionCount; ++i) { @@ -1125,10 +1132,6 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration:: mainCommandBuffer->EndRenderPass(syncObject); } - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_FINISHED", [&](std::ostringstream& oss) { - oss << "[" << targetstoPresent.size() << "]"; - }); - // Flush UBOs mImpl->uniformBufferManager->Flush(sceneObject, renderToFbo); mImpl->renderAlgorithms.SubmitCommandBuffer(); @@ -1145,8 +1148,12 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration:: rt = target; } } - - DALI_TRACE_END(gTraceFilter, "DALI_RENDER_FINISHED"); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_FINISHED\n"); + } +#endif } void RenderManager::PostRender() @@ -1165,28 +1172,32 @@ void RenderManager::PostRender() // Notify RenderGeometries that rendering has finished if(mImpl->geometryContainer.Count() > 0u) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_GEOMETRY_RENDER_FINISHED", [&](std::ostringstream& oss) { - oss << "[" << mImpl->geometryContainer.Count() << "]"; - }); for(auto&& iter : mImpl->geometryContainer) { iter->OnRenderFinished(); } - DALI_TRACE_END(gTraceFilter, "DALI_GEOMETRY_RENDER_FINISHED"); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_GEOMETRY_RENDER_FINISHED [%zu]\n", mImpl->geometryContainer.Count()); + } +#endif } // Notify updated RenderTexture that rendering has finished if(mImpl->updatedTextures.Count() > 0u) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_TEXTURE_UPDATED", [&](std::ostringstream& oss) { - oss << "[" << mImpl->updatedTextures.Count() << "]"; - }); for(auto&& iter : mImpl->updatedTextures) { iter->OnRenderFinished(); } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_TEXTURE_UPDATED [%zu]\n", mImpl->updatedTextures.Count()); + } +#endif mImpl->updatedTextures.Clear(); - DALI_TRACE_END(gTraceFilter, "DALI_TEXTURE_UPDATED"); } // Remove discarded textures after OnRenderFinished called diff --git a/dali/internal/render/queue/render-queue.cpp b/dali/internal/render/queue/render-queue.cpp index f42ee9f..e7cf546 100644 --- a/dali/internal/render/queue/render-queue.cpp +++ b/dali/internal/render/queue/render-queue.cpp @@ -22,6 +22,7 @@ #include // INTERNAL INCLUDES +#include #include #include @@ -86,7 +87,6 @@ uint32_t* RenderQueue::ReserveMessageSlot(BufferIndex updateBufferIndex, std::si void RenderQueue::ProcessMessages(BufferIndex bufferIndex) { - DALI_TRACE_BEGIN(gTraceFilter, "DALI_RENDER_MESSAGE_QUEUE_PROCESS"); std::size_t capacity = container0->GetCapacity() + container1->GetCapacity(); mCapacity = capacity; // write is atomic. @@ -108,9 +108,12 @@ void RenderQueue::ProcessMessages(BufferIndex bufferIndex) container->Reset(); LimitBufferCapacity(bufferIndex); - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDER_MESSAGE_QUEUE_PROCESS", [&](std::ostringstream& oss) { - oss << "[" << messageCount << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_RENDER_MESSAGE_QUEUE_PROCESS [%u]\n", messageCount); + } +#endif } MessageBuffer* RenderQueue::GetCurrentContainer(BufferIndex bufferIndex) diff --git a/dali/internal/update/animation/scene-graph-animation.cpp b/dali/internal/update/animation/scene-graph-animation.cpp index 8adfff2..b35206e 100644 --- a/dali/internal/update/animation/scene-graph-animation.cpp +++ b/dali/internal/update/animation/scene-graph-animation.cpp @@ -55,9 +55,6 @@ bool CompareAnimatorEndTimes(const Dali::Internal::SceneGraph::AnimatorBase* lhs return ((lhs->GetIntervalDelay() + lhs->GetDuration()) < (rhs->GetIntervalDelay() + rhs->GetDuration())); } -// TODO : The name of trace marker name is from VD specific. We might need to change it future. -DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_COMBINED, false); - } // unnamed namespace namespace Dali diff --git a/dali/internal/update/manager/frame-callback-processor.cpp b/dali/internal/update/manager/frame-callback-processor.cpp index 82b2bc5..fb66c62 100644 --- a/dali/internal/update/manager/frame-callback-processor.cpp +++ b/dali/internal/update/manager/frame-callback-processor.cpp @@ -128,33 +128,40 @@ bool FrameCallbackProcessor::Update(BufferIndex bufferIndex, float elapsedSecond if(!mFrameCallbacks.empty()) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_FRAME_CALLBACK_UPDATE", [&](std::ostringstream& oss) { - oss << "[" << mFrameCallbacks.size() << "]"; - }); - #ifdef TRACE_ENABLED std::vector> frameCallbackTimeChecker; uint32_t frameIndex = 0u; + uint64_t start = 0u; + uint64_t end = 0u; #endif // If any of the FrameCallback::Update calls returns false, then they are no longer required & can be removed. auto iter = std::remove_if( mFrameCallbacks.begin(), mFrameCallbacks.end(), [&](OwnerPointer& frameCallback) { #ifdef TRACE_ENABLED - uint64_t start = GetNanoSeconds(); + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + start = GetNanoSeconds(); + } #endif FrameCallback::RequestFlags requests = frameCallback->Update(bufferIndex, elapsedSeconds, mNodeHierarchyChanged); #ifdef TRACE_ENABLED - uint64_t end = GetNanoSeconds(); - frameCallbackTimeChecker.emplace_back(end - start, ++frameIndex); + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + end = GetNanoSeconds(); + frameCallbackTimeChecker.emplace_back(end - start, ++frameIndex); + } #endif keepRendering |= (requests & FrameCallback::KEEP_RENDERING); return (requests & FrameCallback::CONTINUE_CALLING) == 0; }); mFrameCallbacks.erase(iter, mFrameCallbacks.end()); - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_FRAME_CALLBACK_UPDATE", [&](std::ostringstream& oss) { +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + std::ostringstream oss; oss << "[" << mFrameCallbacks.size() << ","; std::sort(frameCallbackTimeChecker.rbegin(), frameCallbackTimeChecker.rend()); @@ -167,7 +174,9 @@ bool FrameCallbackProcessor::Update(BufferIndex bufferIndex, float elapsedSecond oss << frameCallbackTimeChecker[i].second << ")"; } oss << "]"; - }); + DALI_LOG_DEBUG_INFO("END: DALI_FRAME_CALLBACK_UPDATE [%s]\n", oss.str().c_str()); + } +#endif } mNodeHierarchyChanged = false; diff --git a/dali/internal/update/manager/render-task-processor.cpp b/dali/internal/update/manager/render-task-processor.cpp index d2d9298..943dce1 100644 --- a/dali/internal/update/manager/render-task-processor.cpp +++ b/dali/internal/update/manager/render-task-processor.cpp @@ -218,7 +218,6 @@ void ProcessTasks(BufferIndex updateBufferIndex, bool isRenderingToFbo, bool processOffscreen) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_TASK_PROCESS"); uint32_t clippingId = 0u; bool hasClippingNodes = false; @@ -313,6 +312,12 @@ void ProcessTasks(BufferIndex updateBufferIndex, } } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_TASK_PROCESS\n"); + } +#endif } } // Anonymous namespace. diff --git a/dali/internal/update/manager/scene-graph-traveler.cpp b/dali/internal/update/manager/scene-graph-traveler.cpp index 1fb90ee..0bc15c3 100644 --- a/dali/internal/update/manager/scene-graph-traveler.cpp +++ b/dali/internal/update/manager/scene-graph-traveler.cpp @@ -61,9 +61,6 @@ SceneGraph::Node* SceneGraphTraveler::FindNode(uint32_t id) } else { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_SCENE_GRAPH_TRAVELER", [&](std::ostringstream& oss) { - oss << "[" << mTravledNodeMap.size() << "]"; - }); while(!FullSearched()) { SceneGraph::Node& currentNode = GetCurrentNode(); @@ -78,10 +75,12 @@ SceneGraph::Node* SceneGraphTraveler::FindNode(uint32_t id) break; } } - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_SCENE_GRAPH_TRAVELER", [&](std::ostringstream& oss) { - oss << "[" << mTravledNodeMap.size() << ","; - oss << "found:" << (node == nullptr ? 0 : 1) << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_SCENE_GRAPH_TRAVELER [%zu,found:%d]\n", mTravledNodeMap.size(), (node == nullptr ? 0 : 1)); + } +#endif } return node; diff --git a/dali/internal/update/manager/transform-manager.cpp b/dali/internal/update/manager/transform-manager.cpp index 32789de..fd61673 100644 --- a/dali/internal/update/manager/transform-manager.cpp +++ b/dali/internal/update/manager/transform-manager.cpp @@ -228,10 +228,15 @@ void TransformManager::ResetToBaseValue() { if(mComponentCount) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_TRANSFORM_RESET_TO_BASE"); memcpy(&mTxComponentAnimatable[0], &mTxComponentAnimatableBaseValue[0], sizeof(TransformComponentAnimatable) * mComponentCount); memcpy(&mSize[0], &mSizeBase[0], sizeof(Vector3) * mComponentCount); memset(&mLocalMatrixDirty[0], false, sizeof(bool) * mComponentCount); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_TRANSFORM_RESET_TO_BASE\n"); + } +#endif } } @@ -239,16 +244,17 @@ bool TransformManager::Update() { bool componentsChanged = false; - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_TRANSFORM_UPDATE", [&](std::ostringstream& oss) { - oss << "[" << mComponentCount << "]"; - }); - if(mReorder) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_TRANSFORM_REORDER"); //If some transform component has change its parent or has been removed since last update //we need to reorder the vectors ReorderComponents(); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_TRANSFORM_REORDER\n"); + } +#endif mReorder = false; } @@ -366,9 +372,12 @@ bool TransformManager::Update() mComponentDirty[i] = false; } - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_TRANSFORM_UPDATE", [&](std::ostringstream& oss) { - oss << "[componentsChanged:" << componentsChanged << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_TRANSFORM_UPDATE [%zu,%d]\n", mComponentCount, componentsChanged); + } +#endif return componentsChanged; } diff --git a/dali/internal/update/manager/update-algorithms.cpp b/dali/internal/update/manager/update-algorithms.cpp index 6870965..481c1dc 100644 --- a/dali/internal/update/manager/update-algorithms.cpp +++ b/dali/internal/update/manager/update-algorithms.cpp @@ -33,12 +33,6 @@ #include #include -namespace -{ -// TODO : The name of trace marker name is from VD specific. We might need to change it future. -DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_COMBINED, false); -} // namespace - namespace Dali { namespace Internal @@ -168,8 +162,6 @@ NodePropertyFlags UpdateNodeTree(Layer& rootNode, return NodePropertyFlags::NOTHING; } - DALI_TRACE_BEGIN(gTraceFilter, "DALI_UPDATE_NODE_TREE"); - // If the root node was not previously visible BufferIndex previousBuffer = updateBufferIndex ? 0u : 1u; if(DALI_UNLIKELY(!rootNode.IsVisible(previousBuffer))) // almost never ever true @@ -200,8 +192,6 @@ NodePropertyFlags UpdateNodeTree(Layer& rootNode, updated); } - DALI_TRACE_END(gTraceFilter, "DALI_UPDATE_NODE_TREE"); - return cumulativeDirtyFlags; } diff --git a/dali/internal/update/manager/update-manager.cpp b/dali/internal/update/manager/update-manager.cpp index 1fdc932..df63dc5 100644 --- a/dali/internal/update/manager/update-manager.cpp +++ b/dali/internal/update/manager/update-manager.cpp @@ -770,38 +770,38 @@ void UpdateManager::ResetProperties(BufferIndex bufferIndex) if(mImpl->nodeResetters.Count() > 0u) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_NODE_RESETTER", [&](std::ostringstream& oss) { - oss << "[" << mImpl->nodeResetters.Count() << "]"; - }); // Reset node properties mImpl->nodeResetters.ResetToBaseValues(bufferIndex); - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_NODE_RESETTER", [&](std::ostringstream& oss) { - oss << "[" << mImpl->nodeResetters.Count() << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_NODE_RESETTER [%zu]\n", mImpl->nodeResetters.Count()); + } +#endif } if(mImpl->rendererResetters.Count() > 0u) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDERER_RESETTER", [&](std::ostringstream& oss) { - oss << "[" << mImpl->rendererResetters.Count() << "]"; - }); // Reset renderer properties mImpl->rendererResetters.ResetToBaseValues(bufferIndex); - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_RENDERER_RESETTER", [&](std::ostringstream& oss) { - oss << "[" << mImpl->rendererResetters.Count() << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_RENDERER_RESETTER [%zu]\n", mImpl->rendererResetters.Count()); + } +#endif } if(mImpl->propertyResetters.Count() > 0u) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_PROPERTY_RESETTER", [&](std::ostringstream& oss) { - oss << "[" << mImpl->propertyResetters.Count() << "]"; - }); // Reset all animating / constrained properties mImpl->propertyResetters.ResetToBaseValues(bufferIndex); - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_PROPERTY_RESETTER", [&](std::ostringstream& oss) { - oss << "[" << mImpl->propertyResetters.Count() << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_PROPERTY_RESETTER [%zu]\n", mImpl->propertyResetters.Count()); + } +#endif } // Clear all root nodes dirty flags @@ -811,9 +811,6 @@ void UpdateManager::ResetProperties(BufferIndex bufferIndex) root->ResetDirtyFlags(bufferIndex); } - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_NODE_RESET", [&](std::ostringstream& oss) { - oss << "[" << mImpl->nodes.Count() << "]"; - }); // Clear node dirty flags Vector::Iterator iter = mImpl->nodes.Begin() + 1; Vector::Iterator endIter = mImpl->nodes.End(); @@ -821,7 +818,12 @@ void UpdateManager::ResetProperties(BufferIndex bufferIndex) { (*iter)->ResetDirtyFlags(bufferIndex); } - DALI_TRACE_END(gTraceFilter, "DALI_UPDATE_NODE_RESET"); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_NODE_RESET [%zu]\n", mImpl->nodes.Count()); + } +#endif } bool UpdateManager::ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds) @@ -833,6 +835,12 @@ bool UpdateManager::ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncT // gesture processor only supports default properties mImpl->panGestureProcessor->ResetDefaultProperties(bufferIndex); // Needs to be done every time as gesture data is written directly to an update-buffer rather than via a message gestureUpdated |= mImpl->panGestureProcessor->UpdateProperties(lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_GESTURE [updated:%d]\n", gestureUpdated); + } +#endif } return gestureUpdated; @@ -845,10 +853,6 @@ bool UpdateManager::Animate(BufferIndex bufferIndex, float elapsedSeconds) auto&& iter = mImpl->animations.Begin(); - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_ANIMATION_ANIMATE", [&](std::ostringstream& oss) { - oss << "[" << mImpl->animations.Count() << "]"; - }); - while(iter != mImpl->animations.End()) { Animation* animation = *iter; @@ -890,16 +894,18 @@ bool UpdateManager::Animate(BufferIndex bufferIndex, float elapsedSeconds) mImpl->notificationManager.QueueNotification(&mImpl->animationPlaylist, std::move(mImpl->notifyRequiredAnimations)); } - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_ANIMATION_ANIMATE", [&](std::ostringstream& oss) { - oss << "[" << mImpl->animations.Count() << "]"; - }); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled() && mImpl->animations.Count() > 0u) + { + DALI_LOG_DEBUG_INFO("END: DALI_ANIMATION_ANIMATE [%zu active:%d]\n", mImpl->animations.Count(), animationActive); + } +#endif return animationActive; } void UpdateManager::ConstrainCustomObjects(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_CONSTRAINT_CUSTOM_OBJECTS"); // Constrain custom objects (in construction order) for(auto&& object : mImpl->customObjects) { @@ -909,11 +915,19 @@ void UpdateManager::ConstrainCustomObjects(PropertyOwnerContainer& postPropertyO postPropertyOwners.PushBack(object); } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled() && mImpl->customObjects.Count() > 0u) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_CONSTRAINT_CUSTOM_OBJECTS [%zu]\n", mImpl->customObjects.Count()); + } +#endif } void UpdateManager::ConstrainRenderTasks(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_CONSTRAINT_RENDER_TASK"); +#ifdef TRACE_ENABLED + uint32_t taskCount = 0u; +#endif // Constrain render-tasks for(auto&& scene : mImpl->scenes) { @@ -922,6 +936,9 @@ void UpdateManager::ConstrainRenderTasks(PropertyOwnerContainer& postPropertyOwn RenderTaskList::RenderTaskContainer& tasks = scene->taskList->GetTasks(); for(auto&& task : tasks) { +#ifdef TRACE_ENABLED + ++taskCount; +#endif ConstrainPropertyOwner(*task, bufferIndex); if(!task->GetPostConstraints().Empty()) { @@ -930,11 +947,16 @@ void UpdateManager::ConstrainRenderTasks(PropertyOwnerContainer& postPropertyOwn } } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled() && taskCount > 0u) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_CONSTRAINT_RENDER_TASK [%u]\n", taskCount); + } +#endif } void UpdateManager::ConstrainShaders(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_CONSTRAINT_SHADER"); // constrain shaders... (in construction order) for(auto&& shader : mImpl->shaders) { @@ -944,11 +966,16 @@ void UpdateManager::ConstrainShaders(PropertyOwnerContainer& postPropertyOwners, postPropertyOwners.PushBack(shader); } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled() && mImpl->shaders.Count() > 0u) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_CONSTRAINT_SHADER [%zu]\n", mImpl->shaders.Count()); + } +#endif } void UpdateManager::ProcessPropertyNotifications(BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_PROPERTY_NOTIFICATION"); for(auto&& notification : mImpl->propertyNotifications) { bool valid = notification->Check(bufferIndex); @@ -957,6 +984,12 @@ void UpdateManager::ProcessPropertyNotifications(BufferIndex bufferIndex) mImpl->notificationManager.QueueMessage(PropertyChangedMessage(mImpl->propertyNotifier, notification->GetNotifyId(), notification->GetValidity())); } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled() && mImpl->propertyNotifications.Count() > 0u) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_PROPERTY_NOTIFICATION [%zu]\n", mImpl->propertyNotifications.Count()); + } +#endif } void UpdateManager::ForwardCompiledShadersToEventThread() @@ -986,7 +1019,6 @@ void UpdateManager::ForwardCompiledShadersToEventThread() void UpdateManager::UpdateRenderers(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_RENDERER"); for(const auto& rendererKey : mImpl->renderers) { // Apply constraints @@ -999,11 +1031,16 @@ void UpdateManager::UpdateRenderers(PropertyOwnerContainer& postPropertyOwners, mImpl->renderingRequired = renderer->PrepareRender(bufferIndex) || mImpl->renderingRequired; } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_RENDERER [%zu]\n", mImpl->renderers.Count()); + } +#endif } void UpdateManager::UpdateNodes(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_NODES"); mImpl->nodeDirtyFlags = NodePropertyFlags::NOTHING; for(auto&& scene : mImpl->scenes) @@ -1018,11 +1055,16 @@ void UpdateManager::UpdateNodes(PropertyOwnerContainer& postPropertyOwners, Buff postPropertyOwners); } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_NODES\n"); + } +#endif } void UpdateManager::UpdateLayers(BufferIndex bufferIndex) { - DALI_TRACE_SCOPE(gTraceFilter, "DALI_UPDATE_LAYER"); for(auto&& scene : mImpl->scenes) { if(scene && scene->root) @@ -1030,6 +1072,12 @@ void UpdateManager::UpdateLayers(BufferIndex bufferIndex) SceneGraph::UpdateLayerTree(*scene->root, bufferIndex); } } +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_LAYER\n"); + } +#endif } uint32_t UpdateManager::Update(float elapsedSeconds, @@ -1050,9 +1098,7 @@ uint32_t UpdateManager::Update(float elapsedSeconds, bool isAnimationRunning = IsAnimationRunning(); // Process Touches & Gestures - DALI_TRACE_BEGIN(gTraceFilter, "DALI_UPDATE_GESTURE"); const bool gestureUpdated = ProcessGestures(bufferIndex, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds); - DALI_TRACE_END(gTraceFilter, "DALI_UPDATE_GESTURE"); bool updateScene = // The scene-graph requires an update if.. (mImpl->nodeDirtyFlags & RenderableUpdateFlags) || // ..nodes were dirty in previous frame OR @@ -1089,15 +1135,6 @@ uint32_t UpdateManager::Update(float elapsedSeconds, // We should not start skipping update steps or reusing lists until there has been two frames where nothing changes if(updateScene || mImpl->previousUpdateScene) { - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_INTERNAL", [&](std::ostringstream& oss) { - oss << "[node:" << mImpl->nodes.Size() << ","; - oss << "custom:" << mImpl->customObjects.Size() << ","; - oss << "animations:" << mImpl->animations.Size() << ","; - oss << "renderers:" << mImpl->renderers.Size() << ","; - oss << "textureSets:" << mImpl->textureSets.Size() << ","; - oss << "shaders:" << mImpl->shaders.Size() << "]"; - }); - // Animate bool animationActive = Animate(bufferIndex, elapsedSeconds); @@ -1164,8 +1201,6 @@ uint32_t UpdateManager::Update(float elapsedSeconds, // reset the update buffer index and make sure there is enough room in the instruction container if(mImpl->renderersAdded) { - DALI_TRACE_BEGIN(gTraceFilter, "DALI_UPDATE_TASK_PROCESS"); - // Calculate how many render tasks we have in total std::size_t numberOfRenderTasks = 0; for(auto&& scene : mImpl->scenes) @@ -1221,10 +1256,27 @@ uint32_t UpdateManager::Update(float elapsedSeconds, } DALI_LOG_INFO(gLogFilter, Debug::General, "Update: numberOfRenderTasks(%d), Render Instructions(%d)\n", numberOfRenderTasks, numberOfRenderInstructions); - DALI_TRACE_END(gTraceFilter, "DALI_UPDATE_TASK_PROCESS"); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_TASK_PROCESS\n"); + } +#endif } - DALI_TRACE_END(gTraceFilter, "DALI_UPDATE_INTERNAL"); +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + std::ostringstream oss; + oss << "[n:" << mImpl->nodes.Size() << ","; + oss << "c:" << mImpl->customObjects.Size() << ","; + oss << "a:" << mImpl->animations.Size() << ","; + oss << "r:" << mImpl->renderers.Size() << ","; + oss << "t:" << mImpl->textureSets.Size() << ","; + oss << "s:" << mImpl->shaders.Size() << "]"; + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_INTERNAL [%s]\n", oss.str().c_str()); + } +#endif } if(!uploadOnly) diff --git a/dali/internal/update/queue/update-message-queue.cpp b/dali/internal/update/queue/update-message-queue.cpp index 9446c35..c687b07 100644 --- a/dali/internal/update/queue/update-message-queue.cpp +++ b/dali/internal/update/queue/update-message-queue.cpp @@ -23,6 +23,7 @@ // INTERNAL INCLUDES #include +#include #include #include #include @@ -217,9 +218,6 @@ bool MessageQueue::FlushQueue() { // queueMutex must be locked whilst accessing processQueue or recycleQueue MessageQueueMutex::ScopedLock lock(mImpl->queueMutex); - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_MESSAGE_QUEUE_FLUSH", [&](std::ostringstream& oss) { - oss << "[capacity:" << mImpl->currentMessageBuffer->GetCapacity() << "]"; - }); mImpl->processQueue.push_back(mImpl->currentMessageBuffer); mImpl->currentMessageBuffer = nullptr; @@ -247,7 +245,13 @@ bool MessageQueue::FlushQueue() mImpl->sceneUpdate |= 2; mImpl->sceneUpdateFlag = false; } - DALI_TRACE_END(gTraceFilter, "DALI_MESSAGE_QUEUE_FLUSH"); + +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + DALI_LOG_DEBUG_INFO("END: DALI_MESSAGE_QUEUE_FLUSH [%zu]\n", mImpl->currentMessageBuffer->GetCapacity()); + } +#endif } return messagesToProcess; @@ -271,10 +275,6 @@ bool MessageQueue::ProcessMessages(BufferIndex updateBufferIndex) copiedProcessQueue = std::move(mImpl->processQueue); // Move message queue } - DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_MESSAGE_QUEUE_PROCESS", [&](std::ostringstream& oss) { - oss << "[queueCount:" << copiedProcessQueue.size() << "]"; - }); - uint32_t messageCount = 0u; for(auto&& buffer : copiedProcessQueue) @@ -300,10 +300,15 @@ bool MessageQueue::ProcessMessages(BufferIndex updateBufferIndex) std::make_move_iterator(copiedProcessQueue.end())); // Note trace end inside of mutex, since we need to check recycleQueue size correct. - DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_MESSAGE_QUEUE_PROCESS", [&](std::ostringstream& oss) { +#ifdef TRACE_ENABLED + if(gTraceFilter && gTraceFilter->IsTraceEnabled()) + { + std::ostringstream oss; oss << "[messageCount:" << messageCount << ","; oss << "recycleQueueCount:" << mImpl->recycleQueue.size() << "]"; - }); + DALI_LOG_DEBUG_INFO("END: DALI_UPDATE_MESSAGE_QUEUE_PROCESS [%s]\n", oss.str().c_str()); + } +#endif } PERF_MONITOR_END(PerformanceMonitor::PROCESS_MESSAGES); -- 2.7.4