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 void perf_header__set_feat(struct perf_header
*header
, int feat
);
68 void perf_header__clear_feat(struct perf_header
*header
, int feat
);
69 bool perf_header__has_feat(const struct perf_header
*header
, int feat
);
71 int perf_header__process_sections(struct perf_header
*header
, int fd
,
72 int (*process
)(struct perf_file_section
*section
,
73 struct perf_header
*ph
,
76 int build_id_cache__add_s(const char *sbuild_id
, const char *debugdir
,
77 const char *name
, bool is_kallsyms
);
78 int build_id_cache__remove_s(const char *sbuild_id
, const char *debugdir
);
80 int perf_event__synthesize_attr(struct perf_event_attr
*attr
, u16 ids
, u64
*id
,
81 perf_event__handler_t process
,
82 struct perf_session
*session
);
83 int perf_session__synthesize_attrs(struct perf_session
*session
,
84 perf_event__handler_t process
);
85 int perf_event__process_attr(union perf_event
*event
, struct perf_session
*session
);
87 int perf_event__synthesize_event_type(u64 event_id
, char *name
,
88 perf_event__handler_t process
,
89 struct perf_session
*session
);
90 int perf_event__synthesize_event_types(perf_event__handler_t process
,
91 struct perf_session
*session
);
92 int perf_event__process_event_type(union perf_event
*event
,
93 struct perf_session
*session
);
95 int perf_event__synthesize_tracing_data(int fd
, struct perf_evlist
*evlist
,
96 perf_event__handler_t process
,
97 struct perf_session
*session
);
98 int perf_event__process_tracing_data(union perf_event
*event
,
99 struct perf_session
*session
);
101 int perf_event__synthesize_build_id(struct dso
*pos
, u16 misc
,
102 perf_event__handler_t process
,
103 struct machine
*machine
,
104 struct perf_session
*session
);
105 int perf_event__process_build_id(union perf_event
*event
,
106 struct perf_session
*session
);
107 #endif /* __PERF_HEADER_H */