Skip to content

Commit

Permalink
Rebase and remove mount guards
Browse files Browse the repository at this point in the history
  • Loading branch information
danobi authored and yonghong-song committed Jul 12, 2019
1 parent d413c95 commit 86633c4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/cc/bcc_syms.cc
Expand Up @@ -351,12 +351,10 @@ bool ProcSyms::Module::find_name(const char *symname, uint64_t *addr) {
return 0;
};

ProcMountNSGuard g(mount_ns_);

if (type_ == ModuleType::PERF_MAP)
bcc_perf_map_foreach_sym(name_.c_str(), cb, &payload);
bcc_perf_map_foreach_sym(path_.c_str(), cb, &payload);
if (type_ == ModuleType::EXEC || type_ == ModuleType::SO)
bcc_elf_foreach_sym(name_.c_str(), cb, symbol_option_, &payload);
bcc_elf_foreach_sym(path_.c_str(), cb, symbol_option_, &payload);
if (type_ == ModuleType::VDSO)
bcc_elf_foreach_vdso_sym(cb, &payload);

Expand Down Expand Up @@ -405,9 +403,8 @@ bool ProcSyms::Module::find_addr(uint64_t offset, struct bcc_symbol *sym) {
if (offset < it->start + it->size) {
// Resolve and cache the symbol name if necessary
if (!it->is_name_resolved) {
ProcMountNSGuard g(mount_ns_);
std::string sym_name(it->data.name_idx.str_len + 1, '\0');
if (bcc_elf_symbol_str(name_.c_str(), it->data.name_idx.section_idx,
if (bcc_elf_symbol_str(path_.c_str(), it->data.name_idx.section_idx,
it->data.name_idx.str_table_idx, &sym_name[0], sym_name.size(),
it->data.name_idx.debugfile))
break;
Expand Down

0 comments on commit 86633c4

Please sign in to comment.