Re: [PATCH] perf report: Add 'tgid' sort key
From: Arnaldo Carvalho de Melo
Date: Tue Feb 25 2025 - 14:26:16 EST
On Tue, Feb 25, 2025 at 08:11:17PM +0100, Arnaldo Carvalho de Melo wrote:
> On Tue, Feb 25, 2025 at 08:07:18PM +0100, Arnaldo Carvalho de Melo wrote:
> > On Mon, Feb 24, 2025 at 11:51:35PM -0800, Namhyung Kim wrote:
> > > On Mon, Feb 24, 2025 at 08:40:37PM -0800, Ian Rogers wrote:
> > > > On Mon, Feb 24, 2025 at 6:51 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > > > > On Mon, Feb 24, 2025 at 10:18:37AM -0800, Ian Rogers wrote:
> > > [SNIP]
> > > > > > I thought the real-time processing had to use
> > > > > > maps__fixup_overlap_and_insert (rather than maps__insert) as mmap
> > > > > > events only give us VMA data and two mmaps may have been merged.
> > > > > > Shouldn't doing this change be the simplest fix?
>
> > > > > Make sense. How about this?
>
> > > > Lgtm, I have no way to test the issue. Why does maps__fixup_end need
> > > > to get pushed later?
>
> > > I just noticed it would add extra kernel maps after modules. I think it
> > > should fixup end address of the kernel maps after adding all maps first.
>
> > > Arnaldo, can you please test this?
>
> > Trying it now.
>
> Now we have something different:
>
> root@number:~# perf record sleep
> sleep: missing operand
> Try 'sleep --help' for more information.
> [ perf record: Woken up 1 times to write data ]
> perf: util/maps.c:80: check_invariants: Assertion `RC_CHK_EQUAL(map__kmap(map)->kmaps, maps)' failed.
> Aborted (core dumped)
> root@number:~#
__maps__insert() does:
if (dso && dso__kernel(dso)) {
struct kmap *kmap = map__kmap(new);
if (kmap)
kmap->kmaps = maps;
else
pr_err("Internal error: kernel dso with non kernel map\n");
}
while maps__fixup_overlap_and_insert() doesn't.
It calls __maps__insert_sorted() that probably should do what
__maps__insert() does?
- Arnaldo