* [GIT PULL 0/1] perf/urgent fix
@ 2017-03-17 14:03 Arnaldo Carvalho de Melo
2017-03-17 14:03 ` [PATCH 1/1] perf symbols: Fix symbols__fixup_end heuristic for corner cases Arnaldo Carvalho de Melo
2017-03-17 14:14 ` [GIT PULL 0/1] perf/urgent fix Ingo Molnar
0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-17 14:03 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexei Starovoitov,
Daniel Borkmann, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit d8a8cfc76919b6c830305266b23ba671623f37ff:
perf/core: Better explain the inherit magic (2017-03-16 14:16:53 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-4.11-20170317
for you to fetch changes up to e7ede72a6d40cb3a30c087142d79381ca8a31dab:
perf symbols: Fix symbols__fixup_end heuristic for corner cases (2017-03-17 10:30:22 -0300)
----------------------------------------------------------------
perf/urgent fix
- Fix symbols__fixup_end heuristic for corner cases, such as JITted eBPF
programs, that are loaded at page aligned addresses, just after the
kernel proper (Daniel Borkmann)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Daniel Borkmann (1):
perf symbols: Fix symbols__fixup_end heuristic for corner cases
tools/perf/util/symbol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] perf symbols: Fix symbols__fixup_end heuristic for corner cases
2017-03-17 14:03 [GIT PULL 0/1] perf/urgent fix Arnaldo Carvalho de Melo
@ 2017-03-17 14:03 ` Arnaldo Carvalho de Melo
2017-03-17 14:14 ` [GIT PULL 0/1] perf/urgent fix Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-17 14:03 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, Daniel Borkmann, Arnaldo Carvalho de Melo
From: Daniel Borkmann <daniel@iogearbox.net>
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.
Reported-and-Tested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Fixes: 2e538c4a1847 ("perf tools: Improve kernel/modules symbol lookup")
Link: http://lkml.kernel.org/r/bb5c80d27743be6f12afc68405f1956a330e1bc9.1489614365.git.daniel@iogearbox.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 70e389bc4af7..9b4d8ba22fed 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -202,7 +202,7 @@ void symbols__fixup_end(struct rb_root *symbols)
/* Last entry */
if (curr->end == curr->start)
- curr->end = roundup(curr->start, 4096);
+ curr->end = roundup(curr->start, 4096) + 4096;
}
void __map_groups__fixup_end(struct map_groups *mg, enum map_type type)
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [GIT PULL 0/1] perf/urgent fix
2017-03-17 14:03 [GIT PULL 0/1] perf/urgent fix Arnaldo Carvalho de Melo
2017-03-17 14:03 ` [PATCH 1/1] perf symbols: Fix symbols__fixup_end heuristic for corner cases Arnaldo Carvalho de Melo
@ 2017-03-17 14:14 ` Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2017-03-17 14:14 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Alexei Starovoitov, Daniel Borkmann,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit d8a8cfc76919b6c830305266b23ba671623f37ff:
>
> perf/core: Better explain the inherit magic (2017-03-16 14:16:53 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-4.11-20170317
>
> for you to fetch changes up to e7ede72a6d40cb3a30c087142d79381ca8a31dab:
>
> perf symbols: Fix symbols__fixup_end heuristic for corner cases (2017-03-17 10:30:22 -0300)
>
> ----------------------------------------------------------------
> perf/urgent fix
>
> - Fix symbols__fixup_end heuristic for corner cases, such as JITted eBPF
> programs, that are loaded at page aligned addresses, just after the
> kernel proper (Daniel Borkmann)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Daniel Borkmann (1):
> perf symbols: Fix symbols__fixup_end heuristic for corner cases
>
> tools/perf/util/symbol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Pulled, thanks Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-17 14:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-17 14:03 [GIT PULL 0/1] perf/urgent fix Arnaldo Carvalho de Melo
2017-03-17 14:03 ` [PATCH 1/1] perf symbols: Fix symbols__fixup_end heuristic for corner cases Arnaldo Carvalho de Melo
2017-03-17 14:14 ` [GIT PULL 0/1] perf/urgent fix Ingo Molnar
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.