[PATCH perf/core v2 0/5] perf-probe: improve glibc support

From: Masami Hiramatsu
Date: Fri Mar 06 2015 - 02:32:31 EST


Hi,

Here is a series of patches which improves perf-probe to
handle glibc's aliased symbols and weak symbols more
correctly.

This version includes 2 new patches from Namhyung (Thanks!)
which solves a problem on weak symbols. I added a fix
on his latter patch to modify find_alternative_probe_point,
and dropped a bugfix which is already merged.
So, this series is a merged series of below 2 series.

http://lkml.kernel.org/g/20150302124939.9191.33564.stgit@xxxxxxxxxxxxxxxxxxxxx
http://lkml.kernel.org/g/1425477143-5310-1-git-send-email-namhyung@xxxxxxxxxx

======
A major known issue of probing on glibc is that the
some aliased symbols(e.g. malloc) and weak symbols
(e.g. calloc) can not find by perf-probe.

Actually, glibc's malloc symbol is just an alias of
__libc_malloc. Its debuginfo knows only __libc_malloc,
and perf's symbol map knows only malloc. This difference
always confuses users that they can see malloc by perf
report or annotate, but they can not probe on it, nor
find definitions by --line option.

And weak symbols have been dropped when loading.

Previously, I've made a commit 906451b98b67 which solved
this problem partly, but not completely fixed.
So I decided to solve this issue completely by finding
the symbols like malloc from perf's symbol map, and
converting the symbol's address into debuginfo's
location infomation.

With this series, you can use --vars, --line and --add
with the aliased symbols and weak symbols on glibc.

Thank you,


---

Masami Hiramatsu (3):
perf-probe: Fix to handle aliased symbols in glibc
perf-probe: Fix --line to handle aliased symbols in glibc
Revert "perf probe: Fix to fall back to find probe point in symbols"

Namhyung Kim (2):
perf symbols: Allow symbol alias when loading map for symbol name
perf probe: Allow weak symbols to be probed


tools/perf/util/machine.c | 2
tools/perf/util/map.c | 6 +
tools/perf/util/map.h | 8 +-
tools/perf/util/probe-event.c | 185 +++++++++++++++++++++++++++++++++-----
tools/perf/util/symbol-elf.c | 5 +
tools/perf/util/symbol-minimal.c | 2
tools/perf/util/symbol.c | 8 +-
tools/perf/util/symbol.h | 5 +
8 files changed, 182 insertions(+), 39 deletions(-)

--
Masami HIRAMATSU
Software Platform Research Dpt. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/