summaryrefslogtreecommitdiff
path: root/perfprofd/configreader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'perfprofd/configreader.cc')
-rw-r--r--perfprofd/configreader.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/perfprofd/configreader.cc b/perfprofd/configreader.cc
index 5d52b26e..def3f18f 100644
--- a/perfprofd/configreader.cc
+++ b/perfprofd/configreader.cc
@@ -70,7 +70,7 @@ void ConfigReader::addDefaultEntries()
// set to 100, then over time we want to see a perf profile
// collected every 100 seconds). The actual time within the interval
// for the collection is chosen randomly.
- addUnsignedEntry("collection_interval", config.collection_interval_in_s, 1, UINT32_MAX);
+ addUnsignedEntry("collection_interval", config.collection_interval_in_s, 0, UINT32_MAX);
// Use the specified fixed seed for random number generation (unit
// testing)
@@ -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,
@@ -333,6 +337,7 @@ void ConfigReader::FillConfig(Config* config) {
config->perf_path = getStringValue("perf_path");
config->sampling_period = getUnsignedValue("sampling_period");
+ config->sampling_frequency = getUnsignedValue("sampling_frequency");
config->sample_duration_in_s = getUnsignedValue("sample_duration");
@@ -352,7 +357,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");