Set the allowed minimum for collection_interval to 0.
Copy the sampling_frequency.
Add "-m 8192" when call-stacks are requested.
(cherry picked from commit
59a18215031faedc4bbee70baef363299cec0b69)
Bug:
73175642
Test: mmma system/extras/perfprofd
Test: perfprofd_test
Merged-In: I8fd41da08eb14dadc98b85afe1e4dbed2d9bc9b1
Change-Id: I8fd41da08eb14dadc98b85afe1e4dbed2d9bc9b1
// 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)
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");
}
// 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();
}
// -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) {
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");
// 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