summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-21 17:58:46 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-23 09:34:57 +0100
commit6096779ede1c837461dfe1224f69539dd974631b (patch)
tree5956c52e978c885f337d9d8127325d38fc0c4065
parent375a060a07b421480d6389ce62e7ac1e505155cb (diff)
ecore - expose "hidden" internal api for debugging to get wakeup time
get the real time at which main loop woke up for purposes of debugging and finding jank/scheduling jitter.
-rw-r--r--src/lib/ecore/Ecore.h2
-rw-r--r--src/lib/ecore/ecore_main.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h
index 294fe0e5a2..e87ccc6093 100644
--- a/src/lib/ecore/Ecore.h
+++ b/src/lib/ecore/Ecore.h
@@ -331,6 +331,8 @@ extern "C" {
331#endif 331#endif
332#include "Ecore_Eo.h" 332#include "Ecore_Eo.h"
333 333
334EAPI double _ecore_main_loop_wakeup_time_get(void);
335
334#ifdef __cplusplus 336#ifdef __cplusplus
335} 337}
336#endif 338#endif
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 78438b336e..efd5310029 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -207,12 +207,20 @@ static gboolean _ecore_glib_idle_enterer_called;
207static gboolean ecore_fds_ready; 207static gboolean ecore_fds_ready;
208#endif 208#endif
209 209
210static double _ecore_main_loop_wakeup_time = 0.0;
211
212EAPI double _ecore_main_loop_wakeup_time_get(void)
213{
214 return _ecore_main_loop_wakeup_time;
215}
216
210static inline void 217static inline void
211_update_loop_time(Efl_Loop_Data *pd) 218_update_loop_time(Efl_Loop_Data *pd)
212{ 219{
213 double loop_time = ecore_time_get(); 220 double loop_time = ecore_time_get();
214 if (loop_time > pd->loop_time) 221 if (loop_time > pd->loop_time)
215 pd->loop_time = loop_time; 222 pd->loop_time = loop_time;
223 _ecore_main_loop_wakeup_time = loop_time;
216} 224}
217 225
218#ifdef EFL_EXTRA_SANITY_CHECKS 226#ifdef EFL_EXTRA_SANITY_CHECKS