diff options
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r-- | tools/perf/util/machine.c | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 6a0f5c25ce3e..71ee078d30f4 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -772,45 +772,16 @@ int machine__process_ksymbol(struct machine *machine __maybe_unused, return machine__process_ksymbol_register(machine, event, sample); } -static void dso__adjust_kmod_long_name(struct dso *dso, const char *filename) -{ - const char *dup_filename; - - if (!filename || !dso || !dso->long_name) - return; - if (dso->long_name[0] != '[') - return; - if (!strchr(filename, '/')) - return; - - dup_filename = strdup(filename); - if (!dup_filename) - return; - - dso__set_long_name(dso, dup_filename, true); -} - -struct map *machine__findnew_module_map(struct machine *machine, u64 start, - const char *filename) +static struct map *machine__addnew_module_map(struct machine *machine, u64 start, + const char *filename) { struct map *map = NULL; - struct dso *dso = NULL; struct kmod_path m; + struct dso *dso; if (kmod_path__parse_name(&m, filename)) return NULL; - map = map_groups__find_by_name(&machine->kmaps, m.name); - if (map) { - /* - * If the map's dso is an offline module, give dso__load() - * a chance to find the file path of that module by fixing - * long_name. - */ - dso__adjust_kmod_long_name(map->dso, filename); - goto out; - } - dso = machine__findnew_module_dso(machine, &m, filename); if (dso == NULL) goto out; @@ -1409,7 +1380,7 @@ static int machine__create_module(void *arg, const char *name, u64 start, if (arch__fix_module_text_start(&start, &size, name) < 0) return -1; - map = machine__findnew_module_map(machine, start, name); + map = machine__addnew_module_map(machine, start, name); if (map == NULL) return -1; map->end = start + size; @@ -1584,8 +1555,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine, strlen(machine->mmap_name) - 1) == 0; if (event->mmap.filename[0] == '/' || (!is_kernel_mmap && event->mmap.filename[0] == '[')) { - map = machine__findnew_module_map(machine, event->mmap.start, - event->mmap.filename); + map = machine__addnew_module_map(machine, event->mmap.start, + event->mmap.filename); if (map == NULL) goto out_problem; @@ -2414,7 +2385,7 @@ static int thread__resolve_callchain_sample(struct thread *thread, } check_calls: - if (callchain_param.order != ORDER_CALLEE) { + if (chain && callchain_param.order != ORDER_CALLEE) { err = find_prev_cpumode(chain, thread, cursor, parent, root_al, &cpumode, chain->nr - first_call); if (err) |