aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/machine.h')
-rw-r--r--tools/perf/util/machine.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 58a6be1fc739..477133015440 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -4,6 +4,7 @@
4#include <sys/types.h> 4#include <sys/types.h>
5#include <linux/rbtree.h> 5#include <linux/rbtree.h>
6#include "map.h" 6#include "map.h"
7#include "event.h"
7 8
8struct addr_location; 9struct addr_location;
9struct branch_stack; 10struct branch_stack;
@@ -40,13 +41,20 @@ struct map *machine__kernel_map(struct machine *machine, enum map_type type)
40 41
41struct thread *machine__find_thread(struct machine *machine, pid_t tid); 42struct thread *machine__find_thread(struct machine *machine, pid_t tid);
42 43
43int machine__process_comm_event(struct machine *machine, union perf_event *event); 44int machine__process_comm_event(struct machine *machine, union perf_event *event,
44int machine__process_exit_event(struct machine *machine, union perf_event *event); 45 struct perf_sample *sample);
45int machine__process_fork_event(struct machine *machine, union perf_event *event); 46int machine__process_exit_event(struct machine *machine, union perf_event *event,
46int machine__process_lost_event(struct machine *machine, union perf_event *event); 47 struct perf_sample *sample);
47int machine__process_mmap_event(struct machine *machine, union perf_event *event); 48int machine__process_fork_event(struct machine *machine, union perf_event *event,
48int machine__process_mmap2_event(struct machine *machine, union perf_event *event); 49 struct perf_sample *sample);
49int machine__process_event(struct machine *machine, union perf_event *event); 50int machine__process_lost_event(struct machine *machine, union perf_event *event,
51 struct perf_sample *sample);
52int machine__process_mmap_event(struct machine *machine, union perf_event *event,
53 struct perf_sample *sample);
54int machine__process_mmap2_event(struct machine *machine, union perf_event *event,
55 struct perf_sample *sample);
56int machine__process_event(struct machine *machine, union perf_event *event,
57 struct perf_sample *sample);
50 58
51typedef void (*machine__process_t)(struct machine *machine, void *data); 59typedef void (*machine__process_t)(struct machine *machine, void *data);
52 60
@@ -74,6 +82,7 @@ char *machine__mmap_name(struct machine *machine, char *bf, size_t size);
74void machines__set_symbol_filter(struct machines *machines, 82void machines__set_symbol_filter(struct machines *machines,
75 symbol_filter_t symbol_filter); 83 symbol_filter_t symbol_filter);
76 84
85struct machine *machine__new_host(void);
77int machine__init(struct machine *machine, const char *root_dir, pid_t pid); 86int machine__init(struct machine *machine, const char *root_dir, pid_t pid);
78void machine__exit(struct machine *machine); 87void machine__exit(struct machine *machine);
79void machine__delete_dead_threads(struct machine *machine); 88void machine__delete_dead_threads(struct machine *machine);
@@ -91,7 +100,8 @@ int machine__resolve_callchain(struct machine *machine,
91 struct thread *thread, 100 struct thread *thread,
92 struct perf_sample *sample, 101 struct perf_sample *sample,
93 struct symbol **parent, 102 struct symbol **parent,
94 struct addr_location *root_al); 103 struct addr_location *root_al,
104 int max_stack);
95 105
96/* 106/*
97 * Default guest kernel is defined by parameter --guestkallsyms 107 * Default guest kernel is defined by parameter --guestkallsyms
@@ -165,4 +175,19 @@ void machines__destroy_kernel_maps(struct machines *machines);
165 175
166size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp); 176size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
167 177
178int machine__for_each_thread(struct machine *machine,
179 int (*fn)(struct thread *thread, void *p),
180 void *priv);
181
182int __machine__synthesize_threads(struct machine *machine, struct perf_tool *tool,
183 struct target *target, struct thread_map *threads,
184 perf_event__handler_t process, bool data_mmap);
185static inline
186int machine__synthesize_threads(struct machine *machine, struct target *target,
187 struct thread_map *threads, bool data_mmap)
188{
189 return __machine__synthesize_threads(machine, NULL, target, threads,
190 perf_event__process, data_mmap);
191}
192
168#endif /* __PERF_MACHINE_H */ 193#endif /* __PERF_MACHINE_H */