summaryrefslogtreecommitdiff
path: root/trace2
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2019-04-15 20:39:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-16 04:37:07 (GMT)
commitbad229aef232256f3fb6e8ed9c09e26ff654399c (patch)
treefcc9692c72aa90d437dfb69e823c68bf65741af8 /trace2
parent26c6f251d754a33c188ce7ad8f5ea6cb0bc740d7 (diff)
downloadgit-bad229aef232256f3fb6e8ed9c09e26ff654399c.zip
git-bad229aef232256f3fb6e8ed9c09e26ff654399c.tar.gz
git-bad229aef232256f3fb6e8ed9c09e26ff654399c.tar.bz2
trace2: clarify UTC datetime formatting
Update tr2_tbuf_utc_datetime to generate extended UTC format. Update tr2_tgt_event target to use extended format in 'time' columns. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2')
-rw-r--r--trace2/tr2_tbuf.c4
-rw-r--r--trace2/tr2_tbuf.h4
-rw-r--r--trace2/tr2_tgt_event.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/trace2/tr2_tbuf.c b/trace2/tr2_tbuf.c
index 0844910..eb1b240 100644
--- a/trace2/tr2_tbuf.c
+++ b/trace2/tr2_tbuf.c
@@ -15,7 +15,7 @@ void tr2_tbuf_local_time(struct tr2_tbuf *tb)
tm.tm_min, tm.tm_sec, (long)tv.tv_usec);
}
-void tr2_tbuf_utc_time(struct tr2_tbuf *tb)
+void tr2_tbuf_utc_datetime_extended(struct tr2_tbuf *tb)
{
struct timeval tv;
struct tm tm;
@@ -26,7 +26,7 @@ void tr2_tbuf_utc_time(struct tr2_tbuf *tb)
gmtime_r(&secs, &tm);
xsnprintf(tb->buf, sizeof(tb->buf),
- "%4d-%02d-%02d %02d:%02d:%02d.%06ld", tm.tm_year + 1900,
+ "%4d-%02d-%02dT%02d:%02d:%02d.%06ldZ", tm.tm_year + 1900,
tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec,
(long)tv.tv_usec);
}
diff --git a/trace2/tr2_tbuf.h b/trace2/tr2_tbuf.h
index 9cdefa3..2a1d173 100644
--- a/trace2/tr2_tbuf.h
+++ b/trace2/tr2_tbuf.h
@@ -16,8 +16,8 @@ struct tr2_tbuf {
void tr2_tbuf_local_time(struct tr2_tbuf *tb);
/*
- * Fill buffer with formatted UTC time string.
+ * Fill buffer with formatted UTC datatime string.
*/
-void tr2_tbuf_utc_time(struct tr2_tbuf *tb);
+void tr2_tbuf_utc_datetime_extended(struct tr2_tbuf *tb);
#endif /* TR2_TBUF_H */
diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c
index 48d9193..2c97cf5 100644
--- a/trace2/tr2_tgt_event.c
+++ b/trace2/tr2_tgt_event.c
@@ -94,7 +94,7 @@ static void event_fmt_prepare(const char *event_name, const char *file,
*/
if (!tr2env_event_be_brief || !strcmp(event_name, "version") ||
!strcmp(event_name, "atexit")) {
- tr2_tbuf_utc_time(&tb_now);
+ tr2_tbuf_utc_datetime_extended(&tb_now);
jw_object_string(jw, "time", tb_now.buf);
}