aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/machine.c
diff options
context:
space:
mode:
authorKrister Johansen <kjlx@templeofstupid.com>2017-07-05 21:48:09 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-18 22:14:09 -0400
commitbf2e710b3cb8445c052f2ff50b4875a2523bb279 (patch)
tree404a86734bb7b7275638b1d5c7a49a136d6e4766 /tools/perf/util/machine.c
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/machine.c')
-rw-r--r--tools/perf/util/machine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 2e9eb6aa3ce2..246b441110a1 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1392,7 +1392,7 @@ int machine__process_mmap2_event(struct machine *machine,
1392 1392
1393 map = map__new(machine, event->mmap2.start, 1393 map = map__new(machine, event->mmap2.start,
1394 event->mmap2.len, event->mmap2.pgoff, 1394 event->mmap2.len, event->mmap2.pgoff,
1395 event->mmap2.pid, event->mmap2.maj, 1395 event->mmap2.maj,
1396 event->mmap2.min, event->mmap2.ino, 1396 event->mmap2.min, event->mmap2.ino,
1397 event->mmap2.ino_generation, 1397 event->mmap2.ino_generation,
1398 event->mmap2.prot, 1398 event->mmap2.prot,
@@ -1450,7 +1450,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event
1450 1450
1451 map = map__new(machine, event->mmap.start, 1451 map = map__new(machine, event->mmap.start,
1452 event->mmap.len, event->mmap.pgoff, 1452 event->mmap.len, event->mmap.pgoff,
1453 event->mmap.pid, 0, 0, 0, 0, 0, 0, 1453 0, 0, 0, 0, 0, 0,
1454 event->mmap.filename, 1454 event->mmap.filename,
1455 type, thread); 1455 type, thread);
1456 1456