perf tools: Remove junk code in mmap size handling
[deliverable/linux.git] / tools / perf / util / evlist.h
CommitLineData
361c99a6
ACM
1#ifndef __PERF_EVLIST_H
2#define __PERF_EVLIST_H 1
3
4#include <linux/list.h>
70db7533 5#include "../perf.h"
04391deb 6#include "event.h"
361c99a6 7
5c581041 8struct pollfd;
f8a95309
ACM
9struct thread_map;
10struct cpu_map;
5c581041 11
70db7533
ACM
12#define PERF_EVLIST__HLIST_BITS 8
13#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
14
361c99a6
ACM
15struct perf_evlist {
16 struct list_head entries;
70db7533 17 struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
361c99a6 18 int nr_entries;
5c581041 19 int nr_fds;
70db7533 20 int mmap_len;
7bb41152 21 bool overwrite;
8115d60c 22 union perf_event event_copy;
70db7533 23 struct perf_mmap *mmap;
5c581041 24 struct pollfd *pollfd;
7e2ed097
ACM
25 struct thread_map *threads;
26 struct cpu_map *cpus;
361c99a6
ACM
27};
28
29struct perf_evsel;
30
7e2ed097
ACM
31struct perf_evlist *perf_evlist__new(struct cpu_map *cpus,
32 struct thread_map *threads);
33void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
34 struct thread_map *threads);
ef1d1af2 35void perf_evlist__exit(struct perf_evlist *evlist);
361c99a6
ACM
36void perf_evlist__delete(struct perf_evlist *evlist);
37
38void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry);
39int perf_evlist__add_default(struct perf_evlist *evlist);
40
a91e5431
ACM
41void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel,
42 int cpu, int thread, u64 id);
3d3b5e95 43
7e2ed097 44int perf_evlist__alloc_pollfd(struct perf_evlist *evlist);
70082dd9 45void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
5c581041 46
70db7533
ACM
47struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
48
8115d60c 49union perf_event *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu);
04391deb 50
7e2ed097
ACM
51int perf_evlist__alloc_mmap(struct perf_evlist *evlist);
52int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite);
53void perf_evlist__munmap(struct perf_evlist *evlist);
54
55static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
56 struct cpu_map *cpus,
57 struct thread_map *threads)
58{
59 evlist->cpus = cpus;
60 evlist->threads = threads;
61}
62
63int perf_evlist__create_maps(struct perf_evlist *evlist, pid_t target_pid,
64 pid_t target_tid, const char *cpu_list);
65void perf_evlist__delete_maps(struct perf_evlist *evlist);
0a102479 66int perf_evlist__set_filters(struct perf_evlist *evlist);
f8a95309 67
361c99a6 68#endif /* __PERF_EVLIST_H */
This page took 0.047033 seconds and 5 git commands to generate.