ADD_DEFINITIONS("-DNDEBUG")
#ADD_DEFINITIONS("-D_ENABLE_MCHECK")
ADD_DEFINITIONS("-DLOG_TAG=\"DATA_PROVIDER_SLAVE\"")
+ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
ADD_DEFINITIONS(${pkg_CFLAGS})
Name: org.tizen.data-provider-slave
Summary: Plugin type livebox service provider.
-Version: 0.12.11
+Version: 0.12.12
Release: 1
Group: HomeTF/Livebox
License: Flora License
#include <dlog.h>
#include <Eina.h>
+#include <Ecore.h>
#include <provider.h>
#include "util.h"
static struct info {
+#if defined(_USE_ECORE_TIME_GET)
+ double alarm_tv;
+#else
struct timeval alarm_tv;
+#endif
int marked;
int disable_checker;
} s_info = {
so_fname = util_get_current_module(&symbol);
if (info->si_signo == SIGALRM) {
- struct timeval tv;
- struct timeval res_tv;
-
if (!s_info.marked) {
DbgPrint("Ignore false alarm signal [false]\n");
return;
}
+#if defined(_USE_ECORE_TIME_GET)
+ double tv;
+ tv = ecore_time_get();
+ if (tv - s_info.alarm_tv < DEFAULT_LIFE_TIMER) {
+ DbgPrint("Ignore false alarm signal [%lf]\n", tv - s_info.alarm_tv);
+ return;
+ }
+
+ CRITICAL_LOG("ALARM: %lf (%d, %d)\n", tv - s_info.alarm_tv, DEFAULT_LIFE_TIMER, DEFAULT_LOAD_TIMER);
+#else
+ struct timeval tv;
+ struct timeval res_tv;
+
if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
tv.tv_sec = 0;
CRITICAL_LOG("ALARM: %d.%d (%d, %d)\n",
res_tv.tv_sec, res_tv.tv_usec, DEFAULT_LIFE_TIMER, DEFAULT_LOAD_TIMER);
+#endif
} else if (so_fname) {
int fd;
char log_fname[256];
* Enable alarm for detecting infinite loop
*/
if (!noalarm) {
+#if defined(_USE_ECORE_TIME_GET)
+ s_info.alarm_tv = ecore_time_get();
+#else
if (gettimeofday(&s_info.alarm_tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
s_info.alarm_tv.tv_sec = 0;
s_info.alarm_tv.tv_usec = 0;
}
+#endif
s_info.marked = 1;
alarm(life_time);
}
static void timer_freeze(struct item *item)
{
- struct timeval tv;
-
if (!item->timer) {
return;
}
return;
}
+#if defined(_USE_ECORE_TIME_GET)
+ item->sleep_at = ecore_time_get();
+#else
+ struct timeval tv;
if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
tv.tv_sec = 0;
}
item->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
+#endif
}
static inline void update_monitor_cnt(struct item *item)
}
#endif
+#define BIN_PATH "/usr/apps/org.tizen.data-provider-slave/bin/"
int main(int argc, char *argv[])
{
int ret;
const char *option;
memset(argv[0], 0, strlen(argv[0]));
- strcpy(argv[0], "/usr/apps/org.tizen.data-provider-slave/bin/data-provider-slave");
+ strcpy(argv[0], BIN_PATH "data-provider-slave");
DbgPrint("Replace argv[0] with %s\n", argv[0]);
#if defined(_ENABLE_MCHECK)
ErrPrint("dlclose: %s\n", strerror(errno));
}
}
+
return ret;
}
HAPI double util_timestamp(void)
{
+#if defined(_USE_ECORE_TIME_GET)
+ return ecore_time_get();
+#else
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0) {
}
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
+#endif
}
HAPI const char *util_basename(const char *name)
HAPI double util_time_delay_for_compensation(double period)
{
- struct timeval tv;
unsigned long long curtime;
unsigned long long _period;
unsigned long long remain;
return 0.0f;
}
+#if defined(_USE_ECORE_TIME_GET)
+ curtime = ecore_time_get() * 1000000llu;
+#else
+ struct timeval tv;
if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
return period;
}
curtime = (unsigned long long)tv.tv_sec * 1000000llu + (unsigned long long)tv.tv_usec;
+#endif
+
_period = (unsigned long long)(period * (double)1000000);
if (_period == 0llu) {
ErrPrint("%lf <> %llu\n", period, _period);