diff options
Diffstat (limited to 'tools/perf/util/header.h')
-rw-r--r-- | tools/perf/util/header.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index a22d70b07571..f1b3bf7bdfc1 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -15,11 +15,34 @@ struct perf_header_attr { | |||
15 | off_t id_offset; | 15 | off_t id_offset; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | #define HEADER_TRACE_INFO 1 | 18 | enum { |
19 | #define HEADER_BUILD_ID 2 | 19 | HEADER_TRACE_INFO = 1, |
20 | HEADER_BUILD_ID, | ||
21 | HEADER_LAST_FEATURE, | ||
22 | }; | ||
20 | 23 | ||
21 | #define HEADER_FEAT_BITS 256 | 24 | #define HEADER_FEAT_BITS 256 |
22 | 25 | ||
26 | struct perf_file_section { | ||
27 | u64 offset; | ||
28 | u64 size; | ||
29 | }; | ||
30 | |||
31 | struct perf_file_header { | ||
32 | u64 magic; | ||
33 | u64 size; | ||
34 | u64 attr_size; | ||
35 | struct perf_file_section attrs; | ||
36 | struct perf_file_section data; | ||
37 | struct perf_file_section event_types; | ||
38 | DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS); | ||
39 | }; | ||
40 | |||
41 | struct perf_header; | ||
42 | |||
43 | int perf_file_header__read(struct perf_file_header *self, | ||
44 | struct perf_header *ph, int fd); | ||
45 | |||
23 | struct perf_header { | 46 | struct perf_header { |
24 | int frozen; | 47 | int frozen; |
25 | int attrs, size; | 48 | int attrs, size; |
@@ -54,4 +77,8 @@ bool perf_header__has_feat(const struct perf_header *self, int feat); | |||
54 | 77 | ||
55 | struct perf_header *perf_header__new(void); | 78 | struct perf_header *perf_header__new(void); |
56 | 79 | ||
80 | int perf_header__process_sections(struct perf_header *self, int fd, | ||
81 | int (*process)(struct perf_file_section *self, | ||
82 | int feat, int fd)); | ||
83 | |||
57 | #endif /* __PERF_HEADER_H */ | 84 | #endif /* __PERF_HEADER_H */ |