Jiri Olsa | 5f86b80 | 2014-08-01 13:02:58 -0300 | [diff] [blame] | 1 | #ifndef __ORDERED_EVENTS_H |
| 2 | #define __ORDERED_EVENTS_H |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | #include "tool.h" |
| 6 | |
| 7 | struct perf_session; |
| 8 | |
| 9 | struct ordered_event { |
| 10 | u64 timestamp; |
| 11 | u64 file_offset; |
| 12 | union perf_event *event; |
| 13 | struct list_head list; |
| 14 | }; |
| 15 | |
| 16 | enum oe_flush { |
| 17 | OE_FLUSH__FINAL, |
| 18 | OE_FLUSH__ROUND, |
| 19 | OE_FLUSH__HALF, |
| 20 | }; |
| 21 | |
| 22 | struct ordered_events { |
| 23 | u64 last_flush; |
| 24 | u64 next_flush; |
| 25 | u64 max_timestamp; |
| 26 | u64 max_alloc_size; |
| 27 | u64 cur_alloc_size; |
| 28 | struct list_head events; |
| 29 | struct list_head cache; |
| 30 | struct list_head to_free; |
| 31 | struct ordered_event *buffer; |
| 32 | struct ordered_event *last; |
| 33 | int buffer_idx; |
| 34 | unsigned int nr_events; |
| 35 | }; |
| 36 | |
| 37 | struct ordered_event *ordered_events__new(struct ordered_events *oe, u64 timestamp); |
| 38 | void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event); |
| 39 | int ordered_events__flush(struct perf_session *s, struct perf_tool *tool, |
| 40 | enum oe_flush how); |
Jiri Olsa | 36522f5 | 2014-06-10 22:47:40 +0200 | [diff] [blame^] | 41 | void ordered_events__init(struct ordered_events *oe); |
Jiri Olsa | 5f86b80 | 2014-08-01 13:02:58 -0300 | [diff] [blame] | 42 | #endif /* __ORDERED_EVENTS_H */ |