diff options
author | ssid <ssid@chromium.org> | 2016-01-14 10:44:24 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-14 18:45:58 +0000 |
commit | 4d77d76a42425282b1a3c5b7309db9b98e777f60 (patch) | |
tree | c0563a9452960265b470289de6e8decd271f19ad /base/process | |
parent | e463401bc88116d770ba6ed209f9066a84155a4c (diff) | |
download | chromium_src-4d77d76a42425282b1a3c5b7309db9b98e777f60.zip chromium_src-4d77d76a42425282b1a3c5b7309db9b98e777f60.tar.gz chromium_src-4d77d76a42425282b1a3c5b7309db9b98e777f60.tar.bz2 |
[tracing] Dump child processes' memory metrics in browser
The sandbox in linux prevents the process from reading the process
metrics file. To work around this issue, the browser process will now
dump statistics of the child processes too. This requires the
composable dumps support in trace viewer and telemetry.
This CL makes following changes.
1. Move the process totals and memory maps dump provider into a single
header as process_metrics_dump_provider in components/tracing. This is
because it is not necessary to have this in base and now the provider
knows/manages for different processes. Also the dump method are made to
handle error better, since process can vanish while dumping.
2. Make the dump provider non-singleton and have a register / unregister
that manages the lifetime of the dump providers.
3. The dump providers unregister using the new
UnregisterAndDeleteDumpProviderAsync api added by crrev.com/1430073002.
4. On linux the browser process dumps metrics for all processes and on
android the child processes can dump since seccomp sandbox is not
enabled in android yet.
5. The proc/status file is human readable stats and is not guaranteed to
have a field that is asked for. So, the NOTREACHED is removed in
ReadProcStatusAndGetFieldAsSizeT.
6. Since we introduce other process dumps from browser process there
could be races while unregistering and dumping. To test this, the
browser test is updated.
BUG=461788
Review URL: https://codereview.chromium.org/1417003003
Cr-Commit-Position: refs/heads/master@{#369482}
Diffstat (limited to 'base/process')
-rw-r--r-- | base/process/process_metrics_linux.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc index bcebcf5..7a731bb 100644 --- a/base/process/process_metrics_linux.cc +++ b/base/process/process_metrics_linux.cc @@ -86,7 +86,8 @@ size_t ReadProcStatusAndGetFieldAsSizeT(pid_t pid, const std::string& field) { return value; } } - NOTREACHED(); + // This can be reached if the process dies when proc is read -- in that case, + // the kernel can return missing fields. return 0; } |