Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Debug

  1. AppleDebug Type: plist boolean Failsafe: false Description: Enable writing the boot.efi debug log to the OpenCore log.

    Note: This option only applies to 10.15.4 and newer.

  2. ApplePanic Type: plist boolean Failsafe: false Description: Save macOS kernel panic output to the OpenCore root partition.

    The file is saved as panic-YYYY-MM-DD-HHMMSS.txt. It is strongly recommended to set the keepsyms=1 boot argument to see debug symbols in the panic log. In cases where it is not present, the kpdescribe.sh utility (bundled with OpenCore) may be used to partially recover the stacktrace.

    Development and debug kernels produce more useful kernel panic logs. Consider downloading and installing the KernelDebugKit from developer.apple.com when debugging a problem. To activate a development kernel, the boot argument kcsuffix=development should be added. Use the uname -a command to ensure that the current loaded kernel is a development (or a debug) kernel.

    In cases where the OpenCore kernel panic saving mechanism is not used, kernel panic logs may still be found in the /Library/Logs/DiagnosticReports directory.

    Starting with macOS Catalina, kernel panics are stored in JSON format and thus need to be preprocessed before passing to kpdescribe.sh:

    
         cat Kernel.panic | grep macOSProcessedStackshotData |
             python3 -c 'import json,sys;print(json.load(sys.stdin)["macOSPanicString"])'
    
  3. DisableWatchDog Type: plist boolean Failsafe: false Description: Some types of firmware may not succeed in booting the operating system quickly, especially in debug mode. This results in the watchdog timer aborting the process. This option turns off the watchdog timer.

  4. DisplayDelay Type: plist integer Failsafe: 0 Description: Delay in microseconds executed after every printed line visible onscreen (i.e. console).

  5. DisplayLevel Type: plist integer, 64 bit Failsafe: 0 Description: EDK II debug level bitmask (sum) showed onscreen. Unless Target enables console (onscreen) printing, onscreen debug output will not be visible. The following levels are supported (discover more in DebugLib.h):

    • 0x00000002 (bit 1) — DEBUG_WARN in DEBUG, NOOPT, RELEASE.
    • 0x00000040 (bit 6) — DEBUG_INFO in DEBUG, NOOPT.
    • 0x00400000 (bit 22) — DEBUG_VERBOSE in custom builds.
    • 0x80000000 (bit 31) — DEBUG_ERROR in DEBUG, NOOPT, RELEASE.
  6. LogModules Type: plist string Failsafe: * Description: Filter log entries by module.

    This option filters logging generated by specific modules, both in the log and onscreen. Two modes are supported:

    • + - Positive filtering: Only present selected modules.
    • - - Negative filtering: Exclude selected modules.

    When multiple ones are selected, comma (,) should be used as the splitter. For instance, +OCCPU,OCA,OCB means only OCCPU, OCA, OCB being printed, while -OCCPU,OCA,OCB indicates these modules being filtered out (i.e. not logged). When no symbol is specified, positive filtering (+) will be used. * indicates all modules being logged.

    Note 1: Acronyms of libraries can be found in the Libraries section below.

    Note 2: Messages printed before the configuration of log protocol cannot be filtered.

  7. SysReport Type: plist boolean Failsafe: false Description: Produce system report on ESP folder.

    This option will create a SysReport directory in the ESP partition unless already present. The directory will contain ACPI, SMBIOS, and audio codec dumps. Audio codec dumps require an audio backend driver to be loaded.

    Note: To maintain system integrity, the SysReport option is not available in RELEASE builds. Use a DEBUG build if this option is required.

  8. Target Type: plist integer Failsafe: 0 Description: A bitmask (sum) of enabled logging targets. Logging output is hidden by default and this option must be set when such output is required, such as when debugging.

    The following logging targets are supported:

    • 0x01 (bit 0) — Enable logging, otherwise all log is discarded. - 0x02 (bit 1) — Enable basic console (onscreen) logging.
    • 0x04 (bit 2) — Enable logging to Data Hub.
    • 0x08 (bit 3) — Enable serial port logging.
    • 0x10 (bit 4) — Enable UEFI variable logging.
    • 0x20 (bit 5) — Enable non-volatile UEFI variable logging.
    • 0x40 (bit 6) — Enable logging to file.
    • 0x80 (bit 7) — In combination with 0x40, enable faster but unsafe (see Warning 2 below) file logging.

    Console logging prints less than the other variants. Depending on the build type (RELEASE, DEBUG, or NOOPT) different amount of logging may be read (from least to most).

    To obtain Data Hub logs, use the following command in macOS (Note that Data Hub logs do not log kernel and kext patches):

     ioreg -lw0 -p IODeviceTree | grep boot-log | sort | sed 's/.*<\(.*\)>.*/\1/' | xxd -r -p
    

    UEFI variable log does not include some messages and has no performance data. To maintain system integrity, the log size is limited to 32 kilobytes. Some types of firmware may truncate it much earlier or drop completely if they have no memory. Using the non-volatile flag will cause the log to be written to NVRAM flash after every printed line.

    To obtain UEFI variable logs, use the following command in macOS:

     nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-log | awk '{gsub(/%0d%0a%00/,"");gsub(/%0d%0a/,"\n")}1'
    

    Warning 1: Certain firmware appear to have defective NVRAM garbage collection. As a result, they may not be able to always free space after variable deletion. Do not enable non-volatile NVRAM logging on such devices unless specifically required.

    While the OpenCore boot log already contains basic version information including build type and date, this information may also be found in the opencore-version NVRAM variable even when boot logging is disabled.

    File logging will create a file named opencore-YYYY-MM-DD-HHMMSS.txt (in UTC) under the EFI volume root with log contents (the upper case letter sequence is replaced with date and time from the firmware). Please be warned that some file system drivers present in firmware are not reliable and may corrupt data when writing files through UEFI. Log writing is attempted in the safest manner and thus, is very slow. Ensure that DisableWatchDog is set to true when a slow drive is used. Try to avoid frequent use of this option when dealing with flash drives as large I/O amounts may speed up memory wear and render the flash drive unusable quicker.

    Warning 2: It is possible to enable fast file logging, which requires a fully compliant firmware FAT32 driver. On drivers with incorrect FAT32 write support (e.g. APTIO IV, but maybe others) this setting can result in corruption up to and including an unusable ESP filesystem, therefore be prepared to recreate the ESP partition and all of its contents if testing this option. This option can increase logging speed significantly on some suitable firmware, but may make little speed difference on some others.

    When interpreting the log, note that the lines are prefixed with a tag describing the relevant location (module) of the log line allowing better attribution of the line to the functionality.

    The list of currently used tags is as follows.

    ### Drivers and tools

    • BMF — OpenCanopy, bitmap font
    • BS — Bootstrap
    • GSTT — GoptStop
    • HDA — AudioDxe
    • KKT — KeyTester
    • LNX — OpenLinuxBoot
    • MMDD — MmapDump
    • OCPAVP — PavpProvision
    • OCRST — ResetSystem
    • OCUI — OpenCanopy
    • OC — OpenCore main, also OcMainLib
    • VMOPT — VerifyMemOpt

    ### Libraries

    • AAPL — OcLogAggregatorLib, Apple EfiBoot logging
    • OCABC — OcAfterBootCompatLib
    • OCAE — OcAppleEventLib
    • OCAK — OcAppleKernelLib
    • OCAU — OcAudioLib
    • OCA —- OcAcpiLib
    • OCBP — OcAppleBootPolicyLib
    • OCB — OcBootManagementLib
    • OCLBT — OcBlitLib
    • OCCL — OcAppleChunkListLib
    • OCCPU — OcCpuLib
    • OCC — OcConsoleLib
    • OCDC — OcDriverConnectionLib
    • OCDH — OcDataHubLib
    • OCDI — OcAppleDiskImageLib
    • OCDM — OcDeviceMiscLib
    • OCFS — OcFileLib
    • OCFV — OcFirmwareVolumeLib
    • OCHS — OcHashServicesLib
    • OCI4 — OcAppleImg4Lib
    • OCIC — OcImageConversionLib
    • OCII — OcInputLib
    • OCJS — OcApfsLib
    • OCKM — OcAppleKeyMapLib
    • OCL — OcLogAggregatorLib
    • OCM — OcMiscLib
    • OCMCO — OcMachoLib
    • OCME — OcHeciLib
    • OCMM — OcMemoryLib
    • OCPE — OcPeCoffLib, OcPeCoffExtLib
    • OCPI — OcFileLib, partition info
    • OCPNG — OcPngLib
    • OCRAM — OcAppleRamDiskLib
    • OCRTC — OcRtcLib
    • OCSB — OcAppleSecureBootLib
    • OCSMB — OcSmbiosLib
    • OCSMC — OcSmcLib
    • OCST — OcStorageLib
    • OCS — OcSerializedLib
    • OCTPL — OcTemplateLib
    • OCUC — OcUnicodeCollationLib
    • OCUT — OcAppleUserInterfaceThemeLib
    • OCVAR — OcVariableLib
    • OCXML — OcXmlLib