Skip to content

Commit

Permalink
Reduce debug messages, add some.
Browse files Browse the repository at this point in the history
  • Loading branch information
jief666 committed Jan 2, 2024
1 parent 432a459 commit d4ea30d
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Library/OcAfterBootCompatLib/ServiceOverrides.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ OcStartImage (
NULL,
NULL
);
DEBUG ((DEBUG_INFO, "OCABC: VMware Mac installed on %p - %r\n", ImageHandle, Status));
// DEBUG ((DEBUG_INFO, "OCABC: VMware Mac installed on %p - %r\n", ImageHandle, Status));

BootCompat->ServiceState.AppleHibernateWake = OcIsAppleHibernateWake ();
BootCompat->ServiceState.AppleCustomSlide = OcCheckArgumentFromEnv (
Expand Down
30 changes: 15 additions & 15 deletions Library/OcAppleBootPolicyLib/OcAppleBootPolicyLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ InternalGetApfsSpecialFileInfo (
return EFI_NOT_FOUND;
}

DEBUG ((
DEBUG_BULK_INFO,
"OCBP: APFS Volume Info - %p (%u, %g, %u)\n",
*VolumeInfo,
(*VolumeInfo)->Always1,
&(*VolumeInfo)->Uuid,
(*VolumeInfo)->Role
));
// DEBUG ((
// DEBUG_BULK_INFO,
// "OCBP: APFS Volume Info - %p (%u, %g, %u)\n",
// *VolumeInfo,
// (*VolumeInfo)->Always1,
// &(*VolumeInfo)->Uuid,
// (*VolumeInfo)->Role
// ));
}

if (ContainerInfo != NULL) {
Expand All @@ -226,13 +226,13 @@ InternalGetApfsSpecialFileInfo (
return EFI_NOT_FOUND;
}

DEBUG ((
DEBUG_BULK_INFO,
"OCBP: APFS Container Info - %p (%u, %g)\n",
*ContainerInfo,
(*ContainerInfo)->Always1,
&(*ContainerInfo)->Uuid
));
// DEBUG ((
// DEBUG_BULK_INFO,
// "OCBP: APFS Container Info - %p (%u, %g)\n",
// *ContainerInfo,
// (*ContainerInfo)->Always1,
// &(*ContainerInfo)->Uuid
// ));
}

return EFI_SUCCESS;
Expand Down
12 changes: 6 additions & 6 deletions Library/OcAppleEventLib/PointerHandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ InternalRegisterSimplePointerInterface (
SIMPLE_POINTER_INSTANCE *Instance;
UINTN Index;

DEBUG ((DEBUG_VERBOSE, "InternalRegisterSimplePointerInterface\n"));
// DEBUG ((DEBUG_VERBOSE, "InternalRegisterSimplePointerInterface\n"));

Instance = AllocateZeroPool (
(mNumberOfPointerProtocols + 1) * sizeof (*Instance)
Expand Down Expand Up @@ -303,7 +303,7 @@ EventSimplePointerDesctructor (
VOID
)
{
DEBUG ((DEBUG_VERBOSE, "EventSimplePointerDesctructor\n"));
// DEBUG ((DEBUG_VERBOSE, "EventSimplePointerDesctructor\n"));

if (mPointerProtocols != NULL) {
FreePool ((VOID *)mPointerProtocols);
Expand Down Expand Up @@ -333,7 +333,7 @@ InternalRemoveUninstalledInstances (
SIMPLE_POINTER_INSTANCE *NewInstances;
UINTN NumberOfMatches;

DEBUG ((DEBUG_VERBOSE, "InternalRemoveUninstalledInstances\n"));
// DEBUG ((DEBUG_VERBOSE, "InternalRemoveUninstalledInstances\n"));

OrgInstances = *InstancesPtr;

Expand Down Expand Up @@ -426,7 +426,7 @@ InternalSimplePointerInstallNotifyFunction (
UINTN Index;
EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;

DEBUG ((DEBUG_VERBOSE, "InternalSimplePointerInstallNotifyFunction\n"));
// DEBUG ((DEBUG_VERBOSE, "InternalSimplePointerInstallNotifyFunction\n"));

if (Event != NULL) {
Status = gBS->LocateHandleBuffer (
Expand Down Expand Up @@ -471,7 +471,7 @@ EventCreateSimplePointerInstallNotifyEvent (
{
EFI_STATUS Status;

DEBUG ((DEBUG_VERBOSE, "EventCreateSimplePointerInstallNotifyEvent\n"));
// DEBUG ((DEBUG_VERBOSE, "EventCreateSimplePointerInstallNotifyEvent\n"));

Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
Expand Down Expand Up @@ -506,7 +506,7 @@ EventCloseSimplePointerInstallNotifyEvent (
VOID
)
{
DEBUG ((DEBUG_VERBOSE, "EventCloseSimplePointerInstallNotifyEvent\n"));
// DEBUG ((DEBUG_VERBOSE, "EventCloseSimplePointerInstallNotifyEvent\n"));

if (mSimplePointerInstallNotifyEvent != NULL) {
gBS->CloseEvent (mSimplePointerInstallNotifyEvent);
Expand Down
14 changes: 7 additions & 7 deletions Library/OcAppleKernelLib/Link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,13 +1762,13 @@ InternalPrelinkKext (
));
return EFI_LOAD_ERROR;
} else {
DEBUG ((
DEBUG_VERBOSE,
"OCAK: Symbol %a was resolved for kext %a to %Lx\n",
MachoGetSymbolName (MachoContext, Symbol),
Kext->Identifier,
Context->Is32Bit ? Symbol->Symbol32.Value : Symbol->Symbol64.Value
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCAK: Symbol %a was resolved for kext %a to %Lx\n",
// MachoGetSymbolName (MachoContext, Symbol),
// Kext->Identifier,
// Context->Is32Bit ? Symbol->Symbol32.Value : Symbol->Symbol64.Value
// ));
}
}

Expand Down
6 changes: 3 additions & 3 deletions Library/OcAppleKernelLib/PrelinkedKext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ InternalScanPrelinkedKext (
continue;
}

DEBUG ((DEBUG_VERBOSE, "OCAK: Checking dependency %a for kext %a\n", DependencyId, Kext->Identifier));
// DEBUG ((DEBUG_VERBOSE, "OCAK: Checking dependency %a for kext %a\n", DependencyId, Kext->Identifier));

//
// In 11.0 KPIs just like plist-only kexts are not present in memory and their
Expand All @@ -1039,7 +1039,7 @@ InternalScanPrelinkedKext (
if ( Context->IsKernelCollection
&& (AsciiStrnCmp (DependencyId, "com.apple.kpi.", L_STR_LEN ("com.apple.kpi.")) == 0))
{
DEBUG ((DEBUG_VERBOSE, "OCAK: Ignoring KPI %a for kext %a in KC/state mode\n", DependencyId, Kext->Identifier));
// DEBUG ((DEBUG_VERBOSE, "OCAK: Ignoring KPI %a for kext %a in KC/state mode\n", DependencyId, Kext->Identifier));
continue;
}

Expand All @@ -1049,7 +1049,7 @@ InternalScanPrelinkedKext (
//
DependencyKext = InternalCachedPrelinkedKext (Context, DependencyId);
if (DependencyKext == NULL) {
DEBUG ((DEBUG_INFO, "OCAK: Dependency %a was not found for kext %a\n", DependencyId, Kext->Identifier));
// DEBUG ((DEBUG_INFO, "OCAK: Dependency %a was not found for kext %a\n", DependencyId, Kext->Identifier));

DependencyKext = InternalGetQuirkDependencyKext (DependencyId, Context);
if (DependencyKext == NULL) {
Expand Down
6 changes: 3 additions & 3 deletions Library/OcCpuLib/OcCpuLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ OcCpuCorrectTscSync (
BOOLEAN InterruptState;

if (Cpu->ThreadCount <= 1) {
DEBUG ((DEBUG_INFO, "OCCPU: Thread count is too low for sync - %u\n", Cpu->ThreadCount));
DEBUG ((DEBUG_ERROR, "OCCPU: Thread count is too low for sync - %u\n", Cpu->ThreadCount));
return EFI_UNSUPPORTED;
}

Expand All @@ -1309,7 +1309,7 @@ OcCpuCorrectTscSync (
);

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCCPU: Failed to find mp services - %r\n", Status));
DEBUG ((DEBUG_ERROR, "OCCPU: Failed to find mp services - %r\n", Status));
return Status;
}
}
Expand Down Expand Up @@ -1343,7 +1343,7 @@ OcCpuCorrectTscSync (
SetInterruptState (InterruptState);
gBS->RestoreTPL (OldTpl);

DEBUG ((DEBUG_INFO, "OCCPU: Completed TSC sync with code - %r\n", Status));
DEBUG ((DEBUG_ERROR, "OCCPU: Completed TSC sync with code - %r\n", Status));

return Status;
}
Expand Down
2 changes: 1 addition & 1 deletion Library/OcDeviceMiscLib/SetResizableBar.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ ResizeGpuBarsPciIo (
continue;
}

DEBUG ((DEBUG_VERBOSE, "OCDM: PCI device %u/%u has class %X\n", Index+1, HandleCount, ClassCode));
// DEBUG ((DEBUG_VERBOSE, "OCDM: PCI device %u/%u has class %X\n", Index+1, HandleCount, ClassCode));

if (ClassCode.BaseCode != PCI_CLASS_DISPLAY) {
continue;
Expand Down
128 changes: 64 additions & 64 deletions Library/OcMachoLib/HeaderX.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ MACH_X (
return 0;
}

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Src segment offset 0x%X size 0x%X delta 0x%X\n",
Segment->FileOffset,
Segment->FileSize,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Src segment offset 0x%X size 0x%X delta 0x%X\n",
// Segment->FileOffset,
// Segment->FileSize,
// CurrentDelta
// ));

//
// Align delta by x86 page size, this is what our lib expects.
Expand Down Expand Up @@ -459,13 +459,13 @@ MACH_X (

SegmentOffset = DstSegment->FileOffset + CurrentDelta;

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Dst segment offset 0x%X size 0x%X delta 0x%X\n",
SegmentOffset,
DstSegment->Size,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Dst segment offset 0x%X size 0x%X delta 0x%X\n",
// SegmentOffset,
// DstSegment->Size,
// CurrentDelta
// ));

if (!IsObject && (DstSegment->VirtualAddress - SegmentOffset != FirstSegment->VirtualAddress)) {
return 0;
Expand Down Expand Up @@ -552,14 +552,14 @@ MACH_X (
for (Index = 0; Index < DstSegment->NumSections; ++Index) {
SectionOffset = DstSegment->Sections[Index].Offset;

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Src section %u offset 0x%X size 0x%X delta 0x%X\n",
Index,
SectionOffset,
DstSegment->Sections[Index].Size,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Src section %u offset 0x%X size 0x%X delta 0x%X\n",
// Index,
// SectionOffset,
// DstSegment->Sections[Index].Size,
// CurrentDelta
// ));

//
// Allocate space for zero offset sections.
Expand All @@ -574,14 +574,14 @@ MACH_X (
CopyFileOffset = SectionOffset + DstSegment->Sections[Index].Size;
}

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Dst section %u offset 0x%X size 0x%X delta 0x%X\n",
Index,
SectionOffset,
DstSegment->Sections[Index].Size,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Dst section %u offset 0x%X size 0x%X delta 0x%X\n",
// Index,
// SectionOffset,
// DstSegment->Sections[Index].Size,
// CurrentDelta
// ));

if (!CalculateSizeOnly) {
DstSegment->Sections[Index].Offset = SectionOffset;
Expand Down Expand Up @@ -617,14 +617,14 @@ MACH_X (
SectionOffset = DstSegment->Sections[Index].RelocationsOffset;

if (SectionOffset != 0) {
DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Src section %u relocs offset 0x%X count %u delta 0x%X\n",
Index,
SectionOffset,
DstSegment->Sections[Index].NumRelocations,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Src section %u relocs offset 0x%X count %u delta 0x%X\n",
// Index,
// SectionOffset,
// DstSegment->Sections[Index].NumRelocations,
// CurrentDelta
// ));

CopyFileOffset = SectionOffset;
RelocationsSize = DstSegment->Sections[Index].NumRelocations * sizeof (MACH_RELOCATION_INFO);
Expand All @@ -639,14 +639,14 @@ MACH_X (

SectionOffset += CurrentDelta;

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Dst section %u relocs offset 0x%X count %u delta 0x%X\n",
Index,
SectionOffset,
DstSegment->Sections[Index].NumRelocations,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Dst section %u relocs offset 0x%X count %u delta 0x%X\n",
// Index,
// SectionOffset,
// DstSegment->Sections[Index].NumRelocations,
// CurrentDelta
// ));

if (!CalculateSizeOnly) {
DstSegment->Sections[Index].RelocationsOffset = SectionOffset;
Expand All @@ -670,15 +670,15 @@ MACH_X (
SymbolsOffset = Symtab->SymbolsOffset;
StringsOffset = Symtab->StringsOffset;

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Src symtab 0x%X (%u symbols), strings 0x%X (size 0x%X) delta 0x%X\n",
SymbolsOffset,
Symtab->NumSymbols,
StringsOffset,
Symtab->StringsSize,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Src symtab 0x%X (%u symbols), strings 0x%X (size 0x%X) delta 0x%X\n",
// SymbolsOffset,
// Symtab->NumSymbols,
// StringsOffset,
// Symtab->StringsSize,
// CurrentDelta
// ));

if (!CalculateSizeOnly) {
Symtab = (MACH_SYMTAB_COMMAND *)((UINT8 *)Symtab - Source + Destination);
Expand Down Expand Up @@ -726,15 +726,15 @@ MACH_X (
}
}

DEBUG ((
DEBUG_VERBOSE,
"OCMCO: Dst symtab 0x%X (%u symbols), strings 0x%X (size 0x%X) delta 0x%X\n",
SymbolsOffset,
Symtab->NumSymbols,
StringsOffset,
Symtab->StringsSize,
CurrentDelta
));
// DEBUG ((
// DEBUG_VERBOSE,
// "OCMCO: Dst symtab 0x%X (%u symbols), strings 0x%X (size 0x%X) delta 0x%X\n",
// SymbolsOffset,
// Symtab->NumSymbols,
// StringsOffset,
// Symtab->StringsSize,
// CurrentDelta
// ));
}
}

Expand Down
4 changes: 4 additions & 0 deletions Library/OcMainLib/OpenCoreAcpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ OcAcpiAddTables (
continue;
}

DEBUG ((DEBUG_INFO, "OC: add ACPI %a\n", TablePath));

Status = OcUnicodeSafeSPrint (FullPath, sizeof (FullPath), OPEN_CORE_ACPI_PATH "%a", TablePath);
if (EFI_ERROR (Status)) {
DEBUG ((
Expand Down Expand Up @@ -147,8 +149,10 @@ OcAcpiPatchTables (
UserPatch = Config->Acpi.Patch.Values[Index];

if (!UserPatch->Enabled) {
DEBUG ((DEBUG_INFO, "OC: Skipping disabled patch ACPI %a\n", OC_BLOB_GET(&Config->Acpi.Patch.Values[Index]->Comment)));
continue;
}
DEBUG ((DEBUG_INFO, "OC: Apply patch ACPI %a\n", OC_BLOB_GET(&Config->Acpi.Patch.Values[Index]->Comment)));

Comment = OC_BLOB_GET (&UserPatch->Comment);

Expand Down
Loading

0 comments on commit d4ea30d

Please sign in to comment.