summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-12-12 17:13:14 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-12-12 17:21:19 +0100
commit3e0e6f1c09af031ec1bbaf0649b2d8360c145947 (patch)
tree2de3d8bd7f6d5aaffd9d484df5fad423c9f41a6a
parent442f25843bfde8fb835f0306f04d6da878bc5bca (diff)
afb-trace: Make real timestamps
The optimisation that represent the timestamp as a fake double is not accurate in local context. Bug-AGL: SPEC-2051 Change-Id: I285837251507a69ad210823020d0cf69ad5999f3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-trace.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/afb-trace.c b/src/afb-trace.c
index aaa16352..ffb03059 100644
--- a/src/afb-trace.c
+++ b/src/afb-trace.c
@@ -148,18 +148,8 @@ static void ctxt_error(char **errors, const char *format, ...)
/* timestamp */
static struct json_object *timestamp(const struct afb_hookid *hookid)
{
-#if JSON_C_MAJOR_VERSION > 0 || JSON_C_MINOR_VERSION >= 12
- char ts[50];
-
- snprintf(ts, sizeof ts, "%llu.%06lu",
- (long long unsigned)hookid->time.tv_sec,
- (long unsigned)((hookid->time.tv_nsec + 500) / 1000));
-
- return json_object_new_double_s(0.0f, ts); /* the real value isn't used */
-#else
return json_object_new_double((double)hookid->time.tv_sec +
(double)hookid->time.tv_nsec * .000000001);
-#endif
}
/* verbosity level name or NULL */