summaryrefslogtreecommitdiff
path: root/tools/perf/util/namespaces.h
diff options
context:
space:
mode:
authorKrister Johansen <kjlx@templeofstupid.com>2017-07-05 18:48:09 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-18 23:14:09 -0300
commitbf2e710b3cb8445c052f2ff50b4875a2523bb279 (patch)
tree404a86734bb7b7275638b1d5c7a49a136d6e4766 /tools/perf/util/namespaces.h
parent843ff37bb59edbe51d64e77ba1b3245a15a4dd9f (diff)
perf maps: Lookup maps in both intitial mountns and inner mountns.
If a process is in a mountns and has symbols in /tmp/perf-<pid>.map, look first in the namespace using the tgid for the pidns that the process might be in. If the map isn't found there, try looking in the mountns where perf is running, and use the tgid that's appropriate for perf's pid namespace. If all else fails, use the original pid. This allows us to locate a symbol map file in the mount namespace, if it was generated there. However, we also try the tool's /tmp in case it's there instead. Signed-off-by: Krister Johansen <kjlx@templeofstupid.com> Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1499305693-1599-3-git-send-email-kjlx@templeofstupid.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/namespaces.h')
-rw-r--r--tools/perf/util/namespaces.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
index b20f6ead7b2d..f19aa41119ae 100644
--- a/tools/perf/util/namespaces.h
+++ b/tools/perf/util/namespaces.h
@@ -26,6 +26,8 @@ void namespaces__free(struct namespaces *namespaces);
struct nsinfo {
pid_t pid;
+ pid_t tgid;
+ pid_t nstgid;
bool need_setns;
char *mntns_path;
refcount_t refcnt;
@@ -36,8 +38,9 @@ struct nscookie {
int newns;
};
-void nsinfo__init(struct nsinfo *nsi);
+int nsinfo__init(struct nsinfo *nsi);
struct nsinfo *nsinfo__new(pid_t pid);
+struct nsinfo *nsinfo__copy(struct nsinfo *nsi);
void nsinfo__delete(struct nsinfo *nsi);
struct nsinfo *nsinfo__get(struct nsinfo *nsi);