https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45964099f31a221a729bf…
commit 45964099f31a221a729bf97744541f3848f418c5
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Feb 24 13:35:17 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Feb 24 13:36:26 2018 +0100
[NTOSKRNL] Return some Cc counters in SystemPerformanceInformation
---
ntoskrnl/cc/pin.c | 4 ++++
ntoskrnl/ex/sysinfo.c | 8 ++++----
ntoskrnl/include/internal/cc.h | 8 ++++++++
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c
index d0a0d7e930..07afd1847f 100644
--- a/ntoskrnl/cc/pin.c
+++ b/ntoskrnl/cc/pin.c
@@ -18,6 +18,10 @@
extern NPAGED_LOOKASIDE_LIST iBcbLookasideList;
+/* Counters:
+ * - Number of calls to CcMapData that could wait
+ * - Number of calls to CcMapData that couldn't wait
+ */
ULONG CcMapDataWait = 0;
ULONG CcMapDataNoWait = 0;
diff --git a/ntoskrnl/ex/sysinfo.c b/ntoskrnl/ex/sysinfo.c
index 14809474da..59c6d263c2 100644
--- a/ntoskrnl/ex/sysinfo.c
+++ b/ntoskrnl/ex/sysinfo.c
@@ -687,8 +687,8 @@ QSI_DEF(SystemPerformanceInformation)
Spi->CcFastMdlReadResourceMiss = 0; /* FIXME */
Spi->CcFastMdlReadNotPossible = 0; /* FIXME */
- Spi->CcMapDataNoWait = 0; /* FIXME */
- Spi->CcMapDataWait = 0; /* FIXME */
+ Spi->CcMapDataNoWait = CcMapDataNoWait;
+ Spi->CcMapDataWait = CcMapDataWait;
Spi->CcMapDataNoWaitMiss = 0; /* FIXME */
Spi->CcMapDataWaitMiss = 0; /* FIXME */
@@ -707,8 +707,8 @@ QSI_DEF(SystemPerformanceInformation)
Spi->CcMdlReadNoWaitMiss = 0; /* FIXME */
Spi->CcMdlReadWaitMiss = 0; /* FIXME */
Spi->CcReadAheadIos = 0; /* FIXME */
- Spi->CcLazyWriteIos = 0; /* FIXME */
- Spi->CcLazyWritePages = 0; /* FIXME */
+ Spi->CcLazyWriteIos = CcLazyWriteIos;
+ Spi->CcLazyWritePages = CcLazyWritePages;
Spi->CcDataFlushes = 0; /* FIXME */
Spi->CcDataPages = 0; /* FIXME */
Spi->ContextSwitches = 0; /* FIXME */
diff --git a/ntoskrnl/include/internal/cc.h b/ntoskrnl/include/internal/cc.h
index 5751ab665e..c404cd9179 100644
--- a/ntoskrnl/include/internal/cc.h
+++ b/ntoskrnl/include/internal/cc.h
@@ -53,6 +53,14 @@ extern LIST_ENTRY CcPostTickWorkQueue;
extern NPAGED_LOOKASIDE_LIST CcTwilightLookasideList;
extern LARGE_INTEGER CcIdleDelay;
+//
+// Counters
+//
+extern ULONG CcLazyWritePages;
+extern ULONG CcLazyWriteIos;
+extern ULONG CcMapDataWait;
+extern ULONG CcMapDataNoWait;
+
typedef struct _PF_SCENARIO_ID
{
WCHAR ScenName[30];