Author: sir_richard
Date: Tue Nov 2 15:05:37 2010
New Revision: 49443
URL:
http://svn.reactos.org/svn/reactos?rev=49443&view=rev
Log:
[NTOS]: Define an array of MI_USAGE integers to track what a PFN is used for.
[NTOS]: Extend the MMPFN structure for ReactOS-specific PFN tracing mechanism.
[NTOS]: Add macros to track page usage and process/extra-data (not yet used).
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Tue Nov 2 15:05:37 2010
@@ -294,6 +294,43 @@
#endif
}
MM_RMAP_ENTRY, *PMM_RMAP_ENTRY;
+
+#if MI_TRACE_PFNS
+extern ULONG MI_PFN_CURRENT_USAGE;
+extern CHAR MI_PFN_CURRENT_PROCESS_NAME[16];
+#define MI_SET_USAGE(x) MI_PFN_CURRENT_USAGE = x
+#define MI_SET_PROCESS2(x) memcpy(MI_PFN_CURRENT_PROCESS_NAME, x, 16)
+#else
+#define MI_SET_USAGE(x)
+#define MI_SET_PROCESS2(x)
+#endif
+
+typedef enum _MI_PFN_USAGES
+{
+ MI_USAGE_NOT_SET = 0,
+ MI_USAGE_PAGED_POOL,
+ MI_USAGE_NONPAGED_POOL,
+ MI_USAGE_NONPAGED_POOL_EXPANSION,
+ MI_USAGE_KERNEL_STACK,
+ MI_USAGE_KERNEL_STACK_EXPANSION,
+ MI_USAGE_SYSTEM_PTE,
+ MI_USAGE_VAD,
+ MI_USAGE_PEB_TEB,
+ MI_USAGE_SECTION,
+ MI_USAGE_PAGE_TABLE,
+ MI_USAGE_PAGE_DIRECTORY,
+ MI_USAGE_LEGACY_PAGE_DIRECTORY,
+ MI_USAGE_DRIVER_PAGE,
+ MI_USAGE_CONTINOUS_ALLOCATION,
+ MI_USAGE_MDL,
+ MI_USAGE_DEMAND_ZERO,
+ MI_USAGE_ZERO_LOOP,
+ MI_USAGE_CACHE,
+ MI_USAGE_PFN_DATABASE,
+ MI_USAGE_BOOT_DRIVER,
+ MI_USAGE_INIT_MEMORY,
+ MI_USAGE_FREE_PAGE
+} MI_PFN_USAGES;
//
// These two mappings are actually used by Windows itself, based on the ASSERTS
@@ -362,6 +399,10 @@
ULONG_PTR MustBeCached:1;
};
} u4;
+#if MI_TRACE_PFNS
+ MI_PFN_USAGES PfnUsage;
+ CHAR ProcessName[16];
+#endif
} MMPFN, *PMMPFN;
extern PMMPFN MmPfnDatabase;