Commit 146cf041 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

ntdll: Always fill PagefileUsage counter with a nonzero value on Linux.

parent d6dfe197
...@@ -152,9 +152,12 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) ...@@ -152,9 +152,12 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi)
pvmi->PeakWorkingSetSize = (ULONG64)value * 1024; pvmi->PeakWorkingSetSize = (ULONG64)value * 1024;
else if (sscanf(line, "VmRSS: %lu", &value)) else if (sscanf(line, "VmRSS: %lu", &value))
pvmi->WorkingSetSize = (ULONG64)value * 1024; pvmi->WorkingSetSize = (ULONG64)value * 1024;
else if (sscanf(line, "RssAnon: %lu", &value))
pvmi->PagefileUsage += (ULONG64)value * 1024;
else if (sscanf(line, "VmSwap: %lu", &value)) else if (sscanf(line, "VmSwap: %lu", &value))
pvmi->PeakPagefileUsage = pvmi->PagefileUsage = (ULONG64)value * 1024; pvmi->PagefileUsage += (ULONG64)value * 1024;
} }
pvmi->PeakPagefileUsage = pvmi->PagefileUsage;
fclose(f); fclose(f);
} }
......
...@@ -1096,6 +1096,7 @@ static void test_query_process_vm(void) ...@@ -1096,6 +1096,7 @@ static void test_query_process_vm(void)
/* Check if we have some return values */ /* Check if we have some return values */
dump_vm_counters("VM counters for GetCurrentProcess", &pvi); dump_vm_counters("VM counters for GetCurrentProcess", &pvi);
ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n"); ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n");
ok( pvi.PagefileUsage > 0, "Expected a PagefileUsage > 0\n");
process = OpenProcess(PROCESS_VM_READ, FALSE, GetCurrentProcessId()); process = OpenProcess(PROCESS_VM_READ, FALSE, GetCurrentProcessId());
status = pNtQueryInformationProcess(process, ProcessVmCounters, &pvi, sizeof(pvi), NULL); status = pNtQueryInformationProcess(process, ProcessVmCounters, &pvi, sizeof(pvi), NULL);
...@@ -1115,6 +1116,7 @@ static void test_query_process_vm(void) ...@@ -1115,6 +1116,7 @@ static void test_query_process_vm(void)
/* Check if we have some return values */ /* Check if we have some return values */
dump_vm_counters("VM counters for GetCurrentProcessId", &pvi); dump_vm_counters("VM counters for GetCurrentProcessId", &pvi);
ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n"); ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n");
ok( pvi.PagefileUsage > 0, "Expected a PagefileUsage > 0\n");
CloseHandle(process); CloseHandle(process);
} }
......
...@@ -1397,9 +1397,12 @@ DECL_HANDLER(get_process_vm_counters) ...@@ -1397,9 +1397,12 @@ DECL_HANDLER(get_process_vm_counters)
reply->peak_working_set_size = (mem_size_t)value * 1024; reply->peak_working_set_size = (mem_size_t)value * 1024;
else if (sscanf( line, "VmRSS: %lu", &value )) else if (sscanf( line, "VmRSS: %lu", &value ))
reply->working_set_size = (mem_size_t)value * 1024; reply->working_set_size = (mem_size_t)value * 1024;
else if (sscanf( line, "RssAnon: %lu", &value ))
reply->pagefile_usage += (mem_size_t)value * 1024;
else if (sscanf( line, "VmSwap: %lu", &value )) else if (sscanf( line, "VmSwap: %lu", &value ))
reply->peak_pagefile_usage = reply->pagefile_usage = (mem_size_t)value * 1024; reply->pagefile_usage += (mem_size_t)value * 1024;
} }
reply->peak_pagefile_usage = reply->pagefile_usage;
fclose( f ); fclose( f );
} }
else set_error( STATUS_ACCESS_DENIED ); else set_error( STATUS_ACCESS_DENIED );
......
...@@ -853,8 +853,8 @@ struct rawinput_device ...@@ -853,8 +853,8 @@ struct rawinput_device
mem_size_t virtual_size; /* virtual memory in bytes */ mem_size_t virtual_size; /* virtual memory in bytes */
mem_size_t peak_working_set_size; /* peak real memory in bytes */ mem_size_t peak_working_set_size; /* peak real memory in bytes */
mem_size_t working_set_size; /* real memory in bytes */ mem_size_t working_set_size; /* real memory in bytes */
mem_size_t pagefile_usage; /* swapped-out memory in bytes */ mem_size_t pagefile_usage; /* commit charge in bytes */
mem_size_t peak_pagefile_usage; /* peak swapped-out memory in bytes */ mem_size_t peak_pagefile_usage; /* peak commit charge in bytes */
@END @END
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment