svn commit: r356706 - head/sbin/savecore

Gleb Smirnoff glebius at freebsd.org
Mon Jan 13 22:13:59 UTC 2020


  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 at 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 at freebsd.org"

-- 
Gleb Smirnoff


More information about the svn-src-all mailing list