diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-11 18:24:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-12 01:42:12 -0500 |
commit | 94c744b6c0c6c5802a85ebfebbec429ac5851f2b (patch) | |
tree | e34dcaca54f1d7752ab1e7974bb73f94ff3cf94c /tools/perf/util/session.h | |
parent | ea08d8cbd162fe3756e3e2298efbe0b8b12f92d1 (diff) |
perf tools: Introduce perf_session class
That does all the initialization boilerplate, opening the file,
reading the header, checking if it is valid, etc.
And that will as well have the threads list, kmap (now) global
variable, etc, so that we can handle two (or more) perf.data files
describing sessions to compare.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260573842-19720-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r-- | tools/perf/util/session.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h new file mode 100644 index 000000000000..f3699c8c8ed4 --- /dev/null +++ b/tools/perf/util/session.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __PERF_SESSION_H | ||
2 | #define __PERF_SESSION_H | ||
3 | |||
4 | #include "header.h" | ||
5 | |||
6 | struct perf_session { | ||
7 | struct perf_header header; | ||
8 | unsigned long size; | ||
9 | int fd; | ||
10 | char filename[0]; | ||
11 | }; | ||
12 | |||
13 | struct perf_session *perf_session__new(const char *filename, int mode, bool force); | ||
14 | void perf_session__delete(struct perf_session *self); | ||
15 | |||
16 | #endif /* __PERF_SESSION_H */ | ||