[PATCH v2 tip/perf/core 0/6] namespace tracing improvements

From: Krister Johansen
Date: Wed Jul 05 2017 - 21:48:22 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

Changes v1 -> v2:

- stylistic cleanups in namespace.c (Arnaldo)
- zfree instead of free in nsinfo__delete (Arnaldo)
- un-reflow map__new and dso__load (Arnaldo)
- introduce nsinfo__realpath (Arnaldo)
- move documentation into the patch that introduced the change. (Arnaldo)
- update help descriptions (Brendan)
- add perf-probe examples for uprobes and USDT (Brendan)


Krister Johansen (6):
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 buildid-cache: cache debuginfo

tools/perf/Documentation/perf-buildid-cache.txt | 5 +
tools/perf/Documentation/perf-probe.txt | 14 ++
tools/perf/Documentation/perf-top.txt | 4 +
tools/perf/builtin-buildid-cache.c | 54 ++++--
tools/perf/builtin-probe.c | 45 ++++-
tools/perf/builtin-top.c | 15 ++
tools/perf/tests/sdt.c | 4 +-
tools/perf/util/annotate.c | 2 +-
tools/perf/util/build-id.c | 119 ++++++++++---
tools/perf/util/build-id.h | 12 +-
tools/perf/util/dso.c | 21 ++-
tools/perf/util/dso.h | 3 +
tools/perf/util/machine.c | 7 +-
tools/perf/util/map.c | 23 ++-
tools/perf/util/map.h | 2 +-
tools/perf/util/namespaces.c | 211 ++++++++++++++++++++++++
tools/perf/util/namespaces.h | 38 +++++
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 | 92 +++++++++--
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, 713 insertions(+), 118 deletions(-)

--
2.7.4