Skip to content

perf tools: Support out-of-tree modules

Namhyung Kim lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9perf symbols: Use absolute address to fixup map addresstools/perf/util/map.c+2 -20 replies
2/9perf tools: Remove duplicate codetools/perf/util/machine.c+0 -150 replies
3/9perf symbols: Discard symbols in kallsyms for loaded modulestools/perf/util/symbol.c+5 -42 replies
4/9perf symbols: Load kernel module symbols ASAPtools/perf/util/machine.c+3 -02 replies
5/9perf symbols: Fixup the end address of kernel map properlytools/perf/util/symbol.c+2 -22 replies
6/9perf symbols: Use already loaded module dso when loading kcoretools/perf/util/symbol.c+23 -222 replies
7/9perf tools: Add symbol_conf.use_kcoretools/perf/util/symbol.c tools/perf/util/symbol.h+4 -20 replies
8/9perf record: Not use kcore by defaulttools/perf/Documentation/perf-record.txt tools/perf/builtin-record.c tools/perf/perf-with-kcore.sh+9 -00 replies
9/9perf record: Add --module-dir optiontools/perf/Documentation/perf-record.txt tools/perf/builtin-record.c tools/perf/util/machine.c +1 more+21 -22 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCHSET/RFC 0/9] perf tools: Support out-of-tree modules

Hello,

Currently perf loads modules only in the canonical directory (/lib/modules/uname -r/). But in some situation users want to use local or out-of-tree modules which are not placed in the directory.

One example is developing kernel in a qemu environment. In this case, guest doesn't see vmlinux or modules but one can load a module in some directory which was copied separately. During the development, the module can be unloaded, fixed and reloaded more than once.

I notice that perf uses symbols in /proc/kallsyms (and /proc/kcore) and it sometimes shows different result with a same data file. This was due to a same module being loaded at a different address or a reworked module being loaded at a same address.

I think it needs to use build-id cache if possible. To do that we need to add an option to search modules and to save them in the build-id cache automatically.

The code is available on 'perf/kmod-dir-v1' branch at

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (9):
perf symbols: Use absolute address to fixup map address perf tools: Remove duplicate code
perf symbols: Discard symbols in kallsyms for loaded modules perf symbols: Load kernel module symbols ASAP
perf symbols: Fixup the end address of kernel map properly perf symbols: Use already loaded module dso when loading kcore perf tools: Add symbol_conf.use_kcore
perf record: Not use kcore by default
perf record: Add --module-dir option

 tools/perf/Documentation/perf-record.txt |  6 ++++
 tools/perf/builtin-record.c              |  7 ++++
 tools/perf/perf-with-kcore.sh            |  1 +
 tools/perf/util/machine.c                | 33 ++++++++---------
 tools/perf/util/map.c                    |  4 +--
 tools/perf/util/symbol.c                 | 61 +++++++++++++++++---------------
 tools/perf/util/symbol.h                 |  6 ++--
 7 files changed, 69 insertions(+), 49 deletions(-)
Signature · 1 line
2.13.1