Message ID | 20210113112643.12893-1-jack@suse.cz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | blkparse: Print time when trace was started | expand |
On 1/13/21 03:29, Jan Kara wrote: > 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> Looks good. Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
On Wed 13-01-21 12:26:43, Jan Kara wrote: > 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> Ping Jens, can you please merge this blktrace patch? Thanks! Honza > --- > blkparse.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/blkparse.c b/blkparse.c > index 911309e26a15..dc518632ebf5 100644 > --- a/blkparse.c > +++ b/blkparse.c > @@ -31,6 +31,7 @@ > #include <signal.h> > #include <locale.h> > #include <libgen.h> > +#include <time.h> > > #include "blktrace.h" > #include "rbtree.h" > @@ -2797,6 +2798,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); > } > -- > 2.26.2 >
On 1/13/21 4:26 AM, Jan Kara wrote: > 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. Applied, thanks.
diff --git a/blkparse.c b/blkparse.c index 911309e26a15..dc518632ebf5 100644 --- a/blkparse.c +++ b/blkparse.c @@ -31,6 +31,7 @@ #include <signal.h> #include <locale.h> #include <libgen.h> +#include <time.h> #include "blktrace.h" #include "rbtree.h" @@ -2797,6 +2798,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); }
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> --- blkparse.c | 2 ++ 1 file changed, 2 insertions(+)