1 #ifndef __PERF_HEADER_H
2 #define __PERF_HEADER_H
4 #include "../../../include/linux/perf_event.h"
10 #include <linux/bitmap.h>
13 HEADER_TRACE_INFO
= 1,
18 #define HEADER_FEAT_BITS 256
20 struct perf_file_section
{
25 struct perf_file_header
{
29 struct perf_file_section attrs
;
30 struct perf_file_section data
;
31 struct perf_file_section event_types
;
32 DECLARE_BITMAP(adds_features
, HEADER_FEAT_BITS
);
35 struct perf_pipe_file_header
{
42 int perf_file_header__read(struct perf_file_header
*header
,
43 struct perf_header
*ph
, int fd
);
53 DECLARE_BITMAP(adds_features
, HEADER_FEAT_BITS
);
58 int perf_session__read_header(struct perf_session
*session
, int fd
);
59 int perf_session__write_header(struct perf_session
*session
,
60 struct perf_evlist
*evlist
,
61 int fd
, bool at_exit
);
62 int perf_header__write_pipe(int fd
);
64 int perf_header__push_event(u64 id
, const char *name
);
65 char *perf_header__find_event(u64 id
);
67 u64
perf_evlist__sample_type(struct perf_evlist
*evlist
);
68 bool perf_evlist__sample_id_all(const struct perf_evlist
*evlist
);
69 void perf_header__set_feat(struct perf_header
*header
, int feat
);
70 void perf_header__clear_feat(struct perf_header
*header
, int feat
);
71 bool perf_header__has_feat(const struct perf_header
*header
, int feat
);
73 int perf_header__process_sections(struct perf_header
*header
, int fd
,
74 int (*process
)(struct perf_file_section
*section
,
75 struct perf_header
*ph
,
78 int build_id_cache__add_s(const char *sbuild_id
, const char *debugdir
,
79 const char *name
, bool is_kallsyms
);
80 int build_id_cache__remove_s(const char *sbuild_id
, const char *debugdir
);
82 int perf_event__synthesize_attr(struct perf_event_attr
*attr
, u16 ids
, u64
*id
,
83 perf_event__handler_t process
,
84 struct perf_session
*session
);
85 int perf_session__synthesize_attrs(struct perf_session
*session
,
86 perf_event__handler_t process
);
87 int perf_event__process_attr(union perf_event
*event
, struct perf_session
*session
);
89 int perf_event__synthesize_event_type(u64 event_id
, char *name
,
90 perf_event__handler_t process
,
91 struct perf_session
*session
);
92 int perf_event__synthesize_event_types(perf_event__handler_t process
,
93 struct perf_session
*session
);
94 int perf_event__process_event_type(union perf_event
*event
,
95 struct perf_session
*session
);
97 int perf_event__synthesize_tracing_data(int fd
, struct perf_evlist
*evlist
,
98 perf_event__handler_t process
,
99 struct perf_session
*session
);
100 int perf_event__process_tracing_data(union perf_event
*event
,
101 struct perf_session
*session
);
103 int perf_event__synthesize_build_id(struct dso
*pos
, u16 misc
,
104 perf_event__handler_t process
,
105 struct machine
*machine
,
106 struct perf_session
*session
);
107 int perf_event__process_build_id(union perf_event
*event
,
108 struct perf_session
*session
);
109 #endif /* __PERF_HEADER_H */