OSDN Git Service

simpleperf: print file path used for reading symbols.
authorYabin Cui <yabinc@google.com>
Thu, 25 Aug 2016 17:46:40 +0000 (10:46 -0700)
committerYabin Cui <yabinc@google.com>
Thu, 25 Aug 2016 17:46:40 +0000 (10:46 -0700)
It helps users to find out which files are used for
reporting.

Bug: http://b/29574526
Change-Id: I3d608e61c50471632c50bf6e8f6f9e45c63fc4b4
Test: run `simpleperf report --log verbose` manually.

simpleperf/dso.cpp

index 69049e2..bd6c1ba 100644 (file)
@@ -265,6 +265,7 @@ static void VmlinuxSymbolCallback(const ElfFileSymbol& elf_symbol, Dso* dso) {
 
 bool CheckReadSymbolResult(ElfStatus result, const std::string& filename) {
   if (result == ElfStatus::NO_ERROR) {
+    LOG(VERBOSE) << "Read symbols from " << filename << " successfully";
     return true;
   } else if (result == ElfStatus::NO_SYMBOL_TABLE) {
     // Lacking symbol table isn't considered as an error but worth reporting.
@@ -374,7 +375,7 @@ bool Dso::LoadElfFile() {
         std::bind(ElfFileSymbolCallback, std::placeholders::_1, this,
                   SymbolFilterForDso));
     if (result == ElfStatus::NO_ERROR) {
-      return true;
+      return CheckReadSymbolResult(result, "/usr/lib/debug" + path_);
     }
   }
   ElfStatus result = ParseSymbolsFromElfFile(