summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-10 15:13:58 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-10 15:13:58 +0200
commit8e799ac22e01de00b9ac822a1c115a3a85fd279d (patch)
tree5181fad8edd0b2a5d9c63be2e732d0af0debebc0
parent736ae3cfbde91d2526fb8109030aa3348f11eb2f (diff)
Support stats save on SIGPROG trigger
-rw-r--r--src/lib/cov_preload.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/cov_preload.c b/src/lib/cov_preload.c
index 870a0e9..58a4d7e 100644
--- a/src/lib/cov_preload.c
+++ b/src/lib/cov_preload.c
@@ -1,5 +1,6 @@
1#define _GNU_SOURCE 1#define _GNU_SOURCE
2#include <dlfcn.h> 2#include <dlfcn.h>
3#include <signal.h>
3 4
4#ifndef ELM_INTERNAL_API_ARGESFSDFEFC 5#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
5#define ELM_INTERNAL_API_ARGESFSDFEFC 6#define ELM_INTERNAL_API_ARGESFSDFEFC
@@ -12,11 +13,24 @@ Stat_Infos infos;
12static Eina_Bool _changed = EINA_FALSE; 13static Eina_Bool _changed = EINA_FALSE;
13 14
14static void 15static void
16_sig_prof_bt(int sig EINA_UNUSED, siginfo_t *si EINA_UNUSED, void *foo EINA_UNUSED)
17{
18 printf("Saving stats\n");
19 stats_save(&infos, "espion_stats.eet", STATS_EET_FORMAT);
20}
21
22static void
15_init() 23_init()
16{ 24{
17 static Eina_Bool _inited = EINA_FALSE; 25 static Eina_Bool _inited = EINA_FALSE;
18 if (!_inited) 26 if (!_inited)
19 { 27 {
28 struct sigaction sa;
29 sa.sa_sigaction = _sig_prof_bt;
30 sa.sa_flags = SA_RESTART | SA_SIGINFO;
31 sigemptyset(&sa.sa_mask);
32 sigaction(SIGPROF, &sa, NULL);
33
20 infos.l = NULL; 34 infos.l = NULL;
21 _inited = EINA_TRUE; 35 _inited = EINA_TRUE;
22 } 36 }