From 9edaccd922af346bba59ce32668fd91f051af1d6 Mon Sep 17 00:00:00 2001 From: Wojciech Macek Date: Thu, 23 Feb 2023 09:33:06 +0100 Subject: util/cbfstool/eventlog: Use LocalTime or UTC timestamps Add a new flag "--utc" to allow the user to choose if elogtool should print timestamps in Local Time or in UTC. It is useful for generating automated crash reports including all system logs when users are located in various regions (timezones). Add information about timezone to timestamps printed on the console. Signed-off-by: Wojciech Macek Change-Id: I30ba0e17c67ab4078e3a7137ece69009a63d68fa Reviewed-on: https://review.coreboot.org/c/coreboot/+/73201 Tested-by: build bot (Jenkins) Reviewed-by: Jakub Czapiga --- util/cbfstool/eventlog.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'util/cbfstool/eventlog.h') diff --git a/util/cbfstool/eventlog.h b/util/cbfstool/eventlog.h index 1911b77e82..6cc39fbf88 100644 --- a/util/cbfstool/eventlog.h +++ b/util/cbfstool/eventlog.h @@ -8,7 +8,13 @@ struct event_header; struct buffer; -void eventlog_print_event(const struct event_header *event, int count); +enum eventlog_timezone { + EVENTLOG_TIMEZONE_LOCALTIME = 0, + EVENTLOG_TIMEZONE_UTC, +}; + +void eventlog_print_event(const struct event_header *event, int count, + enum eventlog_timezone tz); int eventlog_init_event(const struct buffer *buf, uint8_t type, const void *data, int data_size); -- cgit v1.2.3