2009-09-24 18:02:18 +02:00
|
|
|
#ifndef __PERF_THREAD_H
|
|
|
|
|
#define __PERF_THREAD_H
|
|
|
|
|
|
2009-08-14 12:21:53 +02:00
|
|
|
#include <linux/rbtree.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include "symbol.h"
|
|
|
|
|
|
2009-12-11 14:50:36 -02:00
|
|
|
struct thread {
|
2010-06-17 08:37:44 -03:00
|
|
|
union {
|
|
|
|
|
struct rb_node rb_node;
|
|
|
|
|
struct list_head node;
|
|
|
|
|
};
|
2009-12-11 14:50:36 -02:00
|
|
|
struct map_groups mg;
|
|
|
|
|
pid_t pid;
|
2009-09-16 17:40:48 +02:00
|
|
|
char shortname[3];
|
2010-02-19 23:02:07 -02:00
|
|
|
bool comm_set;
|
2009-09-11 12:12:54 +02:00
|
|
|
char *comm;
|
2009-10-22 23:23:23 +02:00
|
|
|
int comm_len;
|
2009-08-14 12:21:53 +02:00
|
|
|
};
|
|
|
|
|
|
2011-11-28 07:56:39 -02:00
|
|
|
struct machine;
|
2010-03-25 19:58:58 -03:00
|
|
|
|
2010-07-30 18:28:42 -03:00
|
|
|
void thread__delete(struct thread *self);
|
|
|
|
|
|
2009-08-14 12:21:53 +02:00
|
|
|
int thread__set_comm(struct thread *self, const char *comm);
|
2009-10-22 23:23:23 +02:00
|
|
|
int thread__comm_len(struct thread *self);
|
2009-08-14 12:21:53 +02:00
|
|
|
void thread__insert_map(struct thread *self, struct map *map);
|
|
|
|
|
int thread__fork(struct thread *self, struct thread *parent);
|
2009-09-24 18:02:18 +02:00
|
|
|
|
2009-11-27 16:29:20 -02:00
|
|
|
static inline struct map *thread__find_map(struct thread *self,
|
2009-11-27 16:29:23 -02:00
|
|
|
enum map_type type, u64 addr)
|
2009-09-28 14:48:46 -03:00
|
|
|
{
|
2009-12-11 14:50:36 -02:00
|
|
|
return self ? map_groups__find(&self->mg, type, addr) : NULL;
|
2009-11-27 16:29:20 -02:00
|
|
|
}
|
2009-11-27 16:29:23 -02:00
|
|
|
|
2011-11-28 07:56:39 -02:00
|
|
|
void thread__find_addr_map(struct thread *thread, struct machine *machine,
|
|
|
|
|
u8 cpumode, enum map_type type, u64 addr,
|
2010-01-14 23:45:29 -02:00
|
|
|
struct addr_location *al);
|
|
|
|
|
|
2011-11-28 07:56:39 -02:00
|
|
|
void thread__find_addr_location(struct thread *thread, struct machine *machine,
|
|
|
|
|
u8 cpumode, enum map_type type, u64 addr,
|
2009-11-27 16:29:23 -02:00
|
|
|
struct addr_location *al,
|
|
|
|
|
symbol_filter_t filter);
|
2009-09-24 18:02:18 +02:00
|
|
|
#endif /* __PERF_THREAD_H */
|