From 404ac95a4be625bf8759d3191c99df17ed0fc924 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 21 Aug 2014 08:31:26 +0200 Subject: Fix #28: use elapsed seconds to compute timestamp --- ufo/ufo-priv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ufo/ufo-priv.c') diff --git a/ufo/ufo-priv.c b/ufo/ufo-priv.c index dea64c0..a52e387 100644 --- a/ufo/ufo-priv.c +++ b/ufo/ufo-priv.c @@ -117,8 +117,9 @@ write_trace_json (const gchar *filename_template, GList *events) g_list_for (events, it) { Event *event = (Event *) it->data; - fprintf (fp, "{\"cat\":\"f\",\"ph\": \"%c\", \"ts\": %.1f, \"pid\": %zu, \"tid\": \"%s\",\"name\": \"%s\", \"args\": {}}", - event->type, event->timestamp, event->pid, event->tid, event->name); + gdouble timestamp = event->timestamp * 1000 * 1000; + fprintf (fp, "{\"cat\":\"f\",\"ph\": \"%c\", \"ts\": %.0f, \"pid\": %zu, \"tid\": \"%s\",\"name\": \"%s\", \"args\": {}}", + event->type, timestamp, event->pid, event->tid, event->name); if (g_list_next (it) != NULL) fprintf (fp, ","); -- cgit v1.2.3