Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cherry-Pick] Bring in last of 202311 changes into 202405 #563

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AdvLoggerPkg/AdvLoggerPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
LOGTELEMETRY,
DEBUGAGENT,
POSTMEM,
MMARM
MMARM,
BLKIO
]
},

Expand Down
63 changes: 32 additions & 31 deletions AdvLoggerPkg/Application/DecodeUefiLog/DecodeUefiLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import copy

from win32com.shell import shell

from UefiVariablesSupportLib import UefiVariable
from edk2toollib.os.uefivariablesupport import UefiVariable


class AdvLogParser ():
Expand Down Expand Up @@ -260,9 +259,9 @@ class AdvLogParser ():
ADVANCED_LOGGER_PHASE_SMM = 9
ADVANCED_LOGGER_PHASE_TFA = 10
ADVANCED_LOGGER_PHASE_CNT = 11
PHASE_STRING_LIST = ["[UNSPECIFIED] ", "[SEC] ", "[PEI] ", "[PEI64] ",
"[DXE] ", "[RUNTIME] ", "[MM_CORE] ", "[MM] ",
"[SMM_CORE] ", "[SMM] ", "[TFA] "]
PHASE_STRING_LIST = ["[UNSPECIFIED]", "[SEC]", "[PEI]", "[PEI64]",
"[DXE]", "[RUNTIME]", "[MM_CORE]", "[MM]",
"[SMM_CORE]", "[SMM]", "[TFA]"]

# Debug levels from MU_BASECORE\MdePkg\Include\Library\DebugLib.h
# //
Expand Down Expand Up @@ -293,27 +292,27 @@ class AdvLogParser ():
# #define DEBUG_ERROR 0x80000000 // Error

debug_levels_dict = {
0x00000001: "[DEBUG_INIT]",
0x00000002: "[DEBUG_WARN]",
0x00000004: "[DEBUG_LOAD]",
0x00000008: "[DEBUG_FS]",
0x00000010: "[DEBUG_POOL]",
0x00000020: "[DEBUG_PAGE]",
0x00000040: "[DEBUG_INFO]",
0x00000080: "[DEBUG_DISPATCH]",
0x00000100: "[DEBUG_VARIABLE]",
0x00000200: "[DEBUG_SMI]",
0x00000400: "[DEBUG_BM]",
0x00001000: "[DEBUG_BLKIO]",
0x00004000: "[DEBUG_NET]",
0x00010000: "[DEBUG_UNDI]",
0x00020000: "[DEBUG_LOADFILE]",
0x00080000: "[DEBUG_EVENT]",
0x00100000: "[DEBUG_GCD]",
0x00200000: "[DEBUG_CACHE]",
0x00400000: "[DEBUG_VERBOSE]",
0x00800000: "[DEBUG_MANAGEABILITY]",
0x80000000: "[DEBUG_ERROR]"
0x00000001: "[INIT]",
0x00000002: "[WARN]",
0x00000004: "[LOAD]",
0x00000008: "[FS]",
0x00000010: "[POOL]",
0x00000020: "[PAGE]",
0x00000040: "[INFO]",
0x00000080: "[DISPATCH]",
0x00000100: "[VARIABLE]",
0x00000200: "[SMI]",
0x00000400: "[BM]",
0x00001000: "[BLKIO]",
0x00004000: "[NET]",
0x00010000: "[UNDI]",
0x00020000: "[LOADFILE]",
0x00080000: "[EVENT]",
0x00100000: "[GCD]",
0x00200000: "[CACHE]",
0x00400000: "[VERBOSE]",
0x00800000: "[MANAGEABILITY]",
0x80000000: "[ERROR]"
}

#
Expand Down Expand Up @@ -713,15 +712,17 @@ def _GetPhaseString(self, Phase):
elif Phase <= self.ADVANCED_LOGGER_PHASE_UNSPECIFIED:
PhaseString = ""
else:
PhaseString = self.PHASE_STRING_LIST[Phase]
# Add an extra space for readability
PhaseString = self.PHASE_STRING_LIST[Phase] + ' '
return PhaseString

#
# Get the formatted debug level string
#
def _GetDebugLevelString(self, DebugLevel):
if DebugLevel in list(self.debug_levels_dict.keys()):
DebugLevelString = self.debug_levels_dict[DebugLevel]
# Add an extra space for readability
DebugLevelString = self.debug_levels_dict[DebugLevel] + ' '
else:
DebugLevelString = ""
return DebugLevelString
Expand Down Expand Up @@ -1001,7 +1002,7 @@ def ReadLogFromUefiInterface():

while rc == 0:
VariableName = 'V'+str(Index)
(rc, var, errorstring) = UefiVar.GetUefiVar(VariableName, 'a021bf2b-34ed-4a98-859c-420ef94f3e94')
(rc, var) = UefiVar.GetUefiVar(VariableName, 'a021bf2b-34ed-4a98-859c-420ef94f3e94')
if (rc == 0):
Index += 1
InFile.write(var)
Expand Down Expand Up @@ -1058,7 +1059,7 @@ def main():
CountOfLines = len(lines)
print(f"{CountOfLines} lines written to {options.OutFilePath}")

except Exception as ex:
except Exception:
print("Error processing log output.")
traceback.print_exc()

Expand All @@ -1070,7 +1071,7 @@ def main():
RawFile.close()
print("RawFile complete")

except Exception as ex:
except Exception:
print("Error processing raw file output.")
traceback.print_exc()

Expand Down
114 changes: 0 additions & 114 deletions AdvLoggerPkg/Application/DecodeUefiLog/UefiVariablesSupportLib.py

This file was deleted.

Loading
Loading