2011-01-11 22:56:53 +00:00
|
|
|
#ifndef __PERF_EVLIST_H
|
|
|
|
#define __PERF_EVLIST_H 1
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
2011-01-13 00:39:13 +00:00
|
|
|
#include "../perf.h"
|
2011-01-15 12:40:59 +00:00
|
|
|
#include "event.h"
|
2011-01-11 22:56:53 +00:00
|
|
|
|
2011-01-12 00:30:02 +00:00
|
|
|
struct pollfd;
|
|
|
|
|
2011-01-13 00:39:13 +00:00
|
|
|
#define PERF_EVLIST__HLIST_BITS 8
|
|
|
|
#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
|
|
|
|
|
2011-01-11 22:56:53 +00:00
|
|
|
struct perf_evlist {
|
|
|
|
struct list_head entries;
|
2011-01-13 00:39:13 +00:00
|
|
|
struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
|
2011-01-11 22:56:53 +00:00
|
|
|
int nr_entries;
|
2011-01-12 00:30:02 +00:00
|
|
|
int nr_fds;
|
2011-01-13 00:39:13 +00:00
|
|
|
int mmap_len;
|
2011-01-15 12:40:59 +00:00
|
|
|
event_t event_copy;
|
2011-01-13 00:39:13 +00:00
|
|
|
struct perf_mmap *mmap;
|
2011-01-12 00:30:02 +00:00
|
|
|
struct pollfd *pollfd;
|
2011-01-11 22:56:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct perf_evsel;
|
|
|
|
|
|
|
|
struct perf_evlist *perf_evlist__new(void);
|
2011-01-18 23:41:45 +00:00
|
|
|
void perf_evlist__init(struct perf_evlist *evlist);
|
|
|
|
void perf_evlist__exit(struct perf_evlist *evlist);
|
2011-01-11 22:56:53 +00:00
|
|
|
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);
|
|
|
|
|
2011-01-12 00:30:02 +00:00
|
|
|
int perf_evlist__alloc_pollfd(struct perf_evlist *evlist, int ncpus, int nthreads);
|
2011-01-12 19:03:24 +00:00
|
|
|
void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd);
|
2011-01-12 00:30:02 +00:00
|
|
|
|
2011-01-13 00:39:13 +00:00
|
|
|
struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id);
|
|
|
|
|
2011-01-15 12:40:59 +00:00
|
|
|
event_t *perf_evlist__read_on_cpu(struct perf_evlist *self, int cpu);
|
|
|
|
|
2011-01-11 22:56:53 +00:00
|
|
|
#endif /* __PERF_EVLIST_H */
|