perf hists browser: Handle browsing empty hists tree
[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
7e2ed097 41int perf_evlist__alloc_pollfd(struct perf_evlist *evlist);
70082dd9 42void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
5c581041 43
70db7533
ACM
44struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
45
8115d60c 46union perf_event *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu);
04391deb 47
7e2ed097
ACM
48int perf_evlist__alloc_mmap(struct perf_evlist *evlist);
49int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite);
50void perf_evlist__munmap(struct perf_evlist *evlist);
51
52static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
53 struct cpu_map *cpus,
54 struct thread_map *threads)
55{
56 evlist->cpus = cpus;
57 evlist->threads = threads;
58}
59
60int perf_evlist__create_maps(struct perf_evlist *evlist, pid_t target_pid,
61 pid_t target_tid, const char *cpu_list);
62void perf_evlist__delete_maps(struct perf_evlist *evlist);
0a102479 63int perf_evlist__set_filters(struct perf_evlist *evlist);
f8a95309 64
361c99a6 65#endif /* __PERF_EVLIST_H */
This page took 0.031576 seconds and 5 git commands to generate.