summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_record_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2021-02-24 15:11:57 -0800
committerYabin Cui <yabinc@google.com>2021-02-25 13:27:32 -0800
commit0272f02006d7a1776a80173996a9d2debc0d0a35 (patch)
treeb2465b06c88dcbf490ab0eb6ab226bb93d214607 /simpleperf/cmd_record_test.cpp
parentb8b553363fc94d4d72e55d207abbb30ab30656ec (diff)
downloadextras-0272f02006d7a1776a80173996a9d2debc0d0a35.tar.gz
simpleperf: add options to keep failed unwinding results in record cmd.
We want to add extra info for debugging unwinding failures while not affecting normal recording/reporting process. So add --keep-failed-unwinding-result to keep failed unwnding reasons, and add --keep-failed-unwinding-stack to keep failed unwinding stack data. The former is lightweight and can be used to give user some explanation. And both are needed to keep enough info for debugging. Bug: 181075274 Test: run simpleperf_unit_test Test: run simpleperf manually Change-Id: I8d65ad4957025d372099a66f749050f5c37aba81
Diffstat (limited to 'simpleperf/cmd_record_test.cpp')
-rw-r--r--simpleperf/cmd_record_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/simpleperf/cmd_record_test.cpp b/simpleperf/cmd_record_test.cpp
index 67afaf31..3cf3f59f 100644
--- a/simpleperf/cmd_record_test.cpp
+++ b/simpleperf/cmd_record_test.cpp
@@ -1104,3 +1104,12 @@ TEST(record_cmd, record_filter_options) {
RunRecordCmd({"--include-pid", "1,2", "--include-tid", "3,4", "--include-process-name",
"processB", "--include-thread-name", "threadB", "--include-uid", "5,6"}));
}
+
+TEST(record_cmd, keep_failed_unwinding_result_option) {
+ OMIT_TEST_ON_NON_NATIVE_ABIS();
+ std::vector<std::unique_ptr<Workload>> workloads;
+ CreateProcesses(1, &workloads);
+ std::string pid = std::to_string(workloads[0]->GetPid());
+ ASSERT_TRUE(RunRecordCmd(
+ {"-p", pid, "-g", "--keep-failed-unwinding-result", "--keep-failed-unwinding-stack"}));
+}