remarkable-linux/tools/perf
He Kuang 0560a0c4a1 perf probe: Fix failure to add multiple probes without debuginfo
Perf tries to find probe function addresses from map when debuginfo
could not be found.

To the first added function, the value of ref_reloc_sym was set in
maps__set_kallsyms_ref_reloc_sym() and can be obtained from
host_machine->kmaps->maps. After that, new maps are added to
host_machine->kmaps->maps in dso__load_kcore(), all these new added maps
do not have a valid ref_reloc_sym.

When adding a second function, get_target_map() may get a map without
valid ref_reloc_sym, and raise the error "Relocated base symbol is not
found".

Fix this by using kernel_get_ref_reloc_sym() to get ref_reloc_sym.

This problem can be reproduced as following:

  $ perf probe --add='sys_write' --add='sys_open'
  Relocated base symbol is not found!
    Error: Failed to add events.

After this patch:

  $ perf probe --add='sys_write' --add='sys_open'
  Added new event:
    probe:sys_write      (on sys_write)

  You can now use it in all perf tools, such as:

      perf record -e probe:sys_write -aR sleep 1

  Added new event:
    probe:sys_open       (on sys_open)

  You can now use it in all perf tools, such as:

      perf record -e probe:sys_open -aR sleep 1

Signed-off-by: He Kuang <hekuang@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1426816616-2394-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-03-21 14:53:21 -03:00
..
arch perf build: Add arch sparc objects building 2015-02-12 13:22:01 -03:00
bench Merge 'tip/perf/urgent' into perf/core to pick fixes 2015-03-02 11:45:49 -03:00
config perf build: Add config/feature-checks/*.output to the .gitignore file 2015-03-20 17:49:52 -03:00
Documentation perf kmem: Allow -v option 2015-03-13 07:47:48 -03:00
python
scripts perf build: Add scripts objects building 2015-02-12 11:49:53 -03:00
tests perf tools: Add the bash completion for listing subsubcommands of perf test 2015-03-19 13:52:54 -03:00
ui perf hists browser: Allow annotating entries in callchains 2015-03-17 18:27:28 -03:00
util perf probe: Fix failure to add multiple probes without debuginfo 2015-03-21 14:53:21 -03:00
.gitignore perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file 2015-03-20 17:49:51 -03:00
Build perf tools: Add new 'perf data' command 2015-02-25 12:42:25 -03:00
builtin-annotate.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-bench.c
builtin-buildid-cache.c perf buildid-cache: Show usage with incorrect params 2015-02-27 15:52:40 -03:00
builtin-buildid-list.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-data.c perf tools: Add the bash completion for listing subsubcommands of perf data 2015-03-19 13:49:38 -03:00
builtin-diff.c perf tools: Don't allow empty argument for field-separator 2015-03-20 17:49:51 -03:00
builtin-evlist.c perf tools: Modify error code for when perf_session__new() fails 2014-09-26 12:32:58 -03:00
builtin-help.c perf tools: Add the bash completion for listing subsubcommands of perf help 2015-03-19 13:49:39 -03:00
builtin-inject.c perf tools: tool->finished_round() doesn't need perf_session 2015-03-12 12:39:49 -03:00
builtin-kmem.c perf kmem: Fix alignment of slab result table 2015-03-13 07:47:48 -03:00
builtin-kvm.c perf tools: tool->finished_round() doesn't need perf_session 2015-03-12 12:39:49 -03:00
builtin-list.c perf list: Extend raw-dump to certain kind of events 2015-02-27 15:52:24 -03:00
builtin-lock.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-mem.c perf tools: Don't allow empty argument for field-separator 2015-03-20 17:49:51 -03:00
builtin-probe.c perf probe: Add --quiet option to suppress output result message 2014-10-29 10:32:49 -02:00
builtin-record.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-report.c perf report: Don't allow empty argument for '-t'. 2015-03-19 13:53:28 -03:00
builtin-sched.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-script.c perf tools: Add the bash completion for listing subsubcommands of perf script 2015-03-19 13:49:39 -03:00
builtin-stat.c perf stat: Always correctly indent ratio column 2015-03-13 07:47:44 -03:00
builtin-timechart.c perf tools: Add the bash completion for listing subsubcommands of perf timechart 2015-03-19 13:53:25 -03:00
builtin-top.c perf evlist: Adopt events_stats from perf_session 2015-02-22 22:22:57 -03:00
builtin-trace.c perf tools: Add the bash completion for listing subsubcommands of perf trace 2015-03-19 13:53:26 -03:00
builtin.h perf tools: Add new 'perf data' command 2015-02-25 12:42:25 -03:00
command-list.txt perf tools: Add new 'perf data' command 2015-02-25 12:42:25 -03:00
CREDITS
design.txt
Makefile perf tools: Compare JOBS to 0 after grep 2015-03-02 11:51:00 -03:00
Makefile.perf perf build: Rename PERF-FEATURES into FEATURE-DUMP 2015-03-18 15:10:44 -03:00
MANIFEST tools build: Add new build support 2015-02-11 18:30:03 -03:00
perf-archive.sh
perf-completion.sh perf tools: Avoid confusion with preloaded bash function for perf bash completion 2015-03-19 13:53:27 -03:00
perf-read-vdso.c perf tools: Build programs to copy 32-bit compatibility 2014-10-29 10:32:48 -02:00
perf-sys.h perf tools: Avoid build splat for syscall numbers with uclibc 2015-01-16 17:49:29 -03:00
perf-with-kcore.sh perf tools: Add perf-with-kcore script 2014-09-17 17:08:08 -03:00
perf.c perf tools: Fix the bash completion problem of 'perf --*' 2015-02-27 15:52:28 -03:00
perf.h perf record: Support recording running/enabled time 2015-02-25 12:42:23 -03:00