https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0fbdf317092603d594baf…
commit 0fbdf317092603d594bafacfd6da71fffe2bd219
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Feb 24 13:47:15 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Feb 24 14:52:04 2018 +0100
[NTOSKRNL] Add the CcPinReadWait and CcPinReadNoWait counters
---
ntoskrnl/cc/pin.c | 13 +++++++++++++
ntoskrnl/ex/sysinfo.c | 4 ++--
ntoskrnl/include/internal/cc.h | 2 ++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c
index 07afd1847f..20b409662f 100644
--- a/ntoskrnl/cc/pin.c
+++ b/ntoskrnl/cc/pin.c
@@ -21,9 +21,13 @@ extern NPAGED_LOOKASIDE_LIST iBcbLookasideList;
/* Counters:
* - Number of calls to CcMapData that could wait
* - Number of calls to CcMapData that couldn't wait
+ * - Number of calls to CcPinRead that could wait
+ * - Number of calls to CcPinRead that couldn't wait
*/
ULONG CcMapDataWait = 0;
ULONG CcMapDataNoWait = 0;
+ULONG CcPinReadWait = 0;
+ULONG CcPinReadNoWait = 0;
/* FUNCTIONS *****************************************************************/
@@ -192,6 +196,15 @@ CcPinRead (
CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu
Flags=0x%lx\n",
FileObject, FileOffset, Length, Flags);
+ if (Flags & PIN_WAIT)
+ {
+ ++CcPinReadWait;
+ }
+ else
+ {
+ ++CcPinReadNoWait;
+ }
+
if (CcMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer))
{
if (CcPinMappedData(FileObject, FileOffset, Length, Flags, Bcb))
diff --git a/ntoskrnl/ex/sysinfo.c b/ntoskrnl/ex/sysinfo.c
index 59c6d263c2..4db50e5b0b 100644
--- a/ntoskrnl/ex/sysinfo.c
+++ b/ntoskrnl/ex/sysinfo.c
@@ -693,8 +693,8 @@ QSI_DEF(SystemPerformanceInformation)
Spi->CcMapDataWaitMiss = 0; /* FIXME */
Spi->CcPinMappedDataCount = 0; /* FIXME */
- Spi->CcPinReadNoWait = 0; /* FIXME */
- Spi->CcPinReadWait = 0; /* FIXME */
+ Spi->CcPinReadNoWait = CcPinReadNoWait;
+ Spi->CcPinReadWait = CcPinReadWait;
Spi->CcPinReadNoWaitMiss = 0; /* FIXME */
Spi->CcPinReadWaitMiss = 0; /* FIXME */
Spi->CcCopyReadNoWait = 0; /* FIXME */
diff --git a/ntoskrnl/include/internal/cc.h b/ntoskrnl/include/internal/cc.h
index c404cd9179..32caa551b2 100644
--- a/ntoskrnl/include/internal/cc.h
+++ b/ntoskrnl/include/internal/cc.h
@@ -60,6 +60,8 @@ extern ULONG CcLazyWritePages;
extern ULONG CcLazyWriteIos;
extern ULONG CcMapDataWait;
extern ULONG CcMapDataNoWait;
+extern ULONG CcPinReadWait;
+extern ULONG CcPinReadNoWait;
typedef struct _PF_SCENARIO_ID
{