summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/machine.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2015-09-30 16:54:04 +0200
committerArnaldo Carvalho de Melo2015-09-30 23:34:29 +0200
commita5e813c68649366aaa3f785772b00ea6ccad7b8d (patch)
tree593b32a8e438fe635878321b34a02474fcfaf0bd /tools/perf/util/machine.c
parentperf machine: Use machine__kernel_map() thoroughly (diff)
downloadkernel-qcow2-linux-a5e813c68649366aaa3f785772b00ea6ccad7b8d.tar.gz
kernel-qcow2-linux-a5e813c68649366aaa3f785772b00ea6ccad7b8d.tar.xz
kernel-qcow2-linux-a5e813c68649366aaa3f785772b00ea6ccad7b8d.zip
perf machine: Add method for common kernel_map(FUNCTION) operation
And it is also a step in the direction of killing the separation of data and text maps in map_groups. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-rrds86kb3wx5wk8v38v56gw8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r--tools/perf/util/machine.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index d71b7dcf4579..76fe167c359e 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -625,7 +625,7 @@ size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp)
{
int i;
size_t printed = 0;
- struct dso *kdso = machine__kernel_map(machine, MAP__FUNCTION)->dso;
+ struct dso *kdso = machine__kernel_map(machine)->dso;
if (kdso->has_build_id) {
char filename[PATH_MAX];
@@ -750,7 +750,7 @@ int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel)
machine->vmlinux_maps[type]->map_ip =
machine->vmlinux_maps[type]->unmap_ip =
identity__map_ip;
- map = machine__kernel_map(machine, type);
+ map = __machine__kernel_map(machine, type);
kmap = map__kmap(map);
if (!kmap)
return -1;
@@ -768,7 +768,7 @@ void machine__destroy_kernel_maps(struct machine *machine)
for (type = 0; type < MAP__NR_TYPES; ++type) {
struct kmap *kmap;
- struct map *map = machine__kernel_map(machine, type);
+ struct map *map = __machine__kernel_map(machine, type);
if (map == NULL)
continue;
@@ -868,7 +868,7 @@ int machines__create_kernel_maps(struct machines *machines, pid_t pid)
int machine__load_kallsyms(struct machine *machine, const char *filename,
enum map_type type, symbol_filter_t filter)
{
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
int ret = dso__load_kallsyms(map->dso, filename, map, filter);
if (ret > 0) {
@@ -887,7 +887,7 @@ int machine__load_kallsyms(struct machine *machine, const char *filename,
int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
symbol_filter_t filter)
{
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
int ret = dso__load_vmlinux_path(map->dso, map, filter);
if (ret > 0)
@@ -1245,8 +1245,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
/*
* preload dso of guest kernel and modules
*/
- dso__load(kernel, machine__kernel_map(machine, MAP__FUNCTION),
- NULL);
+ dso__load(kernel, machine__kernel_map(machine), NULL);
}
}
return 0;
@@ -1998,7 +1997,7 @@ int machine__set_current_tid(struct machine *machine, int cpu, pid_t pid,
int machine__get_kernel_start(struct machine *machine)
{
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
int err = 0;
/*