linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	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,
	Blake Jones <blakejones@google.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Petr Pavlu <petr.pavlu@suse.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Daniel Gomez <da.gomez@samsung.com>,
	linux-modules@vger.kernel.org
Subject: Re: [PATCH] perf tools: Fixup end address of modules
Date: Thu, 9 Jan 2025 18:19:44 -0300	[thread overview]
Message-ID: <Z4A9cMoSHVpAxF3-@x1> (raw)
In-Reply-To: <CAP-5=fX2Pj+Gv89LoO8SakqwVoaiT2A9BZEKmLjnbYmc4ZRo4w@mail.gmail.com>

On Wed, Dec 18, 2024 at 02:15:35PM -0800, Ian Rogers wrote:
> On Wed, Dec 18, 2024 at 2:04 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > In machine__create_module(), it reads /proc/modules to get a list of
> > modules in the system.  The file shows the start address (of text) and
> > the size of the module so it uses the info to reconstruct system memory
> > maps for symbol resolution.
> >
> > But module memory consists of multiple segments and they can be
> > scaterred.  Currently perf tools assume they are contiguous and see some
> 
> nit: s/scaterred/scattered/
> 
> > overlaps.  This can confuse the tool when it finds a map containing a
> > given address.
> >
> > As we mostly care about the function symbols in the text segment, it can
> > fixup the size or end address of modules when there's an overlap.  We
> > can use maps__fixup_end() which updates the end address using the start
> > address of the next map.
> >
> > Ideally it should be able to track other segments (like data/rodata),
> > but that would require some changes in /proc/modules IMHO.
> >
> > Reported-by: Blake Jones <blakejones@google.com>
> > Cc: Luis Chamberlain <mcgrof@kernel.org>
> > Cc: Petr Pavlu <petr.pavlu@suse.com>
> > Cc: Sami Tolvanen <samitolvanen@google.com>
> > Cc: Daniel Gomez <da.gomez@samsung.com>
> > Cc: linux-modules@vger.kernel.org
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied to perf-tools-next,

- Arnaldo

      reply	other threads:[~2025-01-09 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 22:04 [PATCH] perf tools: Fixup end address of modules Namhyung Kim
2024-12-18 22:15 ` Ian Rogers
2025-01-09 21:19   ` Arnaldo Carvalho de Melo [this message]

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=Z4A9cMoSHVpAxF3-@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=blakejones@google.com \
    --cc=da.gomez@samsung.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=petr.pavlu@suse.com \
    --cc=samitolvanen@google.com \
    /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).