public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Dave Martin <dave.martin@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	kernel-team@lists.ubuntu.com, Will Deacon <Will.Deacon@arm.com>,
	Linaro Dev <linaro-dev@lists.linaro.org>
Subject: Re: [PATCH 0/2] perf: symbol offset breakage with separated debug
Date: Tue, 3 Aug 2010 10:54:20 -0300	[thread overview]
Message-ID: <20100803135420.GV29507@ghostprotocols.net> (raw)
In-Reply-To: <1280836116-6654-1-git-send-email-dave.martin@linaro.org>

Em Tue, Aug 03, 2010 at 12:48:34PM +0100, Dave Martin escreveu:
> Hi all,
> 
> I've hit some problems in trying to get perf record/report to
> work correctly on systems with separated debug images (Ubuntu,
> in particular).  I worked on some patches to ensure that
> separate debug images do actually get loaded, when present --
> these commits have now been merged in linux-2.6-tip/master.
> (See below for a list of the commits.)
> 
> Now that these are in place, I'm observing a new problem which
> can mess up symbol locations -- though I think there might be a
> practical workaround, I can't see a trivial solution, so I'm
> keen to hear if anyone has any ideas.
> 
> 
> The problem:
> 
> perf makes some incorrect assumptions, which mean that the
> symbol locations seen by perf report and friends can be
> incorrect.
> 
> My analysis:
> 
> 	a) perf represents symbols as offsets from the start of
> 		the mmap'd code region which contains each
> 		symbol.

The symbol library in perf uses separate map_ip and unmap_ip to cope
with those, covering things like prelinked binaries, the kernel with its
absolute addresses, kexec cases where we capture a reference relocation
symbol so that we can adjust later when using the unrelocated vmlinux,
etc.
 
> 	b) For shared libs (ET_DYN objects), the desired offset
> 		is (usually) equal to the VMA of each given

VMA here stands for Virtual Memory Address, not Virtual Memory Area
where a map is loaded, right? I guess so, but trying to get to common
ground.

> 		symbol in the image.  Perf assumes that these
> 		offsets are always equal, and this normally
> 		works.
> 
> 		Atypical link configurations could cause this

Which ones? We need to detect those and act accordingly, doing
adjustments at load time or by using a separate map_ip/unmap_ip pair of
functions in struct map.

I'll continue reading your patches, the first one probably fixes a bug,
but wonder if you looked at the struct map->{map_ip,unmap_ip} routines
in tools/perf/util/map.h.

- Arnaldo

  parent reply	other threads:[~2010-08-03 13:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 11:48 [PATCH 0/2] perf: symbol offset breakage with separated debug Dave Martin
2010-08-03 11:48 ` [PATCH 1/2] perf events: Fix mmap offset determination Dave Martin
2010-08-03 14:31   ` Arnaldo Carvalho de Melo
2010-08-05  8:00   ` [tip:perf/core] " tip-bot for Dave Martin
2010-08-03 11:48 ` [PATCH 2/2] perf symbols: work around incorrect ET_EXEC symbol adjustment Dave Martin
2010-08-12 13:19   ` [PATCH v2] perf symbols: fix symbol offset breakage with separated debug Dave Martin
2010-08-13  9:27     ` [PATCH v3] " Dave Martin
2010-08-03 13:54 ` Arnaldo Carvalho de Melo [this message]
2010-08-04  8:29 ` [PATCH 0/2] perf: " Dave Martin

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=20100803135420.GV29507@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=Will.Deacon@arm.com \
    --cc=dave.martin@linaro.org \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.pitre@linaro.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