Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684679

Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in different mount namespace

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in different mount namespace
Date 2017-07-11 01:00 +0200
Message-ID <u1POO-2A7-7@gated-at.bofh.it> (permalink)
References (2 earlier) <u045A-5Wp-23@gated-at.bofh.it> <u0kWJ-1y4-1@gated-at.bofh.it> <u0HgC-8vC-27@gated-at.bofh.it> <u1Ad3-1kU-7@gated-at.bofh.it> <u1PF8-2wD-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Mon, Jul 10, 2017 at 03:39:25PM -0700, Krister Johansen escreveu:
> On Mon, Jul 10, 2017 at 08:17:00AM +0200, Thomas-Mich Richter wrote:
> > On 07/07/2017 09:36 PM, Krister Johansen wrote:
> > > On Thu, Jul 06, 2017 at 04:41:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > >> Em Wed, Jul 05, 2017 at 06:48:08PM -0700, Krister Johansen escreveu:
> > >>> Teach perf how to resolve symbols from binaries that are in a different
> > >>> mount namespace from the tool.  This allows perf to generate meaningful
> > >>> stack traces even if the binary resides in a different mount namespace
> > >>> from the tool.
> > >>
> > >> I was trying to find a way to test after applying each of the patches in
> > >> this series, when it ocurred to me that if a process that appears on a
> > >> perf.data file has exit, how can we access /proc/%ITS_PID/something?
> > > 
> > > You're correct.  We can't access /proc/<PID>/whatever once the process
> > > has exited.  That was the impeteus for patches 4 and 6, which allow us
> > > to capture the binary (and debuginfo, if it exists) into the buildid
> > > cache so that if we do have a trace that exists after a process or
> > > container exists, we'll still be able to resolve some of the symbols.

> > Any ideas on how to extend this to be able to resolve symbols after
> > the process/container exited?
> > I believe it boils down on how to interpret the mnt inode number in the
> > PERF_RECORD_NAMESPACE record...
> > Can this be done post-mortem? Maybe the PERF_RECORD_NAMESPACE record
> > has to contain more data than just the inode number?
 
> I think we're talking past one another.  If the container exits then the
> inode numbers that identify mount namespace are referring to something
> that is no longer valid.  There's no mount namespace to enter in order
> to locate the binary objects.  They may be on a volume that's no longer
> mounted.
 
> I have a pair of patches in the existing set that copies the binary
> objects into the buildid cache.  This lets you resolve the symbols after
> the container has exited, provided that you recorded the buildids during
> the trace.
 
> If you apply all the patches in this set, you should be able to generate
> traces that you can look at with script or report even after the process
> has exited.  I've been able to do it in my tests, at least.

I will work on testing them soon, I just wanted this discussion to take
place, what you did seems to be the best we can do with the existing
kernel infrastructure, and is a clear advance, so we need to test and
merge it.

Getting the build-ids for the binaries is the key here, then its just a
matter of populating a database where to get the matching binaries, we
wouldn't need even to copy the actual binaries at record time.

- Arnaldo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH tip/perf/core 6/7] perf documentation: updates for  target-ns. Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-03 20:50 +0200
  Re: [PATCH tip/perf/core 6/7] perf documentation: updates for  target-ns. Krister Johansen <kjlx@templeofstupid.com> - 2017-07-05 22:50 +0200
    [PATCH v2 tip/perf/core 3/6] perf probe: allow placing uprobes in alternate namespaces. Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
      [PATCH] perf probe: Fix build failure for get_target_map() Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2017-07-17 12:40 +0200
        Re: [PATCH] perf probe: Fix build failure for get_target_map() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-17 15:20 +0200
          Re: [PATCH] perf probe: Fix build failure for get_target_map() Michael Ellerman <mpe@ellerman.id.au> - 2017-07-18 11:20 +0200
    [PATCH v2 tip/perf/core 6/6] perf buildid-cache: cache debuginfo Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
    [PATCH v2 tip/perf/core 5/6] perf top: support lookup of symbols in other mount namespaces. Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
    [PATCH v2 tip/perf/core 4/6] perf buildid-cache: support binary objects from other namespaces Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
    [PATCH v2 tip/perf/core 0/6] namespace tracing improvements Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
      [PATCH v2 tip/perf/core 2/6] perf maps: lookup maps in both intitial mountns and inner mountns. Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
      [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in different mount namespace Krister Johansen <kjlx@templeofstupid.com> - 2017-07-06 03:50 +0200
        Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-06 21:50 +0200
          Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Krister Johansen <kjlx@templeofstupid.com> - 2017-07-07 21:40 +0200
            Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Thomas-Mich Richter <tmricht@linux.vnet.ibm.com> - 2017-07-10 08:20 +0200
              Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Krister Johansen <kjlx@templeofstupid.com> - 2017-07-11 00:50 +0200
                Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-11 01:00 +0200
                Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Krister Johansen <kjlx@templeofstupid.com> - 2017-07-11 01:40 +0200
                Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-11 15:00 +0200
                Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in  different mount namespace Krister Johansen <kjlx@templeofstupid.com> - 2017-07-11 19:20 +0200

csiph-web