[PATCH tip/perf/core 0/7] namespace tracing improvements

From: Krister Johansen
Date: Fri Jun 30 2017 - 22:19:47 EST


This patch set is similar to a set of features I implemented for bcc
back in April. At a high-level it does the following:

- Allow the tracing tools to resolve symbols if the traced process has a
binary that is in a different mount namespace from perf.

- Allow the perf-<pid>.map files to live either in /tmp in the target
process' mount namespace, or the tracing process's /tmp in its own
mount namespace.

- Adds the ability to set and record against uprobes and USDT probes
when the target process resides in a different mount namespace.

With these changes I can get pretty good insight into what containerized
processes on my systems are doing. In addition to the above, I also
modified the builid cache code to cache relevant bits from the target
namespaces so that it's possible to preserve more information should a
container exit and take the mounted volumes along with it.

-K

Krister Johansen (7):
perf symbols: find symbols in different mount namespace
perf maps: lookup maps in both intitial mountns and inner mountns.
perf probe: allow placing uprobes in alternate namespaces.
perf buildid-cache: support binary objects from other namespaces
perf top: support lookup of symbols in other mount namespaces.
perf documentation: updates for target-ns.
perf buildid-cache: cache debuginfo

tools/perf/Documentation/perf-buildid-cache.txt | 5 +
tools/perf/Documentation/perf-probe.txt | 5 +
tools/perf/Documentation/perf-top.txt | 4 +
tools/perf/builtin-buildid-cache.c | 54 +++++--
tools/perf/builtin-probe.c | 46 +++++-
tools/perf/builtin-top.c | 15 ++
tools/perf/tests/sdt.c | 4 +-
tools/perf/util/annotate.c | 2 +-
tools/perf/util/build-id.c | 120 +++++++++++---
tools/perf/util/build-id.h | 12 +-
tools/perf/util/dso.c | 21 ++-
tools/perf/util/dso.h | 3 +
tools/perf/util/machine.c | 22 ++-
tools/perf/util/map.c | 29 +++-
tools/perf/util/map.h | 8 +-
tools/perf/util/namespaces.c | 198 ++++++++++++++++++++++++
tools/perf/util/namespaces.h | 36 +++++
tools/perf/util/parse-events.c | 2 +-
tools/perf/util/probe-event.c | 85 ++++++----
tools/perf/util/probe-event.h | 10 +-
tools/perf/util/probe-file.c | 19 ++-
tools/perf/util/probe-file.h | 4 +-
tools/perf/util/symbol.c | 93 +++++++++--
tools/perf/util/thread.c | 3 +
tools/perf/util/thread.h | 1 +
tools/perf/util/util.c | 34 +++-
tools/perf/util/util.h | 2 +
27 files changed, 706 insertions(+), 131 deletions(-)

--
2.7.4