Add trace marker for some EGL CONTROLLER Render case 37/304437/4
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 17 Jan 2024 08:47:02 +0000 (17:47 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 22 Jan 2024 08:23:49 +0000 (17:23 +0900)
Make trace don't wait sleep + Print more logs when we trace EGL

Change-Id: Id4894c99c2c525c82b716625e52fc5e29a5cf00a
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles/gl-implementation.h

index b9598cc..48b7f25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -623,7 +623,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
   while(UpdateRenderReady(useElapsedTime, updateRequired, timeToSleepUntil))
   {
     LOG_UPDATE_RENDER_TRACE;
-    TRACE_UPDATE_RENDER_SCOPE("DALI_UPDATE_RENDER");
+    TRACE_UPDATE_RENDER_BEGIN("DALI_UPDATE_RENDER");
 
     // For thread safe
     bool                          uploadOnly     = mUploadWithoutRendering;
@@ -909,6 +909,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       }
     }
 
+    TRACE_UPDATE_RENDER_END("DALI_UPDATE_RENDER");
+
     // Render to FBO is intended to measure fps above 60 so sleep is not wanted.
     if(0u == renderToFboInterval)
     {
index db7879c..d8b911b 100644 (file)
@@ -18,6 +18,7 @@
 #include <dali/internal/graphics/gles-impl/egl-graphics-controller.h>
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/trace.h>
 #include <dali/public-api/common/dali-common.h>
 
 // INTERNAL INCLUDES
@@ -128,6 +129,7 @@ T0* CastObject(T1* apiObject)
 // Maximum size of texture upload buffer.
 const uint32_t TEXTURE_UPLOAD_MAX_BUFER_SIZE_MB = 1;
 
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_EGL, false);
 } // namespace
 
 EglGraphicsController::EglGraphicsController()
@@ -435,6 +437,8 @@ void EglGraphicsController::AddFramebuffer(GLES::Framebuffer& framebuffer)
 
 void EglGraphicsController::ProcessDiscardQueues()
 {
+  DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_DISCARD_QUEUE");
+
   // Process textures
   ProcessDiscardQueue<GLES::Texture>(mDiscardTextureQueue);
 
@@ -476,6 +480,7 @@ void EglGraphicsController::ProcessDiscardQueues()
 
 void EglGraphicsController::ProcessCreateQueues()
 {
+  DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_CREATE_QUEUE");
   // Process textures
   ProcessCreateQueue(mCreateTextureQueue);
 
@@ -490,6 +495,11 @@ void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& comm
 {
   auto       count    = 0u;
   const auto commands = commandBuffer.GetCommands(count);
+
+  DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_EGL_CONTROLLER_PROCESS", [&](std::ostringstream& oss) {
+    oss << "[commandCount:" << count << "]";
+  });
+
   for(auto i = 0u; i < count; ++i)
   {
     auto& cmd = commands[i];
@@ -702,6 +712,7 @@ void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& comm
       }
     }
   }
+  DALI_TRACE_END(gTraceFilter, "DALI_EGL_CONTROLLER_PROCESS");
 }
 
 void EglGraphicsController::ProcessCommandQueues()
@@ -721,6 +732,11 @@ void EglGraphicsController::ProcessCommandQueues()
 
 void EglGraphicsController::ProcessTextureUpdateQueue()
 {
+  if(mTextureUpdateRequests.empty())
+  {
+    return;
+  }
+  DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_TEXTURE_UPDATE");
   while(!mTextureUpdateRequests.empty())
   {
     TextureUpdateRequest& request = mTextureUpdateRequests.front();
@@ -933,6 +949,11 @@ void EglGraphicsController::UpdateTextures(const std::vector<TextureUpdateInfo>&
 
 void EglGraphicsController::ProcessTextureMipmapGenerationQueue()
 {
+  if(mTextureMipmapGenerationRequests.empty())
+  {
+    return;
+  }
+  DALI_TRACE_SCOPE(gTraceFilter, "DALI_EGL_CONTROLLER_TEXTURE_MIPMAP");
   while(!mTextureMipmapGenerationRequests.empty())
   {
     auto* texture = mTextureMipmapGenerationRequests.front();
index 0a4b2e7..bf40d8c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GL_IMPLEMENTATION_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -556,12 +556,20 @@ public:
 
   void Finish(void) override
   {
+    START_DURATION_CHECK();
+
     glFinish();
+
+    FINISH_DURATION_CHECK("glFinish");
   }
 
   void Flush(void) override
   {
+    START_DURATION_CHECK();
+
     glFlush();
+
+    FINISH_DURATION_CHECK("glFlush");
   }
 
   void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) override