/* * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP; * for newer versions we can use mmap to reduce memory usage:
*/ #ifdef ELF_C_READ_MMAP # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP #else # define PERF_ELF_C_READ_MMAP ELF_C_READ #endif
/** * A symtab entry. When allocated this may be preceded by an annotation (see * symbol__annotation) and/or a browser_index (see symbol__browser_index).
*/ struct symbol { struct rb_node rb_node; /** Range of symbol [start, end). */
u64 start;
u64 end; /** Length of the string name. */
u16 namelen; /** ELF symbol type as defined for st_info. E.g STT_OBJECT or STT_FUNC. */
u8 type:4; /** ELF binding type as defined for st_info. E.g. STB_WEAK or STB_GLOBAL. */
u8 binding:4; /** Set true for kernel symbols of idle routines. */
u8 idle:1; /** Resolvable but tools ignore it (e.g. idle routines). */
u8 ignore:1; /** Symbol for an inlined function. */
u8 inlined:1; /** Has symbol__annotate2 been performed. */
u8 annotate2:1; /** Symbol is an alias of an STT_GNU_IFUNC */
u8 ifunc_alias:1; /** Architecture specific. Unused except on PPC where it holds st_other. */
u8 arch_sym; /** The name of length namelen associated with the symbol. */ char name[];
};
void symbol__delete(struct symbol *sym); void symbols__delete(struct rb_root_cached *symbols);
/* symbols__for_each_entry - iterate over symbols (rb_root) * * @symbols: the rb_root of symbols * @pos: the 'struct symbol *' to use as a loop cursor * @nd: the 'struct rb_node *' to use as a temporary storage
*/ #define symbols__for_each_entry(symbols, pos, nd) \ for (nd = rb_first_cached(symbols); \
nd && (pos = rb_entry(nd, struct symbol, rb_node)); \
nd = rb_next(nd))
int dso__load(struct dso *dso, struct map *map); int dso__load_vmlinux(struct dso *dso, struct map *map, constchar *vmlinux, bool vmlinux_allocated); int dso__load_vmlinux_path(struct dso *dso, struct map *map); int __dso__load_kallsyms(struct dso *dso, constchar *filename, struct map *map, bool no_kcore); int dso__load_kallsyms(struct dso *dso, constchar *filename, struct map *map);
void dso__insert_symbol(struct dso *dso, struct symbol *sym); void dso__delete_symbol(struct dso *dso, struct symbol *sym);
struct symbol *dso__find_symbol(struct dso *dso, u64 addr); struct symbol *dso__find_symbol_nocache(struct dso *dso, u64 addr);
struct symbol *dso__next_symbol_by_name(struct dso *dso, size_t *idx); struct symbol *dso__find_symbol_by_name(struct dso *dso, constchar *name, size_t *idx);
struct symbol *dso__first_symbol(struct dso *dso); struct symbol *dso__last_symbol(struct dso *dso); struct symbol *dso__next_symbol(struct symbol *sym);
enum dso_type dso__type_fd(int fd);
int filename__read_build_id(constchar *filename, struct build_id *id, bool block); int sysfs__read_build_id(constchar *filename, struct build_id *bid); int modules__parse(constchar *filename, void *arg, int (*process_module)(void *arg, constchar *name,
u64 start, u64 size)); int filename__read_debuglink(constchar *filename, char *debuglink,
size_t size); bool filename__has_section(constchar *filename, constchar *sec);
struct perf_env; int symbol__init(struct perf_env *env); void symbol__exit(void); void symbol__elf_init(void); int symbol__annotation_init(void);
struct symbol *symbol__new(u64 start, u64 len, u8 binding, u8 type, constchar *name);
size_t __symbol__fprintf_symname_offs(conststruct symbol *sym, conststruct addr_location *al, bool unknown_as_addr, bool print_offsets, FILE *fp);
size_t symbol__fprintf_symname_offs(conststruct symbol *sym, conststruct addr_location *al, FILE *fp);
size_t __symbol__fprintf_symname(conststruct symbol *sym, conststruct addr_location *al, bool unknown_as_addr, FILE *fp);
size_t symbol__fprintf_symname(conststruct symbol *sym, FILE *fp);
size_t symbol__fprintf(struct symbol *sym, FILE *fp); bool symbol__restricted_filename(constchar *filename, constchar *restricted_filename); int symbol__config_symfs(conststruct option *opt __maybe_unused, constchar *dir, int unset __maybe_unused);
struct symsrc;
#ifdef HAVE_LIBBFD_SUPPORT int dso__load_bfd_symbols(struct dso *dso, constchar *debugfile); #endif
int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, struct symsrc *runtime_ss, int kmodule); int dso__synthesize_plt_symbols(struct dso *dso, struct symsrc *ss);
char *dso__demangle_sym(struct dso *dso, int kmodule, constchar *elf_name);
int arch__compare_symbol_names(constchar *namea, constchar *nameb); int arch__compare_symbol_names_n(constchar *namea, constchar *nameb, unsignedint n); int arch__choose_best_symbol(struct symbol *syma, struct symbol *symb);
int symbol__match_symbol_name(constchar *namea, constchar *nameb, enum symbol_tag_include includes);
/* structure containing an SDT note's info */ struct sdt_note { char *name; /* name of the note*/ char *provider; /* provider name */ char *args; bool bit32; /* whether the location is 32 bits? */ union { /* location, base and semaphore addrs */
Elf64_Addr a64[3];
Elf32_Addr a32[3];
} addr; struct list_head note_list; /* SDT notes' list */
};
int get_sdt_note_list(struct list_head *head, constchar *target); int cleanup_sdt_note_list(struct list_head *sdt_notes); int sdt_notes__get_count(struct list_head *start);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.