ecore,elementary: move startup time accounting in ecore.
authorCedric BAIL <cedric@osg.samsung.com>
Mon, 6 Nov 2017 18:52:36 +0000 (10:52 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 8 Nov 2017 00:08:39 +0000 (16:08 -0800)
src/lib/ecore/Efl_Core.h
src/lib/ecore/ecore.c
src/lib/elementary/efl_general.h
src/lib/elementary/elm_general.h
src/lib/elementary/elm_main.c

index 0f670b5..e70df03 100644 (file)
@@ -61,6 +61,8 @@
 extern "C" {
 #endif
 
+extern EAPI double _efl_startup_time;
+
 #include "Ecore_Common.h"
 #include "Ecore_Eo.h"
 
index 35967d6..00bf640 100644 (file)
@@ -30,6 +30,7 @@
 #include <Efl.h>
 
 #include "Ecore.h"
+#include "Efl_Core.h"
 #include "ecore_private.h"
 
 #if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
@@ -43,6 +44,8 @@
 static Ecore_Version _version = { VMAJ, VMIN, VMIC, VREV };
 EAPI Ecore_Version *ecore_version = &_version;
 
+EAPI double _efl_startup_time = 0;
+
 #if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
 #define KEEP_MAX(Global, Local) \
   if (Global < (Local))         \
index e10261c..e1e81a2 100644 (file)
@@ -35,8 +35,8 @@
   {                                                                     \
      Eina_Value *ret__;                                                 \
      int real__;                                                        \
+     _efl_startup_time = ecore_time_unix_get();                         \
      _EFL_APP_VERSION_SET();                                            \
-     _elm_startup_time = ecore_time_unix_get();                         \
      elm_init(argc, argv);                                              \
      efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
      ret__ = efl_loop_begin(ecore_main_loop_get());                     \
@@ -55,8 +55,8 @@
   {                                                                     \
      Eina_Value *ret__;                                                 \
      int real__;                                                        \
+     _efl_startup_time = ecore_time_unix_get();                         \
      _EFL_APP_VERSION_SET();                                            \
-     _elm_startup_time = ecore_time_unix_get();                         \
      elm_init(argc, argv);                                              \
      efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
      ret__ = efl_loop_begin(ecore_main_loop_get());                     \
index 7c2a282..5645bf4 100644 (file)
@@ -96,6 +96,7 @@ extern EAPI double _elm_startup_time;
 #define ELM_MAIN() int main(int argc, char **argv) { int ret__; _elm_startup_time = ecore_time_unix_get(); ret__ = elm_quicklaunch_fallback(argc, argv); elm_shutdown(); return ret__; }
 #endif
 
+#include "Efl_Core.h"
 #include "efl_general.h"
 
 /**************************************************************************/
index cb96aa5..3b08958 100644 (file)
@@ -424,6 +424,14 @@ elm_init(int argc, char **argv)
      _elm_config->web_backend = "none";
    _elm_code_parse_setup();
 
+   // For backward compability, EFL startup time and ELM startup time are made
+   // identical. It is fine to do it here as we are finishing initialisation
+   // and the startup time should have been accounted earlier.
+   if (_elm_startup_time >= 0)
+     if (_efl_startup_time <= 0)
+       _efl_startup_time = _elm_startup_time;
+   _elm_startup_time = _efl_startup_time;
+
    return _elm_init_count;
 }