From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by mx.groups.io with SMTP id smtpd.web12.14235.1614960684336021318 for ; Fri, 05 Mar 2021 08:11:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=BJzk/R8D; spf=pass (domain: nuviainc.com, ip: 209.85.166.172, mailfrom: rebecca@nuviainc.com) Received: by mail-il1-f172.google.com with SMTP id f10so2468906ilq.5 for ; Fri, 05 Mar 2021 08:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S1YVtAxPdwBlF8o/go1eeTq+8/zV0cz8J3lHAkLT1i0=; b=BJzk/R8Dm7syr+1qiZqBOVAFigr+DiN070KxX+JmRwBFL/NQG/d30Q8quhUR2gs4K/ KWTQJeqK9Gpei9wfDAWWV9YsfSQybw9xw3yhX9wkB++pnW7uD2omiFDXHS83JgxyTcel 48BPl5SE9eYEQALC+WIOvM2E6NVc3eaRMQazJgHCc2uiOlfKu5puVfJbKE2rXY5q0Iuw 74Tx12TDzYjggPpSQOlOMEticWIJIrROaRrn9hEoF80LDzd/uMCuJtZsJSMtsCkwHUh3 jronpnBrLDt4bXMymh+nOgVH0CPCf7Khx04nbuqSTZceD2OWZOhD+Vk2HGbmnLw0T4l9 H5LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S1YVtAxPdwBlF8o/go1eeTq+8/zV0cz8J3lHAkLT1i0=; b=Fzh+11wbj8LICtN3POA5Zt8zsFgQMJpM7SsUt8QqxlcbcxY4DVAbmx1vAH/h17zMId phLIEXygFTzKhIyO2fX++GGrhfqTuT8pTrrvRE/bBehYQXOVCCiFyCl0wxvt4z+7TSp8 nUwNU4U2PqZo2mkfgmtNghzibLX7FDJnESBNqkwb5C9WMQcg5ZdKkf3WG3eDENMvGbaX aA8S1M6zHXK4Zh8Uykj2NF3tO0ij+gTLy7YHxvKZKFODvNPfYcQU/KgqJ2NdDuftvZgC PMBC/Jjk4H1lok93jBtmiSVgKApTwl4pOnK6F50nuvtbE6HyDm+yinGYZ+cAYkGLrazK mvuA== X-Gm-Message-State: AOAM533KmI4Ob96hS9HMJcrw2uPos/lsCfBCaodBAwYKn0CieHARBKPa 3dntW/LYkkDtuAlvc/GOs5U15AbVH08SrdQ2KYVzQ+jMEebhbjUt2sJ5Fyac49HP8I9OghHB2jB R7NFM5QjD66AWR39+6olYOnNWGnMagcxJ4JcqsfC0+rQhxAZrQl5BTpJe7V0b2tcDoQWUDw== X-Google-Smtp-Source: ABdhPJzyVuSpupHqchEyDrtTCM3FqZfP8G+77v4J17j7JE7bUnqln/jJsYtCfRztrdAUtIVm0LLA9Q== X-Received: by 2002:a05:6e02:152c:: with SMTP id i12mr8725056ilu.46.1614960683369; Fri, 05 Mar 2021 08:11:23 -0800 (PST) Return-Path: Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id y18sm1531765ili.16.2021.03.05.08.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 08:11:23 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Leif Lindholm , Ard Biesheuvel , Samer El-Haj-Mahmoud Subject: [PATCH 1/1] EmbeddedPkg: Only print LibGetTime message about compile time epoch once Date: Fri, 5 Mar 2021 09:11:16 -0700 Message-Id: <20210305161116.13141-1-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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