diff options
-rw-r--r-- | perfprofd/configreader.cc | 3 | ||||
-rw-r--r-- | perfprofd/perfprofdcore.cc | 7 | ||||
-rw-r--r-- | perfprofd/tests/perfprofd_test.cc | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/perfprofd/configreader.cc b/perfprofd/configreader.cc index f2b60788..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) @@ -337,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"); diff --git a/perfprofd/perfprofdcore.cc b/perfprofd/perfprofdcore.cc index c5605ac7..73332a3f 100644 --- a/perfprofd/perfprofdcore.cc +++ b/perfprofd/perfprofdcore.cc @@ -481,7 +481,7 @@ static PROFILE_RESULT invoke_perf(Config& config, } // marshall arguments - constexpr unsigned max_args = 15; + constexpr unsigned max_args = 17; const char *argv[max_args]; unsigned slot = 0; argv[slot++] = perf_path.c_str(); @@ -504,8 +504,11 @@ static PROFILE_RESULT invoke_perf(Config& config, } // -g if desired - if (stack_profile_opt) + if (stack_profile_opt) { argv[slot++] = stack_profile_opt; + argv[slot++] = "-m"; + argv[slot++] = "8192"; + } std::string pid_str; if (config.process < 0) { diff --git a/perfprofd/tests/perfprofd_test.cc b/perfprofd/tests/perfprofd_test.cc index 6c5c2783..a96fd710 100644 --- a/perfprofd/tests/perfprofd_test.cc +++ b/perfprofd/tests/perfprofd_test.cc @@ -613,7 +613,6 @@ TEST_F(PerfProfdTest, ConfigFileParsing) runner.addToConfig("destination_directory=/does/not/exist"); // assorted bad syntax - runner.addToConfig("collection_interval=0"); runner.addToConfig("collection_interval=-1"); runner.addToConfig("nonexistent_key=something"); runner.addToConfig("no_equals_stmt"); @@ -626,10 +625,9 @@ TEST_F(PerfProfdTest, ConfigFileParsing) // Verify log contents const std::string expected = RAW_RESULT( - W: line 6: specified value 0 for 'collection_interval' outside permitted range [1 4294967295] (ignored) - W: line 7: malformed unsigned value (ignored) - W: line 8: unknown option 'nonexistent_key' ignored - W: line 9: line malformed (no '=' found) + W: line 6: malformed unsigned value (ignored) + W: line 7: unknown option 'nonexistent_key' ignored + W: line 8: line malformed (no '=' found) ); // check to make sure log excerpt matches |