diff options
author | Yabin Cui <yabinc@google.com> | 2020-12-17 17:06:27 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2020-12-17 17:41:52 -0800 |
commit | 36b57d9cce9d82213dc26716e86f34016f2336ac (patch) | |
tree | b84de9158640cc8acdfd2b4db258f5f64fd76ae0 /simpleperf/dso.cpp | |
parent | 01b38b8836ee9f8c30ac6074d11efef08efbd8fa (diff) | |
download | extras-36b57d9cce9d82213dc26716e86f34016f2336ac.tar.gz |
simpleperf: fix ReportCommandTest on windows.
Fix failed tests:
ReportCommandTest.report_kernel_symbol
ReportCommandTest.kallsyms_option
They fail because kallsyms are only used on linux.
Bug: 175885920
Test: run simpleperf_unit_test
Change-Id: I6a10969a819a4169a173c77178e6fcd67fee40df
Diffstat (limited to 'simpleperf/dso.cpp')
-rw-r--r-- | simpleperf/dso.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp index 5eb42bf4..fbff62b7 100644 --- a/simpleperf/dso.cpp +++ b/simpleperf/dso.cpp @@ -642,10 +642,10 @@ class KernelDso : public Dso { ReadSymbolsFromDebugFile(&symbols); } -#if defined(__linux__) if (symbols.empty() && !kallsyms_.empty()) { ReadSymbolsFromKallsyms(kallsyms_, &symbols); } +#if defined(__linux__) if (symbols.empty()) { ReadSymbolsFromProc(&symbols); } @@ -682,7 +682,6 @@ class KernelDso : public Dso { ReportReadElfSymbolResult(status, path_, debug_file_path_); } -#if defined(__linux__) void ReadSymbolsFromKallsyms(std::string& kallsyms, std::vector<Symbol>* symbols) { auto symbol_callback = [&](const KernelSymbol& symbol) { if (strchr("TtWw", symbol.type) && symbol.addr != 0u) { @@ -702,6 +701,7 @@ class KernelDso : public Dso { } } +#if defined(__linux__) void ReadSymbolsFromProc(std::vector<Symbol>* symbols) { BuildId build_id = GetExpectedBuildId(); if (!build_id.IsEmpty()) { |