cleanup, live textdump working
[lttngtop.git] / src / common.c
index c910a063826efa9b3e3d1042e3e5c8dd359e446f..bff5b00715685b312c7ad3745811776b7a473e3d 100644 (file)
@@ -470,7 +470,7 @@ enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data,
        int64_t pid, tid;
        char *procname;
 
-       timestamp = bt_ctf_get_real_timestamp(call_data);
+       timestamp = bt_ctf_get_timestamp(call_data);
        if (timestamp == -1ULL)
                goto error;
 
@@ -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.022682 seconds and 4 git commands to generate.