1 #ifndef __PERF_SESSION_H
2 #define __PERF_SESSION_H
8 #include <linux/rbtree.h>
9 #include "../../../include/linux/perf_event.h"
15 struct perf_header header;
17 unsigned long mmap_window;
18 struct rb_root threads;
19 struct thread *last_match;
20 struct rb_root kerninfo_root;
21 struct events_stats events_stats;
22 struct rb_root stats_by_id;
23 unsigned long event_total[PERF_RECORD_MAX];
24 unsigned long unknown_events;
34 typedef int (*event_op)(event_t *self, struct perf_session *session);
36 struct perf_event_ops {
52 struct perf_session *perf_session__new(const char *filename, int mode, bool force);
53 void perf_session__delete(struct perf_session *self);
55 void perf_event_header__bswap(struct perf_event_header *self);
57 int __perf_session__process_events(struct perf_session *self,
58 u64 data_offset, u64 data_size, u64 size,
59 struct perf_event_ops *ops);
60 int perf_session__process_events(struct perf_session *self,
61 struct perf_event_ops *event_ops);
63 struct map_symbol *perf_session__resolve_callchain(struct perf_session *self,
64 struct thread *thread,
65 struct ip_callchain *chain,
66 struct symbol **parent);
68 bool perf_session__has_traces(struct perf_session *self, const char *msg);
70 int perf_session__set_kallsyms_ref_reloc_sym(struct map **maps,
71 const char *symbol_name,
74 void mem_bswap_64(void *src, int byte_size);
76 int perf_session__create_kernel_maps(struct perf_session *self);
78 int do_read(int fd, void *buf, size_t size);
79 void perf_session__update_sample_type(struct perf_session *self);
81 #ifdef NO_NEWT_SUPPORT
82 static inline int perf_session__browse_hists(struct rb_root *hists __used,
84 u64 session_total __used,
85 const char *helpline __used,
86 const char *input_name __used)
91 int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
92 u64 session_total, const char *helpline,
93 const char *input_name);
95 #endif /* __PERF_SESSION_H */