From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Eric Saint-Etienne <eric.saint.etienne@oracle.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.co>,
Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Namhyung Kim <namhyung@kernel.org>,
Shaggy <dave.kleikamp@oracle.com>,
David Aldridge <david.j.aldridge@oracle.com>,
Rob Gardner <rob.gardner@oracle.com>,
Eric Saint-Etienne <eric.saintetienne@gmail.com>
Subject: Re: [PATCH] perf symbols: fix slowness due to -ffunction-section
Date: Wed, 21 Nov 2018 18:26:59 -0300 [thread overview]
Message-ID: <20181121212659.GA3067@kernel.org> (raw)
In-Reply-To: <1542822679-25591-1-git-send-email-eric.saint.etienne@oracle.com>
Em Wed, Nov 21, 2018 at 09:51:19AM -0800, Eric Saint-Etienne escreveu:
> Perf can take minutes to parse an image when -ffunction-section is used.
> This is especially true with the kernel image when it is compiled this way,
> which is the arm64 default since the patcheset "Enable deadcode elimination
> at link time".
>
> Perf organize maps using a rbtree. Whenever perf finds a new symbols, it
> first searches this rbtree for the map it belongs to, by strcmp()'aring
> section names. When it finds the map with the right name, it uses it to
> add the symbol. With a usual image there aren't so many maps but when using
> -ffunction-section there's basically one map per function.
> With the kernel image that's north of 40,000 maps. For most symbols perf
> has to parses the entire rbtree to eventually create a new map and add it.
> Consequently perf spends most of the time browsing a rbtree that keeps
> getting larger.
>
> This performance fix introduces a secondary rbtree that indexes maps based
> on the section name.
>
> Signed-off-by: Eric Saint-Etienne <eric.saint.etienne@oracle.com>
> Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> Reviewed-by: David Aldridge <david.aldridge@oracle.com>
> Reviewed-by: Rob Gardner <rob.gardner@oracle.com>
Looks sane, thanks to the multiple reviewers, really appreciated,
Applied.
- Arnaldo
next prev parent reply other threads:[~2018-11-21 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 17:51 [PATCH] perf symbols: fix slowness due to -ffunction-section Eric Saint-Etienne
2018-11-21 21:26 ` Arnaldo Carvalho de Melo [this message]
2018-11-22 7:15 ` [tip:perf/core] perf symbols: Fix " tip-bot for Eric Saint-Etienne
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=20181121212659.GA3067@kernel.org \
--to=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.co \
--cc=dave.kleikamp@oracle.com \
--cc=david.j.aldridge@oracle.com \
--cc=eric.saint.etienne@oracle.com \
--cc=eric.saintetienne@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rob.gardner@oracle.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.