]>
Commit | Line | Data |
---|---|---|
16958497 ACM |
1 | #ifndef __PERF_MMAP_H |
2 | #define __PERF_MMAP_H 1 | |
3 | ||
547740f7 | 4 | #include <internal/mmap.h> |
16958497 ACM |
5 | #include <linux/compiler.h> |
6 | #include <linux/refcount.h> | |
7 | #include <linux/types.h> | |
09d62154 | 8 | #include <linux/ring_buffer.h> |
16958497 | 9 | #include <stdbool.h> |
f2a39fe8 | 10 | #include <pthread.h> // for cpu_set_t |
0b773831 AB |
11 | #ifdef HAVE_AIO_SUPPORT |
12 | #include <aio.h> | |
13 | #endif | |
16958497 ACM |
14 | #include "auxtrace.h" |
15 | #include "event.h" | |
16 | ||
d3d1af6f | 17 | struct aiocb; |
16958497 | 18 | /** |
a5830532 | 19 | * struct mmap - perf's ring buffer mmap details |
16958497 ACM |
20 | * |
21 | * @refcnt - e.g. code using PERF_EVENT_IOC_SET_OUTPUT to share this | |
22 | */ | |
a5830532 | 23 | struct mmap { |
547740f7 | 24 | struct perf_mmap core; |
16958497 | 25 | struct auxtrace_mmap auxtrace_mmap; |
0b773831 AB |
26 | #ifdef HAVE_AIO_SUPPORT |
27 | struct { | |
93f20c0f AB |
28 | void **data; |
29 | struct aiocb *cblocks; | |
30 | struct aiocb **aiocb; | |
d3d1af6f | 31 | int nr_cblocks; |
0b773831 AB |
32 | } aio; |
33 | #endif | |
9d2ed645 | 34 | cpu_set_t affinity_mask; |
51255a8a AB |
35 | void *data; |
36 | int comp_level; | |
16958497 ACM |
37 | }; |
38 | ||
16958497 | 39 | struct mmap_params { |
e440979f JO |
40 | struct perf_mmap_param core; |
41 | int nr_cblocks, affinity, flush, comp_level; | |
16958497 ACM |
42 | struct auxtrace_mmap_params auxtrace_mp; |
43 | }; | |
44 | ||
32c261c0 | 45 | int mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu); |
59d7ea62 | 46 | void mmap__munmap(struct mmap *map); |
16958497 | 47 | |
a5830532 | 48 | union perf_event *perf_mmap__read_forward(struct mmap *map); |
16958497 | 49 | |
a5830532 JO |
50 | int perf_mmap__push(struct mmap *md, void *to, |
51 | int push(struct mmap *map, void *to, void *buf, size_t size)); | |
73c17d81 | 52 | |
bf59b305 | 53 | size_t mmap__mmap_len(struct mmap *map); |
16958497 ACM |
54 | |
55 | #endif /*__PERF_MMAP_H */ |