linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf and containers
@ 2017-06-29 20:33 Brendan Gregg
  2017-06-30  2:16 ` Arnaldo Carvalho de Melo
  2017-06-30 17:13 ` Milian Wolff
  0 siblings, 2 replies; 5+ messages in thread
From: Brendan Gregg @ 2017-06-29 20:33 UTC (permalink / raw)
  To: linux-perf-use.

G'Day perf-users,

I've been using perf with containers a lot, running perf from the host
system-wide or with --cgroup for one container, and I'm wondering
about symbol translation and namespaces. When running "perf script" or
"perf report" from the host:

- kernel symbols: works fine

- JIT symbols: doesn't work as /tmp/perf-PID.map is in the container,
not the host, and has a different PID. I currently have shell scripts
to copy and rename map files, but... Would it be possible for perf to
try opening /tmp/perf-PID.map, and if that fails, check if the PID
still exists in /proc, read its NSpid from /proc/PID/status, and if
that's different (meaning it's in a container), then read
/proc/PID/root/tmp/perf-NSpid.map instead?

- binary symbols: /usr/bin/node,
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java, /lib/..., etc, may not
be in the host, so symbol translation fails. Could perf have a similar
approach where it tries from /proc/PID/root/... instead, if the PID is
in a container?

Or, are there other workarounds I don't know about for these? :) perf
could have a --setns flag to set the mount namespace before it
attempts symbol translation, which may also work for when I'm
analyzing one container only from the host, and could run "perf script
--setns=..." for that one container.

Using perf from within the container is totally different, and not
always possible (perf_event_open() can be disabled, and, some
containers are completely locked down, such that it's hard to run any
command that isn't the application)...

Brendan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-30 17:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-29 20:33 perf and containers Brendan Gregg
2017-06-30  2:16 ` Arnaldo Carvalho de Melo
2017-06-30  7:00   ` Thomas-Mich Richter
2017-06-30 14:55     ` David Ahern
2017-06-30 17:13 ` Milian Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).