Re: [PATCH 2/2] perf probe: Fix the incorrect line number display in 'perf probe -l'
From: Google
Date: Mon Nov 11 2024 - 07:06:30 EST
Hi Li,
On Mon, 11 Nov 2024 17:05:49 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
> Currently debuginfo__find_probe_point() does
>
> (1) Get the line and file from CU's lineinfo
> (2) Get the real function(function instance) of the address
> (use this function's decl_line/decl_file as basement)
> (2-1) Search the inlined function scope in the real function
> for the given address.
> (2-2) if there is inlined function, update basement line/file.
> (2-3) verify the filename is same as basement filename.
> (3) calculate the relative line number from basement.
>
> The problem is in (1). Since we have no basement file/line info,
> we can not verify that the file/line info from CU's lineinfo.
> As Li shown above, the lineinfo may have several different lines
> for one address. We need to find most appropriate one based on
> the basement file/line.
>
> Thus what we need are
>
> - Introduce cu_find_lineinfo_at() which gives basement file/line
> information so that it can choose correct one. (hopefully)
> - Swap the order of (1) and (2*) so that we can pass the basement
> file/line when searching lineinfo. (Also, (2-3) should be right
> before (3))
>
Can you check below change fixes your issue?
Thank you,