Re: [PATCH 0/3] Handle chroot tasks properly (v1)

From: Arnaldo Carvalho de Melo
Date: Tue Feb 01 2022 - 19:12:03 EST


Em Tue, Feb 01, 2022 at 12:01:49PM -0800, Namhyung Kim escreveu:
> On Mon, Jan 31, 2022 at 5:16 PM Andi Kleen <ak@xxxxxxxxxxxxxxx> wrote:
> > On 1/28/2022 12:39 PM, Namhyung Kim wrote:

> > > I found that perf tools don't work well with tasks in a chroot. The
> > > filenames in MMAP record are from the root directory of the task so
> > > it's different than what it sees from outside.

> > While that's a real problem, and for chroot it can be fixed, it's much
> > more complicated for the more complex container namespace case with
> > custom mounts, including loop back, etc.

> Probably. Note that perf tool can handle namespaces (to some extent)
> but missed chroot support. I have a bug report because of this issue.
> Let's fix the simple case first.

> > It seems it really need some kind of agent to handle all cases. For
> > example the agent could understand container metadata formats and then
> > do the right thing.
>
> Sounds like a good idea for a long term solution.

I think build ids are the way to go and would be really happy to have
arguments against it to be properly spelled out so we can harvest
documentation.

Its really difficult to associate a mmap to a backing storage, its race
prone, so having something that uniquely identifies the contents at the
time of mmap placement hugely desirable.

We seem to have that in most cases, and there is discussion about what
to do to the cases where parsing the ELF headers when that area is not
in memory, so there is hope that the buildid for an exec VMA will be
always available.

- Arnaldo