mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
c338aee853
Just like we do with the other DSOs. This also simplifies the kernel_maps setup process, now all that the tools need to do is to call kernel_maps__init and the maps for the modules and kernel will be created, then, later, when kernel_maps__find_symbol() is used, it will also call maps__find_symbol that already checks if the symtab was loaded, loading it if needed. Now if one does 'perf top --hide_kernel_symbols' we won't pay the price of loading the (many) symbols in /proc/kallsyms or vmlinux. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1258757489-5978-4-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
38 lines
1 KiB
C
38 lines
1 KiB
C
#ifndef __PERF_THREAD_H
|
|
#define __PERF_THREAD_H
|
|
|
|
#include <linux/rbtree.h>
|
|
#include <unistd.h>
|
|
#include "symbol.h"
|
|
|
|
struct thread {
|
|
struct rb_node rb_node;
|
|
struct rb_root maps;
|
|
struct list_head removed_maps;
|
|
pid_t pid;
|
|
char shortname[3];
|
|
char *comm;
|
|
int comm_len;
|
|
};
|
|
|
|
int thread__set_comm(struct thread *self, const char *comm);
|
|
int thread__comm_len(struct thread *self);
|
|
struct thread *threads__findnew(pid_t pid);
|
|
struct thread *register_idle_thread(void);
|
|
void thread__insert_map(struct thread *self, struct map *map);
|
|
int thread__fork(struct thread *self, struct thread *parent);
|
|
size_t threads__fprintf(FILE *fp);
|
|
|
|
void maps__insert(struct rb_root *maps, struct map *map);
|
|
struct map *maps__find(struct rb_root *maps, u64 ip);
|
|
|
|
struct symbol *kernel_maps__find_symbol(const u64 ip, struct map **mapp,
|
|
symbol_filter_t filter);
|
|
struct map *kernel_maps__find_by_dso_name(const char *name);
|
|
|
|
static inline struct map *thread__find_map(struct thread *self, u64 ip)
|
|
{
|
|
return self ? maps__find(&self->maps, ip) : NULL;
|
|
}
|
|
|
|
#endif /* __PERF_THREAD_H */
|