summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-10 13:55:32 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-10 13:55:34 +0200
commit736ae3cfbde91d2526fb8109030aa3348f11eb2f (patch)
treef7c8858c11b4dc907f16343c87c0615f31449373
parent3567d97406e28a2a22c7db47243cba8b13f5ce21 (diff)
Eet save is now done on every eina_shutdown
This is needed as the shutdown process (counter == 0) may not happen.
-rw-r--r--src/lib/cov_preload.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/lib/cov_preload.c b/src/lib/cov_preload.c
index 75166ac..870a0e9 100644
--- a/src/lib/cov_preload.c
+++ b/src/lib/cov_preload.c
@@ -8,10 +8,8 @@
8 8
9#include "stats_common.h" 9#include "stats_common.h"
10 10
11static int _init_count = 0;
12static Eina_Bool _exit_required = EINA_FALSE;
13
14Stat_Infos infos; 11Stat_Infos infos;
12static Eina_Bool _changed = EINA_FALSE;
15 13
16static void 14static void
17_init() 15_init()
@@ -20,39 +18,19 @@ _init()
20 if (!_inited) 18 if (!_inited)
21 { 19 {
22 infos.l = NULL; 20 infos.l = NULL;
23 eina_init();
24 eet_init();
25 _inited = EINA_TRUE; 21 _inited = EINA_TRUE;
26 } 22 }
27} 23}
28 24
29EAPI int 25EAPI int
30evas_init(void) 26eina_shutdown()
31{ 27{
32 _init_count++;
33 int (*foo)() = dlsym(RTLD_NEXT, __func__); 28 int (*foo)() = dlsym(RTLD_NEXT, __func__);
34 return foo();
35}
36 29
37EAPI int 30 if (_changed)
38evas_shutdown()
39{
40 Stat_Info *info;
41 int (*foo)() = dlsym(RTLD_NEXT, __func__);
42 _init_count--;
43
44 if (!_init_count && !_exit_required)
45 { 31 {
46 stats_save(&infos, "espion_stats.eet", STATS_EET_FORMAT); 32 stats_save(&infos, "espion_stats.eet", STATS_EET_FORMAT);
47 33 _changed = EINA_FALSE;
48 EINA_LIST_FREE(infos.l, info)
49 {
50 free(info);
51 }
52 infos.l = NULL;
53 _exit_required = EINA_TRUE;
54 eet_shutdown();
55 eina_shutdown();
56 } 34 }
57 35
58 return foo(); 36 return foo();
@@ -62,7 +40,6 @@ static Stat_Info *
62_info_update(const char *func, Stat_Info *info) 40_info_update(const char *func, Stat_Info *info)
63{ 41{
64 _init(); 42 _init();
65 if (_exit_required) return info;
66 if (!info) 43 if (!info)
67 { 44 {
68 info = calloc(1, sizeof(*info)); 45 info = calloc(1, sizeof(*info));
@@ -70,6 +47,7 @@ _info_update(const char *func, Stat_Info *info)
70 infos.l = eina_list_append(infos.l, info); 47 infos.l = eina_list_append(infos.l, info);
71 } 48 }
72 info->counter++; 49 info->counter++;
50 _changed = EINA_TRUE;
73 return info; 51 return info;
74} 52}
75 53