From: Namhyung Kim <namhyung.kim@lge.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>,
Stephane Eranian <eranian@google.com>,
Jiri Olsa <jolsa@redhat.com>
Subject: Re: [RFC 0/5] perf tools: Minimalistic build without libelf dependency
Date: Mon, 21 May 2012 15:00:55 +0900 [thread overview]
Message-ID: <87mx522huw.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1336979424-17206-1-git-send-email-namhyung.kim@lge.com> (Namhyung Kim's message of "Mon, 14 May 2012 16:10:19 +0900")
Hi, all
Any other comments for this?
Thanks,
Namhyung
On Mon, 14 May 2012 16:10:19 +0900, Namhyung Kim wrote:
> NOTE: This is a RFC patchset and it contains a lot of rough edges
> and ugly codes.
>
> Current build procedure of perf tools requires a couple of external
> libraries. Although most of them are optional, elfutils' libelf is
> mandatory for resolving symbols and build-id of the binaries being
> profiled. For some reason, it makes embedded guys' life harder who
> want to build and run perf tools on their boards.
>
> This patch set tries to fix the problem by letting the perf could
> be built without libelf. The initial intent was just providing
> perf record command to gather performance events interested on the
> system and copies the data to development box to be used by perf
> report for analysis.
>
> However it's changed to have most of perf commands as is because
> perf can resolve kernel symbols without libelf and many of perf
> commands deal (mostly) with kernel events - so no need to restrict
> capability of perf tools. Therefore, the end result is not so
> minimalistic in fact and only thing it cannot do is "perf probe".
>
> And then I realized that the perf record needs to know about the
> build-id's anyway :(. So I implemented a poor man's version of elf
> parser only for parsing the build-id info.
>
> To build a minimal perf tools, pass MINIMAL=1 to make. The perf
> report will not display symbol names:
>
> # Samples: 988 of event 'cycles'
> # Event count (approx.): 3726465542
> #
> # Overhead Command Shared Object Symbol
> # ........ ....... ................. .........................
> #
> 98.40% noploop noploop [.] 0x000000000000066d
> 1.35% noploop ld-2.15.so [.] 0x000000000000bab1
> 0.10% noploop [kernel.kallsyms] [k] native_write_msr_safe
> 0.10% noploop [kernel.kallsyms] [k] scheduler_tick
> 0.03% noploop [kernel.kallsyms] [k] bad_range
> 0.01% noploop [kernel.kallsyms] [k] pipe_read
>
> But perf buildid-list can show you the build-id's:
>
> $ ./perf buildid-list
> ebfc1bdb98999c64d36ddfe394c58df3de6cbcfb [kernel.kallsyms]
> 52f0c5f25b95075e6fd7682763f7c3a779a4e889 /usr/lib64/ld-2.15.so
> 43a7a2b399b6ee2ff29c6bdadbda6bff88712ed4 /home/namhyung/bin/noploop
>
> So it can be packed using perf archive so copied and analized
> with full-fledged perf tools on a development machine.
>
> This patchset is based on commit cb04ff9ac424 ("sched, perf: Use
> a single callback into the scheduler") and tested on x86_64 and arm.
>
> Any comments are welcome, thanks.
> Namhyung
>
>
> Namhyung Kim (5):
> perf symbols: Introduce symbol__elf_init()
> perf symbols: Do not use ELF's symbol binding constants
> perf tools: Split out util/symbol-elf.c
> perf tools: Support minimal build
> perf symbols: Implement poor man's ELF parser
>
> tools/perf/Makefile | 29 ++
> tools/perf/builtin-buildid-list.c | 4 +-
> tools/perf/builtin-top.c | 5 +-
> tools/perf/command-list.txt | 2 +-
> tools/perf/perf.c | 2 +
> tools/perf/ui/browsers/map.c | 5 +-
> tools/perf/util/elf-minimal.h | 153 ++++++++
> tools/perf/util/generate-cmdlist.sh | 15 +
> tools/perf/util/symbol-elf.c | 691 +++++++++++++++++++++++++++++++++
> tools/perf/util/symbol-minimal.c | 258 +++++++++++++
> tools/perf/util/symbol.c | 712 ++---------------------------------
> tools/perf/util/symbol.h | 20 +
> 12 files changed, 1195 insertions(+), 701 deletions(-)
> create mode 100644 tools/perf/util/elf-minimal.h
> create mode 100644 tools/perf/util/symbol-elf.c
> create mode 100644 tools/perf/util/symbol-minimal.c
next prev parent reply other threads:[~2012-05-21 6:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 7:10 [RFC 0/5] perf tools: Minimalistic build without libelf dependency Namhyung Kim
2012-05-14 7:10 ` [PATCH 1/5] perf symbols: Introduce symbol__elf_init() Namhyung Kim
2012-05-14 7:10 ` [PATCH 2/5] perf symbols: Do not use ELF's symbol binding constants Namhyung Kim
2012-05-14 7:10 ` [PATCH 3/5] perf tools: Split out util/symbol-elf.c Namhyung Kim
2012-05-21 11:45 ` Jiri Olsa
2012-05-22 1:00 ` Namhyung Kim
2012-05-22 8:35 ` Jiri Olsa
2012-05-14 7:10 ` [PATCH 4/5] perf tools: Support minimal build Namhyung Kim
2012-05-14 7:10 ` [PATCH 5/5] perf symbols: Implement poor man's ELF parser Namhyung Kim
2012-05-21 11:47 ` Jiri Olsa
2012-05-22 1:08 ` Namhyung Kim
2012-05-22 7:52 ` Peter Zijlstra
2012-05-22 10:26 ` Namhyung Kim
2012-05-22 10:44 ` Peter Zijlstra
2012-05-14 9:22 ` [RFC 0/5] perf tools: Minimalistic build without libelf dependency Ingo Molnar
2012-05-15 0:40 ` Namhyung Kim
2012-05-21 6:00 ` Namhyung Kim [this message]
2012-05-21 15:03 ` David Ahern
2012-05-22 0:20 ` 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=87mx522huw.fsf@sejong.aot.lge.com \
--to=namhyung.kim@lge.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.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 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.