2 #ifndef __PERF_MACHINE_H 3 #define __PERF_MACHINE_H 6 #include <linux/rbtree.h> 21 #define HOST_KERNEL_ID (-1) 22 #define DEFAULT_GUEST_KERNEL_ID (0) 28 #define THREADS__TABLE_BITS 8 29 #define THREADS__TABLE_SIZE (1 << THREADS__TABLE_BITS) 40 struct rb_node rb_node;
99 return ip >= kernel_start;
137 struct rb_root guests;
226 bool (
skip)(
struct dso *
dso,
int parm),
int parm);
229 bool (
skip)(
struct dso *dso,
int parm),
int parm);
241 int (*fn)(
struct thread *thread,
void *p),
244 int (*fn)(
struct thread *thread,
void *p),
250 unsigned int proc_map_timeout,
251 unsigned int nr_threads_synthesize);
255 unsigned int proc_map_timeout,
256 unsigned int nr_threads_synthesize)
261 nr_threads_synthesize);
static struct threads * machine__threads(struct machine *machine, pid_t tid)
struct machine * machines__add(struct machines *machines, pid_t pid, const char *root_dir)
struct mem_info * sample__resolve_mem(struct perf_sample *sample, struct addr_location *al)
struct machine * machines__find(struct machines *machines, pid_t pid)
const char * ref_reloc_sym_names[]
int(* perf_event__handler_t)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
void machines__set_id_hdr_size(struct machines *machines, u16 id_hdr_size)
static bool machine__is_host(struct machine *machine)
static void skip(int size)
int machine__init(struct machine *machine, const char *root_dir, pid_t pid)
static int machine__synthesize_threads(struct machine *machine, struct target *target, struct thread_map *threads, bool data_mmap, unsigned int proc_map_timeout, unsigned int nr_threads_synthesize)
int machine__process_comm_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
int machine__process_fork_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
#define DEFAULT_GUEST_KERNEL_ID
struct map * machine__findnew_module_map(struct machine *machine, u64 start, const char *filename)
int machine__process_itrace_start_event(struct machine *machine, union perf_event *event)
void machines__destroy_kernel_maps(struct machines *machines)
int machine__process_exit_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
int machine__create_extra_kernel_maps(struct machine *machine, struct dso *kernel)
bool machine__is(struct machine *machine, const char *arch)
int machine__get_kernel_start(struct machine *machine)
int machine__map_x86_64_entry_trampolines(struct machine *machine, struct dso *kernel)
int machine__load_vmlinux_path(struct machine *machine)
struct vdso_info * vdso_info
static struct symbol * machine__find_kernel_symbol_by_name(struct machine *machine, const char *name, struct map **mapp)
int machine__set_current_tid(struct machine *machine, int cpu, pid_t pid, pid_t tid)
int machine__nr_cpus_avail(struct machine *machine)
static struct map * machine__kernel_map(struct machine *machine)
int machine__process_lost_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
size_t machines__fprintf_dsos_buildid(struct machines *machines, FILE *fp, bool(skip)(struct dso *dso, int parm), int parm)
struct thread * machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid)
size_t machines__fprintf_dsos(struct machines *machines, FILE *fp)
int machine__process_aux_event(struct machine *machine, union perf_event *event)
int machine__process_switch_event(struct machine *machine, union perf_event *event)
struct thread * __machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid)
int perf_event__process(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
struct machine * machine__new_host(void)
struct machine * machine__new_kallsyms(void)
struct threads threads[THREADS__TABLE_SIZE]
int machine__process_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
int __machine__synthesize_threads(struct machine *machine, struct perf_tool *tool, struct target *target, struct thread_map *threads, perf_event__handler_t process, bool data_mmap, unsigned int proc_map_timeout, unsigned int nr_threads_synthesize)
struct symbol * map_groups__find_symbol_by_name(struct map_groups *mg, const char *name, struct map **mapp)
static struct perf_tool tool
static bool machine__kernel_ip(struct machine *machine, u64 ip)
void machines__set_comm_exec(struct machines *machines, bool comm_exec)
bool kptr_restrict_warned
int arch__fix_module_text_start(u64 *start, const char *name)
void machine__delete_threads(struct machine *machine)
int machines__create_guest_kernel_maps(struct machines *machines)
struct symbol * map_groups__find_symbol(struct map_groups *mg, u64 addr, struct map **mapp)
void machine__destroy_kernel_maps(struct machine *machine)
int machine__for_each_thread(struct machine *machine, int(*fn)(struct thread *thread, void *p), void *priv)
void machine__remove_thread(struct machine *machine, struct thread *th)
char * machine__resolve_kernel_addr(void *vmachine, unsigned long long *addrp, char **modp)
int machine__process_lost_samples_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
int machines__create_kernel_maps(struct machines *machines, pid_t pid)
int machine__create_kernel_maps(struct machine *machine)
void(* machine__process_t)(struct machine *machine, void *data)
int machine__process_mmap_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
struct machine * machines__find_host(struct machines *machines)
size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp)
int machine__process_namespaces_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
struct comm * machine__thread_exec_comm(struct machine *machine, struct thread *thread)
void machines__init(struct machines *machines)
int machine__process_mmap2_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
void machines__process_guests(struct machines *machines, machine__process_t process, void *data)
void machine__exit(struct machine *machine)
static struct symbol * machine__find_kernel_symbol(struct machine *machine, u64 addr, struct map **mapp)
#define THREADS__TABLE_SIZE
void machines__exit(struct machines *machines)
static struct maps * machine__kernel_maps(struct machine *machine)
size_t machine__fprintf(struct machine *machine, FILE *fp)
pid_t machine__get_current_tid(struct machine *machine, int cpu)
struct dso * machine__findnew_dso(struct machine *machine, const char *filename)
struct thread * last_match
int machines__for_each_thread(struct machines *machines, int(*fn)(struct thread *thread, void *p), void *priv)
struct thread * machine__find_thread(struct machine *machine, pid_t pid, pid_t tid)
void machine__delete(struct machine *machine)
struct branch_info * sample__resolve_bstack(struct perf_sample *sample, struct addr_location *al)
int machine__load_kallsyms(struct machine *machine, const char *filename)
int machine__create_extra_kernel_map(struct machine *machine, struct dso *kernel, struct extra_kernel_map *xm)
void machine__get_kallsyms_filename(struct machine *machine, char *buf, size_t bufsz)
size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp, bool(skip)(struct dso *dso, int parm), int parm)
static u64 machine__kernel_start(struct machine *machine)
int thread__resolve_callchain(struct thread *thread, struct callchain_cursor *cursor, struct perf_evsel *evsel, struct perf_sample *sample, struct symbol **parent, struct addr_location *root_al, int max_stack)
struct machine * machines__findnew(struct machines *machines, pid_t pid)
static bool machine__is_default_guest(struct machine *machine)