public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/2] perf symbol: Set binary_type of dso when loading
Date: Tue, 24 Sep 2024 22:50:07 -0700	[thread overview]
Message-ID: <ZvOkj-USs2PRXxsH@google.com> (raw)
In-Reply-To: <b9a82437-cd4a-5331-47da-b0d1640169d7@ispras.ru>

Hello,

On Fri, Sep 20, 2024 at 08:04:00PM +0300, Alexander Monakov wrote:
> Hi,
> 
> On Fri, 26 Apr 2024, Namhyung Kim wrote:
> 
> > For the kernel dso, it sets the binary type of dso when loading the
> > symbol table.  But it seems not to do that for user DSOs.  Actually
> > it sets the symtab type only.  It's not clear why we want to maintain
> > the two separately but it uses the binary type info before getting
> > the disassembly.
> > 
> > Let's use the symtab type as binary type too if it's not set.  I think
> > it's ok to set the binary type when it founds a symsrc whether or not
> > it has actual symbols.
> > 
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> Any chance this can be applied and propagated to stable? Annotating
> functions outside of the main executable is broken otherwise (regressed
> since 873a83731f1c ("perf annotate: Skip DSOs not found")).
> 
> Tested-by: Alexander Monakov <amonakov@ispras.ru>

Thanks for the test.  For some reason, it doesn't seem to be merged
while patch 2/2 is.  I'll add this with above information.

Thanks,
Namhyung

> 
> > ---
> >  tools/perf/util/symbol.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> > index 7772a4d3e66c..63936269ec15 100644
> > --- a/tools/perf/util/symbol.c
> > +++ b/tools/perf/util/symbol.c
> > @@ -1927,6 +1927,9 @@ int dso__load(struct dso *dso, struct map *map)
> >  		if (next_slot) {
> >  			ss_pos++;
> >  
> > +			if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND)
> > +				dso__set_binary_type(dso, symtab_type);
> > +
> >  			if (syms_ss && runtime_ss)
> >  				break;
> >  		} else {
> > 

  reply	other threads:[~2024-09-25  5:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 21:51 [PATCH 1/2] perf symbol: Set binary_type of dso when loading Namhyung Kim
2024-04-26 21:51 ` [PATCH 2/2] perf symbol: Simplify kernel module checking Namhyung Kim
2024-09-20 17:04 ` [PATCH 1/2] perf symbol: Set binary_type of dso when loading Alexander Monakov
2024-09-25  5:50   ` Namhyung Kim [this message]
2024-09-25  5:55     ` Namhyung Kim

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=ZvOkj-USs2PRXxsH@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=amonakov@ispras.ru \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@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