mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 13:11:22 +00:00
[NTOSKRNL] Add the CcDataFlushes and CcDataPages counters
This commit is contained in:
parent
0fbdf31709
commit
9ac2e9855a
4 changed files with 19 additions and 2 deletions
|
@ -43,6 +43,13 @@ ULONG CcFastReadWait;
|
|||
ULONG CcFastReadNoWait;
|
||||
ULONG CcFastReadResourceMiss;
|
||||
|
||||
/* Counters:
|
||||
* - Amount of pages flushed to the disk
|
||||
* - Number of flush operations
|
||||
*/
|
||||
ULONG CcDataPages = 0;
|
||||
ULONG CcDataFlushes = 0;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
VOID
|
||||
|
|
|
@ -709,8 +709,8 @@ QSI_DEF(SystemPerformanceInformation)
|
|||
Spi->CcReadAheadIos = 0; /* FIXME */
|
||||
Spi->CcLazyWriteIos = CcLazyWriteIos;
|
||||
Spi->CcLazyWritePages = CcLazyWritePages;
|
||||
Spi->CcDataFlushes = 0; /* FIXME */
|
||||
Spi->CcDataPages = 0; /* FIXME */
|
||||
Spi->CcDataFlushes = CcDataFlushes;
|
||||
Spi->CcDataPages = CcDataPages;
|
||||
Spi->ContextSwitches = 0; /* FIXME */
|
||||
Spi->FirstLevelTbFills = 0; /* FIXME */
|
||||
Spi->SecondLevelTbFills = 0; /* FIXME */
|
||||
|
|
|
@ -62,6 +62,8 @@ extern ULONG CcMapDataWait;
|
|||
extern ULONG CcMapDataNoWait;
|
||||
extern ULONG CcPinReadWait;
|
||||
extern ULONG CcPinReadNoWait;
|
||||
extern ULONG CcDataPages;
|
||||
extern ULONG CcDataFlushes;
|
||||
|
||||
typedef struct _PF_SCENARIO_ID
|
||||
{
|
||||
|
|
|
@ -1039,6 +1039,14 @@ IoSynchronousPageWrite(IN PFILE_OBJECT FileObject,
|
|||
IOTRACE(IO_API_DEBUG, "FileObject: %p. Mdl: %p. Offset: %p \n",
|
||||
FileObject, Mdl, Offset);
|
||||
|
||||
/* Is the write originating from Cc? */
|
||||
if (FileObject->SectionObjectPointer != NULL &&
|
||||
FileObject->SectionObjectPointer->SharedCacheMap != NULL)
|
||||
{
|
||||
++CcDataFlushes;
|
||||
CcDataPages += BYTES_TO_PAGES(MmGetMdlByteCount(Mdl));
|
||||
}
|
||||
|
||||
/* Get the Device Object */
|
||||
DeviceObject = IoGetRelatedDeviceObject(FileObject);
|
||||
|
||||
|
|
Loading…
Reference in a new issue