Linux Perf
ordered-events.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ORDERED_EVENTS_H
3 #define __ORDERED_EVENTS_H
4 
5 #include <linux/types.h>
6 
7 struct perf_sample;
8 
9 struct ordered_event {
10  u64 timestamp;
12  union perf_event *event;
13  struct list_head list;
14 };
15 
16 enum oe_flush {
21 };
22 
23 struct ordered_events;
24 
25 typedef int (*ordered_events__deliver_t)(struct ordered_events *oe,
26  struct ordered_event *event);
27 
34  struct list_head events;
35  struct list_head cache;
36  struct list_head to_free;
41  unsigned int nr_events;
42  enum oe_flush last_flush_type;
45 };
46 
48  u64 timestamp, u64 file_offset);
50 int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
52 void ordered_events__free(struct ordered_events *oe);
53 void ordered_events__reinit(struct ordered_events *oe);
54 
55 static inline
57 {
58  oe->max_alloc_size = size;
59 }
60 
61 static inline
63 {
64  oe->copy_on_queue = copy;
65 }
66 #endif /* __ORDERED_EVENTS_H */
struct list_head list
static void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
struct perf_probe_event events[MAX_PROBES]
Definition: builtin-probe.c:57
struct ordered_event * buffer
size_t size
Definition: evsel.c:60
int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
int(* ordered_events__deliver_t)(struct ordered_events *oe, struct ordered_event *event)
unsigned int nr_events
void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver)
ordered_events__deliver_t deliver
void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event)
void ordered_events__free(struct ordered_events *oe)
int ordered_events__queue(struct ordered_events *oe, union perf_event *event, u64 timestamp, u64 file_offset)
static void ordered_events__set_copy_on_queue(struct ordered_events *oe, bool copy)
oe_flush
union perf_event * event
void ordered_events__reinit(struct ordered_events *oe)
struct ordered_event * last