From: Eunki, Hong Date: Mon, 21 Mar 2022 09:08:16 +0000 (+0900) Subject: TTrace enable always in tizen + Add TTrace for some DALi's API X-Git-Tag: dali_2.1.16~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f13abefdf41f84b8f367bbdb0fa299c66b7113d;hp=79b361bfaff9e9a96626a2be954a6fd64d812aab;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git TTrace enable always in tizen + Add TTrace for some DALi's API Make ttrace enable always in tizen + trace marker for some dali operation HOW TO USE : - build In tizen, we turn on ttrace log. If you want to use ttrace in other platform, (cmake) -DENABLE_TRACE=ON - run set environment like below export DALI_TRACE_COMBINED=true (false in default) export DALI_TRACE_APPLICATION=true (true in default) export DALI_TRACE_FRAMEWORK=true (true in default) export DALI_TRACE_EGL=true (true in default) DALI_TRACE_COMBINED will trace every frames. So they setup as false in default. If you want to get the result every frame, you can setup environment as 'true' Change-Id: Ie58cb0b9839c68a4824e3fdddd1ef96dddb5a2aa Signed-off-by: Eunki, Hong --- diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 7d2da30..70cea5c 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -18,6 +18,7 @@ ENDIF() OPTION(ENABLE_PKG_CONFIGURE "Use pkgconfig" ON) OPTION(ENABLE_LINK_TEST "Enable the link test" ON) OPTION(ENABLE_ATSPI "Enable AT-SPI accessibility" ON) +OPTION(ENABLE_TRACE "Enable Trace" OFF) # Include additional macros INCLUDE( common.cmake ) @@ -109,6 +110,10 @@ IF( NOT DALI_ELDBUS_AVAILABLE ) SET( ENABLE_ATSPI OFF ) ENDIF() +IF( ENABLE_TRACE ) + ADD_DEFINITIONS("-DTRACE_ENABLED") +ENDIF() + # Set up compiler flags and warnings IF( UNIX ) ADD_COMPILE_OPTIONS( -Wall ${DALI_CFLAGS} )# -Wextra -Wno-unused-parameter )# -Wfloat-equal ) @@ -420,6 +425,7 @@ MESSAGE( STATUS "Using Tizen APP FW libraries: ${ENABLE_APPFW}") MESSAGE( STATUS "Use pkg configure: ${ENABLE_PKG_CONFIGURE}" ) MESSAGE( STATUS "Enable link test: ${ENABLE_LINK_TEST}" ) MESSAGE( STATUS "Enable AT-SPI: ${ENABLE_ATSPI}" ) +MESSAGE( STATUS "Enable Trace: ${ENABLE_TRACE}" ) MESSAGE( STATUS "Tizen Platform Config supported ${TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG}") MESSAGE( STATUS "Compile flags: ${CMAKE_CXX_FLAGS}") MESSAGE( STATUS "Compile flags: ${CMAKE_C_FLAGS}") diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index d93886e..97a23e0 100644 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include // INTERNAL INCLUDES @@ -56,6 +57,8 @@ namespace Internal { namespace Adaptor { +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_APPLICATION, true); + ApplicationPtr Application::gPreInitializedApplication(NULL); ApplicationPtr Application::New( @@ -266,7 +269,9 @@ void Application::OnInit() } // Run the adaptor + DALI_TRACE_BEGIN(gTraceFilter, "DALI_APP_ADAPTOR_START"); mAdaptor->Start(); + DALI_TRACE_END(gTraceFilter, "DALI_APP_ADAPTOR_START"); Accessibility::Accessible::SetObjectRegistry(mAdaptor->GetObjectRegistry()); if(!mStylesheet.empty()) @@ -285,7 +290,10 @@ void Application::OnInit() LanguageChangedSignal().Connect(&GetImplementation(lifecycleController), &LifecycleController::OnLanguageChanged); Dali::Application application(this); + + DALI_TRACE_BEGIN(gTraceFilter, "DALI_APP_EMIT_INIT_SIGNAL"); mInitSignal.Emit(application); + DALI_TRACE_END(gTraceFilter, "DALI_APP_EMIT_INIT_SIGNAL"); mAdaptor->NotifySceneCreated(); } diff --git a/dali/internal/adaptor/common/combined-update-render-controller-debug.h b/dali/internal/adaptor/common/combined-update-render-controller-debug.h index 2ebebb6..8a2a150 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller-debug.h +++ b/dali/internal/adaptor/common/combined-update-render-controller-debug.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_DEBUG_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include namespace Dali { @@ -132,6 +133,10 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_THR #define LOG_EVENT_TRACE_FMT(format, ...) #endif +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) + } // unnamed namespace } // namespace Adaptor diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 356cec0..cd81f5c 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -616,12 +616,14 @@ void CombinedUpdateRenderController::UpdateRenderThread() Integration::UpdateStatus updateStatus; AddPerformanceMarker(PerformanceInterface::UPDATE_START); + TRACE_UPDATE_RENDER_BEGIN("DALI_UPDATE"); mCore.Update(frameDelta, currentTime, nextFrameTime, updateStatus, renderToFboEnabled, isRenderingToFbo); + TRACE_UPDATE_RENDER_END("DALI_UPDATE"); AddPerformanceMarker(PerformanceInterface::UPDATE_END); unsigned int keepUpdatingStatus = updateStatus.KeepUpdating(); @@ -665,6 +667,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() Integration::RenderStatus renderStatus; AddPerformanceMarker(PerformanceInterface::RENDER_START); + TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER"); // Upload shared resources mCore.PreRender(renderStatus, mForceClear, mUploadWithoutRendering); @@ -739,6 +742,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() SurfaceDeleted(); } + TRACE_UPDATE_RENDER_END("DALI_RENDER"); AddPerformanceMarker(PerformanceInterface::RENDER_END); mForceClear = false; diff --git a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp index 25a1b58..b4efe3d 100644 --- a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -46,6 +46,7 @@ #endif #include +#include // INTERNAL INCLUDES #include @@ -61,6 +62,7 @@ namespace #if defined(DEBUG_ENABLED) Integration::Log::Filter* gDBusLogging = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DBUS"); #endif +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_FRAMEWORK, true); bool IsWidgetFeatureEnabled() { @@ -834,7 +836,9 @@ void Framework::Run() mRunning = true; int ret; + DALI_TRACE_BEGIN(gTraceFilter, "DALI_APPMAIN"); ret = mImpl->AppMain(); + DALI_TRACE_END(gTraceFilter, "DALI_APPMAIN"); if(ret != APP_ERROR_NONE) { DALI_LOG_ERROR("Framework::Run(), ui_app_main() is failed. err = %d\n", ret); diff --git a/dali/internal/graphics/gles/egl-implementation.cpp b/dali/internal/graphics/gles/egl-implementation.cpp index b850f77..d63989f 100644 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include #include #include @@ -42,6 +43,7 @@ const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_cont const std::string EGL_KHR_PARTIAL_UPDATE = "EGL_KHR_partial_update"; const std::string EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE = "EGL_KHR_swap_buffers_with_damage"; +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_EGL, true); } // namespace namespace Dali @@ -385,6 +387,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface) if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT) { DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers started. eglSurface(%p)\n", eglSurface); + DALI_TRACE_BEGIN(gTraceFilter, "DALI_EGL_SWAP_BUFFERS"); } #endif //DALI_PROFILE_UBUNTU @@ -394,6 +397,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface) #ifndef DALI_PROFILE_UBUNTU if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT) { + DALI_TRACE_END(gTraceFilter, "DALI_EGL_SWAP_BUFFERS"); DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers finished.\n"); mSwapBufferCountAfterResume++; } @@ -453,6 +457,7 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface, const std::vectormPerformanceInterface) { - unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag); - traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId); - } - else - { - unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag); - traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId); + if(start) + { + unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag); + traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId); + } + else + { + unsigned short contextId = traceManagerAndroid->mPerformanceInterface->AddContext(tag); + traceManagerAndroid->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId); + } } } diff --git a/dali/internal/trace/generic/trace-manager-impl-generic.cpp b/dali/internal/trace/generic/trace-manager-impl-generic.cpp index 92ada6e..bf9c696 100644 --- a/dali/internal/trace/generic/trace-manager-impl-generic.cpp +++ b/dali/internal/trace/generic/trace-manager-impl-generic.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -42,15 +42,18 @@ Dali::Integration::Trace::LogContextFunction TraceManagerGeneric::GetLogContextF void TraceManagerGeneric::LogContext(bool start, const char* tag) { - if(start) + if(traceManagerGeneric && traceManagerGeneric->mPerformanceInterface) { - unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag); - traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId); - } - else - { - unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag); - traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId); + if(start) + { + unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag); + traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId); + } + else + { + unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag); + traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId); + } } } diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 1d3a665..ae72b3e 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -270,7 +270,7 @@ CXXFLAGS+=" -D_ARCH_ARM_ -lgcc" CFLAGS+=" -DWAYLAND" CXXFLAGS+=" -DWAYLAND" -cmake_flags=" -DENABLE_WAYLAND=ON -DENABLE_ATSPI=ON" +cmake_flags=" -DENABLE_WAYLAND=ON -DENABLE_ATSPI=ON -DENABLE_TRACE=ON" # Use this conditional when Tizen version is 5.x or greater %if 0%{?tizen_version_major} >= 5 @@ -291,10 +291,6 @@ CXXFLAGS+=" -DOVER_TIZEN_VERSION_7" cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug" %endif -%if 0%{?enable_trace} -cmake_flags+=" -DENABLE_TRACE=ON" -%endif - %if 0%{?enable_logging} cmake_flags+=" -DENABLE_NETWORK_LOGGING=ON" %endif