]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - tools/perf/util/session.h
perf session: Move the global threads list to perf_session
[mirror_ubuntu-jammy-kernel.git] / tools / perf / util / session.h
1 #ifndef __PERF_SESSION_H
2 #define __PERF_SESSION_H
3
4 #include "event.h"
5 #include "header.h"
6 #include <linux/rbtree.h>
7
8 struct thread;
9
10 struct perf_session {
11 struct perf_header header;
12 unsigned long size;
13 unsigned long mmap_window;
14 struct rb_root threads;
15 struct thread *last_match;
16 int fd;
17 int cwdlen;
18 char *cwd;
19 char filename[0];
20 };
21
22 typedef int (*event_op)(event_t *self, struct perf_session *session);
23
24 struct perf_event_ops {
25 event_op process_sample_event;
26 event_op process_mmap_event;
27 event_op process_comm_event;
28 event_op process_fork_event;
29 event_op process_exit_event;
30 event_op process_lost_event;
31 event_op process_read_event;
32 event_op process_throttle_event;
33 event_op process_unthrottle_event;
34 int (*sample_type_check)(u64 sample_type);
35 unsigned long total_unknown;
36 bool full_paths;
37 };
38
39 struct perf_session *perf_session__new(const char *filename, int mode,
40 bool force);
41 void perf_session__delete(struct perf_session *self);
42
43 int perf_session__process_events(struct perf_session *self,
44 struct perf_event_ops *event_ops);
45
46 int perf_header__read_build_ids(int input, u64 offset, u64 file_size);
47
48 #endif /* __PERF_SESSION_H */