Author: hpoussin
Date: Sat Nov 29 21:43:39 2014
New Revision: 65529
URL:
http://svn.reactos.org/svn/reactos?rev=65529&view=rev
Log:
[NTOS:CC] Add some debug prints
Modified:
trunk/reactos/ntoskrnl/cc/cacheman.c
trunk/reactos/ntoskrnl/cc/copy.c
trunk/reactos/ntoskrnl/cc/fs.c
trunk/reactos/ntoskrnl/cc/mdl.c
trunk/reactos/ntoskrnl/cc/pin.c
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/include/internal/cc.h
Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/cacheman.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/cacheman.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/cacheman.c [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -101,6 +101,9 @@
IN BOOLEAN DisableWriteBehind
)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p DisableReadAhead=%d
DisableWriteBehind=%d\n",
+ FileObject, DisableReadAhead, DisableWriteBehind);
+
UNIMPLEMENTED;
}
@@ -114,6 +117,9 @@
IN PVOID Owner
)
{
+ CCTRACE(CC_API_DEBUG, "Bcb=%p Owner=%p\n",
+ Bcb, Owner);
+
UNIMPLEMENTED;
}
@@ -127,6 +133,9 @@
IN ULONG DirtyPageThreshold
)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p DirtyPageThreshold=%lu\n",
+ FileObject, DirtyPageThreshold);
+
UNIMPLEMENTED;
}
@@ -140,5 +149,8 @@
IN ULONG Granularity
)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p Granularity=%lu\n",
+ FileObject, Granularity);
+
UNIMPLEMENTED;
}
Modified: trunk/reactos/ntoskrnl/cc/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=655…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -26,6 +26,7 @@
CcOperationZero
} CC_COPY_OPERATION;
+ULONG CcRosTraceLevel = 0;
ULONG CcFastMdlReadWait;
ULONG CcFastMdlReadNotPossible;
ULONG CcFastReadNotPossible;
@@ -339,6 +340,8 @@
IN BOOLEAN Wait,
IN BOOLEAN Retrying)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p BytesToWrite=%lu Wait=%d
Retrying=%d\n",
+ FileObject, BytesToWrite, Wait, Retrying);
UNIMPLEMENTED;
return FALSE;
}
@@ -356,6 +359,9 @@
OUT PVOID Buffer,
OUT PIO_STATUS_BLOCK IoStatus)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu
Wait=%d\n",
+ FileObject, FileOffset->QuadPart, Length, Wait);
+
DPRINT("CcCopyRead(FileObject 0x%p, FileOffset %I64x, "
"Length %lu, Wait %u, Buffer 0x%p, IoStatus 0x%p)\n",
FileObject, FileOffset->QuadPart, Length, Wait,
@@ -384,6 +390,9 @@
{
IO_STATUS_BLOCK IoStatus;
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu Wait=%d
Buffer=%p\n",
+ FileObject, FileOffset->QuadPart, Length, Wait, Buffer);
+
DPRINT("CcCopyWrite(FileObject 0x%p, FileOffset %I64x, "
"Length %lu, Wait %u, Buffer 0x%p)\n",
FileObject, FileOffset->QuadPart, Length, Wait, Buffer);
@@ -410,6 +419,9 @@
IN ULONG BytesToWrite,
IN BOOLEAN Retrying)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p PostRoutine=%p Context1=%p Context2=%p
BytesToWrite=%lu Retrying=%d\n",
+ FileObject, PostRoutine, Context1, Context2, BytesToWrite, Retrying);
+
UNIMPLEMENTED;
}
@@ -426,6 +438,9 @@
OUT PVOID Buffer,
OUT PIO_STATUS_BLOCK IoStatus)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%lu Length=%lu PageCount=%lu
Buffer=%p\n",
+ FileObject, FileOffset, Length, PageCount, Buffer);
+
UNIMPLEMENTED;
}
/*
@@ -439,6 +454,9 @@
IN ULONG Length,
IN PVOID Buffer)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%lu Length=%lu
Buffer=%p\n",
+ FileObject, FileOffset, Length, Buffer);
+
UNIMPLEMENTED;
}
@@ -474,6 +492,9 @@
IO_STATUS_BLOCK Iosb;
KEVENT Event;
+ CCTRACE(CC_API_DEBUG, "FileObject=%p StartOffset=%I64u EndOffset=%I64u
Wait=%d\n",
+ FileObject, StartOffset->QuadPart, EndOffset->QuadPart, Wait);
+
DPRINT("CcZeroData(FileObject 0x%p, StartOffset %I64x, EndOffset %I64x, "
"Wait %u)\n", FileObject, StartOffset->QuadPart,
EndOffset->QuadPart,
Wait);
Modified: trunk/reactos/ntoskrnl/cc/fs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=65529…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -38,6 +38,10 @@
IN PVOID Context2)
{
LARGE_INTEGER i;
+
+ CCTRACE(CC_API_DEBUG, "LogHandle=%p DirtyPageRoutine=%p Context1=%p
Context2=%p\n",
+ LogHandle, DirtyPageRoutine, Context1, Context2);
+
UNIMPLEMENTED;
i.QuadPart = 0;
return i;
@@ -52,6 +56,9 @@
IN PVOID Bcb)
{
PINTERNAL_BCB iBcb = (PINTERNAL_BCB)Bcb;
+
+ CCTRACE(CC_API_DEBUG, "Bcb=%p\n", Bcb);
+
return iBcb->Vacb->SharedCacheMap->FileObject;
}
@@ -65,6 +72,9 @@
OUT PLARGE_INTEGER OldestLsn OPTIONAL)
{
LARGE_INTEGER i;
+
+ CCTRACE(CC_API_DEBUG, "FileObject=%p\n", FileObject);
+
UNIMPLEMENTED;
i.QuadPart = 0;
return i;
@@ -84,6 +94,9 @@
{
ASSERT(FileObject);
ASSERT(FileSizes);
+
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileSizes=%p PinAccess=%d CallBacks=%p
LazyWriterContext=%p\n",
+ FileObject, FileSizes, PinAccess, CallBacks, LazyWriterContext);
/* Call old ROS cache init function */
CcRosInitializeFileCache(FileObject,
@@ -100,6 +113,8 @@
CcIsThereDirtyData (
IN PVPB Vpb)
{
+ CCTRACE(CC_API_DEBUG, "Vpb=%p\n", Vpb);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -115,6 +130,9 @@
IN ULONG Length,
IN BOOLEAN UninitializeCacheMaps)
{
+ CCTRACE(CC_API_DEBUG, "SectionObjectPointer=%p\n FileOffset=%p Length=%lu
UninitializeCacheMaps=%d",
+ SectionObjectPointer, FileOffset, Length, UninitializeCacheMaps);
+
//UNIMPLEMENTED;
return FALSE;
}
@@ -134,6 +152,9 @@
PROS_VACB current;
LIST_ENTRY FreeListHead;
NTSTATUS Status;
+
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileSizes=%p\n",
+ FileObject, FileSizes);
DPRINT("CcSetFileSizes(FileObject 0x%p, FileSizes 0x%p)\n",
FileObject, FileSizes);
@@ -222,6 +243,9 @@
IN PVOID LogHandle,
IN PFLUSH_TO_LSN FlushToLsnRoutine)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p LogHandle=%p FlushToLsnRoutine=%p\n",
+ FileObject, LogHandle, FlushToLsnRoutine);
+
UNIMPLEMENTED;
}
@@ -236,6 +260,9 @@
IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL)
{
NTSTATUS Status;
+
+ CCTRACE(CC_API_DEBUG, "FileObject=%p TruncateSize=%p
UninitializeCompleteEvent=%p\n",
+ FileObject, TruncateSize, UninitializeCompleteEvent);
Status = CcRosReleaseFileCache(FileObject);
if (UninitializeCompleteEvent)
Modified: trunk/reactos/ntoskrnl/cc/mdl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/mdl.c?rev=6552…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/mdl.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/mdl.c [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -28,6 +28,9 @@
OUT PIO_STATUS_BLOCK IoStatus
)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu\n",
+ FileObject, FileOffset->QuadPart, Length);
+
UNIMPLEMENTED;
}
@@ -173,5 +176,8 @@
OUT PMDL * MdlChain,
OUT PIO_STATUS_BLOCK IoStatus)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu\n",
+ FileObject, FileOffset->QuadPart, Length);
+
UNIMPLEMENTED;
}
Modified: trunk/reactos/ntoskrnl/cc/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/pin.c?rev=6552…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -59,6 +59,8 @@
if (ReadOffset % VACB_MAPPING_GRANULARITY + Length > VACB_MAPPING_GRANULARITY)
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx
-> FALSE\n",
+ FileObject, FileOffset, Length, Flags);
return FALSE;
}
@@ -70,6 +72,8 @@
&Vacb);
if (!NT_SUCCESS(Status))
{
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx
-> FALSE\n",
+ FileObject, FileOffset, Length, Flags);
return FALSE;
}
@@ -78,12 +82,16 @@
if (!(Flags & MAP_WAIT))
{
CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu
Flags=0x%lx -> FALSE\n",
+ FileObject, FileOffset, Length, Flags);
return FALSE;
}
if (!NT_SUCCESS(CcReadVirtualAddress(Vacb)))
{
CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu
Flags=0x%lx -> FALSE\n",
+ FileObject, FileOffset, Length, Flags);
return FALSE;
}
}
@@ -93,6 +101,8 @@
if (iBcb == NULL)
{
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx
-> FALSE\n",
+ FileObject, FileOffset, Length, Flags);
return FALSE;
}
@@ -106,6 +116,8 @@
iBcb->RefCount = 1;
*pBcb = (PVOID)iBcb;
+ CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx ->
TRUE Bcb=%p\n",
+ FileObject, FileOffset, Length, Flags, iBcb);
return TRUE;
}
@@ -121,6 +133,9 @@
IN ULONG Flags,
OUT PVOID * Bcb)
{
+ CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu
Flags=0x%lx\n",
+ FileObject, FileOffset, Length, Flags);
+
/* no-op for current implementation. */
return TRUE;
}
@@ -138,6 +153,9 @@
OUT PVOID * Bcb,
OUT PVOID * Buffer)
{
+ CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu
Flags=0x%lx\n",
+ FileObject, FileOffset, Length, Flags);
+
if (CcMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer))
{
if (CcPinMappedData(FileObject, FileOffset, Length, Flags, Bcb))
@@ -162,6 +180,9 @@
OUT PVOID * Bcb,
OUT PVOID * Buffer)
{
+ CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu Zero=%d
Flags=0x%lx\n",
+ FileObject, FileOffset, Length, Zero, Flags);
+
/*
* FIXME: This is function is similar to CcPinRead, but doesn't
* read the data if they're not present. Instead it should just
@@ -182,6 +203,10 @@
IN PLARGE_INTEGER Lsn)
{
PINTERNAL_BCB iBcb = Bcb;
+
+ CCTRACE(CC_API_DEBUG, "Bcb=%p Lsn=%p\n",
+ Bcb, Lsn);
+
iBcb->Dirty = TRUE;
}
@@ -194,6 +219,8 @@
IN PVOID Bcb)
{
PINTERNAL_BCB iBcb = Bcb;
+
+ CCTRACE(CC_API_DEBUG, "Bcb=%p\n", Bcb);
CcRosReleaseVacb(iBcb->Vacb->SharedCacheMap,
iBcb->Vacb,
@@ -215,6 +242,8 @@
IN PVOID Bcb,
IN ERESOURCE_THREAD ResourceThreadId)
{
+ CCTRACE(CC_API_DEBUG, "Bcb=%p ResourceThreadId=%lu\n", Bcb,
ResourceThreadId);
+
UNIMPLEMENTED;
}
@@ -227,6 +256,9 @@
IN PVOID Bcb)
{
PINTERNAL_BCB iBcb = Bcb;
+
+ CCTRACE(CC_API_DEBUG, "Bcb=%p\n", Bcb);
+
iBcb->RefCount++;
}
@@ -241,6 +273,8 @@
IN PIO_STATUS_BLOCK IoStatus)
{
PINTERNAL_BCB iBcb = Bcb;
+
+ CCTRACE(CC_API_DEBUG, "Bcb=%p WriteThrough=%d\n", Bcb, WriteThrough);
IoStatus->Status = STATUS_SUCCESS;
if (--iBcb->RefCount == 0)
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=655…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -909,6 +909,9 @@
NTSTATUS Status;
KIRQL oldIrql;
+ CCTRACE(CC_API_DEBUG, "SectionObjectPointers=%p FileOffset=%p
Length=%lu\n",
+ SectionObjectPointers, FileOffset, Length);
+
DPRINT("CcFlushCache(SectionObjectPointers 0x%p, FileOffset 0x%p, Length %lu,
IoStatus 0x%p)\n",
SectionObjectPointers, FileOffset, Length, IoStatus);
@@ -1209,6 +1212,9 @@
IN PSECTION_OBJECT_POINTERS SectionObjectPointers)
{
PROS_SHARED_CACHE_MAP SharedCacheMap;
+
+ CCTRACE(CC_API_DEBUG, "SectionObjectPointers=%p\n",
SectionObjectPointers);
+
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
{
SharedCacheMap = SectionObjectPointers->SharedCacheMap;
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] Sat Nov 29 21:43:39 2014
@@ -1,4 +1,45 @@
#pragma once
+
+//
+// Define this if you want debugging support
+//
+#define _CC_DEBUG_ 0x00
+
+//
+// These define the Debug Masks Supported
+//
+#define CC_API_DEBUG 0x01
+
+//
+// Debug/Tracing support
+//
+#if _CC_DEBUG_
+#ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
+#define CCTRACE(x, ...) \
+ { \
+ DbgPrintEx("%s [%.16s] - ", \
+ __FUNCTION__, \
+ PsGetCurrentProcess()->ImageFileName); \
+ DbgPrintEx(__VA_ARGS__); \
+ }
+#else
+#define CCTRACE(x, ...) \
+ if (x & CcRosTraceLevel) \
+ { \
+ DbgPrint("%s [%.16s] - ", \
+ __FUNCTION__, \
+ PsGetCurrentProcess()->ImageFileName); \
+ DbgPrint(__VA_ARGS__); \
+ }
+#endif
+#else
+#define CCTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
+#endif
+
+//
+// Global Cc Data
+//
+extern ULONG CcRosTraceLevel;
typedef struct _PF_SCENARIO_ID
{