diff options
author | Yabin Cui <yabinc@google.com> | 2016-11-29 15:21:13 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2016-11-29 15:21:13 -0800 |
commit | 5be914df7e842a052219a6ef4891ff3208373fc3 (patch) | |
tree | 4aa0c8e5b94d2cdd1e4dfa2caa7420cead3239ee /simpleperf/cmd_report_test.cpp | |
parent | c11a58e7013e0f8cc59eb6eb02fe3366e625665a (diff) | |
download | extras-5be914df7e842a052219a6ef4891ff3208373fc3.tar.gz |
simpleperf: fix tests for dwarf callgraph unwinding.
32-bit simpleperf can't unwind a 64-bit `sleep` process in aarch64
environment. It makes following error in tests:
simpleperf is built in arch arm, and can't do stack unwinding for arch arm64
So make the workload be able to start a process
running callback function. By profiling that process, we can
guarantee that 32-bit simpleperf is profiling a 32-bit process.
Also fix a flaky test IOEventLoop.signal.
Build 32-bit simpleperf_unit_test on 64-bit devices.
Bug: http://b/33167911
Test: run simpleperf_unit_test.
Change-Id: I82741dc5d90c73c1890f834d8e2a9188421a3828
Diffstat (limited to 'simpleperf/cmd_report_test.cpp')
-rw-r--r-- | simpleperf/cmd_report_test.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/simpleperf/cmd_report_test.cpp b/simpleperf/cmd_report_test.cpp index 98190ee1..f34be5ca 100644 --- a/simpleperf/cmd_report_test.cpp +++ b/simpleperf/cmd_report_test.cpp @@ -446,9 +446,12 @@ static std::unique_ptr<Command> RecordCmd() { TEST_F(ReportCommandTest, dwarf_callgraph) { if (IsDwarfCallChainSamplingSupported()) { + std::vector<std::unique_ptr<Workload>> workloads; + CreateProcesses(1, &workloads); + std::string pid = std::to_string(workloads[0]->GetPid()); TemporaryFile tmp_file; ASSERT_TRUE( - RecordCmd()->Run({"-g", "-o", tmp_file.path, "sleep", SLEEP_SEC})); + RecordCmd()->Run({"-p", pid, "-g", "-o", tmp_file.path, "sleep", SLEEP_SEC})); ReportRaw(tmp_file.path, {"-g"}); ASSERT_TRUE(success); } else { |