summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-11-06 10:52:36 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-11-07 16:08:39 -0800
commitdd40079185577c5330f72817e0385aa9cda2e7f4 (patch)
tree2f36395c55688eb73c0b1c40c79cffa5bcc45182
parent25b6a280c087d39f66e30c9c4d07f86b97c989d6 (diff)
ecore,elementary: move startup time accounting in ecore.
-rw-r--r--src/lib/ecore/Efl_Core.h2
-rw-r--r--src/lib/ecore/ecore.c3
-rw-r--r--src/lib/elementary/efl_general.h4
-rw-r--r--src/lib/elementary/elm_general.h1
-rw-r--r--src/lib/elementary/elm_main.c8
5 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/ecore/Efl_Core.h b/src/lib/ecore/Efl_Core.h
index 0f670b50fb..e70df033ef 100644
--- a/src/lib/ecore/Efl_Core.h
+++ b/src/lib/ecore/Efl_Core.h
@@ -61,6 +61,8 @@
61extern "C" { 61extern "C" {
62#endif 62#endif
63 63
64extern EAPI double _efl_startup_time;
65
64#include "Ecore_Common.h" 66#include "Ecore_Common.h"
65#include "Ecore_Eo.h" 67#include "Ecore_Eo.h"
66 68
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 35967d6a00..00bf640624 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -30,6 +30,7 @@
30#include <Efl.h> 30#include <Efl.h>
31 31
32#include "Ecore.h" 32#include "Ecore.h"
33#include "Efl_Core.h"
33#include "ecore_private.h" 34#include "ecore_private.h"
34 35
35#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO) 36#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
@@ -43,6 +44,8 @@
43static Ecore_Version _version = { VMAJ, VMIN, VMIC, VREV }; 44static Ecore_Version _version = { VMAJ, VMIN, VMIC, VREV };
44EAPI Ecore_Version *ecore_version = &_version; 45EAPI Ecore_Version *ecore_version = &_version;
45 46
47EAPI double _efl_startup_time = 0;
48
46#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO) 49#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
47#define KEEP_MAX(Global, Local) \ 50#define KEEP_MAX(Global, Local) \
48 if (Global < (Local)) \ 51 if (Global < (Local)) \
diff --git a/src/lib/elementary/efl_general.h b/src/lib/elementary/efl_general.h
index e10261cd63..e1e81a2287 100644
--- a/src/lib/elementary/efl_general.h
+++ b/src/lib/elementary/efl_general.h
@@ -35,8 +35,8 @@
35 { \ 35 { \
36 Eina_Value *ret__; \ 36 Eina_Value *ret__; \
37 int real__; \ 37 int real__; \
38 _efl_startup_time = ecore_time_unix_get(); \
38 _EFL_APP_VERSION_SET(); \ 39 _EFL_APP_VERSION_SET(); \
39 _elm_startup_time = ecore_time_unix_get(); \
40 elm_init(argc, argv); \ 40 elm_init(argc, argv); \
41 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \ 41 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \
42 ret__ = efl_loop_begin(ecore_main_loop_get()); \ 42 ret__ = efl_loop_begin(ecore_main_loop_get()); \
@@ -55,8 +55,8 @@
55 { \ 55 { \
56 Eina_Value *ret__; \ 56 Eina_Value *ret__; \
57 int real__; \ 57 int real__; \
58 _efl_startup_time = ecore_time_unix_get(); \
58 _EFL_APP_VERSION_SET(); \ 59 _EFL_APP_VERSION_SET(); \
59 _elm_startup_time = ecore_time_unix_get(); \
60 elm_init(argc, argv); \ 60 elm_init(argc, argv); \
61 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \ 61 efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \
62 ret__ = efl_loop_begin(ecore_main_loop_get()); \ 62 ret__ = efl_loop_begin(ecore_main_loop_get()); \
diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h
index 7c2a28236a..5645bf471f 100644
--- a/src/lib/elementary/elm_general.h
+++ b/src/lib/elementary/elm_general.h
@@ -96,6 +96,7 @@ extern EAPI double _elm_startup_time;
96#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__; } 96#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__; }
97#endif 97#endif
98 98
99#include "Efl_Core.h"
99#include "efl_general.h" 100#include "efl_general.h"
100 101
101/**************************************************************************/ 102/**************************************************************************/
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index cb96aa5b50..3b089583ee 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -424,6 +424,14 @@ elm_init(int argc, char **argv)
424 _elm_config->web_backend = "none"; 424 _elm_config->web_backend = "none";
425 _elm_code_parse_setup(); 425 _elm_code_parse_setup();
426 426
427 // For backward compability, EFL startup time and ELM startup time are made
428 // identical. It is fine to do it here as we are finishing initialisation
429 // and the startup time should have been accounted earlier.
430 if (_elm_startup_time >= 0)
431 if (_efl_startup_time <= 0)
432 _efl_startup_time = _elm_startup_time;
433 _elm_startup_time = _efl_startup_time;
434
427 return _elm_init_count; 435 return _elm_init_count;
428} 436}
429 437