Author: pschweitzer
Date: Sat May 27 08:39:42 2017
New Revision: 74676
URL:
http://svn.reactos.org/svn/reactos?rev=74676&view=rev
Log:
[RXCE]
Implement reference tracing
CORE-11327
Modified:
trunk/reactos/sdk/include/ddk/fcb.h
trunk/reactos/sdk/lib/drivers/rxce/rxce.c
Modified: trunk/reactos/sdk/include/ddk/fcb.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/ddk/fcb.h?rev=…
==============================================================================
--- trunk/reactos/sdk/include/ddk/fcb.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/ddk/fcb.h [iso-8859-1] Sat May 27 08:39:42 2017
@@ -324,6 +324,7 @@
#define RDBSS_REF_TRACK_NETFOBX 0x00000008
#define RDBSS_REF_TRACK_NETFCB 0x00000010
#define RDBSS_REF_TRACK_SRVOPEN 0x00000020
+#define RX_PRINT_REF_TRACKING 0x40000000
extern ULONG RdbssReferenceTracingValue;
@@ -340,6 +341,14 @@
_In_ PCSTR FileName,
_In_ ULONG Line,
_In_ PVOID Instance);
+
+#define REF_TRACING_ON(TraceMask) (TraceMask & RdbssReferenceTracingValue)
+#define PRINT_REF_COUNT(TYPE, Count) \
+ if (REF_TRACING_ON( RDBSS_REF_TRACK_ ## TYPE) && \
+ (RdbssReferenceTracingValue & RX_PRINT_REF_TRACKING)) \
+ { \
+ DbgPrint("%ld\n", Count); \
+ }
#define RxReferenceSrvCall(SrvCall) \
RxpTrackReference(RDBSS_REF_TRACK_SRVCALL, __FILE__, __LINE__, SrvCall); \
Modified: trunk/reactos/sdk/lib/drivers/rxce/rxce.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/rxce/rxce.…
==============================================================================
--- trunk/reactos/sdk/lib/drivers/rxce/rxce.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/drivers/rxce/rxce.c [iso-8859-1] Sat May 27 08:39:42 2017
@@ -1718,16 +1718,29 @@
RefCount = InterlockedDecrement((volatile long *)&Node->NodeReferenceCount);
ASSERT(RefCount >= 0);
- /* TODO: trace */
+ /* Trace refcount */
switch (NodeType)
{
case RDBSS_NTC_SRVCALL:
+ PRINT_REF_COUNT(SRVCALL, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_NETROOT:
+ PRINT_REF_COUNT(NETROOT, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_V_NETROOT:
+ PRINT_REF_COUNT(VNETROOT, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_SRVOPEN:
+ PRINT_REF_COUNT(SRVOPEN, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_FOBX:
- UNIMPLEMENTED;
+ PRINT_REF_COUNT(NETFOBX, Node->NodeReferenceCount);
break;
+
default:
ASSERT(FALSE);
break;
@@ -4752,16 +4765,29 @@
Node = (PNODE_TYPE_AND_SIZE)Instance;
InterlockedIncrement((volatile long *)&Node->NodeReferenceCount);
- /* And that's not implemented! (yay, we leak :-D) */
+ /* Trace refcount if asked */
switch (NodeType)
{
case RDBSS_NTC_SRVCALL:
+ PRINT_REF_COUNT(SRVCALL, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_NETROOT:
+ PRINT_REF_COUNT(NETROOT, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_V_NETROOT:
+ PRINT_REF_COUNT(VNETROOT, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_SRVOPEN:
+ PRINT_REF_COUNT(SRVOPEN, Node->NodeReferenceCount);
+ break;
+
case RDBSS_NTC_FOBX:
- UNIMPLEMENTED;
+ PRINT_REF_COUNT(NETFOBX, Node->NodeReferenceCount);
break;
+
default:
ASSERT(FALSE);
break;