[NUI] Add Tizen.Tracer logs at some critical points for app launching performance
authordongsug.song <dongsug.song@samsung.com>
Sun, 22 May 2022 14:47:58 +0000 (23:47 +0900)
committerSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Fri, 27 May 2022 06:15:42 +0000 (15:15 +0900)
src/Tizen.NUI/Tizen.NUI.csproj
src/Tizen.NUI/src/internal/Application/NUICoreBackend.cs
src/Tizen.NUI/src/public/Application/NUIApplication.cs

index c99c027..ccfea8d 100755 (executable)
@@ -27,6 +27,7 @@
     <ProjectReference Include="..\Tizen.System.Information\Tizen.System.Information.csproj" />
     <ProjectReference Include="..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj" />
     <ProjectReference Include="..\Tizen.Applications.ThemeManager\Tizen.Applications.ThemeManager.csproj" />
+    <ProjectReference Include="..\Tizen.Tracer\Tizen.Tracer.csproj" />
   </ItemGroup>
 
   <Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
index 64ad26b..1e191ca 100755 (executable)
@@ -153,7 +153,11 @@ namespace Tizen.NUI
         /// <param name="args">The arguments from commandline.</param>
         public void Run(string[] args)
         {
+            Tizen.Tracer.Begin("[NUI] NUICorebackend Run(): start");
+            Tizen.Tracer.Begin("[NUI] NUICorebackend Run(): TizenSynchronizationContext.Initialize() called");
             TizenSynchronizationContext.Initialize();
+
+            Tizen.Tracer.Begin("[NUI] NUICorebackend Run(): args of main set, window type set");
             if (Tizen.Applications.Application.Current?.ApplicationInfo != null)
             {
                 args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath;
@@ -163,7 +167,7 @@ namespace Tizen.NUI
                 args[0] = this.GetType().Assembly.FullName.Replace(" ", "");
             }
 
-            if(defaultWindowType != WindowType.Normal)
+            if (defaultWindowType != WindowType.Normal)
             {
                 application = Application.NewApplication(stylesheet, windowMode, defaultWindowType);
             }
@@ -179,6 +183,7 @@ namespace Tizen.NUI
                 }
             }
 
+            Tizen.Tracer.Begin("[NUI] NUICorebackend Run(): add application related events");
             application.BatteryLow += OnBatteryLow;
             application.LanguageChanged += OnLanguageChanged;
             application.MemoryLow += OnMemoryLow;
@@ -190,6 +195,7 @@ namespace Tizen.NUI
             application.Paused += OnPaused;
             application.AppControl += OnAppControl;
 
+            Tizen.Tracer.Begin("[NUI] NUICorebackend Run(): application.MainLoop() called");
             application.MainLoop();
             application.Dispose();
         }
@@ -284,13 +290,21 @@ namespace Tizen.NUI
         /// <param name="e">The event argument for Initialized.</param>
         private void OnInitialized(object source, NUIApplicationInitEventArgs e)
         {
+            Tizen.Tracer.Begin("[NUI] OnInitialized(): start");
+
             Log.Info("NUI", "NUICorebackend OnPreCreated Called");
+
+            Tizen.Tracer.Begin("[NUI] OnInitialized(): OnPreCreated event handler");
             var preCreateHandler = Handlers[EventType.PreCreated] as Action;
             preCreateHandler?.Invoke();
 
             Log.Info("NUI", "NUICorebackend OnCreate Called");
+
+            Tizen.Tracer.Begin("[NUI] OnInitialized(): OnCreated event handler");
             var createHandler = Handlers[EventType.Created] as Action;
             createHandler?.Invoke();
+
+            Tizen.Tracer.Begin("[NUI] OnInitialized(): finish");
         }
 
         /// <summary>
@@ -312,9 +326,15 @@ namespace Tizen.NUI
         /// <param name="e">The event argument for Resumed.</param>
         private void OnResumed(object source, NUIApplicationResumedEventArgs e)
         {
+            Tizen.Tracer.Begin("[NUI] OnResumed(): start");
+
             Log.Info("NUI", "NUICorebackend OnResumed Called");
+
+            Tizen.Tracer.Begin("[NUI] OnResumed(): OnResumed event handler");
             var handler = Handlers[EventType.Resumed] as Action;
             handler?.Invoke();
+
+            Tizen.Tracer.Begin("[NUI] OnResumed(): finish");
         }
 
         /// <summary>
index 33c7898..57b032f 100755 (executable)
@@ -476,10 +476,12 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         protected virtual void OnPreCreate()
         {
+            Tizen.Tracer.Begin("[NUI] OnPreCreate(): start");
             if (borderEnabled)
             {
                 GetDefaultWindow().EnableBorder(borderInterface);
             }
+            Tizen.Tracer.Begin("[NUI] OnPreCreate(): finish");
         }
 
         /// <summary>
@@ -502,7 +504,9 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         protected override void OnCreate()
         {
+            Tizen.Tracer.Begin("[NUI] OnCreate(): start");
             base.OnCreate();
+            Tizen.Tracer.Begin("[NUI] OnCreate(): end");
         }
 
         /// <summary>