Author: tfaber
Date: Mon May 22 13:30:44 2017
New Revision: 74626
URL:
http://svn.reactos.org/svn/reactos?rev=74626&view=rev
Log:
[NTOS:MM]
- Make PFN tracing work... somewhat
Modified:
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
trunk/reactos/ntoskrnl/mm/ARM3/section.c
trunk/reactos/ntoskrnl/mm/ARM3/session.c
trunk/reactos/ntoskrnl/mm/ARM3/special.c
trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=746…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Mon May 22 13:30:44 2017
@@ -607,6 +607,7 @@
{
PFN_NUMBER PageFrameNumber;
+ MI_SET_USAGE(MI_USAGE_CACHE);
Status = MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &PageFrameNumber);
if (PageFrameNumber == 0)
{
@@ -741,8 +742,15 @@
PWCHAR pos = NULL;
ULONG len = 0;
pos = wcsrchr(SharedCacheMap->FileObject->FileName.Buffer, '\\');
- len = wcslen(pos) * sizeof(WCHAR);
- if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S",
pos);
+ if (pos)
+ {
+ len = wcslen(pos) * sizeof(WCHAR);
+ snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S", pos);
+ }
+ else
+ {
+ snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%wZ",
&SharedCacheMap->FileObject->FileName);
+ }
}
#endif
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Mon May 22 13:30:44 2017
@@ -653,8 +653,9 @@
if (UserPdeFault) MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
if (!UserPdeFault) MI_SET_USAGE(MI_USAGE_DEMAND_ZERO);
#endif
- if (Process) MI_SET_PROCESS2(Process->ImageFileName);
- if (!Process) MI_SET_PROCESS2("Kernel Demand 0");
+ if (Process == HYDRA_PROCESS) MI_SET_PROCESS2("Hydra");
+ else if (Process) MI_SET_PROCESS2(Process->ImageFileName);
+ else MI_SET_PROCESS2("Kernel Demand 0");
/* Do we need a zero page? */
if (Color != 0xFFFFFFFF)
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Mon May 22 13:30:44 2017
@@ -994,6 +994,8 @@
/* Acquire the PFN lock and grab a zero page */
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
+ MI_SET_PROCESS2(PsGetCurrentProcess()->ImageFileName);
Color = (++MmSessionSpace->Color) & MmSecondaryColorMask;
PageFrameNumber = MiRemoveZeroPage(Color);
TempPde.u.Hard.PageFrameNumber = PageFrameNumber;
Modified: trunk/reactos/ntoskrnl/mm/ARM3/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/session.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] Mon May 22 13:30:44 2017
@@ -511,6 +511,7 @@
if (AllocatedPageTable != FALSE)
{
/* Get a zeroed colored zero page */
+ MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
Color = MI_GET_NEXT_COLOR();
PageFrameIndex = MiRemoveZeroPageSafe(Color);
if (!PageFrameIndex)
@@ -542,6 +543,7 @@
}
/* Get a zeroed colored zero page */
+ MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
Color = MI_GET_NEXT_COLOR();
PageFrameIndex = MiRemoveZeroPageSafe(Color);
if (!PageFrameIndex)
@@ -679,6 +681,7 @@
for (i = 0; i < MiSessionDataPages; i++)
{
/* Get a zeroed colored zero page */
+ MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
Color = MI_GET_NEXT_COLOR();
DataPage[i] = MiRemoveZeroPageSafe(Color);
if (!DataPage[i])
@@ -701,6 +704,7 @@
SessionGlobal = MiPteToAddress(SessionPte);
/* Get a zeroed colored zero page */
+ MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
Color = MI_GET_NEXT_COLOR();
SessionPageDirIndex = MiRemoveZeroPageSafe(Color);
if (!SessionPageDirIndex)
@@ -742,6 +746,7 @@
for (i = 0; i < MiSessionTagPages; i++)
{
/* Grab a zeroed colored page */
+ MI_SET_USAGE(MI_USAGE_INIT_MEMORY);
Color = MI_GET_NEXT_COLOR();
TagPage[i] = MiRemoveZeroPageSafe(Color);
if (!TagPage[i])
Modified: trunk/reactos/ntoskrnl/mm/ARM3/special.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/special.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/special.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/special.c [iso-8859-1] Mon May 22 13:30:44 2017
@@ -328,6 +328,15 @@
MiSpecialPoolFirstPte = MmSystemPteBase + PointerPte->u.List.NextEntry;
/* Allocate a physical page */
+ if (PoolType == PagedPool)
+ {
+ MI_SET_USAGE(MI_USAGE_PAGED_POOL);
+ }
+ else
+ {
+ MI_SET_USAGE(MI_USAGE_NONPAGED_POOL);
+ }
+ MI_SET_PROCESS2("Kernel-Special");
PageFrameNumber = MiRemoveAnyPage(MI_GET_NEXT_COLOR());
/* Initialize PFN and make it valid */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Mon May 22 13:30:44 2017
@@ -178,25 +178,25 @@
/* Lock the PFN database */
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- /* Some debug stuff */
- MI_SET_USAGE(MI_USAGE_DRIVER_PAGE);
-#if MI_TRACE_PFNS
- if (FileName->Buffer)
- {
- PWCHAR pos = NULL;
- ULONG len = 0;
- pos = wcsrchr(FileName->Buffer, '\\');
- len = wcslen(pos) * sizeof(WCHAR);
- if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S",
pos);
- }
-#endif
-
/* Loop the new driver PTEs */
TempPte = ValidKernelPte;
while (PointerPte < LastPte)
{
/* Make sure the PTE is not valid for whatever reason */
ASSERT(PointerPte->u.Hard.Valid == 0);
+
+ /* Some debug stuff */
+ MI_SET_USAGE(MI_USAGE_DRIVER_PAGE);
+#if MI_TRACE_PFNS
+ if (FileName->Buffer)
+ {
+ PWCHAR pos = NULL;
+ ULONG len = 0;
+ pos = wcsrchr(FileName->Buffer, '\\');
+ len = wcslen(pos) * sizeof(WCHAR);
+ if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S",
pos);
+ }
+#endif
/* Grab a page */
PageFrameIndex = MiRemoveAnyPage(MI_GET_NEXT_COLOR());