aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2021-01-13 12:26:43 +0100
committerJens Axboe <axboe@kernel.dk>2021-04-19 11:55:04 -0600
commitdc24c67dfbbd11a3221034557548061e7d2c602f (patch)
tree6d674163736b7b54bc612d92974e2b6ec184e727
parent2ec0bb0b725305025dcc3e3f195894040e2dab90 (diff)
downloadblktrace-dc24c67dfbbd11a3221034557548061e7d2c602f.tar.gz
blkparse: Print time when trace was started
For correlating blktrace data with other information, it is useful to know when the trace has been captured. Since the absolute timestamp is contained in the blktrace file, just output it. Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Link: https://lore.kernel.org/r/20210113112643.12893-1-jack@suse.cz Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--blkparse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/blkparse.c b/blkparse.c
index 33dd023..1d7ae95 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -32,6 +32,7 @@
#include <signal.h>
#include <locale.h>
#include <libgen.h>
+#include <time.h>
#include "blktrace.h"
#include "rbtree.h"
@@ -2888,6 +2889,7 @@ static void show_stats(void)
if (per_device_and_cpu_stats)
show_device_and_cpu_stats();
+ fprintf(ofp, "Trace started at %s\n", ctime(&abs_start_time.tv_sec));
fflush(ofp);
}