LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: <acme@kernel.org>, <jolsa@kernel.org>, <namhyung@kernel.org>
Cc: <mingo@redhat.com>, <lizefan@huawei.com>, <pi3orama@163.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 0/4] perf tools: introduce --map-adjustment.
Date: Wed, 1 Apr 2015 10:33:11 +0000	[thread overview]
Message-ID: <1427884395-241111-1-git-send-email-wangnan0@huawei.com> (raw)

This series of patches introduce a --map-adjustment argument for
dealing with private dynamic linkers.

Some programs write their private dynamic loader instead of glibc ld for
different reasons. They mmap() executable memory area, assemble code
from different '.so' and '.o' files then do the relocation and code
fixing by itself. Since the memory area is not file-backended, perf is
unable to handle symbol information in those files.

Actually, it is not hard for us to create a /tmp/perf-%d.map file from
those ELF objects then utilize the JIT interface. However, without this
series of patches, dwarf unwind information is lost. We are unable to
unwind stack recorded by --call-graph=dwarf if they are compiled without
frame pointer. In addition, we are unable to use annotation to analysis
instruction level histogram.

This series of patches solve this problem by introducing
'--map-adjustment' argument and let users directly hint perf-report
about the private mapping which known to be copied from ELF files.

Patch 1/4: fix a bug in unwind hooks.
Patch 2/4: extracts common code from machine__process_mmap2_event and
           machine__process_mmap_event, create machine_map_new().
Patch 3/4: the main part of this series. The usage of the newly
           introduced argument is described in the commit message of
	   that patch. It also update document for the argument.
Patch 4/4: Allows libunwind to try to read from user provided dso even
           the required address is not actually mapped.

Wang Nan (4):
  perf tools: unwind: ensure unwind hooks return negative errorno.
  perf tools: introduce machine_map_new to merge mmap/mmap2 processing
    code.
  perf tools: report: introduce --map-adjustment argument.
  perf tools: unwinding: try to read from map_adj for a unmapped
    address.

 tools/perf/Documentation/perf-report.txt |  11 +
 tools/perf/builtin-report.c              |   2 +
 tools/perf/util/machine.c                | 355 ++++++++++++++++++++++++++++++-
 tools/perf/util/machine.h                |   3 +
 tools/perf/util/unwind-libunwind.c       |  28 ++-
 5 files changed, 383 insertions(+), 16 deletions(-)

-- 
1.8.3.4


             reply	other threads:[~2015-04-01 10:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 10:33 Wang Nan [this message]
2015-04-01 10:33 ` [PATCH 1/4] perf tools: unwind: ensure unwind hooks return negative errorno Wang Nan
2015-04-01 12:12   ` Jiri Olsa
2015-04-01 12:41     ` Wang Nan
2015-04-07  8:30       ` Wang Nan
2015-04-01 10:33 ` [PATCH 2/4] perf tools: introduce machine_map_new to merge mmap/mmap2 processing code Wang Nan
2015-04-01 12:18   ` Jiri Olsa
2015-04-01 14:58     ` Arnaldo Carvalho de Melo
2015-04-01 10:33 ` [PATCH 3/4] perf tools: report: introduce --map-adjustment argument Wang Nan
2015-04-01 13:21   ` Jiri Olsa
2015-04-02  1:15     ` Wang Nan
2015-04-01 14:23   ` pi3orama
2015-04-01 10:33 ` [PATCH 4/4] perf tools: unwinding: try to read from map_adj for a unmapped address Wang Nan

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=1427884395-241111-1-git-send-email-wangnan0@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=pi3orama@163.com \
    --subject='Re: [PATCH 0/4] perf tools: introduce --map-adjustment.' \
    /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

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).