lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20241114004508.cdafc33a99e3a02d5b5a714e@kernel.org>
Date: Thu, 14 Nov 2024 00:45:08 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Li Huafei <lihuafei1@...wei.com>
Cc: <acme@...nel.org>, <peterz@...radead.org>, <mingo@...hat.com>,
 <namhyung@...nel.org>, <mark.rutland@....com>,
 <alexander.shishkin@...ux.intel.com>, <jolsa@...nel.org>,
 <irogers@...gle.com>, <adrian.hunter@...el.com>,
 <kan.liang@...ux.intel.com>, <dima@...retsauce.net>,
 <aleksander.lobakin@...el.com>, <linux-perf-users@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] perf probe: Fix the incorrect line number display
 in 'perf probe -l'

Hi Li,

On Wed, 13 Nov 2024 16:39:54 +0800
Li Huafei <lihuafei1@...wei.com> wrote:

> 
> 
> On 2024/11/12 11:09, Li Huafei wrote:
> > Hi Masami,
> > 
> > On 2024/11/11 20:05, Masami Hiramatsu (Google) wrote:
> >> Hi Li,
> >>
> >> On Mon, 11 Nov 2024 17:05:49 +0900
> >> Masami Hiramatsu (Google) <mhiramat@...nel.org> 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 for the detailed explanation in your previous email. I tested
> > your patch, and the results are as follows:
> > 
> >   # perf probe -l
> >     probe:schedule       (on schedule:5@...nel/sched/core.c)
> > 
> 
> Sorry, I made a mistake. 5 is the offset from the function entry, not
> the line number. So your patch is ok.

Thanks for testing! OK, let me cleanup the patch.


-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ