From: José Bollo Date: Fri, 18 May 2018 23:45:36 +0000 (+0200) Subject: afb-trace: Restore microsecond time X-Git-Tag: flounder_5.99.1~16 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=6293abf4b450e8403111894b1d7047e92bbb3ef3;hp=b2abd7a2a4eed32845a71138694e7977d08b3d3a;p=src%2Fapp-framework-binder.git afb-trace: Restore microsecond time This allow to use accurately float 64 bits for times from 1970 to 2112. Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e Signed-off-by: José Bollo --- diff --git a/src/afb-trace.c b/src/afb-trace.c index f5f9c19e..5404a5af 100644 --- a/src/afb-trace.c +++ b/src/afb-trace.c @@ -168,7 +168,7 @@ static struct json_object *timestamp(const struct afb_hookid *hookid) { char ts[50]; - snprintf(ts, sizeof ts, "%llu.%09llu", (long long unsigned)hookid->time.tv_sec, (long long unsigned)hookid->time.tv_nsec); + snprintf(ts, sizeof ts, "%llu.%06lu", (long long unsigned)hookid->time.tv_sec, (long unsigned)(hookid->time.tv_nsec / 1000)); return json_object_new_string(ts); }