1 Star 1 Fork 0

Rong Tao/autofdo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
instruction_map.cc 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
Wei Mi 提交于 2021-09-15 22:55 . Update to the latest internal version.
// 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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rtoax/autofdo.git
git@gitee.com:rtoax/autofdo.git
rtoax
autofdo
autofdo
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385