evlist.h 1.2 KB
Newer Older
1 2 3 4
#ifndef __PERF_EVLIST_H
#define __PERF_EVLIST_H 1

#include <linux/list.h>
5
#include "../perf.h"
6
#include "event.h"
7

8 9
struct pollfd;

10 11 12
#define PERF_EVLIST__HLIST_BITS 8
#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)

13 14
struct perf_evlist {
	struct list_head entries;
15
	struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
16
	int		 nr_entries;
17
	int		 nr_fds;
18
	int		 mmap_len;
19
	bool		 overwrite;
20
	union perf_event event_copy;
21
	struct perf_mmap *mmap;
22
	struct pollfd	 *pollfd;
23 24 25 26 27
};

struct perf_evsel;

struct perf_evlist *perf_evlist__new(void);
28 29
void perf_evlist__init(struct perf_evlist *evlist);
void perf_evlist__exit(struct perf_evlist *evlist);
30 31 32 33 34
void perf_evlist__delete(struct perf_evlist *evlist);

void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry);
int perf_evlist__add_default(struct perf_evlist *evlist);

35
int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads);
36
void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
37

38 39
struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);

40
union perf_event *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu);
41

42
#endif /* __PERF_EVLIST_H */