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,
OSMemDumpPtr GetFakeOSMemDump(uint32_t resident_set_kb,
uint32_t private_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
#endif
) {
) {
using memory_instrumentation::mojom::VmRegion;
return memory_instrumentation::mojom::OSMemDump::New(
resident_set_kb, resident_set_kb /* peak_resident_set_kb */,
true /* is_peak_rss_resettable */, private_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
#endif
......@@ -156,7 +156,7 @@ void PopulateBrowserMetrics(GlobalMemoryDumpPtr& global_dump,
OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb) * 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
// modify metrics_mb to create the value, which leads to
// expectation failures.
......@@ -165,7 +165,7 @@ void PopulateBrowserMetrics(GlobalMemoryDumpPtr& global_dump,
#else
metrics_mb["SharedMemoryFootprint"] * 1024
#endif
);
);
pmd->os_dump = std::move(os_dump);
global_dump->process_dumps.push_back(std::move(pmd));
}
......@@ -179,7 +179,7 @@ MetricMap GetExpectedBrowserMetrics() {
{"Malloc", 20}, {"PrivateMemoryFootprint", 30},
{"SharedMemoryFootprint", 35}, {"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},
#endif
});
......@@ -310,15 +310,15 @@ void PopulateRendererMetrics(GlobalMemoryDumpPtr& global_dump,
metrics_mb_or_count["PartitionAlloc.Partitions.ArrayBuffer"] * 1024 *
1024);
OSMemDumpPtr os_dump = GetFakeOSMemDump(
GetResidentValue(metrics_mb_or_count) * 1024,
metrics_mb_or_count["PrivateMemoryFootprint"] * 1024,
#if defined(OS_LINUX) || defined(OS_ANDROID)
// accessing PrivateSwapFootprint on other OSes will
// modify metrics_mb_or_count to create the value, which leads to
// expectation failures.
metrics_mb_or_count["SharedMemoryFootprint"] * 1024,
metrics_mb_or_count["PrivateSwapFootprint"] * 1024
OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb_or_count) * 1024,
metrics_mb_or_count["PrivateMemoryFootprint"] * 1024,
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
// accessing PrivateSwapFootprint on other OSes will
// modify metrics_mb_or_count to create the value, which
// leads to expectation failures.
metrics_mb_or_count["SharedMemoryFootprint"] * 1024,
metrics_mb_or_count["PrivateSwapFootprint"] * 1024
#else
metrics_mb_or_count["SharedMemoryFootprint"] * 1024
#endif
......@@ -372,7 +372,7 @@ MetricMap GetExpectedRendererMetrics() {
{"V8.Main.Malloc", 2}, {"V8.Workers", 60},
{"V8.Workers.AllocatedObjects", 40}, {"NumberOfExtensions", 0},
{"Uptime", 42},
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
{"PrivateSwapFootprint", 50},
#endif
{"NumberOfAdSubframes", 28}, {"NumberOfDetachedScriptStates", 11},
......@@ -406,7 +406,7 @@ void PopulateGpuMetrics(GlobalMemoryDumpPtr& global_dump,
OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb) * 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
// modify metrics_mb to create the value, which leads to
// expectation failures.
......@@ -415,7 +415,7 @@ void PopulateGpuMetrics(GlobalMemoryDumpPtr& global_dump,
#else
metrics_mb["SharedMemoryFootprint"] * 1024
#endif
);
);
pmd->os_dump = std::move(os_dump);
global_dump->process_dumps.push_back(std::move(pmd));
}
......@@ -429,7 +429,7 @@ MetricMap GetExpectedGpuMetrics() {
{"Malloc", 220}, {"PrivateMemoryFootprint", 230},
{"SharedMemoryFootprint", 235}, {"CommandBuffer", kGpuCommandBufferMB},
{"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},
#endif
});
......@@ -445,7 +445,7 @@ void PopulateAudioServiceMetrics(GlobalMemoryDumpPtr& global_dump,
OSMemDumpPtr os_dump =
GetFakeOSMemDump(GetResidentValue(metrics_mb) * 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
// modify metrics_mb to create the value, which leads to
// expectation failures.
......@@ -454,7 +454,7 @@ void PopulateAudioServiceMetrics(GlobalMemoryDumpPtr& global_dump,
#else
metrics_mb["SharedMemoryFootprint"] * 1024
#endif
);
);
pmd->os_dump = std::move(os_dump);
global_dump->process_dumps.push_back(std::move(pmd));
}
......@@ -467,7 +467,7 @@ MetricMap GetExpectedAudioServiceMetrics() {
#endif
{"Malloc", 20}, {"PrivateMemoryFootprint", 30},
{"SharedMemoryFootprint", 35}, {"Uptime", 42},
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
{"PrivateSwapFootprint", 50},
#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