Lines Matching refs:sym
61 bool KSyms::resolve_addr(uint64_t addr, struct bcc_symbol *sym, bool demangle) { in resolve_addr() argument
72 sym->name = (*it).name.c_str(); in resolve_addr()
74 sym->demangle_name = sym->name; in resolve_addr()
75 sym->module = "kernel"; in resolve_addr()
76 sym->offset = addr - (*it).addr; in resolve_addr()
81 memset(sym, 0, sizeof(struct bcc_symbol)); in resolve_addr()
91 for (Symbol &sym : syms_) { in resolve_name()
92 symnames_[sym.name] = sym.addr; in resolve_name()
190 bool ProcSyms::resolve_addr(uint64_t addr, struct bcc_symbol *sym, in resolve_addr() argument
195 memset(sym, 0, sizeof(struct bcc_symbol)); in resolve_addr()
204 if (mod.find_addr(offset, sym)) { in resolve_addr()
206 if (sym->name && (!strncmp(sym->name, "_Z", 2) || !strncmp(sym->name, "___Z", 4))) in resolve_addr()
207 sym->demangle_name = in resolve_addr()
208 abi::__cxa_demangle(sym->name, nullptr, nullptr, nullptr); in resolve_addr()
209 if (!sym->demangle_name) in resolve_addr()
210 sym->demangle_name = sym->name; in resolve_addr()
228 sym->module = original_module; in resolve_addr()
332 bool ProcSyms::Module::find_addr(uint64_t offset, struct bcc_symbol *sym) { in find_addr() argument
335 sym->module = name_.c_str(); in find_addr()
336 sym->offset = offset; in find_addr()
366 sym->name = it->name->c_str(); in find_addr()
367 sym->offset = (offset - it->start); in find_addr()
395 void bcc_symbol_free_demangle_name(struct bcc_symbol *sym) { in bcc_symbol_free_demangle_name() argument
396 if (sym->demangle_name && (sym->demangle_name != sym->name)) in bcc_symbol_free_demangle_name()
397 free(const_cast<char*>(sym->demangle_name)); in bcc_symbol_free_demangle_name()
401 struct bcc_symbol *sym) { in bcc_symcache_resolve() argument
403 return cache->resolve_addr(addr, sym) ? 0 : -1; in bcc_symcache_resolve()
407 struct bcc_symbol *sym) { in bcc_symcache_resolve_no_demangle() argument
409 return cache->resolve_addr(addr, sym, false) ? 0 : -1; in bcc_symcache_resolve_no_demangle()
473 struct bcc_symbol *sym = (struct bcc_symbol *)payload; in _find_sym() local
474 if (!strcmp(sym->name, symname)) { in _find_sym()
475 sym->offset = addr; in _find_sym()
498 struct bcc_symbol *sym) { in bcc_resolve_symname() argument
508 memset(sym, 0, sizeof(bcc_symbol)); in bcc_resolve_symname()
511 sym->module = strdup(module); in bcc_resolve_symname()
513 sym->module = bcc_procutils_which_so(module, pid); in bcc_resolve_symname()
515 if (sym->module == NULL) in bcc_resolve_symname()
520 sym->name = symname; in bcc_resolve_symname()
521 sym->offset = addr; in bcc_resolve_symname()
525 if (sym->name && sym->offset == 0x0) in bcc_resolve_symname()
526 if (bcc_elf_foreach_sym(sym->module, _find_sym, option, sym) < 0) in bcc_resolve_symname()
528 if (sym->offset == 0x0) in bcc_resolve_symname()
535 if (bcc_elf_get_type(sym->module) == ET_EXEC) { in bcc_resolve_symname()
537 .target_addr = sym->offset, in bcc_resolve_symname()
540 if (bcc_elf_foreach_load_section(sym->module, &_find_load, &addr) < 0) in bcc_resolve_symname()
544 sym->offset = addr.binary_addr; in bcc_resolve_symname()
549 if (sym->module) { in bcc_resolve_symname()
550 ::free(const_cast<char*>(sym->module)); in bcc_resolve_symname()
551 sym->module = NULL; in bcc_resolve_symname()