blob: 8a5cfb656674336c9056d11a465e3b94776b9ee1 [file] [log] [blame]
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -02001#ifndef __PERF_EVSEL_H
2#define __PERF_EVSEL_H 1
3
4#include <linux/list.h>
5#include <linux/perf_event.h>
6#include "types.h"
7#include "xyarray.h"
8
9struct perf_evsel {
10 struct list_head node;
11 struct perf_event_attr attr;
12 char *filter;
13 struct xyarray *fd;
14 int idx;
15 void *priv;
16};
17
18struct perf_evsel *perf_evsel__new(u32 type, u64 config, int idx);
19void perf_evsel__delete(struct perf_evsel *evsel);
20
21int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
22void perf_evsel__free_fd(struct perf_evsel *evsel);
23
Arnaldo Carvalho de Melodaec78a2011-01-03 16:49:44 -020024#define perf_evsel__match(evsel, t, c) \
25 (evsel->attr.type == PERF_TYPE_##t && \
26 evsel->attr.config == PERF_COUNT_##c)
27
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020028#endif /* __PERF_EVSEL_H */