cleanup, live textdump working
[lttngtop.git] / src / common.c
index f741a29b536d20a74e9d96a38ef0136b3c5782c8..bff5b00715685b312c7ad3745811776b7a473e3d 100644 (file)
@@ -529,3 +529,20 @@ enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data,
 error:
        return BT_CB_ERROR_STOP;
 }
+
+struct tm 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;
+}
This page took 0.022673 seconds and 4 git commands to generate.