From d6dfe19794cc521a8c009c258d3e9591e2fc06e8 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Tue, 16 May 2017 20:32:43 -0600 Subject: [PATCH] ntdll/tests: Dump entire VM_COUNTERS structure. Signed-off-by: Alex Henrie Signed-off-by: Alexandre Julliard --- dlls/ntdll/tests/info.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index f8759fe9bd1..9fda2d5e357 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -1046,6 +1046,22 @@ static void test_query_process_basic(void) ok( pbi.UniqueProcessId > 0, "Expected a ProcessID > 0, got 0\n"); } +static void dump_vm_counters(const char *header, const VM_COUNTERS *pvi) +{ + trace("%s:\n", header); + trace("PeakVirtualSize : %lu\n", pvi->PeakVirtualSize); + trace("VirtualSize : %lu\n", pvi->VirtualSize); + trace("PageFaultCount : %u\n", pvi->PageFaultCount); + trace("PeakWorkingSetSize : %lu\n", pvi->PeakWorkingSetSize); + trace("WorkingSetSize : %lu\n", pvi->WorkingSetSize); + trace("QuotaPeakPagedPoolUsage : %lu\n", pvi->QuotaPeakPagedPoolUsage); + trace("QuotaPagedPoolUsage : %lu\n", pvi->QuotaPagedPoolUsage); + trace("QuotaPeakNonPagePoolUsage : %lu\n", pvi->QuotaPeakNonPagedPoolUsage); + trace("QuotaNonPagePoolUsage : %lu\n", pvi->QuotaNonPagedPoolUsage); + trace("PagefileUsage : %lu\n", pvi->PagefileUsage); + trace("PeakPagefileUsage : %lu\n", pvi->PeakPagefileUsage); +} + static void test_query_process_vm(void) { NTSTATUS status; @@ -1078,7 +1094,7 @@ static void test_query_process_vm(void) ok( ReturnLength == old_size || ReturnLength == sizeof(pvi), "Inconsistent length %d\n", ReturnLength); /* Check if we have some return values */ - trace("WorkingSetSize : %ld\n", pvi.WorkingSetSize); + dump_vm_counters("VM counters for GetCurrentProcess", &pvi); ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n"); process = OpenProcess(PROCESS_VM_READ, FALSE, GetCurrentProcessId()); @@ -1097,7 +1113,7 @@ static void test_query_process_vm(void) ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); /* Check if we have some return values */ - trace("WorkingSetSize : %ld\n", pvi.WorkingSetSize); + dump_vm_counters("VM counters for GetCurrentProcessId", &pvi); ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n"); CloseHandle(process); -- 2.11.4.GIT