Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] blkparse: Print time when trace was started
@ 2021-01-13 11:26 Jan Kara
  2021-01-14  0:41 ` Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Kara @ 2021-01-13 11:26 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Jan Kara

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(+)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blkparse: Print time when trace was started
  2021-01-13 11:26 [PATCH] blkparse: Print time when trace was started Jan Kara
@ 2021-01-14  0:41 ` Chaitanya Kulkarni
  2021-04-19  8:06 ` Jan Kara
  2021-04-19 17:55 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-01-14  0:41 UTC (permalink / raw)
  To: Jan Kara, Jens Axboe; +Cc: linux-block

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blkparse: Print time when trace was started
  2021-01-13 11:26 [PATCH] blkparse: Print time when trace was started Jan Kara
  2021-01-14  0:41 ` Chaitanya Kulkarni
@ 2021-04-19  8:06 ` Jan Kara
  2021-04-19 17:55 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2021-04-19  8:06 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Jan Kara

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
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blkparse: Print time when trace was started
  2021-01-13 11:26 [PATCH] blkparse: Print time when trace was started Jan Kara
  2021-01-14  0:41 ` Chaitanya Kulkarni
  2021-04-19  8:06 ` Jan Kara
@ 2021-04-19 17:55 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-04-19 17:55 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-block

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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13 11:26 [PATCH] blkparse: Print time when trace was started Jan Kara
2021-01-14  0:41 ` Chaitanya Kulkarni
2021-04-19  8:06 ` Jan Kara
2021-04-19 17:55 ` Jens Axboe

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git