diff options
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r-- | tools/perf/util/session.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 04bf7373a7e5..50f640958f0f 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "machine.h" | 7 | #include "machine.h" |
8 | #include "symbol.h" | 8 | #include "symbol.h" |
9 | #include "thread.h" | 9 | #include "thread.h" |
10 | #include "data.h" | ||
10 | #include <linux/rbtree.h> | 11 | #include <linux/rbtree.h> |
11 | #include <linux/perf_event.h> | 12 | #include <linux/perf_event.h> |
12 | 13 | ||
@@ -29,16 +30,13 @@ struct ordered_samples { | |||
29 | 30 | ||
30 | struct perf_session { | 31 | struct perf_session { |
31 | struct perf_header header; | 32 | struct perf_header header; |
32 | unsigned long size; | ||
33 | struct machines machines; | 33 | struct machines machines; |
34 | struct perf_evlist *evlist; | 34 | struct perf_evlist *evlist; |
35 | struct pevent *pevent; | 35 | struct pevent *pevent; |
36 | struct events_stats stats; | 36 | struct events_stats stats; |
37 | int fd; | ||
38 | bool fd_pipe; | ||
39 | bool repipe; | 37 | bool repipe; |
40 | struct ordered_samples ordered_samples; | 38 | struct ordered_samples ordered_samples; |
41 | char filename[1]; | 39 | struct perf_data_file *file; |
42 | }; | 40 | }; |
43 | 41 | ||
44 | #define PRINT_IP_OPT_IP (1<<0) | 42 | #define PRINT_IP_OPT_IP (1<<0) |
@@ -49,17 +47,16 @@ struct perf_session { | |||
49 | 47 | ||
50 | struct perf_tool; | 48 | struct perf_tool; |
51 | 49 | ||
52 | struct perf_session *perf_session__new(const char *filename, int mode, | 50 | struct perf_session *perf_session__new(struct perf_data_file *file, |
53 | bool force, bool repipe, | 51 | bool repipe, struct perf_tool *tool); |
54 | struct perf_tool *tool); | ||
55 | void perf_session__delete(struct perf_session *session); | 52 | void perf_session__delete(struct perf_session *session); |
56 | 53 | ||
57 | void perf_event_header__bswap(struct perf_event_header *self); | 54 | void perf_event_header__bswap(struct perf_event_header *hdr); |
58 | 55 | ||
59 | int __perf_session__process_events(struct perf_session *self, | 56 | int __perf_session__process_events(struct perf_session *session, |
60 | u64 data_offset, u64 data_size, u64 size, | 57 | u64 data_offset, u64 data_size, u64 size, |
61 | struct perf_tool *tool); | 58 | struct perf_tool *tool); |
62 | int perf_session__process_events(struct perf_session *self, | 59 | int perf_session__process_events(struct perf_session *session, |
63 | struct perf_tool *tool); | 60 | struct perf_tool *tool); |
64 | 61 | ||
65 | int perf_session_queue_event(struct perf_session *s, union perf_event *event, | 62 | int perf_session_queue_event(struct perf_session *s, union perf_event *event, |
@@ -67,37 +64,38 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event, | |||
67 | 64 | ||
68 | void perf_tool__fill_defaults(struct perf_tool *tool); | 65 | void perf_tool__fill_defaults(struct perf_tool *tool); |
69 | 66 | ||
70 | int perf_session__resolve_callchain(struct perf_session *self, struct perf_evsel *evsel, | 67 | int perf_session__resolve_callchain(struct perf_session *session, |
68 | struct perf_evsel *evsel, | ||
71 | struct thread *thread, | 69 | struct thread *thread, |
72 | struct ip_callchain *chain, | 70 | struct ip_callchain *chain, |
73 | struct symbol **parent); | 71 | struct symbol **parent); |
74 | 72 | ||
75 | bool perf_session__has_traces(struct perf_session *self, const char *msg); | 73 | bool perf_session__has_traces(struct perf_session *session, const char *msg); |
76 | 74 | ||
77 | void mem_bswap_64(void *src, int byte_size); | 75 | void mem_bswap_64(void *src, int byte_size); |
78 | void mem_bswap_32(void *src, int byte_size); | 76 | void mem_bswap_32(void *src, int byte_size); |
79 | void perf_event__attr_swap(struct perf_event_attr *attr); | 77 | void perf_event__attr_swap(struct perf_event_attr *attr); |
80 | 78 | ||
81 | int perf_session__create_kernel_maps(struct perf_session *self); | 79 | int perf_session__create_kernel_maps(struct perf_session *session); |
82 | 80 | ||
83 | void perf_session__set_id_hdr_size(struct perf_session *session); | 81 | void perf_session__set_id_hdr_size(struct perf_session *session); |
84 | 82 | ||
85 | static inline | 83 | static inline |
86 | struct machine *perf_session__find_machine(struct perf_session *self, pid_t pid) | 84 | struct machine *perf_session__find_machine(struct perf_session *session, pid_t pid) |
87 | { | 85 | { |
88 | return machines__find(&self->machines, pid); | 86 | return machines__find(&session->machines, pid); |
89 | } | 87 | } |
90 | 88 | ||
91 | static inline | 89 | static inline |
92 | struct machine *perf_session__findnew_machine(struct perf_session *self, pid_t pid) | 90 | struct machine *perf_session__findnew_machine(struct perf_session *session, pid_t pid) |
93 | { | 91 | { |
94 | return machines__findnew(&self->machines, pid); | 92 | return machines__findnew(&session->machines, pid); |
95 | } | 93 | } |
96 | 94 | ||
97 | struct thread *perf_session__findnew(struct perf_session *self, pid_t pid); | 95 | struct thread *perf_session__findnew(struct perf_session *session, pid_t pid); |
98 | size_t perf_session__fprintf(struct perf_session *self, FILE *fp); | 96 | size_t perf_session__fprintf(struct perf_session *session, FILE *fp); |
99 | 97 | ||
100 | size_t perf_session__fprintf_dsos(struct perf_session *self, FILE *fp); | 98 | size_t perf_session__fprintf_dsos(struct perf_session *session, FILE *fp); |
101 | 99 | ||
102 | size_t perf_session__fprintf_dsos_buildid(struct perf_session *session, FILE *fp, | 100 | size_t perf_session__fprintf_dsos_buildid(struct perf_session *session, FILE *fp, |
103 | bool (fn)(struct dso *dso, int parm), int parm); | 101 | bool (fn)(struct dso *dso, int parm), int parm); |