aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r--tools/perf/util/session.h32
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
15struct sample_queue;
16struct ip_callchain; 16struct ip_callchain;
17struct thread; 17struct thread;
18 18
19struct 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
32struct perf_session { 19struct 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
59void perf_event_header__bswap(struct perf_event_header *hdr); 46void perf_event_header__bswap(struct perf_event_header *hdr);
60 47
48int 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
61int __perf_session__process_events(struct perf_session *session, 53int __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
67int perf_session_queue_event(struct perf_session *s, union perf_event *event, 59int 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
70void perf_tool__fill_defaults(struct perf_tool *tool); 63void perf_tool__fill_defaults(struct perf_tool *tool);
71 64
65int 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
72int perf_session__resolve_callchain(struct perf_session *session, 70int 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
129extern volatile int session_done; 127extern 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 */