ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DLOG_TAG=\"LIVEBOX_VIEWER\"")
ADD_DEFINITIONS("-DNDEBUG")
+ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
#ADD_DEFINITIONS("-DFLOG")
ADD_DEFINITIONS("-DMASTER_PKGNAME=\"data-provider-master\"")
ADD_DEFINITIONS("-DINFO_SOCKET=\"/opt/usr/share/live_magazine/.live.socket\"")
Name: liblivebox-viewer
Summary: Library for developing the application.
-Version: 0.14.3
+Version: 0.14.4
Release: 1
Group: HomeTF/Livebox
License: Flora License
{
va_list ap;
int ret;
- struct timeval tv;
if (!s_info.fp) {
return LB_STATUS_ERROR_IO;
}
+#if defined(_USE_ECORE_TIME_GET)
+ double tv;
+ tv = util_timestamp();
+ fprintf(s_info.fp, "%d %lf [%s:%d] ", getpid(), tv, util_basename((char *)func), line);
+#else
+ struct timeval tv;
gettimeofday(&tv, NULL);
fprintf(s_info.fp, "%d %lu.%lu [%s:%d] ", getpid(), tv.tv_sec, tv.tv_usec, util_basename((char *)func), line);
+#endif
va_start(ap, fmt);
ret = vfprintf(s_info.fp, fmt, ap);
#include <sys/time.h>
#include <unistd.h>
#include <stdlib.h>
+#include <time.h>
#include <dlog.h>
#include <livebox-errno.h> /* For error code */
#include "util.h"
int errno;
+#if defined(_USE_ECORE_TIME_GET)
+static struct {
+ clockid_t type;
+} s_info = {
+ .type = CLOCK_MONOTONIC,
+};
+#endif
int util_check_extension(const char *filename, const char *check_ptr)
{
double util_timestamp(void)
{
+#if defined(_USE_ECORE_TIME_GET)
+ struct timespec ts;
+
+ do {
+ if (clock_gettime(s_info.type, &ts) == 0) {
+ return ts.tv_sec + ts.tv_nsec / 1000000000.0f;
+ }
+
+ ErrPrint("%d: %s\n", s_info.type, strerror(errno));
+ if (s_info.type == CLOCK_MONOTONIC) {
+ s_info.type = CLOCK_REALTIME;
+ } else if (s_info.type == CLOCK_REALTIME) {
+ break;
+ }
+ } while (1);
+
+ return 0.0f;
+#else
struct timeval tv;
gettimeofday(&tv, NULL);
-
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
+#endif
}
const char *util_basename(const char *name)