mm-only debug patch...
[mmotm.git] / tools / perf / util / header.h
blob30aee5160dc0536b0b870b2bdd78e022c313615f
1 #ifndef __PERF_HEADER_H
2 #define __PERF_HEADER_H
4 #include "../../../include/linux/perf_event.h"
5 #include <sys/types.h>
6 #include "types.h"
8 struct perf_header_attr {
9 struct perf_event_attr attr;
10 int ids, size;
11 u64 *id;
12 off_t id_offset;
15 struct perf_header {
16 int frozen;
17 int attrs, size;
18 struct perf_header_attr **attr;
19 s64 attr_offset;
20 u64 data_offset;
21 u64 data_size;
22 u64 event_offset;
23 u64 event_size;
24 u64 trace_info_offset;
25 u64 trace_info_size;
28 struct perf_header *perf_header__read(int fd);
29 void perf_header__write(struct perf_header *self, int fd);
31 void perf_header__add_attr(struct perf_header *self,
32 struct perf_header_attr *attr);
34 void perf_header__push_event(u64 id, const char *name);
35 char *perf_header__find_event(u64 id);
38 struct perf_header_attr *
39 perf_header_attr__new(struct perf_event_attr *attr);
40 void perf_header_attr__add_id(struct perf_header_attr *self, u64 id);
42 u64 perf_header__sample_type(struct perf_header *header);
43 struct perf_event_attr *
44 perf_header__find_attr(u64 id, struct perf_header *header);
45 void perf_header__set_trace_info(void);
47 struct perf_header *perf_header__new(void);
49 #endif /* __PERF_HEADER_H */