Include end-of-run time in the output
authorJens Axboe <axboe@kernel.dk>
Thu, 14 Jun 2012 13:11:15 +0000 (15:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jun 2012 13:11:15 +0000 (15:11 +0200)
When results are stored, it's convenient to be able to tell
when they were run.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.c

diff --git a/stat.c b/stat.c
index 8c846f666f431e9a80d5930f1939df42f32020c4..0a0479814825c7a5c6eaf09985bc8eb9b15b496c 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -523,19 +523,25 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs)
        double io_u_dist[FIO_IO_U_MAP_NR];
        double io_u_lat_u[FIO_IO_U_LAT_U_NR];
        double io_u_lat_m[FIO_IO_U_LAT_M_NR];
        double io_u_dist[FIO_IO_U_MAP_NR];
        double io_u_lat_u[FIO_IO_U_LAT_U_NR];
        double io_u_lat_m[FIO_IO_U_LAT_M_NR];
+       time_t time_p;
+       char time_buf[64];
 
        if (!(ts->io_bytes[0] + ts->io_bytes[1]) &&
            !(ts->total_io_u[0] + ts->total_io_u[1]))
                return;
 
 
        if (!(ts->io_bytes[0] + ts->io_bytes[1]) &&
            !(ts->total_io_u[0] + ts->total_io_u[1]))
                return;
 
+       time(&time_p);
+       ctime_r((const time_t *) &time_p, time_buf);
+
        if (!ts->error) {
        if (!ts->error) {
-               log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d\n",
+               log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d: %s",
                                        ts->name, ts->groupid, ts->members,
                                        ts->name, ts->groupid, ts->members,
-                                       ts->error, (int) ts->pid);
+                                       ts->error, (int) ts->pid, time_buf);
        } else {
        } else {
-               log_info("%s: (groupid=%d, jobs=%d): err=%2d (%s): pid=%d\n",
+               log_info("%s: (groupid=%d, jobs=%d): err=%2d (%s): pid=%d: %s",
                                        ts->name, ts->groupid, ts->members,
                                        ts->name, ts->groupid, ts->members,
-                                       ts->error, ts->verror, (int) ts->pid);
+                                       ts->error, ts->verror, (int) ts->pid,
+                                       time_buf);
        }
 
        if (strlen(ts->description))
        }
 
        if (strlen(ts->description))