summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2024-05-08 17:22:41 -0700
committerYabin Cui <yabinc@google.com>2024-05-08 17:26:08 -0700
commit1684aa5147a27c89e610bae78799d68b87e64790 (patch)
tree75d47703ff8f568189242ccf920887bba6e6a9a8
parente04e4a20c8d4fb1de37123bf7ff2957f9b41e4b7 (diff)
downloadextras-1684aa5147a27c89e610bae78799d68b87e64790.tar.gz
simpleperf: Fix default value for --etm-flush-interval
options.PullUintValue() returns true even when --etm-flush-interval isn't used. In this case, interval is still set to etm_flush_interval_, which makes it 0. Bug: 336375740 Test: run simpleperf manually Change-Id: I95fafcf24b9ae821d8b19782813c7b2f312bf317
-rw-r--r--simpleperf/cmd_record.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/simpleperf/cmd_record.cpp b/simpleperf/cmd_record.cpp
index e08b153b..cb9ad884 100644
--- a/simpleperf/cmd_record.cpp
+++ b/simpleperf/cmd_record.cpp
@@ -1057,7 +1057,7 @@ bool RecordCommand::ParseOptions(const std::vector<std::string>& args,
etm_branch_list_generator_ = ETMBranchListGenerator::Create(system_wide_collection_);
}
uint32_t interval = 0;
- if (options.PullUintValue("--etm-flush-interval", &interval)) {
+ if (options.PullUintValue("--etm-flush-interval", &interval) && interval != 0) {
etm_flush_interval_ = std::chrono::milliseconds(interval);
}