vmxnet3: Fix inconsistent LRO state after initialization
[linux-2.6/linux-mips.git] / tools / perf / util / header.h
blob456661d7f10e7a2594699ae005e451c25914b21c
1 #ifndef __PERF_HEADER_H
2 #define __PERF_HEADER_H
4 #include "../../../include/linux/perf_event.h"
5 #include <sys/types.h>
6 #include <stdbool.h>
7 #include "types.h"
8 #include "event.h"
10 #include <linux/bitmap.h>
12 enum {
13 HEADER_TRACE_INFO = 1,
14 HEADER_BUILD_ID,
15 HEADER_LAST_FEATURE,
18 #define HEADER_FEAT_BITS 256
20 struct perf_file_section {
21 u64 offset;
22 u64 size;
25 struct perf_file_header {
26 u64 magic;
27 u64 size;
28 u64 attr_size;
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 {
36 u64 magic;
37 u64 size;
40 struct perf_header;
42 int perf_file_header__read(struct perf_file_header *header,
43 struct perf_header *ph, int fd);
45 struct perf_header {
46 int frozen;
47 bool needs_swap;
48 s64 attr_offset;
49 u64 data_offset;
50 u64 data_size;
51 u64 event_offset;
52 u64 event_size;
53 DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
56 struct perf_evlist;
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,
76 int feat, int fd));
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 */