perf session: Move the global threads list to perf_session
[deliverable/linux.git] / tools / perf / util / session.h
CommitLineData
94c744b6
ACM
1#ifndef __PERF_SESSION_H
2#define __PERF_SESSION_H
3
301a0b02 4#include "event.h"
94c744b6 5#include "header.h"
b3165f41
ACM
6#include <linux/rbtree.h>
7
8struct thread;
94c744b6
ACM
9
10struct perf_session {
11 struct perf_header header;
12 unsigned long size;
ec913369 13 unsigned long mmap_window;
b3165f41
ACM
14 struct rb_root threads;
15 struct thread *last_match;
94c744b6 16 int fd;
ec913369
ACM
17 int cwdlen;
18 char *cwd;
94c744b6
ACM
19 char filename[0];
20};
21
301a0b02
ACM
22typedef int (*event_op)(event_t *self, struct perf_session *session);
23
24struct 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;
ec913369 36 bool full_paths;
301a0b02
ACM
37};
38
39struct perf_session *perf_session__new(const char *filename, int mode,
40 bool force);
94c744b6
ACM
41void perf_session__delete(struct perf_session *self);
42
301a0b02 43int perf_session__process_events(struct perf_session *self,
ec913369 44 struct perf_event_ops *event_ops);
301a0b02
ACM
45
46int perf_header__read_build_ids(int input, u64 offset, u64 file_size);
47
94c744b6 48#endif /* __PERF_SESSION_H */
This page took 0.03481 seconds and 5 git commands to generate.