]> Pileus Git - ~andy/linux/blobdiff - tools/perf/util/machine.h
perf machine: Simplify synthesize_threads method
[~andy/linux] / tools / perf / util / machine.h
index 0df925ba6a44e5ca97235b90cadd7a672429c49a..fedd1dfaf715ebfbf907959ad07d11ddd21a26cc 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/types.h>
 #include <linux/rbtree.h>
 #include "map.h"
+#include "event.h"
 
 struct addr_location;
 struct branch_stack;
@@ -40,12 +41,20 @@ struct map *machine__kernel_map(struct machine *machine, enum map_type type)
 
 struct thread *machine__find_thread(struct machine *machine, pid_t tid);
 
-int machine__process_comm_event(struct machine *machine, union perf_event *event);
-int machine__process_exit_event(struct machine *machine, union perf_event *event);
-int machine__process_fork_event(struct machine *machine, union perf_event *event);
-int machine__process_lost_event(struct machine *machine, union perf_event *event);
-int machine__process_mmap_event(struct machine *machine, union perf_event *event);
-int machine__process_event(struct machine *machine, union perf_event *event);
+int machine__process_comm_event(struct machine *machine, union perf_event *event,
+                               struct perf_sample *sample);
+int machine__process_exit_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);
+int machine__process_lost_event(struct machine *machine, union perf_event *event,
+                               struct perf_sample *sample);
+int machine__process_mmap_event(struct machine *machine, union perf_event *event,
+                               struct perf_sample *sample);
+int machine__process_mmap2_event(struct machine *machine, union perf_event *event,
+                                struct perf_sample *sample);
+int machine__process_event(struct machine *machine, union perf_event *event,
+                               struct perf_sample *sample);
 
 typedef void (*machine__process_t)(struct machine *machine, void *data);
 
@@ -73,6 +82,7 @@ char *machine__mmap_name(struct machine *machine, char *bf, size_t size);
 void machines__set_symbol_filter(struct machines *machines,
                                 symbol_filter_t symbol_filter);
 
+struct machine *machine__new_host(void);
 int machine__init(struct machine *machine, const char *root_dir, pid_t pid);
 void machine__exit(struct machine *machine);
 void machine__delete_dead_threads(struct machine *machine);
@@ -90,7 +100,8 @@ int machine__resolve_callchain(struct machine *machine,
                               struct thread *thread,
                               struct perf_sample *sample,
                               struct symbol **parent,
-                              struct addr_location *root_al);
+                              struct addr_location *root_al,
+                              int max_stack);
 
 /*
  * Default guest kernel is defined by parameter --guestkallsyms
@@ -164,4 +175,19 @@ void machines__destroy_kernel_maps(struct machines *machines);
 
 size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
 
+int machine__for_each_thread(struct machine *machine,
+                            int (*fn)(struct thread *thread, void *p),
+                            void *priv);
+
+int __machine__synthesize_threads(struct machine *machine, struct perf_tool *tool,
+                                 struct perf_target *target, struct thread_map *threads,
+                                 perf_event__handler_t process, bool data_mmap);
+static inline
+int machine__synthesize_threads(struct machine *machine, struct perf_target *target,
+                               struct thread_map *threads, bool data_mmap)
+{
+       return __machine__synthesize_threads(machine, NULL, target, threads,
+                                            perf_event__process, data_mmap);
+}
+
 #endif /* __PERF_MACHINE_H */