summaryrefslogtreecommitdiff
path: root/ufo/ufo-priv.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-08-21 08:31:26 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-08-21 08:53:47 +0200
commit404ac95a4be625bf8759d3191c99df17ed0fc924 (patch)
treed1567e2dac0647205e159051d04c43c8a1555ac5 /ufo/ufo-priv.c
parent8be1c34ba98672fde543835669ed87590e26f4b2 (diff)
Fix #28: use elapsed seconds to compute timestamp
Diffstat (limited to 'ufo/ufo-priv.c')
-rw-r--r--ufo/ufo-priv.c5
1 files changed, 3 insertions, 2 deletions
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, ",");