Print the number of loop count when we trace iteration
[platform/core/uifw/dali-core.git] / dali / internal / common / core-impl.cpp
index 421d2e5..e9da296 100644 (file)
@@ -359,7 +359,7 @@ void Core::RelayoutAndFlush(SceneContainer& scenes)
   RunPostProcessors();
 
   // Rebuild depth tree after event processing has finished
-  for(auto scene : scenes)
+  for(auto& scene : scenes)
   {
     scene->RebuildDepthTree();
   }
@@ -428,7 +428,14 @@ void Core::RunProcessors()
 {
   if(mProcessors.Count() != 0)
   {
-    DALI_TRACE_SCOPE(gTraceFilter, "DALI_CORE_RUN_PROCESSORS");
+#ifdef TRACE_ENABLED
+    if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+    {
+      std::ostringstream stream;
+      stream << "[" << mProcessors.Count() << "]";
+      DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_PROCESSORS", stream.str().c_str());
+    }
+#endif
 
     // Copy processor pointers to prevent changes to vector affecting loop iterator.
     Dali::Vector<Integration::Processor*> processors(mProcessors);
@@ -456,6 +463,19 @@ void Core::RunProcessors()
         }
       }
     }
+#ifdef TRACE_ENABLED
+    if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+    {
+      std::ostringstream stream;
+      stream << "[" << mProcessors.Count();
+      if(mProcessorUnregistered)
+      {
+        stream << ", processor changed";
+      }
+      stream << "]";
+      DALI_TRACE_END_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_PROCESSORS", stream.str().c_str());
+    }
+#endif
   }
 }
 
@@ -463,7 +483,14 @@ void Core::RunPostProcessors()
 {
   if(mPostProcessors.Count() != 0)
   {
-    DALI_TRACE_SCOPE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS");
+#ifdef TRACE_ENABLED
+    if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+    {
+      std::ostringstream stream;
+      stream << "[" << mPostProcessors.Count() << "]";
+      DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS", stream.str().c_str());
+    }
+#endif
 
     // Copy processor pointers to prevent changes to vector affecting loop iterator.
     Dali::Vector<Integration::Processor*> processors(mPostProcessors);
@@ -491,6 +518,20 @@ void Core::RunPostProcessors()
         }
       }
     }
+
+#ifdef TRACE_ENABLED
+    if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+    {
+      std::ostringstream stream;
+      stream << "[" << mPostProcessors.Count();
+      if(mPostProcessorUnregistered)
+      {
+        stream << ", post processor changed";
+      }
+      stream << "]";
+      DALI_TRACE_END_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS", stream.str().c_str());
+    }
+#endif
   }
 }