Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jan 2020 14:13:49 -0800
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        Eric van Gyzen <vangyzen@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r356706 - head/sbin/savecore
Message-ID:  <20200113221349.GP39529@FreeBSD.org>
In-Reply-To: <202001132201.00DM1cvd045817@repo.freebsd.org>
References:  <202001132201.00DM1cvd045817@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  Eric,

looks like this changes content format of info.X, whatever
libxo output you choose, thus this change at minimum needs
to be documented in UPDATING and in release notes for next
release.

On Mon, Jan 13, 2020 at 10:01:38PM +0000, Eric van Gyzen wrote:
E> Author: vangyzen
E> Date: Mon Jan 13 22:01:37 2020
E> New Revision: 356706
E> URL: https://svnweb.freebsd.org/changeset/base/356706
E> 
E> Log:
E>   savecore: include time zone in info.N file
E>   
E>   This helps with event correlation when machines are distributed
E>   across multiple time zones.
E>   
E>   Format the time with relaxed ISO 8601 for all the usual reasons.
E>   
E>   MFC after:	2 weeks
E>   Sponsored by:	Dell EMC Isilon
E> 
E> Modified:
E>   head/sbin/savecore/savecore.c
E> 
E> Modified: head/sbin/savecore/savecore.c
E> ==============================================================================
E> --- head/sbin/savecore/savecore.c	Mon Jan 13 21:49:27 2020	(r356705)
E> +++ head/sbin/savecore/savecore.c	Mon Jan 13 22:01:37 2020	(r356706)
E> @@ -157,6 +157,8 @@ printheader(xo_handle_t *xo, const struct kerneldumphe
E>  {
E>  	uint64_t dumplen;
E>  	time_t t;
E> +	struct tm tm;
E> +	char time_str[64];
E>  	const char *stat_str;
E>  	const char *comp_str;
E>  
E> @@ -189,7 +191,10 @@ printheader(xo_handle_t *xo, const struct kerneldumphe
E>  	}
E>  	xo_emit_h(xo, "{P:  }{Lwc:Compression}{:compression/%s}\n", comp_str);
E>  	t = dtoh64(h->dumptime);
E> -	xo_emit_h(xo, "{P:  }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t));
E> +	localtime_r(&t, &tm);
E> +	if (strftime(time_str, sizeof(time_str), "%F %T %z", &tm) == 0)
E> +		time_str[0] = '\0';
E> +	xo_emit_h(xo, "{P:  }{Lwc:Dumptime}{:dumptime/%s}\n", time_str);
E>  	xo_emit_h(xo, "{P:  }{Lwc:Hostname}{:hostname/%s}\n", h->hostname);
E>  	xo_emit_h(xo, "{P:  }{Lwc:Magic}{:magic/%s}\n", h->magic);
E>  	xo_emit_h(xo, "{P:  }{Lwc:Version String}{:version_string/%s}",
E> _______________________________________________
E> svn-src-all@freebsd.org mailing list
E> https://lists.freebsd.org/mailman/listinfo/svn-src-all
E> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"

-- 
Gleb Smirnoff



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200113221349.GP39529>