代码拉取完成,页面将自动刷新
// Copyright 2011 Google Inc. All Rights Reserved.
// Author: dehao@google.com (Dehao Chen)
// Class to build the map from instruction address to its info.
#include "instruction_map.h"
#include <string.h>
#include <cstdint>
#include "addr2line.h"
#include "symbol_map.h"
namespace devtools_crosstool_autofdo {
InstructionMap::~InstructionMap() {
for (const auto &addr_info : inst_map_) {
delete addr_info.second;
}
}
void InstructionMap::BuildPerFunctionInstructionMap(const std::string &name,
uint64_t start_addr,
uint64_t end_addr) {
if (start_addr >= end_addr) {
return;
}
for (uint64_t addr = start_addr; addr < end_addr; addr++) {
InstInfo *info = new InstInfo();
addr2line_->GetInlineStack(addr, &info->source_stack);
inst_map_.insert(InstMap::value_type(addr, info));
if (info->source_stack.size() > 0) {
symbol_map_->AddSourceCount(name, info->source_stack, 0, 1, 1,
SymbolMap::PERFDATA);
}
}
}
} // namespace devtools_crosstool_autofdo
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。