mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 02:10:07 +00:00
[NTOSKRNL] For SystemPerformanceInformation, return some info extracted from PRCB
This notably includes the amount of context switchs and system calls.
This commit is contained in:
parent
4d974e56ee
commit
e632375851
|
@ -669,7 +669,9 @@ QSI_DEF(SystemProcessorInformation)
|
||||||
/* Class 2 - Performance Information */
|
/* Class 2 - Performance Information */
|
||||||
QSI_DEF(SystemPerformanceInformation)
|
QSI_DEF(SystemPerformanceInformation)
|
||||||
{
|
{
|
||||||
|
LONG i;
|
||||||
ULONG IdleUser, IdleKernel;
|
ULONG IdleUser, IdleKernel;
|
||||||
|
PKPRCB Prcb;
|
||||||
PSYSTEM_PERFORMANCE_INFORMATION Spi
|
PSYSTEM_PERFORMANCE_INFORMATION Spi
|
||||||
= (PSYSTEM_PERFORMANCE_INFORMATION) Buffer;
|
= (PSYSTEM_PERFORMANCE_INFORMATION) Buffer;
|
||||||
|
|
||||||
|
@ -786,10 +788,23 @@ QSI_DEF(SystemPerformanceInformation)
|
||||||
Spi->CcLazyWritePages = CcLazyWritePages;
|
Spi->CcLazyWritePages = CcLazyWritePages;
|
||||||
Spi->CcDataFlushes = CcDataFlushes;
|
Spi->CcDataFlushes = CcDataFlushes;
|
||||||
Spi->CcDataPages = CcDataPages;
|
Spi->CcDataPages = CcDataPages;
|
||||||
Spi->ContextSwitches = 0; /* FIXME */
|
|
||||||
Spi->FirstLevelTbFills = 0; /* FIXME */
|
Spi->ContextSwitches = 0;
|
||||||
Spi->SecondLevelTbFills = 0; /* FIXME */
|
Spi->FirstLevelTbFills = 0;
|
||||||
Spi->SystemCalls = 0; /* FIXME */
|
Spi->SecondLevelTbFills = 0;
|
||||||
|
Spi->SystemCalls = 0;
|
||||||
|
for (i = 0; i < KeNumberProcessors; i ++)
|
||||||
|
{
|
||||||
|
Prcb = KiProcessorBlock[i];
|
||||||
|
if (Prcb)
|
||||||
|
{
|
||||||
|
Spi->ContextSwitches += KeGetContextSwitches(Prcb);
|
||||||
|
Spi->FirstLevelTbFills += Prcb->KeFirstLevelTbFills;
|
||||||
|
Spi->SecondLevelTbFills += Prcb->KeSecondLevelTbFills;
|
||||||
|
Spi->SystemCalls += Prcb->KeSystemCalls;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue