summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2022-01-20 16:36:02 -0800
committerYabin Cui <yabinc@google.com>2022-01-20 16:36:02 -0800
commit97b4bb3c9ad16c15bca22605d385ba95263c20db (patch)
treef05d27566a10ab96bfd38ac7c46bd56d23a1b6e4
parent32278d1edfd41405bfcd8156912f9b30ddd61020 (diff)
downloadextras-97b4bb3c9ad16c15bca22605d385ba95263c20db.tar.gz
simpleperf: add test for unwinding small map range.
For maps with MAPS_FLAGS_JIT_SYMFILE_MAP, the map range is for a JIT function, which can be smaller than elf header size. Test if we can unwind through it. Bug: 215556268 Test: run simpleperf_unit_test Change-Id: I6b727d7c748101589e5c01b957dfb88b7fdcc1d4
-rw-r--r--simpleperf/cmd_debug_unwind_test.cpp10
-rw-r--r--simpleperf/testdata/debug_unwind_small_map_range.databin0 -> 204847 bytes
2 files changed, 10 insertions, 0 deletions
diff --git a/simpleperf/cmd_debug_unwind_test.cpp b/simpleperf/cmd_debug_unwind_test.cpp
index 9a6a6fc2..d0bbfe8f 100644
--- a/simpleperf/cmd_debug_unwind_test.cpp
+++ b/simpleperf/cmd_debug_unwind_test.cpp
@@ -168,3 +168,13 @@ TEST(cmd_debug_unwind, generate_report) {
ASSERT_NE(output.find("unwinding_error_code: 4"), std::string::npos);
ASSERT_NE(output.find("symbol_2: android.os.Handler.enqueueMessage"), std::string::npos);
}
+
+TEST(cmd_debug_unwind, unwind_sample_for_small_map_range) {
+ CaptureStdout capture;
+ ASSERT_TRUE(capture.Start());
+ ASSERT_TRUE(DebugUnwindCmd()->Run(
+ {"-i", GetTestData("debug_unwind_small_map_range.data"), "--unwind-sample"}));
+ std::string output = capture.Finish();
+ ASSERT_NE(output.find("dso_3: /apex/com.android.art/lib64/libart.so"), std::string::npos)
+ << output;
+}
diff --git a/simpleperf/testdata/debug_unwind_small_map_range.data b/simpleperf/testdata/debug_unwind_small_map_range.data
new file mode 100644
index 00000000..2f94baac
--- /dev/null
+++ b/simpleperf/testdata/debug_unwind_small_map_range.data
Binary files differ