MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / AppleDebugLogPrint

Function AppleDebugLogPrint

Library/OcDebugLogLib/OcAppleLog.c:75–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73STATIC
74EFI_STATUS
75EFIAPI
76AppleDebugLogPrint (
77 IN CONST CHAR8 *Message
78 )
79{
80 OC_LOG_PROTOCOL *OcLog;
81 EFI_STATUS Status;
82 UINTN Length;
83 CHAR8 *NewLinePos;
84 APPLE_PERF_ENTRY *Entry;
85 UINT32 Index;
86
87 if (!mAppleDebugLogEnable) {
88 return FALSE;
89 }
90
91 OcLog = InternalGetOcLog ();
92 if (OcLog == NULL) {
93 return EFI_NOT_FOUND;
94 }
95
96 //
97 // Flush perf data.
98 //
99 if (mApplePerfBuffer != NULL
100 && mApplePerfBuffer->Signature == APPLE_PERF_DATA_SIGNATURE
101 && mApplePerfBuffer->NumberOfEntries > mApplePerfDumped) {
102 Entry = APPLE_PERF_FIRST_ENTRY (mApplePerfBuffer);
103
104 for (Index = 0; Index < mApplePerfBuffer->NumberOfEntries; ++Index) {
105 if (Index == mApplePerfDumped) {
106 AppleDebugLogPrintToOcLog (
107 OcLog,
108 "EBPF: [%u ms] %a\n",
109 (UINT32) Entry->TimestampMs,
110 Entry->EntryData
111 );
112 ++mApplePerfDumped;
113 }
114 Entry = APPLE_PERF_NEXT_ENTRY (Entry);
115 }
116 }
117
118 //
119 // Concatenate with the previous message.
120 //
121 Status = AsciiStrCatS (
122 mCurrentBuffer,
123 sizeof (mCurrentBuffer) - 1,
124 Message
125 );
126 if (EFI_ERROR(Status)) {
127 Length = AsciiStrLen (mCurrentBuffer);
128
129 if (Length > 0) {
130 //
131 // Flush the previous message.
132 //

Callers

nothing calls this directly

Calls 6

InternalGetOcLogFunction · 0.85
AsciiStrCatSFunction · 0.85
AsciiStrLenFunction · 0.85
AsciiStrCpySFunction · 0.85
CopyMemFunction · 0.50

Tested by

no test coverage detected