From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: acme@kernel.org, ast@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf: fix symbols__fixup_end heuristic for corner cases
Date: Thu, 16 Mar 2017 11:08:52 -0700 [thread overview]
Message-ID: <20170316180850.GA59520@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <bb5c80d27743be6f12afc68405f1956a330e1bc9.1489614365.git.daniel@iogearbox.net>
On Wed, Mar 15, 2017 at 10:53:37PM +0100, Daniel Borkmann wrote:
> The current symbols__fixup_end() heuristic for the last entry in the
> rb tree is suboptimal as it leads to not being able to recognize the
> symbol in the call graph in a couple of corner cases, for example:
>
> i) If the symbol has a start address (f.e. exposed via kallsyms)
> that is at a page boundary, then the roundup(curr->start, 4096)
> for the last entry will result in curr->start == curr->end with
> a symbol length of zero.
>
> ii) If the symbol has a start address that is shortly before a page
> boundary, then also here, curr->end - curr->start will just be
> very few bytes, where it's unrealistic that we could perform a
> match against.
>
> Instead, change the heuristic to roundup(curr->start, 4096) + 4096,
> so that we can catch such corner cases and have a better chance to
> find that specific symbol. It's still just best effort as the real
> end of the symbol is unknown to us (and could even be at a larger
> offset than the current range), but better than the current situation.
>
> Alexei reported that he recently run into case i) with a JITed eBPF
> program (these are all page aligned) as the last symbol which wasn't
> properly shown in the call graph (while other eBPF program symbols
> in the rb tree were displayed correctly). Since this is a generic
> issue, lets try to improve the heuristic a bit.
>
> Fixes: 2e538c4a1847 ("perf tools: Improve kernel/modules symbol lookup")
> Reported-by: Alexei Starovoitov <ast@kernel.org>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Alexei Starovoitov <ast@kernel.org>
thanks!
next prev parent reply other threads:[~2017-03-16 18:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 21:53 Daniel Borkmann
2017-03-16 1:07 ` Arnaldo Carvalho de Melo
2017-03-16 9:07 ` Daniel Borkmann
2017-03-16 18:08 ` Alexei Starovoitov [this message]
2017-03-17 14:19 ` [tip:perf/urgent] perf symbols: Fix " tip-bot for Daniel Borkmann
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=20170316180850.GA59520@ast-mbp.thefacebook.com \
--to=alexei.starovoitov@gmail.com \
--cc=acme@kernel.org \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®