diff options
author | Rebecca Cran <rebecca@nuviainc.com> | 2021-03-05 09:11:16 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-03-08 12:28:20 +0000 |
commit | 94fa95c8746c553324e8b69ea4a74af670075324 (patch) | |
tree | 28c8f20db17d5d7059663c7362cc2d82337b005a /EmbeddedPkg | |
parent | d28a68153492ce3e64fb0535674e11e7f46a88a8 (diff) | |
download | edk2-94fa95c8746c553324e8b69ea4a74af670075324.tar.gz edk2-94fa95c8746c553324e8b69ea4a74af670075324.tar.bz2 edk2-94fa95c8746c553324e8b69ea4a74af670075324.zip |
EmbeddedPkg: Only print LibGetTime message about compile time epoch once
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 <rebecca@nuviainc.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c index 4210708cff..de6fbb40e6 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);
|