perf tools: Remove superfluous thread->comm_set setting
[deliverable/linux.git] / tools / perf / util / ordered-events.h
CommitLineData
5f86b80b
JO
1#ifndef __ORDERED_EVENTS_H
2#define __ORDERED_EVENTS_H
3
4#include <linux/types.h>
5f86b80b 5
fa713a4e
ACM
6struct perf_tool;
7struct perf_evlist;
d10eb1eb 8struct perf_sample;
fa713a4e 9struct machines;
5f86b80b
JO
10
11struct ordered_event {
12 u64 timestamp;
13 u64 file_offset;
14 union perf_event *event;
15 struct list_head list;
16};
17
18enum oe_flush {
b0a45203 19 OE_FLUSH__NONE,
5f86b80b
JO
20 OE_FLUSH__FINAL,
21 OE_FLUSH__ROUND,
22 OE_FLUSH__HALF,
23};
24
d10eb1eb
ACM
25struct ordered_events;
26
27typedef int (*ordered_events__deliver_t)(struct ordered_events *oe,
28 struct ordered_event *event,
29 struct perf_sample *sample);
30
5f86b80b
JO
31struct ordered_events {
32 u64 last_flush;
33 u64 next_flush;
34 u64 max_timestamp;
35 u64 max_alloc_size;
36 u64 cur_alloc_size;
37 struct list_head events;
38 struct list_head cache;
39 struct list_head to_free;
40 struct ordered_event *buffer;
41 struct ordered_event *last;
b7b61cbe
ACM
42 struct machines *machines;
43 struct perf_evlist *evlist;
44 struct perf_tool *tool;
d10eb1eb 45 ordered_events__deliver_t deliver;
5f86b80b
JO
46 int buffer_idx;
47 unsigned int nr_events;
b0a45203 48 enum oe_flush last_flush_type;
54bf53b1 49 bool copy_on_queue;
5f86b80b
JO
50};
51
54bf53b1
AY
52struct ordered_event *ordered_events__new(struct ordered_events *oe, u64 timestamp,
53 union perf_event *event);
5f86b80b 54void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
b7b61cbe
ACM
55int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
56void ordered_events__init(struct ordered_events *oe, struct machines *machines,
d10eb1eb
ACM
57 struct perf_evlist *evlsit, struct perf_tool *tool,
58 ordered_events__deliver_t deliver);
adc56ed1 59void ordered_events__free(struct ordered_events *oe);
94786b67
JO
60
61static inline
62void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
63{
64 oe->max_alloc_size = size;
65}
54bf53b1
AY
66
67static inline
68void ordered_events__set_copy_on_queue(struct ordered_events *oe, bool copy)
69{
70 oe->copy_on_queue = copy;
71}
5f86b80b 72#endif /* __ORDERED_EVENTS_H */
This page took 0.042485 seconds and 5 git commands to generate.