summaryrefslogtreecommitdiff
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r--tools/perf/util/probe-event.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index cdf5d655d84c..b26670a26005 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -165,8 +165,9 @@ static struct map *kernel_get_module_map(const char *module)
maps__for_each_entry(maps, pos) {
/* short_name is "[module]" */
- const char *short_name = pos->map->dso->short_name;
- u16 short_name_len = pos->map->dso->short_name_len;
+ struct dso *dso = map__dso(pos->map);
+ const char *short_name = dso->short_name;
+ u16 short_name_len = dso->short_name_len;
if (strncmp(short_name + 1, module,
short_name_len - 2) == 0 &&
@@ -182,13 +183,15 @@ struct map *get_target_map(const char *target, struct nsinfo *nsi, bool user)
/* Init maps of given executable or kernel */
if (user) {
struct map *map;
+ struct dso *dso;
map = dso__new_map(target);
- if (map && map->dso) {
- mutex_lock(&map->dso->lock);
- nsinfo__put(map->dso->nsinfo);
- map->dso->nsinfo = nsinfo__get(nsi);
- mutex_unlock(&map->dso->lock);
+ dso = map ? map__dso(map) : NULL;
+ if (dso) {
+ mutex_lock(&dso->lock);
+ nsinfo__put(dso->nsinfo);
+ dso->nsinfo = nsinfo__get(nsi);
+ mutex_unlock(&dso->lock);
}
return map;
} else {
@@ -341,7 +344,7 @@ static int kernel_get_module_dso(const char *module, struct dso **pdso)
snprintf(module_name, sizeof(module_name), "[%s]", module);
map = maps__find_by_name(machine__kernel_maps(host_machine), module_name);
if (map) {
- dso = map->dso;
+ dso = map__dso(map);
goto found;
}
pr_debug("Failed to find module %s.\n", module);
@@ -349,7 +352,7 @@ static int kernel_get_module_dso(const char *module, struct dso **pdso)
}
map = machine__kernel_map(host_machine);
- dso = map->dso;
+ dso = map__dso(map);
if (!dso->has_build_id)
dso__read_running_kernel_build_id(dso, host_machine);
@@ -3737,6 +3740,7 @@ int show_available_funcs(const char *target, struct nsinfo *nsi,
{
struct rb_node *nd;
struct map *map;
+ struct dso *dso;
int ret;
ret = init_probe_symbol_maps(user);
@@ -3762,14 +3766,14 @@ int show_available_funcs(const char *target, struct nsinfo *nsi,
(target) ? : "kernel");
goto end;
}
- if (!dso__sorted_by_name(map->dso))
- dso__sort_by_name(map->dso);
+ dso = map__dso(map);
+ if (!dso__sorted_by_name(dso))
+ dso__sort_by_name(dso);
/* Show all (filtered) symbols */
setup_pager();
- for (nd = rb_first_cached(&map->dso->symbol_names); nd;
- nd = rb_next(nd)) {
+ for (nd = rb_first_cached(&dso->symbol_names); nd; nd = rb_next(nd)) {
struct symbol_name_rb_node *pos = rb_entry(nd, struct symbol_name_rb_node, rb_node);
if (strfilter__compare(_filter, pos->sym.name))