linux-stable/tools/perf
Namhyung Kim 1deec1bd96 perf header: Set proper module name when build-id event found
When perf processes build-id event, it creates DSOs with the build-id.
But it didn't set the module short name (like '[module-name]') so when
processing a kernel mmap event of the module, it cannot found the DSO as
it only checks the short names.

That leads for perf to create a same DSO without the build-id info and
it'll lookup the system path even if the DSO is already in the build-id
cache.  After kernel was updated, perf cannot find the DSO  and cannot
show symbols in it anymore.

You can see this if you have an old data file (w/ old kernel version):

  $ perf report -i perf.data.old -v |& grep scsi_mod
  build id event received for /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz : cafe1ce6ca13a98a5d9ed3425cde249e57a27fc1
  Failed to open /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz, continuing without symbols
  ...

The second message didn't show the build-id.  With this patch:

  $ perf report -i perf.data.old -v |& grep scsi_mod
  build id event received for /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz: cafe1ce6ca13a98a5d9ed3425cde249e57a27fc1
  /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz with build id cafe1ce6ca13a98a5d9ed3425cde249e57a27fc1 not found, continuing without symbols
  ...

Now it shows the build-id but still cannot load the symbol table.  This
is a different problem which will be fixed in the next patch.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170531120105.21731-1-namhyung@kernel.org
[ Fix the build on older compilers (debian <= 8, fedora <= 21, etc) wrt kmod_path var init ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-06-05 14:16:49 -03:00
..
arch perf annotate: Fix AArch64 comment char 2017-05-04 10:03:00 -03:00
bench perf tools: Move extra string util functions to util/string2.h 2017-04-19 13:01:51 -03:00
Documentation perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
jvmti
pmu-events perf vendor events intel: Add missing space in json descriptions 2017-03-30 13:35:50 -07:00
python
scripts
tests perf tests kmod-path: Don't fail if compressed modules aren't supported 2017-05-04 10:05:55 -03:00
trace perf tools: Add signal.h to places using its definitions 2017-04-20 13:22:43 -03:00
ui perf tools: Put caller above callee in --children mode 2017-05-24 08:41:49 +02:00
util perf header: Set proper module name when build-id event found 2017-06-05 14:16:49 -03:00
.gitignore perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git 2017-03-13 10:59:36 -03:00
Build perf trace: Beautify statx syscall 'flag' and 'mask' arguments 2017-03-31 14:42:31 -03:00
builtin-annotate.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-bench.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-buildid-cache.c perf symbols: Accept symbols starting at address 0 2017-05-02 18:23:04 -03:00
builtin-buildid-list.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-c2c.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
builtin-config.c perf config: Refactor a duplicated code for obtaining config file name 2017-05-02 18:23:12 -03:00
builtin-data.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-diff.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-evlist.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-ftrace.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-help.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin-inject.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-kallsyms.c perf tools: Including missing inttypes.h header 2017-04-19 13:01:46 -03:00
builtin-kmem.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-kvm.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-list.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-lock.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-mem.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-probe.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00
builtin-record.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-report.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin-sched.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-script.c perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
builtin-stat.c perf stat: Only print NMI watchdog hint when enabled 2017-06-02 11:15:34 -03:00
builtin-timechart.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-top.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
builtin-trace.c perf trace: Add mmap alias for s390 2017-06-01 10:13:21 -03:00
builtin-version.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin.h perf tools: Remove stale prototypes from builtin.h 2017-04-24 13:43:33 -03:00
check-headers.sh tools include uapi: Grab copies of stat.h and fcntl.h 2017-03-31 11:26:03 -03:00
command-list.txt perf tools: Missing c2c command in command-list 2017-03-13 10:59:31 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf tools: Disable JVMTI if no ELF support available 2017-04-13 11:47:43 -03:00
Makefile.perf perf build: Add special fixdep cleaning rule 2017-02-17 16:04:38 -03:00
MANIFEST tools include: Introduce linux/bug.h, from the kernel sources 2017-04-19 13:01:42 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
perf.h perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info 2017-03-14 11:38:23 -03:00