From 00010bb088e062c15861c7e1b4a378c60dd177c8 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 2 May 2004 19:34:21 +0000 Subject: [PATCH] Add missing io performance counters. SystemPerformanceInformation reads io counters. svn path=/trunk/; revision=9282 --- reactos/ntoskrnl/ex/sysinfo.c | 17 +++++++++-------- reactos/ntoskrnl/include/internal/io.h | 4 +++- reactos/ntoskrnl/io/iomgr.c | 4 +++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 0b4ee629b1e..0ed3180ee36 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1,4 +1,4 @@ -/* $Id: sysinfo.c,v 1.33 2004/05/02 04:40:24 jimtabor Exp $ +/* $Id: sysinfo.c,v 1.34 2004/05/02 19:34:21 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -361,14 +362,14 @@ QSI_DEF(SystemPerformanceInformation) Spi->IdleTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000; - Spi->ReadTransferCount.QuadPart = 0; /* FIXME */ - Spi->WriteTransferCount.QuadPart = 0; /* FIXME */ - Spi->OtherTransferCount.QuadPart = 0; /* FIXME */ - Spi->ReadOperationCount = 0; /* FIXME */ - Spi->WriteOperationCount = 0; /* FIXME */ - Spi->OtherOperationCount = 0; /* FIXME */ + Spi->ReadTransferCount.QuadPart = IoReadTransferCount; + Spi->WriteTransferCount.QuadPart = IoWriteTransferCount; + Spi->OtherTransferCount.QuadPart = IoOtherTransferCount; + Spi->ReadOperationCount = IoReadOperationCount; + Spi->WriteOperationCount = IoWriteOperationCount; + Spi->OtherOperationCount = IoOtherOperationCount; - Spi->AvailablePages = MiNrAvailablePages; + Spi->AvailablePages = MiNrAvailablePages; Spi->TotalCommittedPages = MiUsedSwapPages; Spi->TotalCommitLimit = MiFreeSwapPages + MiUsedSwapPages; /* FIXME */ diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index 968b700d2ef..2dde365097f 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: io.h,v 1.42 2004/03/28 09:48:13 navaraf Exp $ +/* $Id: io.h,v 1.43 2004/05/02 19:33:29 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -256,6 +256,8 @@ typedef struct _DEVICETREE_TRAVERSE_CONTEXT extern PDEVICE_NODE IopRootDeviceNode; +extern ULONG IoOtherOperationCount; +extern ULONGLONG IoOtherTransferCount; VOID PnpInit(VOID); diff --git a/reactos/ntoskrnl/io/iomgr.c b/reactos/ntoskrnl/io/iomgr.c index 061ba346157..4a09a3e839a 100644 --- a/reactos/ntoskrnl/io/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr.c @@ -1,4 +1,4 @@ -/* $Id: iomgr.c,v 1.46 2004/03/27 19:41:32 navaraf Exp $ +/* $Id: iomgr.c,v 1.47 2004/05/02 19:33:50 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -36,6 +36,8 @@ ULONG EXPORTED IoReadOperationCount = 0; ULONGLONG EXPORTED IoReadTransferCount = 0; ULONG EXPORTED IoWriteOperationCount = 0; ULONGLONG EXPORTED IoWriteTransferCount = 0; +ULONG IoOtherOperationCount = 0; +ULONGLONG IoOtherTransferCount = 0; KSPIN_LOCK EXPORTED IoStatisticsLock = 0; static GENERIC_MAPPING IopFileMapping = {FILE_GENERIC_READ,