"common options:\n"
" -h/--help Print this help information.\n"
" --log <severity> Set the minimum severity of logging. Possible severities\n"
- " include debug, warning, error, fatal. Default is error.\n"
+ " include debug, warning, error, fatal. Default is warning.\n"
"subcommands:\n");
for (auto& cmd_name : GetAllCommandNames()) {
std::unique_ptr<Command> cmd = CreateCommandInstance(cmd_name);
#include "dwarf_unwind.h"
#include "environment.h"
-std::vector<uint64_t> UnwindCallChain(const ThreadEntry&, const RegSet&,
- const std::vector<char>&) {
+std::vector<uint64_t> UnwindCallChain(const ThreadEntry&, const RegSet&, const std::vector<char>&) {
return std::vector<uint64_t>();
}
}
};
-
std::string Dso::GetAccessiblePath() const {
return symfs_dir_ + path_;
}
return false;
}
}
+
ProcessKernelSymbols("/proc/kallsyms",
std::bind(&KernelSymbolCallback, std::placeholders::_1, this));
+ bool allZero = true;
+ for (auto& symbol : symbols_) {
+ if (symbol.addr != 0) {
+ allZero = false;
+ break;
+ }
+ }
+ if (allZero) {
+ LOG(WARNING) << "Symbol addresses in /proc/kallsyms are all zero. Check "
+ "/proc/sys/kernel/kptr_restrict if possible.";
+ symbols_.clear();
+ return false;
+ }
}
return true;
}
#include "thread_tree.h"
-#define SetUContextReg(dst, perf_regno) \
- do { \
- uint64_t value; \
+#define SetUContextReg(dst, perf_regno) \
+ do { \
+ uint64_t value; \
if (GetRegValue(regs, perf_regno, &value)) { \
- dst = value; \
- } \
+ dst = value; \
+ } \
} while (0)
static ucontext_t BuildUContextFromRegs(const RegSet& regs __attribute__((unused))) {
return ucontext;
}
-std::vector<uint64_t> UnwindCallChain(const ThreadEntry& thread,
- const RegSet& regs,
+std::vector<uint64_t> UnwindCallChain(const ThreadEntry& thread, const RegSet& regs,
const std::vector<char>& stack) {
std::vector<uint64_t> result;
if (GetCurrentArch() != GetBuildArch()) {
struct ThreadEntry;
std::vector<uint64_t> UnwindCallChain(const ThreadEntry& thread, const RegSet& regs,
- const std::vector<char>& stack);
+ const std::vector<char>& stack);
#endif // SIMPLE_PERF_DWARF_UNWIND_H_
int main(int argc, char** argv) {
InitLogging(argv, android::base::StderrLogger);
std::vector<std::string> args;
- android::base::LogSeverity log_severity = android::base::ERROR;
+ android::base::LogSeverity log_severity = android::base::WARNING;
if (argc == 1) {
args.push_back("help");