Commit f71ed53f authored by Sean McAllister's avatar Sean McAllister Committed by Commit Bot

Refactor OS_LINUX preprocessor directive for LaCrOS effort.

Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

This is changes for /chrome/browser/metrics/process_memory_metrics_emitter_unittest.cc

This CL was uploaded by git cl split.

R=siggi@chromium.org

Bug: 1110266
Change-Id: I9014a8e3003f5dba8151c2599d550441a401d7a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371255Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Sean McAllister <smcallis@google.com>
Cr-Commit-Position: refs/heads/master@{#803132}
parent cfac0086
...@@ -114,18 +114,18 @@ void SetAllocatorDumpMetric(ProcessMemoryDumpPtr& pmd, ...@@ -114,18 +114,18 @@ void SetAllocatorDumpMetric(ProcessMemoryDumpPtr& pmd,
OSMemDumpPtr GetFakeOSMemDump(uint32_t resident_set_kb, OSMemDumpPtr GetFakeOSMemDump(uint32_t resident_set_kb,
uint32_t private_footprint_kb, uint32_t private_footprint_kb,
uint32_t shared_footprint_kb uint32_t shared_footprint_kb
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
, ,
uint32_t private_swap_footprint_kb uint32_t private_swap_footprint_kb
#endif #endif
) { ) {
using memory_instrumentation::mojom::VmRegion; using memory_instrumentation::mojom::VmRegion;
return memory_instrumentation::mojom::OSMemDump::New( return memory_instrumentation::mojom::OSMemDump::New(
resident_set_kb, resident_set_kb /* peak_resident_set_kb */, resident_set_kb, resident_set_kb /* peak_resident_set_kb */,
true /* is_peak_rss_resettable */, private_footprint_kb, true /* is_peak_rss_resettable */, private_footprint_kb,
shared_footprint_kb shared_footprint_kb
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
, ,
private_swap_footprint_kb private_swap_footprint_kb
#endif #endif
...@@ -156,7 +156,7 @@ void PopulateBrowserMetrics(GlobalMemoryDumpPtr& global_dump, ...@@ -156,7 +156,7 @@ void PopulateBrowserMetrics(GlobalMemoryDumpPtr& global_dump,
OSMemDumpPtr os_dump = OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb) * 1024, GetFakeOSMemDump(GetResidentValue(metrics_mb) * 1024,
metrics_mb["PrivateMemoryFootprint"] * 1024, metrics_mb["PrivateMemoryFootprint"] * 1024,
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
// accessing PrivateSwapFootprint on other OSes will // accessing PrivateSwapFootprint on other OSes will
// modify metrics_mb to create the value, which leads to // modify metrics_mb to create the value, which leads to
// expectation failures. // expectation failures.
...@@ -179,7 +179,7 @@ MetricMap GetExpectedBrowserMetrics() { ...@@ -179,7 +179,7 @@ MetricMap GetExpectedBrowserMetrics() {
{"Malloc", 20}, {"PrivateMemoryFootprint", 30}, {"Malloc", 20}, {"PrivateMemoryFootprint", 30},
{"SharedMemoryFootprint", 35}, {"Uptime", 42}, {"SharedMemoryFootprint", 35}, {"Uptime", 42},
{"GpuMemory", kGpuTotalMemory * 1024 * 1024}, {"GpuMemory", kGpuTotalMemory * 1024 * 1024},
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
{"PrivateSwapFootprint", 50}, {"PrivateSwapFootprint", 50},
#endif #endif
}); });
...@@ -310,13 +310,13 @@ void PopulateRendererMetrics(GlobalMemoryDumpPtr& global_dump, ...@@ -310,13 +310,13 @@ void PopulateRendererMetrics(GlobalMemoryDumpPtr& global_dump,
metrics_mb_or_count["PartitionAlloc.Partitions.ArrayBuffer"] * 1024 * metrics_mb_or_count["PartitionAlloc.Partitions.ArrayBuffer"] * 1024 *
1024); 1024);
OSMemDumpPtr os_dump = GetFakeOSMemDump( OSMemDumpPtr os_dump =
GetResidentValue(metrics_mb_or_count) * 1024, GetFakeOSMemDump(GetResidentValue(metrics_mb_or_count) * 1024,
metrics_mb_or_count["PrivateMemoryFootprint"] * 1024, metrics_mb_or_count["PrivateMemoryFootprint"] * 1024,
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
// accessing PrivateSwapFootprint on other OSes will // accessing PrivateSwapFootprint on other OSes will
// modify metrics_mb_or_count to create the value, which leads to // modify metrics_mb_or_count to create the value, which
// expectation failures. // leads to expectation failures.
metrics_mb_or_count["SharedMemoryFootprint"] * 1024, metrics_mb_or_count["SharedMemoryFootprint"] * 1024,
metrics_mb_or_count["PrivateSwapFootprint"] * 1024 metrics_mb_or_count["PrivateSwapFootprint"] * 1024
#else #else
...@@ -372,7 +372,7 @@ MetricMap GetExpectedRendererMetrics() { ...@@ -372,7 +372,7 @@ MetricMap GetExpectedRendererMetrics() {
{"V8.Main.Malloc", 2}, {"V8.Workers", 60}, {"V8.Main.Malloc", 2}, {"V8.Workers", 60},
{"V8.Workers.AllocatedObjects", 40}, {"NumberOfExtensions", 0}, {"V8.Workers.AllocatedObjects", 40}, {"NumberOfExtensions", 0},
{"Uptime", 42}, {"Uptime", 42},
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
{"PrivateSwapFootprint", 50}, {"PrivateSwapFootprint", 50},
#endif #endif
{"NumberOfAdSubframes", 28}, {"NumberOfDetachedScriptStates", 11}, {"NumberOfAdSubframes", 28}, {"NumberOfDetachedScriptStates", 11},
...@@ -406,7 +406,7 @@ void PopulateGpuMetrics(GlobalMemoryDumpPtr& global_dump, ...@@ -406,7 +406,7 @@ void PopulateGpuMetrics(GlobalMemoryDumpPtr& global_dump,
OSMemDumpPtr os_dump = OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb) * 1024, GetFakeOSMemDump(GetResidentValue(metrics_mb) * 1024,
metrics_mb["PrivateMemoryFootprint"] * 1024, metrics_mb["PrivateMemoryFootprint"] * 1024,
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
// accessing PrivateSwapFootprint on other OSes will // accessing PrivateSwapFootprint on other OSes will
// modify metrics_mb to create the value, which leads to // modify metrics_mb to create the value, which leads to
// expectation failures. // expectation failures.
...@@ -429,7 +429,7 @@ MetricMap GetExpectedGpuMetrics() { ...@@ -429,7 +429,7 @@ MetricMap GetExpectedGpuMetrics() {
{"Malloc", 220}, {"PrivateMemoryFootprint", 230}, {"Malloc", 220}, {"PrivateMemoryFootprint", 230},
{"SharedMemoryFootprint", 235}, {"CommandBuffer", kGpuCommandBufferMB}, {"SharedMemoryFootprint", 235}, {"CommandBuffer", kGpuCommandBufferMB},
{"Uptime", 42}, {"GpuMemory", kGpuTotalMemory * 1024 * 1024}, {"Uptime", 42}, {"GpuMemory", kGpuTotalMemory * 1024 * 1024},
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
{"PrivateSwapFootprint", 50}, {"PrivateSwapFootprint", 50},
#endif #endif
}); });
...@@ -445,7 +445,7 @@ void PopulateAudioServiceMetrics(GlobalMemoryDumpPtr& global_dump, ...@@ -445,7 +445,7 @@ void PopulateAudioServiceMetrics(GlobalMemoryDumpPtr& global_dump,
OSMemDumpPtr os_dump = OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb) * 1024, GetFakeOSMemDump(GetResidentValue(metrics_mb) * 1024,
metrics_mb["PrivateMemoryFootprint"] * 1024, metrics_mb["PrivateMemoryFootprint"] * 1024,
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
// accessing PrivateSwapFootprint on other OSes will // accessing PrivateSwapFootprint on other OSes will
// modify metrics_mb to create the value, which leads to // modify metrics_mb to create the value, which leads to
// expectation failures. // expectation failures.
...@@ -467,7 +467,7 @@ MetricMap GetExpectedAudioServiceMetrics() { ...@@ -467,7 +467,7 @@ MetricMap GetExpectedAudioServiceMetrics() {
#endif #endif
{"Malloc", 20}, {"PrivateMemoryFootprint", 30}, {"Malloc", 20}, {"PrivateMemoryFootprint", 30},
{"SharedMemoryFootprint", 35}, {"Uptime", 42}, {"SharedMemoryFootprint", 35}, {"Uptime", 42},
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
{"PrivateSwapFootprint", 50}, {"PrivateSwapFootprint", 50},
#endif #endif
}); });
......
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