Commit eef1fa38 authored by Gabriel Kerneis's avatar Gabriel Kerneis Committed by Commit Bot

Explicitly set swap memory metrics to zero on Fuchsia

Bug: 750948
Test: CQ
Change-Id: Ic11aec698c70d8d562ab51c16859b248b430b0f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299620
Commit-Queue: Gabriel Kerneis <kerneis@google.com>
Commit-Queue: Primiano Tucci <primiano@chromium.org>
Auto-Submit: Gabriel Kerneis <kerneis@google.com>
Reviewed-by: default avatarPrimiano Tucci <primiano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788560}
parent 7ebc0921
...@@ -20,11 +20,14 @@ FORWARD_DECLARE_TEST(ProfilingJsonExporterTest, MemoryMaps); ...@@ -20,11 +20,14 @@ FORWARD_DECLARE_TEST(ProfilingJsonExporterTest, MemoryMaps);
namespace memory_instrumentation { namespace memory_instrumentation {
// This class provides synchronous access to memory metrics for a process with a // This class provides synchronous access to memory metrics for a process with a
// given |pid|. These interfaces have platform-specific restrictrions: // given |pid|. These interfaces have platform-specific restrictions:
// * On Android, due to sandboxing restrictions, processes can only access // * On Android, due to sandboxing restrictions, processes can only access
// memory metrics for themselves. Thus |pid| must be equal to getpid(). // memory metrics for themselves. Thus |pid| must be equal to getpid().
// * On Linux, due to sandboxing restrictions, only the privileged browser // * On Linux, due to sandboxing restrictions, only the privileged browser
// process has access to memory metrics for sandboxed child processes. // process has access to memory metrics for sandboxed child processes.
// * On Fuchsia, due to the API expecting a ProcessId rather than a
// ProcessHandle, processes can only access memory metrics for themselves or
// for children of base::GetDefaultJob().
// //
// These restrictions mean that any code that wishes to be cross-platform // These restrictions mean that any code that wishes to be cross-platform
// compatible cannot synchronously obtain memory metrics for a |pid|. Instead, // compatible cannot synchronously obtain memory metrics for a |pid|. Instead,
......
...@@ -36,6 +36,8 @@ bool OSMetrics::FillOSMemoryDump(base::ProcessId pid, ...@@ -36,6 +36,8 @@ bool OSMetrics::FillOSMemoryDump(base::ProcessId pid,
dump->resident_set_kb = rss_bytes / 1024; dump->resident_set_kb = rss_bytes / 1024;
dump->platform_private_footprint->rss_anon_bytes = rss_anon_bytes; dump->platform_private_footprint->rss_anon_bytes = rss_anon_bytes;
// Fuchsia has no swap.
dump->platform_private_footprint->vm_swap_bytes = 0;
return true; return true;
} }
......
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