symbol.h 952 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _PERF_SYMBOL_
  2. #define _PERF_SYMBOL_ 1
  3. #include <linux/types.h>
  4. #include "list.h"
  5. #include "rbtree.h"
  6. struct symbol {
  7. struct rb_node rb_node;
  8. __u64 start;
  9. __u64 end;
  10. char name[0];
  11. };
  12. struct dso {
  13. struct list_head node;
  14. struct rb_root syms;
  15. unsigned int sym_priv_size;
  16. char name[0];
  17. };
  18. typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
  19. struct dso *dso__new(const char *name, unsigned int sym_priv_size);
  20. void dso__delete(struct dso *self);
  21. static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
  22. {
  23. return ((void *)sym) - self->sym_priv_size;
  24. }
  25. struct symbol *dso__find_symbol(struct dso *self, uint64_t ip);
  26. int dso__load_kernel(struct dso *self, const char *vmlinux,
  27. symbol_filter_t filter, int verbose);
  28. int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
  29. size_t dso__fprintf(struct dso *self, FILE *fp);
  30. void symbol__init(void);
  31. #endif /* _PERF_SYMBOL_ */