mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-19 09:04:51 +08:00
94cb9e385d
Used with perf report --verbose: [acme@doppio linux-2.6-tip]$ perf report -v | head -16 5.17% firefox /usr/lib64/xulrunner-1.9.1/libxul.so 0x00000000005d8eee f [.] imgContainer::DrawFrameTo(gfxIImageFrame*, gfxIImageFrame*, nsRect&) 2.56% firefox /lib64/libpthread-2.10.1.so 0x0000000000008e02 d [.] __pthread_mutex_lock_internal 1.94% firefox /usr/lib64/xulrunner-1.9.1/libxul.so 0x0000000000d0af8f f [.] SearchTable 1.75% firefox [kernel] 0xffffffffff60013b k [.] vread_hpet 1.63% firefox /lib64/libpthread-2.10.1.so 0x000000000000a404 d [.] __pthread_mutex_unlock 1.47% firefox /usr/lib64/xulrunner-1.9.1/libmozjs.so 0x00000000000482ea f [.] js_Interpret 1.42% firefox /usr/lib64/xulrunner-1.9.1/libmozjs.so 0x000000000003eda3 f [.] JS_CallTracer 1.24% firefox [kernel] 0xffffffff8102ca4a k [k] read_hpet 1.16% firefox [kernel] 0xffffffff810f3dd4 k [k] fget_light 1.11% firefox /usr/lib64/xulrunner-1.9.1/libmozjs.so 0x00000000000567ff f [.] js_TraceObject 0.98% firefox /usr/lib64/firefox-3.5.2/firefox 0x000000000000dd23 b [.] arena_ralloc [acme@doppio linux-2.6-tip]$ The new field is just after the symbol address. To help in figuring out symbol resolution bugs. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
#ifndef _PERF_SYMBOL_
|
|
#define _PERF_SYMBOL_ 1
|
|
|
|
#include <linux/types.h>
|
|
#include "types.h"
|
|
#include <linux/list.h>
|
|
#include <linux/rbtree.h>
|
|
#include "module.h"
|
|
|
|
struct symbol {
|
|
struct rb_node rb_node;
|
|
u64 start;
|
|
u64 end;
|
|
u64 obj_start;
|
|
u64 hist_sum;
|
|
u64 *hist;
|
|
struct module *module;
|
|
void *priv;
|
|
char name[0];
|
|
};
|
|
|
|
struct dso {
|
|
struct list_head node;
|
|
struct rb_root syms;
|
|
struct symbol *(*find_symbol)(struct dso *, u64 ip);
|
|
unsigned int sym_priv_size;
|
|
unsigned char adjust_symbols;
|
|
unsigned char slen_calculated;
|
|
unsigned char origin;
|
|
char name[0];
|
|
};
|
|
|
|
const char *sym_hist_filter;
|
|
|
|
typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
|
|
|
|
struct dso *dso__new(const char *name, unsigned int sym_priv_size);
|
|
void dso__delete(struct dso *self);
|
|
|
|
static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
|
|
{
|
|
return ((void *)sym) - self->sym_priv_size;
|
|
}
|
|
|
|
struct symbol *dso__find_symbol(struct dso *self, u64 ip);
|
|
|
|
int dso__load_kernel(struct dso *self, const char *vmlinux,
|
|
symbol_filter_t filter, int verbose, int modules);
|
|
int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose);
|
|
int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
|
|
|
|
size_t dso__fprintf(struct dso *self, FILE *fp);
|
|
char dso__symtab_origin(const struct dso *self);
|
|
|
|
void symbol__init(void);
|
|
#endif /* _PERF_SYMBOL_ */
|