Add more trace logs for UpdateRender thread 85/301585/2
authorEunki Hong <eunkiki.hong@samsung.com>
Mon, 20 Nov 2023 07:49:26 +0000 (16:49 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Mon, 20 Nov 2023 10:31:20 +0000 (19:31 +0900)
Change-Id: I99833a549690562eacb772a1557d87a11a19cb2a
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali/internal/adaptor/common/combined-update-render-controller-debug.h
dali/internal/adaptor/common/combined-update-render-controller.cpp

index 0a0cfe4f60140a367548a7e4769d927e1ed9f516..193085ef6aac370c07d43c05b3a1df8789c13513 100644 (file)
@@ -136,6 +136,7 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_THR
 DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_COMBINED, false);
 #define TRACE_UPDATE_RENDER_BEGIN(tag) DALI_TRACE_BEGIN(gTraceFilter, tag)
 #define TRACE_UPDATE_RENDER_END(tag) DALI_TRACE_END(gTraceFilter, tag)
+#define TRACE_UPDATE_RENDER_SCOPE(tag) DALI_TRACE_SCOPE(gTraceFilter, tag)
 
 } // unnamed namespace
 
index 648ef81b07b540614bbd259410d9cf2ad50e1370..3a8ad2c06435dd25a9c00a6edb52c3417bb30ca9 100644 (file)
@@ -513,6 +513,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
   // Install a function for tracing
   mEnvironmentOptions.InstallTraceFunction();
 
+  TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER_THREAD_INIT");
+
   LOG_UPDATE_RENDER("THREAD CREATED");
 
   // Initialize graphics
@@ -553,9 +555,12 @@ void CombinedUpdateRenderController::UpdateRenderThread()
   const bool         renderToFboEnabled  = 0u != renderToFboInterval;
   unsigned int       frameCount          = 0u;
 
+  TRACE_UPDATE_RENDER_END("DALI_RENDER_THREAD_INIT");
+
   while(UpdateRenderReady(useElapsedTime, updateRequired, timeToSleepUntil))
   {
     LOG_UPDATE_RENDER_TRACE;
+    TRACE_UPDATE_RENDER_SCOPE("DALI_UPDATE_RENDER");
 
     // For thread safe
     bool                          uploadOnly     = mUploadWithoutRendering;
@@ -727,7 +732,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
         if(scene && windowSurface)
         {
-          TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER_SCENE");
+          TRACE_UPDATE_RENDER_SCOPE("DALI_RENDER_SCENE");
           Integration::RenderStatus windowRenderStatus;
 
           const bool sceneSurfaceResized = scene.IsSurfaceRectChanged();
@@ -756,7 +761,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
           {
             SurfaceResized();
           }
-          TRACE_UPDATE_RENDER_END("DALI_RENDER_SCENE");
         }
       }
     }
@@ -845,10 +849,12 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     // Render to FBO is intended to measure fps above 60 so sleep is not wanted.
     if(0u == renderToFboInterval)
     {
+      TRACE_UPDATE_RENDER_SCOPE("DALI_UPDATE_RENDER_SLEEP");
       // Sleep until at least the the default frame duration has elapsed. This will return immediately if the specified end-time has already passed.
       TimeService::SleepUntil(timeToSleepUntil);
     }
   }
+  TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER_THREAD_FINISH");
 
   // Inform core of context destruction
   mCore.ContextDestroyed();
@@ -867,6 +873,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   LOG_UPDATE_RENDER("THREAD DESTROYED");
 
+  TRACE_UPDATE_RENDER_END("DALI_RENDER_THREAD_FINISH");
+
   // Uninstall the logging function
   mEnvironmentOptions.UnInstallLogFunction();
 }
@@ -895,7 +903,9 @@ bool CombinedUpdateRenderController::UpdateRenderReady(bool& useElapsedTime, boo
     // of the first frame.
     timeToSleepUntil = 0;
 
+    TRACE_UPDATE_RENDER_BEGIN("DALI_UPDATE_RENDER_THREAD_WAIT_CONDITION");
     mUpdateRenderThreadWaitCondition.Wait(updateLock);
+    TRACE_UPDATE_RENDER_END("DALI_UPDATE_RENDER_THREAD_WAIT_CONDITION");
 
     if(!mUseElapsedTimeAfterWait)
     {