[Tizen] Reduce the line of trace logs 06/306306/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 20 Feb 2024 03:53:40 +0000 (12:53 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 20 Feb 2024 04:17:49 +0000 (13:17 +0900)
Let we print the trace log only for end.

Change-Id: I8acbce1bcc723ecb91b8df40c25bd62a8a66eeb2
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/render/common/render-algorithms.cpp
dali/internal/render/common/render-manager.cpp
dali/internal/render/queue/render-queue.cpp
dali/internal/update/animation/scene-graph-animation.cpp
dali/internal/update/manager/frame-callback-processor.cpp
dali/internal/update/manager/render-task-processor.cpp
dali/internal/update/manager/scene-graph-traveler.cpp
dali/internal/update/manager/transform-manager.cpp
dali/internal/update/manager/update-algorithms.cpp
dali/internal/update/manager/update-manager.cpp
dali/internal/update/queue/update-message-queue.cpp

index 4e872f5..cff3c31 100644 (file)
@@ -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
index cfd7cfb..010fd32 100644 (file)
@@ -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<Rect<int>>& damagedRects)
@@ -600,10 +601,6 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector<Rect<int>>&
     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<Rect<int>>&
   {
     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<int>();
   }
 
-  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
index f42ee9f..e7cf546 100644 (file)
@@ -22,6 +22,7 @@
 #include <sstream>
 
 // INTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 #include <dali/integration-api/trace.h>
 #include <dali/internal/common/message.h>
 
@@ -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)
index 8adfff2..b35206e 100644 (file)
@@ -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
index 82b2bc5..fb66c62 100644 (file)
@@ -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<std::pair<uint64_t, uint32_t>> 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>& 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;
index d2d9298..943dce1 100644 (file)
@@ -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.
index 1fb90ee..0bc15c3 100644 (file)
@@ -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;
index 32789de..fd61673 100644 (file)
@@ -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;
 }
index 6870965..481c1dc 100644 (file)
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/trace.h>
 
-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;
 }
 
index 1fdc932..df63dc5 100644 (file)
@@ -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<Node*>::Iterator iter    = mImpl->nodes.Begin() + 1;
   Vector<Node*>::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)
index 9446c35..c687b07 100644 (file)
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/threading/mutex.h>
+#include <dali/integration-api/debug.h>
 #include <dali/integration-api/render-controller.h>
 #include <dali/integration-api/trace.h>
 #include <dali/internal/common/message-buffer.h>
@@ -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);