summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e7a98dbd2aed..60a9eaa372ef 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -18,6 +18,8 @@
#include "symbol.h"
#include "strlist.h"
#include "intlist.h"
+#include "namespaces.h"
+#include "vdso.h"
#include "header.h"
#include "path.h"
#include "sane_ctype.h"
@@ -1436,9 +1438,17 @@ int dso__load(struct dso *dso, struct map *map)
struct symsrc *syms_ss = NULL, *runtime_ss = NULL;
bool kmod;
unsigned char build_id[BUILD_ID_SIZE];
+ struct nscookie nsc;
+ nsinfo__mountns_enter(dso->nsinfo, &nsc);
pthread_mutex_lock(&dso->lock);
+ /* The vdso files always live in the host container, so don't go looking
+ * for them in the container's mount namespace.
+ */
+ if (dso__is_vdso(dso))
+ nsinfo__mountns_exit(&nsc);
+
/* check again under the dso->lock */
if (dso__loaded(dso, map->type)) {
ret = 1;
@@ -1584,6 +1594,7 @@ out_free:
out:
dso__set_loaded(dso, map->type);
pthread_mutex_unlock(&dso->lock);
+ nsinfo__mountns_exit(&nsc);
return ret;
}