diff options
author | Yabin Cui <yabinc@google.com> | 2018-07-20 17:12:13 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2018-07-23 10:51:11 -0700 |
commit | 3939b9dd836c7dadeb2fe74ecef7e658d837c36d (patch) | |
tree | b5f877ece7092b02d2e6b45b4bdc714a7d392b36 /simpleperf/dso_test.cpp | |
parent | 3a51155fd7f7c61c333564d72fbe713feefb3674 (diff) | |
download | extras-3939b9dd836c7dadeb2fe74ecef7e658d837c36d.tar.gz |
simpleperf: add --symdir option in report-sample command.
--symdir option is used to provide a directory containing files with
symbols. Mutliple --symdir options can be used to provide more than
one directories. For each symbol directory, simpleperf collects build
id for all elf files under it recursively. Then simpleperf can use
the collected build ids to find files with symbols.
Also fix an error in GetCompleteProcessName().
Bug: 111687223
Test: run simpleperf_unit_test.
Change-Id: Ieac5ebf7451ae85ca15c3eae37bac3c89615580b
Diffstat (limited to 'simpleperf/dso_test.cpp')
-rw-r--r-- | simpleperf/dso_test.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/simpleperf/dso_test.cpp b/simpleperf/dso_test.cpp index a1d005a3..ab220a1c 100644 --- a/simpleperf/dso_test.cpp +++ b/simpleperf/dso_test.cpp @@ -67,6 +67,15 @@ TEST(DebugElfFileFinder, use_vdso) { ASSERT_EQ(finder.FindDebugFile("[vdso]", true, build_id), fake_vdso64); } +TEST(DebugElfFileFinder, add_symbol_dir) { + DebugElfFileFinder finder; + ASSERT_FALSE(finder.AddSymbolDir(GetTestDataDir() + "dir_not_exist")); + ASSERT_EQ(finder.FindDebugFile("elf", false, CHECK_ELF_FILE_BUILD_ID), "elf"); + ASSERT_TRUE(finder.AddSymbolDir(GetTestDataDir() + CORRECT_SYMFS_FOR_BUILD_ID_CHECK)); + ASSERT_EQ(finder.FindDebugFile("elf", false, CHECK_ELF_FILE_BUILD_ID), + GetTestDataDir() + CORRECT_SYMFS_FOR_BUILD_ID_CHECK + "/elf_for_build_id_check"); +} + TEST(dso, dex_file_dso) { #if defined(__linux__) for (DsoType dso_type : {DSO_DEX_FILE, DSO_ELF_FILE}) { |