linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Li Huafei <lihuafei1@huawei.com>
Cc: <acme@kernel.org>, <peterz@infradead.org>, <mingo@redhat.com>,
	<namhyung@kernel.org>, <mark.rutland@arm.com>,
	<alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>,
	<irogers@google.com>, <adrian.hunter@intel.com>,
	<kan.liang@linux.intel.com>, <dima@secretsauce.net>,
	<aleksander.lobakin@intel.com>,
	<linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] perf probe: Fix the incorrect line number display in 'perf probe -l'
Date: Thu, 14 Nov 2024 00:45:08 +0900	[thread overview]
Message-ID: <20241114004508.cdafc33a99e3a02d5b5a714e@kernel.org> (raw)
In-Reply-To: <fa59a868-b7cc-5402-9379-4f7f931e5813@huawei.com>

Hi Li,

On Wed, 13 Nov 2024 16:39:54 +0800
Li Huafei <lihuafei1@huawei.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@kernel.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@kernel/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@kernel.org>

  reply	other threads:[~2024-11-13 15:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 18:19 [PATCH 1/2] perf probe: Reset old content before processing the next event string Li Huafei
2024-11-08 18:19 ` [PATCH 2/2] perf probe: Fix the incorrect line number display in 'perf probe -l' Li Huafei
2024-11-11  8:05   ` Masami Hiramatsu
2024-11-11 12:05     ` Masami Hiramatsu
2024-11-12  3:09       ` Li Huafei
2024-11-13  8:39         ` Li Huafei
2024-11-13 15:45           ` Masami Hiramatsu [this message]
2024-11-11  4:47 ` [PATCH 1/2] perf probe: Reset old content before processing the next event string Masami Hiramatsu
2024-11-12  1:47   ` Li Huafei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241114004508.cdafc33a99e3a02d5b5a714e@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dima@secretsauce.net \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=lihuafei1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).