hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/tools/perf/util/ordered-events.h
....@@ -18,6 +18,8 @@
1818 OE_FLUSH__FINAL,
1919 OE_FLUSH__ROUND,
2020 OE_FLUSH__HALF,
21
+ OE_FLUSH__TOP,
22
+ OE_FLUSH__TIME,
2123 };
2224
2325 struct ordered_events;
....@@ -25,32 +27,41 @@
2527 typedef int (*ordered_events__deliver_t)(struct ordered_events *oe,
2628 struct ordered_event *event);
2729
30
+struct ordered_events_buffer {
31
+ struct list_head list;
32
+ struct ordered_event event[];
33
+};
34
+
2835 struct ordered_events {
29
- u64 last_flush;
30
- u64 next_flush;
31
- u64 max_timestamp;
32
- u64 max_alloc_size;
33
- u64 cur_alloc_size;
34
- struct list_head events;
35
- struct list_head cache;
36
- struct list_head to_free;
37
- struct ordered_event *buffer;
38
- struct ordered_event *last;
39
- ordered_events__deliver_t deliver;
40
- int buffer_idx;
41
- unsigned int nr_events;
42
- enum oe_flush last_flush_type;
43
- u32 nr_unordered_events;
44
- bool copy_on_queue;
36
+ u64 last_flush;
37
+ u64 next_flush;
38
+ u64 max_timestamp;
39
+ u64 max_alloc_size;
40
+ u64 cur_alloc_size;
41
+ struct list_head events;
42
+ struct list_head cache;
43
+ struct list_head to_free;
44
+ struct ordered_events_buffer *buffer;
45
+ struct ordered_event *last;
46
+ ordered_events__deliver_t deliver;
47
+ int buffer_idx;
48
+ unsigned int nr_events;
49
+ enum oe_flush last_flush_type;
50
+ u32 nr_unordered_events;
51
+ bool copy_on_queue;
52
+ void *data;
4553 };
4654
4755 int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
4856 u64 timestamp, u64 file_offset);
4957 void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
5058 int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
51
-void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver);
59
+int ordered_events__flush_time(struct ordered_events *oe, u64 timestamp);
60
+void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver,
61
+ void *data);
5262 void ordered_events__free(struct ordered_events *oe);
5363 void ordered_events__reinit(struct ordered_events *oe);
64
+u64 ordered_events__first_time(struct ordered_events *oe);
5465
5566 static inline
5667 void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)