summaryrefslogtreecommitdiff
path: root/tools/perf/util/session.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-02-03 18:52:00 (GMT)
committerIngo Molnar <mingo@elte.hu>2010-02-04 08:33:24 (GMT)
commit9de89fe7c577847877ae00ea1aa6315559b10243 (patch)
tree523bcd2c2b1e2a839100b472ff864860cdc8caeb /tools/perf/util/session.h
parentb8f46c5a34fa64fd456295388d18f50ae69d9f37 (diff)
downloadlinux-fsl-qoriq-9de89fe7c577847877ae00ea1aa6315559b10243.tar.xz
perf symbols: Remove perf_session usage in symbols layer
I noticed while writing the first test in 'perf regtest' that to just test the symbol handling routines one needs to create a perf session, that is a layer centered on a perf.data file, events, etc, so I untied these layers. This reduces the complexity for the users as the number of parameters to most of the symbols and session APIs now was reduced while not adding more state to all the map instances by only having data that is needed to split the kernel (kallsyms and ELF symtab sections) maps and do vmlinux relocation on the main kernel map. 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: <1265223128-11786-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.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 36d1a80..752d75a 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -3,13 +3,13 @@
#include "event.h"
#include "header.h"
+#include "symbol.h"
#include "thread.h"
#include <linux/rbtree.h>
#include "../../../include/linux/perf_event.h"
struct ip_callchain;
struct thread;
-struct symbol;
struct perf_session {
struct perf_header header;
@@ -24,10 +24,7 @@ struct perf_session {
unsigned long unknown_events;
struct rb_root hists;
u64 sample_type;
- struct {
- const char *name;
- u64 addr;
- } ref_reloc_sym;
+ struct ref_reloc_sym ref_reloc_sym;
int fd;
int cwdlen;
char *cwd;
@@ -69,9 +66,20 @@ int perf_header__read_build_ids(struct perf_header *self, int input,
int perf_session__set_kallsyms_ref_reloc_sym(struct perf_session *self,
const char *symbol_name,
u64 addr);
-void perf_session__reloc_vmlinux_maps(struct perf_session *self,
- u64 unrelocated_addr);
void mem_bswap_64(void *src, int byte_size);
+static inline int __perf_session__create_kernel_maps(struct perf_session *self,
+ struct dso *kernel)
+{
+ return __map_groups__create_kernel_maps(&self->kmaps,
+ self->vmlinux_maps, kernel);
+}
+
+static inline struct map *
+ perf_session__new_module_map(struct perf_session *self,
+ u64 start, const char *filename)
+{
+ return map_groups__new_module(&self->kmaps, start, filename);
+}
#endif /* __PERF_SESSION_H */