+/* FIXME : TMP */
+struct tm ts_format_timestamp(uint64_t timestamp)
+{
+ struct tm tm;
+ uint64_t ts_sec = 0, ts_nsec;
+ time_t time_s;
+
+ ts_nsec = timestamp;
+ ts_sec += ts_nsec / NSEC_PER_SEC;
+ ts_nsec = ts_nsec % NSEC_PER_SEC;
+
+ time_s = (time_t) ts_sec;
+
+ localtime_r(&time_s, &tm);
+
+ return tm;
+}
+
+/*
+ * hook on each event to check the timestamp and refresh the display if
+ * necessary
+ */
+enum bt_cb_ret print_timestamp(struct bt_ctf_event *call_data, void *private_data)
+{
+ unsigned long timestamp;
+ struct tm start;
+ uint64_t ts_nsec_start, ts_nsec_end;
+
+
+ timestamp = bt_ctf_get_timestamp(call_data);
+
+ start = ts_format_timestamp(timestamp);
+ ts_nsec_start = timestamp % NSEC_PER_SEC;
+
+// printf("%02d:%02d:%02d.%09" PRIu64 "\n", start.tm_hour, start.tm_min, start.tm_sec, ts_nsec_start);
+
+ return BT_CB_OK;
+}
+