2004-01-10 02:14:13 +00:00
|
|
|
/*
|
2021-12-16 01:25:32 +00:00
|
|
|
* PROJECT: ReactOS Task Manager
|
2023-06-15 17:45:15 +00:00
|
|
|
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
|
2023-10-20 11:03:59 +00:00
|
|
|
* PURPOSE: Performance Counters
|
2021-12-16 01:25:32 +00:00
|
|
|
* COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp@reactos.org>
|
|
|
|
* Copyright 2014 Ismael Ferreras Morezuelas <swyterzone+ros@gmail.com>
|
2004-01-10 02:14:13 +00:00
|
|
|
*/
|
2005-05-08 04:07:56 +00:00
|
|
|
|
2010-02-26 11:43:19 +00:00
|
|
|
#pragma once
|
2004-01-10 02:14:13 +00:00
|
|
|
|
2005-04-07 13:25:34 +00:00
|
|
|
#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
|
2004-01-10 02:14:13 +00:00
|
|
|
|
|
|
|
typedef struct _PERFDATA
|
|
|
|
{
|
|
|
|
WCHAR ImageName[MAX_PATH];
|
2005-04-07 13:25:34 +00:00
|
|
|
HANDLE ProcessId;
|
2004-01-10 02:14:13 +00:00
|
|
|
WCHAR UserName[MAX_PATH];
|
|
|
|
ULONG SessionId;
|
|
|
|
ULONG CPUUsage;
|
2005-06-20 22:15:59 +00:00
|
|
|
LARGE_INTEGER CPUTime;
|
2004-01-10 02:14:13 +00:00
|
|
|
ULONG WorkingSetSizeBytes;
|
|
|
|
ULONG PeakWorkingSetSizeBytes;
|
|
|
|
ULONG WorkingSetSizeDelta;
|
|
|
|
ULONG PageFaultCount;
|
|
|
|
ULONG PageFaultCountDelta;
|
|
|
|
ULONG VirtualMemorySizeBytes;
|
|
|
|
ULONG PagedPoolUsagePages;
|
|
|
|
ULONG NonPagedPoolUsagePages;
|
|
|
|
ULONG BasePriority;
|
|
|
|
ULONG HandleCount;
|
|
|
|
ULONG ThreadCount;
|
|
|
|
ULONG USERObjectCount;
|
|
|
|
ULONG GDIObjectCount;
|
|
|
|
IO_COUNTERS IOCounters;
|
|
|
|
|
2005-06-20 22:15:59 +00:00
|
|
|
LARGE_INTEGER UserTime;
|
|
|
|
LARGE_INTEGER KernelTime;
|
2004-01-10 02:14:13 +00:00
|
|
|
} PERFDATA, *PPERFDATA;
|
|
|
|
|
2014-11-23 20:10:15 +00:00
|
|
|
typedef struct _CMD_LINE_CACHE
|
|
|
|
{
|
2023-10-20 11:03:59 +00:00
|
|
|
DWORD idx;
|
2014-11-23 20:10:15 +00:00
|
|
|
LPWSTR str;
|
2023-10-20 11:03:59 +00:00
|
|
|
ULONG len;
|
2014-11-23 20:10:15 +00:00
|
|
|
struct _CMD_LINE_CACHE* pnext;
|
|
|
|
} CMD_LINE_CACHE, *PCMD_LINE_CACHE;
|
|
|
|
|
2004-01-10 02:14:13 +00:00
|
|
|
BOOL PerfDataInitialize(void);
|
|
|
|
void PerfDataUninitialize(void);
|
|
|
|
void PerfDataRefresh(void);
|
|
|
|
|
2014-11-23 20:10:15 +00:00
|
|
|
BOOL PerfDataGet(ULONG Index, PPERFDATA *lppData);
|
|
|
|
ULONG PerfDataGetProcessIndex(ULONG pid);
|
2004-01-10 02:14:13 +00:00
|
|
|
ULONG PerfDataGetProcessCount(void);
|
|
|
|
ULONG PerfDataGetProcessorUsage(void);
|
|
|
|
ULONG PerfDataGetProcessorSystemUsage(void);
|
|
|
|
|
2014-11-23 20:10:15 +00:00
|
|
|
BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, ULONG nMaxCount);
|
2004-01-10 02:14:13 +00:00
|
|
|
ULONG PerfDataGetProcessId(ULONG Index);
|
2014-11-23 20:10:15 +00:00
|
|
|
BOOL PerfDataGetUserName(ULONG Index, LPWSTR lpUserName, ULONG nMaxCount);
|
|
|
|
|
|
|
|
BOOL PerfDataGetCommandLine(ULONG Index, LPWSTR lpCommandLine, ULONG nMaxCount);
|
|
|
|
void PerfDataDeallocCommandLineCache();
|
|
|
|
|
2004-01-10 02:14:13 +00:00
|
|
|
ULONG PerfDataGetSessionId(ULONG Index);
|
|
|
|
ULONG PerfDataGetCPUUsage(ULONG Index);
|
2005-06-20 22:15:59 +00:00
|
|
|
LARGE_INTEGER PerfDataGetCPUTime(ULONG Index);
|
2004-01-10 02:14:13 +00:00
|
|
|
ULONG PerfDataGetWorkingSetSizeBytes(ULONG Index);
|
|
|
|
ULONG PerfDataGetPeakWorkingSetSizeBytes(ULONG Index);
|
|
|
|
ULONG PerfDataGetWorkingSetSizeDelta(ULONG Index);
|
|
|
|
ULONG PerfDataGetPageFaultCount(ULONG Index);
|
|
|
|
ULONG PerfDataGetPageFaultCountDelta(ULONG Index);
|
|
|
|
ULONG PerfDataGetVirtualMemorySizeBytes(ULONG Index);
|
|
|
|
ULONG PerfDataGetPagedPoolUsagePages(ULONG Index);
|
|
|
|
ULONG PerfDataGetNonPagedPoolUsagePages(ULONG Index);
|
|
|
|
ULONG PerfDataGetBasePriority(ULONG Index);
|
|
|
|
ULONG PerfDataGetHandleCount(ULONG Index);
|
|
|
|
ULONG PerfDataGetThreadCount(ULONG Index);
|
|
|
|
ULONG PerfDataGetUSERObjectCount(ULONG Index);
|
|
|
|
ULONG PerfDataGetGDIObjectCount(ULONG Index);
|
|
|
|
BOOL PerfDataGetIOCounters(ULONG Index, PIO_COUNTERS pIoCounters);
|
|
|
|
|
|
|
|
ULONG PerfDataGetCommitChargeTotalK(void);
|
|
|
|
ULONG PerfDataGetCommitChargeLimitK(void);
|
|
|
|
ULONG PerfDataGetCommitChargePeakK(void);
|
|
|
|
|
|
|
|
ULONG PerfDataGetKernelMemoryTotalK(void);
|
|
|
|
ULONG PerfDataGetKernelMemoryPagedK(void);
|
|
|
|
ULONG PerfDataGetKernelMemoryNonPagedK(void);
|
|
|
|
|
|
|
|
ULONG PerfDataGetPhysicalMemoryTotalK(void);
|
|
|
|
ULONG PerfDataGetPhysicalMemoryAvailableK(void);
|
|
|
|
ULONG PerfDataGetPhysicalMemorySystemCacheK(void);
|
|
|
|
|
|
|
|
ULONG PerfDataGetSystemHandleCount(void);
|
|
|
|
|
|
|
|
ULONG PerfDataGetTotalThreadCount(void);
|