diff options
author | Andreas Gampe <agampe@google.com> | 2018-04-19 10:16:30 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2018-05-03 13:30:57 -0700 |
commit | 041d329e2fd3193d28168ef8d09f9800180e4527 (patch) | |
tree | f58d598c43bdf8147636f8eef149d70da1cc26aa | |
parent | e9e5710d43556989f48525202460971de3da772a (diff) | |
download | extras-041d329e2fd3193d28168ef8d09f9800180e4527.tar.gz |
Perfprofd: Add process to configreader
So that it is exposed to the command line interface.
(cherry picked from commit abc57274490870903f591140ad3a5cd509a0b372)
Bug: 73175642
Test: mmma system/extras/perfprofd
Test: perfprofd_test
Test: manual
Merged-In: I18903e860d91957dc53adeea9c1f12596fd7ff74
Change-Id: I18903e860d91957dc53adeea9c1f12596fd7ff74
-rw-r--r-- | perfprofd/configreader.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/perfprofd/configreader.cc b/perfprofd/configreader.cc index 5d52b26e..f2b60788 100644 --- a/perfprofd/configreader.cc +++ b/perfprofd/configreader.cc @@ -142,6 +142,10 @@ void ConfigReader::addDefaultEntries() // If true, send the proto to dropbox instead of to a file. addUnsignedEntry("dropbox", config.send_to_dropbox ? 1 : 0, 0, 1); + + // The pid of the process to profile. May be negative, in which case + // the whole system will be profiled. + addUnsignedEntry("process", static_cast<uint32_t>(-1), 0, UINT32_MAX); } void ConfigReader::addUnsignedEntry(const char *key, @@ -352,7 +356,7 @@ void ConfigReader::FillConfig(Config* config) { config->collect_booting = getBoolValue("collect_booting"); config->collect_camera_active = getBoolValue("collect_camera_active"); - config->process = -1; + config->process = static_cast<int32_t>(getUnsignedValue("process")); config->use_elf_symbolizer = getBoolValue("use_elf_symbolizer"); config->compress = getBoolValue("compress"); config->send_to_dropbox = getBoolValue("dropbox"); |