From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by mx.groups.io with SMTP id smtpd.web08.35418.1615207536369107887 for ; Mon, 08 Mar 2021 04:45:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=ASDuWgje; spf=pass (domain: nuviainc.com, ip: 209.85.208.53, mailfrom: leif@nuviainc.com) Received: by mail-ed1-f53.google.com with SMTP id t1so14571010eds.7 for ; Mon, 08 Mar 2021 04:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OlQONyZYCZObsrUtlKeo6VPEywvnJTFGjqf8YOrXrlc=; b=ASDuWgjeA3/1lnUBgzVEISD/ZKjhDWcfnx0/sb60iBpF8tOIBBoxsO823NFXlASj4m a0yXOpBQK/FVdurcn+trHv/53zNhzKaGQKQgGdaYQaTO2I8LHQt7hzHQQuzAYuV+dGCS LgN8+qfVtR/ChTvQzTtEZR649vaB5i+oHIYvgIxmfPfMiidE9J3SN3nqGNdDwtfaUyQF 6G9hn376UQQq3X/Ou59WX3ZV+f9dOAqDTm44OxYIs6kVyOZTAJoRAdOFFeRv4z+TyNfl IZR3DL4fV0PC0n/1okgyH74Js4NTrTUBmnHyhNrXk/t2iyknWxXGGkvV+c3RMhB7EBh8 Qzog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OlQONyZYCZObsrUtlKeo6VPEywvnJTFGjqf8YOrXrlc=; b=Yzt2XiITzj6KAAwOiJlHjYIvpa5z+mSqoXSHGHXYwsB8AfH7H9XRDo+mShqxaPh87v gtmKjGRXggPcUhbB8P+r++9gzCHgTn2SLMYtz9u3Jje16+0WXmyVk0HrxDe/GEpZLTps xvJ1SWQpJ+Z12vpczer0pR25wFt9cdfakMOryFd6ODv0lxkOoNHthopgGXJHF8vu7kmz fRKfZFMOg4AHjfkOxlBxBmdZzT7P/zOq+omSlB0pBalLDrQTyUh+PRBOMdZ6jCLgdeu2 U4CeAl0hFODgGZKvJpwEJjmaf+NVN23x3WPifT0Angki7SOVLifI+HDcLyn557UbGD2c hW8w== X-Gm-Message-State: AOAM531Rp7o+JDSaNfSfPthlwu8g/cXR6V3j5azv9E419sfHYnxruVcU LB9XWbQsG0NLfKeIcKdMIYmMlg== X-Google-Smtp-Source: ABdhPJxan93cvySaFfItWBoMVZ8C9JTszUe+fnB3a7VFyU5c9z+J3Zp3u8E2rlcj5A7KHEPOeHurrQ== X-Received: by 2002:aa7:cf14:: with SMTP id a20mr21809770edy.49.1615207534850; Mon, 08 Mar 2021 04:45:34 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id d3sm7009957edp.43.2021.03.08.04.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 04:45:34 -0800 (PST) Date: Mon, 8 Mar 2021 12:45:32 +0000 From: "Leif Lindholm" To: Rebecca Cran , Ard Biesheuvel Cc: devel@edk2.groups.io, Ard Biesheuvel , Samer El-Haj-Mahmoud Subject: Re: [PATCH 1/1] EmbeddedPkg: Only print LibGetTime message about compile time epoch once Message-ID: <20210308124532.GL1664@vanye> References: <20210305161116.13141-1-rebecca@nuviainc.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 05, 2021 at 17:12:46 +0100, Ard Biesheuvel wrote: > On Fri, 5 Mar 2021 at 17:11, Rebecca Cran wrote: > > > > The message "LibGetTime: RtcEpochSeconds non volatile variable was not > > found - Using compilation time epoch." can be printed a very large > > number of times, causing log files to become excessively large. This is > > because the RtcEpochSeconds variable only gets set if LibSetTime is > > called, for example by running 'time 12:00' in the UEFI Shell. > > > > Avoid this by setting RtcEpochSeconds to BUILD_EPOCH (EpochSeconds) > > after printing the message. It's set to a volatile variable so the > > message will be displayed on future boots and not hidden. > > > > Commit 44ae214591e58af468eacb7b873eaa0bc187c4fa reduced the verbosity of > > the message to DEBUG_VERBOSE. Revert it back to DEBUG_INFO so it's more > > prominent now that it doesn't get printed so frequently. > > > > Signed-off-by: Rebecca Cran > > Acked-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Pushed as 94fa95c8746c. Thanks! > > --- > > EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c > > index 4210708cff36..de6fbb40e61b 100644 > > --- a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c > > +++ b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c > > @@ -88,10 +88,18 @@ LibGetTime ( > > // > > EpochSeconds = BUILD_EPOCH; > > DEBUG (( > > - DEBUG_VERBOSE, > > + DEBUG_INFO, > > "LibGetTime: %s non volatile variable was not found - Using compilation time epoch.\n", > > mEpochVariableName > > )); > > + > > + EfiSetVariable ( > > + (CHAR16 *)mEpochVariableName, > > + &gEfiCallerIdGuid, > > + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, > > + sizeof (EpochSeconds), > > + &EpochSeconds > > + ); > > } > > Counter = GetPerformanceCounter (); > > EpochSeconds += DivU64x64Remainder (Counter, Freq, &Remainder); > > -- > > 2.26.2 > >