diff options
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r-- | tools/perf/util/session.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 0321013bd9fd..ffb440462008 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -9,26 +9,13 @@ | |||
9 | #include "symbol.h" | 9 | #include "symbol.h" |
10 | #include "thread.h" | 10 | #include "thread.h" |
11 | #include "data.h" | 11 | #include "data.h" |
12 | #include "ordered-events.h" | ||
12 | #include <linux/rbtree.h> | 13 | #include <linux/rbtree.h> |
13 | #include <linux/perf_event.h> | 14 | #include <linux/perf_event.h> |
14 | 15 | ||
15 | struct sample_queue; | ||
16 | struct ip_callchain; | 16 | struct ip_callchain; |
17 | struct thread; | 17 | struct thread; |
18 | 18 | ||
19 | struct ordered_samples { | ||
20 | u64 last_flush; | ||
21 | u64 next_flush; | ||
22 | u64 max_timestamp; | ||
23 | struct list_head samples; | ||
24 | struct list_head sample_cache; | ||
25 | struct list_head to_free; | ||
26 | struct sample_queue *sample_buffer; | ||
27 | struct sample_queue *last_sample; | ||
28 | int sample_buffer_idx; | ||
29 | unsigned int nr_samples; | ||
30 | }; | ||
31 | |||
32 | struct perf_session { | 19 | struct perf_session { |
33 | struct perf_header header; | 20 | struct perf_header header; |
34 | struct machines machines; | 21 | struct machines machines; |
@@ -39,7 +26,7 @@ struct perf_session { | |||
39 | bool one_mmap; | 26 | bool one_mmap; |
40 | void *one_mmap_addr; | 27 | void *one_mmap_addr; |
41 | u64 one_mmap_offset; | 28 | u64 one_mmap_offset; |
42 | struct ordered_samples ordered_samples; | 29 | struct ordered_events ordered_events; |
43 | struct perf_data_file *file; | 30 | struct perf_data_file *file; |
44 | }; | 31 | }; |
45 | 32 | ||
@@ -58,6 +45,11 @@ void perf_session__delete(struct perf_session *session); | |||
58 | 45 | ||
59 | void perf_event_header__bswap(struct perf_event_header *hdr); | 46 | void perf_event_header__bswap(struct perf_event_header *hdr); |
60 | 47 | ||
48 | int perf_session__peek_event(struct perf_session *session, off_t file_offset, | ||
49 | void *buf, size_t buf_sz, | ||
50 | union perf_event **event_ptr, | ||
51 | struct perf_sample *sample); | ||
52 | |||
61 | int __perf_session__process_events(struct perf_session *session, | 53 | int __perf_session__process_events(struct perf_session *session, |
62 | u64 data_offset, u64 data_size, u64 size, | 54 | u64 data_offset, u64 data_size, u64 size, |
63 | struct perf_tool *tool); | 55 | struct perf_tool *tool); |
@@ -65,10 +57,16 @@ int perf_session__process_events(struct perf_session *session, | |||
65 | struct perf_tool *tool); | 57 | struct perf_tool *tool); |
66 | 58 | ||
67 | int perf_session_queue_event(struct perf_session *s, union perf_event *event, | 59 | int perf_session_queue_event(struct perf_session *s, union perf_event *event, |
68 | struct perf_sample *sample, u64 file_offset); | 60 | struct perf_tool *tool, struct perf_sample *sample, |
61 | u64 file_offset); | ||
69 | 62 | ||
70 | void perf_tool__fill_defaults(struct perf_tool *tool); | 63 | void perf_tool__fill_defaults(struct perf_tool *tool); |
71 | 64 | ||
65 | int perf_session__deliver_event(struct perf_session *session, | ||
66 | union perf_event *event, | ||
67 | struct perf_sample *sample, | ||
68 | struct perf_tool *tool, u64 file_offset); | ||
69 | |||
72 | int perf_session__resolve_callchain(struct perf_session *session, | 70 | int perf_session__resolve_callchain(struct perf_session *session, |
73 | struct perf_evsel *evsel, | 71 | struct perf_evsel *evsel, |
74 | struct thread *thread, | 72 | struct thread *thread, |
@@ -128,5 +126,5 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session, | |||
128 | 126 | ||
129 | extern volatile int session_done; | 127 | extern volatile int session_done; |
130 | 128 | ||
131 | #define session_done() (*(volatile int *)(&session_done)) | 129 | #define session_done() ACCESS_ONCE(session_done) |
132 | #endif /* __PERF_SESSION_H */ | 130 | #endif /* __PERF_SESSION_H */ |