All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, Anton Blanchard <anton@au1.ibm.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 01/32] perf tools powerpc: Cache the DWARF debug info
Date: Fri, 31 Oct 2014 12:10:17 +0900	[thread overview]
Message-ID: <87a94d6ijq.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20141029212620.GC17916@us.ibm.com> (Sukadev Bhattiprolu's message of "Wed, 29 Oct 2014 14:26:20 -0700")

Hi Sukadev,

On Wed, 29 Oct 2014 14:26:20 -0700, Sukadev Bhattiprolu wrote:
> Namhyung Kim [namhyung@kernel.org] wrote:
> | I don't know how dwfl_report_offline() can make it to find out a mod
> | from pc as it's an (loaded) virtual address.  Maybe I miss something or
> | is your dso's are prelinked?
>
> Scratching my head on this and a related issue.
>
> The code seems to work consistently on Fedora20 and we recently noticed
> that it does not work on RHEL7. Maybe related to the issue you point out.
>
> On Fedora20 objdump -D /usr/lib64/libc-2.18.so shows something like this:
>
> 00000080a7be3bf0 <.__random>:
>   80a7be3bf0:   7c 08 02 a6     mflr    r0
>   80a7be3bf4:   fb e1 ff f8     std     r31,-8(r1)
>   80a7be3bf8:   60 00 00 00     nop
>   80a7be3bfc:   39 00 00 01     li      r8,1
>   80a7be3c00:   3b e2 9a f0     addi    r31,r2,-25872
>   80a7be3c04:   39 40 00 00     li      r10,0
>   80a7be3c08:   f8 01 00 10     std     r0,16(r1)
>   80a7be3c0c:   f8 21 ff 71     stdu    r1,-144(r1)
>   80a7be3c10:   7d 20 f8 29     lwarx   r9,0,r31,1
>   80a7be3c14:   7c 09 50 00     cmpw    r9,r10
>   80a7be3c18:   40 82 00 0c     bne     80a7be3c24 <.__random+0x34>
>
> and my small test program (and perf) can use the addresses to correctly
> say if LR is relevant or not.

Looks like it's prelink'ed.


>
> But on RHEL7, objdump shows addresses differently:
>
> 0000000000063870 <.__random>:
>    63870:       7c 08 02 a6     mflr    r0
>    63874:       fb e1 ff f8     std     r31,-8(r1)
>    63878:       60 00 00 00     nop
>    6387c:       3b e2 9a e0     addi    r31,r2,-25888
>    63880:       39 00 00 01     li      r8,1
>    63884:       39 40 00 00     li      r10,0
>    63888:       f8 01 00 10     std     r0,16(r1)
>    6388c:       f8 21 ff 71     stdu    r1,-144(r1)
>    63890:       7d 20 f8 29     lwarx   r9,0,r31,1
>
> and perf and my test program fail. Not sure if this is something related
> to the way it is built.

Then I think struct dso might not be a proper place to cache since a dso
can be mapped to different locations/addresses and it has no idea about
the location.

Maybe it's worth move the caching logic to a different place like struct
thread as libunwind does now, and make it generic so that the arch's
can also get the benefit when unwinding.  A problem I can expect is that
it will have thread x dso number of cache entries which can consume a
lot of memory and fd IMHO.

Thanks,
Namhyung

  reply	other threads:[~2014-10-31  3:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 13:31 [GIT PULL 00/32] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-10-28 13:31 ` [PATCH 01/32] perf tools powerpc: Cache the DWARF debug info Arnaldo Carvalho de Melo
2014-10-29  6:39   ` Namhyung Kim
2014-10-29 21:26     ` Sukadev Bhattiprolu
2014-10-31  3:10       ` Namhyung Kim [this message]
2014-10-28 13:31 ` [PATCH 02/32] perf tools: Set thread->mg.machine in all places Arnaldo Carvalho de Melo
2014-10-28 13:31 ` [PATCH 03/32] perf tools: A thread's machine can be found via thread->mg->machine Arnaldo Carvalho de Melo
2014-10-28 13:31 ` [PATCH 04/32] perf thread: Adopt resolve_callchain method from machine Arnaldo Carvalho de Melo
2014-10-28 13:31 ` [PATCH 05/32] perf callchains: Use thread->mg->machine Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 06/32] perf tests: Remove misplaced __maybe_unused Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 07/32] perf tests: Use thread->mg->machine Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 08/32] perf tools: Add PARSE_OPT_DISABLED flag Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 09/32] perf tools: Export usage string and option table of perf record Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 10/32] perf kvm: Print kvm specific --help output Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 11/32] perf tools: Add support for exclusive option Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 12/32] perf probe: Use PARSE_OPT_EXCLUSIVE flag Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 13/32] perf callchain: Use global caching provided by libunwind Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 14/32] perf tools: Ensure return negative value when write header error Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 15/32] perf pmu: Let pmu's with no events show up on perf list Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 16/32] perf tools: Build programs to copy 32-bit compatibility Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 17/32] perf tools: Add support for 32-bit compatibility VDSOs Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 18/32] perf tools: Do not attempt to run perf-read-vdso32 if it wasn't built Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 19/32] perf tools: Make CPUINFO_PROC an array to support different kernel versions Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 20/32] perf pmu: Add proper error handling to print_pmu_events() Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 21/32] perf tools: Fix report -F abort for data without branch info Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 22/32] perf tools: Fix report -F in_tx " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 23/32] perf tools: Fix report -F mispredict " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 24/32] perf tools: Fix report -F symbol_to " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 25/32] perf tools: Fix report -F symbol_from " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 26/32] perf tools: Fix report -F dso_to " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 27/32] perf tools: Fix report -F dso_from " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 28/32] perf tools: Add facility to export data in database-friendly way Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 29/32] perf scripting python: Extend interface to export data in a " Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 30/32] perf script: Add Python script to export to postgresql Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 31/32] perf probe: Trivial typo fix for --demangle Arnaldo Carvalho de Melo
2014-10-28 13:32 ` [PATCH 32/32] perf probe: Add --quiet option to suppress output result message Arnaldo Carvalho de Melo
2014-10-29  9:11 ` [GIT PULL 00/32] perf/core improvements and fixes Ingo Molnar
2014-10-29 12:58   ` Arnaldo Carvalho de Melo

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=87a94d6ijq.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=anton@au1.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sukadev@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.