Skip to content

Commit 35ca454

Browse files
[NTOSKRNL] Add missing \n to DPRINT() calls (reactos#6012)
Improve debug logs. - Add missing \n to DPRINT() calls - And demote/promote some DPRINT()/DPRINT1().
1 parent c1b8c4f commit 35ca454

5 files changed

Lines changed: 22 additions & 19 deletions

File tree

ntoskrnl/cc/view.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
/* INCLUDES ******************************************************************/
3434

3535
#include <ntoskrnl.h>
36+
3637
#define NDEBUG
3738
#include <debug.h>
3839

@@ -385,7 +386,7 @@ CcRosFlushDirtyPages (
385386
Locked = SharedCacheMap->Callbacks->AcquireForLazyWrite(SharedCacheMap->LazyWriteContext, Wait);
386387
if (!Locked)
387388
{
388-
DPRINT("Not locked!");
389+
DPRINT("Not locked\n");
389390
ASSERT(!Wait);
390391
CcRosVacbDecRefCount(current);
391392
OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
@@ -1038,7 +1039,7 @@ CcRosRequestVacb (
10381039

10391040
if (FileOffset % VACB_MAPPING_GRANULARITY != 0)
10401041
{
1041-
DPRINT1("Bad fileoffset %I64x should be multiple of %x",
1042+
DPRINT1("Bad FileOffset %I64x: should be multiple of %x\n",
10421043
FileOffset, VACB_MAPPING_GRANULARITY);
10431044
KeBugCheck(CACHE_MANAGER);
10441045
}

ntoskrnl/io/iomgr/irq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ IopConnectInterruptExFullySpecific(
189189
Parameters->FullySpecified.ShareVector,
190190
Parameters->FullySpecified.ProcessorEnableMask,
191191
Parameters->FullySpecified.FloatingSave);
192-
DPRINT("IopConnectInterruptEx_FullySpecific: has failed with status %X", Status);
192+
if (!NT_SUCCESS(Status))
193+
DPRINT1("IopConnectInterruptExFullySpecific() failed: 0x%lx\n", Status);
193194
return Status;
194195
}
195196

ntoskrnl/ke/amd64/cpu.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <ntoskrnl.h>
1313
#include <x86x64/Cpuid.h>
1414
#include <x86x64/Msr.h>
15+
1516
#define NDEBUG
1617
#include <debug.h>
1718

@@ -358,9 +359,9 @@ KiReportCpuFeatures(IN PKPRCB Prcb)
358359
CpuFeatures = CpuInfo.Edx;
359360
}
360361

361-
DPRINT1("Supported CPU features: ");
362+
DPRINT1("Supported CPU features:");
362363

363-
#define print_kf_bit(kf_value) if (Prcb->FeatureBits & kf_value) DbgPrint(#kf_value " ")
364+
#define print_kf_bit(kf_value) if (Prcb->FeatureBits & kf_value) DbgPrint(" " #kf_value)
364365
print_kf_bit(KF_SMEP);
365366
print_kf_bit(KF_RDTSC);
366367
print_kf_bit(KF_CR4);
@@ -405,7 +406,7 @@ KiReportCpuFeatures(IN PKPRCB Prcb)
405406
print_kf_bit(KF_SSE4_2);
406407
#undef print_kf_bit
407408

408-
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(#cpu_flag " ")
409+
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(" " #cpu_flag)
409410
print_cf(X86_FEATURE_PAE);
410411
print_cf(X86_FEATURE_HT);
411412
#undef print_cf

ntoskrnl/ke/i386/cpu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
/* INCLUDES *****************************************************************/
1010

1111
#include <ntoskrnl.h>
12+
#include <xmmintrin.h>
13+
1214
#define NDEBUG
1315
#include <debug.h>
1416

15-
#include <xmmintrin.h>
16-
1717
/* GLOBALS *******************************************************************/
1818

1919
/* The TSS to use for Double Fault Traps (INT 0x9) */
@@ -451,9 +451,9 @@ KiReportCpuFeatures(VOID)
451451
CpuFeatures = CpuInfo.Edx;
452452
}
453453

454-
DPRINT1("Supported CPU features: ");
454+
DPRINT1("Supported CPU features:");
455455

456-
#define print_kf_bit(kf_value) if (KeFeatureBits & kf_value) DbgPrint(#kf_value " ")
456+
#define print_kf_bit(kf_value) if (KeFeatureBits & kf_value) DbgPrint(" " #kf_value)
457457
print_kf_bit(KF_V86_VIS);
458458
print_kf_bit(KF_RDTSC);
459459
print_kf_bit(KF_CR4);
@@ -477,7 +477,7 @@ KiReportCpuFeatures(VOID)
477477
print_kf_bit(KF_NX_ENABLED);
478478
#undef print_kf_bit
479479

480-
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(#cpu_flag " ")
480+
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(" " #cpu_flag)
481481
print_cf(X86_FEATURE_PAE);
482482
print_cf(X86_FEATURE_APIC);
483483
print_cf(X86_FEATURE_HT);

ntoskrnl/se/srm.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/* INCLUDES *******************************************************************/
1111

1212
#include <ntoskrnl.h>
13+
1314
#define NDEBUG
1415
#include <debug.h>
1516

@@ -225,7 +226,7 @@ SeRmInitPhase1(VOID)
225226
2 * PAGE_SIZE);
226227
if (!NT_SUCCESS(Status))
227228
{
228-
DPRINT1("Security: Rm Create Command Port failed 0x%lx\n", Status);
229+
DPRINT1("Security: Rm Command Port creation failed: 0x%lx\n", Status);
229230
return FALSE;
230231
}
231232

@@ -239,7 +240,7 @@ SeRmInitPhase1(VOID)
239240
FALSE);
240241
if (!NT_VERIFY((NT_SUCCESS(Status))))
241242
{
242-
DPRINT1("Security: LSA init event creation failed.0x%xl\n", Status);
243+
DPRINT1("Security: LSA Init Event creation failed: 0x%lx\n", Status);
243244
return FALSE;
244245
}
245246

@@ -253,7 +254,7 @@ SeRmInitPhase1(VOID)
253254
NULL);
254255
if (!NT_SUCCESS(Status))
255256
{
256-
DPRINT1("Security: Rm Server Thread creation failed 0x%lx\n", Status);
257+
DPRINT1("Security: Rm Command Server Thread creation failed: 0x%lx\n", Status);
257258
return FALSE;
258259
}
259260

@@ -297,8 +298,7 @@ SepAdtInitializeBounds(VOID)
297298
(ListBounds.MinLength < 16) ||
298299
(ListBounds.MaxLength - ListBounds.MinLength < 16))
299300
{
300-
DPRINT1("ListBounds are invalid: %u, %u\n",
301-
ListBounds.MinLength, ListBounds.MaxLength);
301+
DPRINT1("ListBounds invalid: %lu, %lu\n", ListBounds.MinLength, ListBounds.MaxLength);
302302
return;
303303
}
304304

@@ -1149,7 +1149,7 @@ SepRmCommandServerThreadInit(VOID)
11491149
NULL);
11501150
if (!NT_SUCCESS(Status))
11511151
{
1152-
DPRINT1("Security Rm Init: Create Memory Section for LSA port failed: %X\n", Status);
1152+
DPRINT1("Security Rm Init: Create Memory Section for LSA port failed: 0x%lx\n", Status);
11531153
goto Cleanup;
11541154
}
11551155

@@ -1251,7 +1251,7 @@ SepRmCommandServerThread(
12511251
&Message.Header);
12521252
if (!NT_SUCCESS(Status))
12531253
{
1254-
DPRINT1("Failed to get message: 0x%lx", Status);
1254+
DPRINT1("Failed to get message: 0x%lx\n", Status);
12551255
ReplyMessage = NULL;
12561256
continue;
12571257
}
@@ -1283,7 +1283,7 @@ SepRmCommandServerThread(
12831283
/* Check if this is an actual request */
12841284
if (Message.Header.u2.s2.Type != LPC_REQUEST)
12851285
{
1286-
DPRINT1("SepRmCommandServerThread: unexpected message type: 0x%lx\n",
1286+
DPRINT1("SepRmCommandServerThread: unexpected message type: 0x%x\n",
12871287
Message.Header.u2.s2.Type);
12881288

12891289
/* Restart without replying */

0 commit comments

Comments
 (0)