linux-kernel-test/tools/perf
Masami Hiramatsu 981a23792c perf probe: Do not add offset twice to uprobe address
Fix perf-probe not to add offset value twice to uprobe probe address
when post processing.

The tevs[i].point.address struct member is the address of symbol+offset,
but current perf-probe adjusts the point.address by adding the offset.

As a result, the probe address becomes symbol+offset+offset. This may
cause unexpected code corruption. Urgent fix is needed.

Without this fix:
  ---
  # ./perf probe -x ./perf dso__load_vmlinux+4
  # ./perf probe -l
    probe_perf:dso__load_vmlinux (on 0x000000000006d2b8)
  # nm ./perf.orig | grep dso__load_vmlinux\$
  000000000046d0a0 T dso__load_vmlinux
  ---

You can see the given offset is 3 but the actual probed address is
dso__load_vmlinux+8.

With this fix:
  ---
  # ./perf probe -x ./perf dso__load_vmlinux+4
  # ./perf probe -l
    probe_perf:dso__load_vmlinux (on 0x000000000006d2b4)
  ---

Now the problem is fixed.

Note: This bug is introduced by
	commit fb7345bbf7

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: "David A. Long" <dave.long@linaro.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20140205051858.6519.27314.stgit@kbuild-fedora.yrl.intra.hitachi.co.jp
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-02-10 11:34:30 -03:00
..
arch perf tools: Introduce zfree 2013-12-27 15:17:00 -03:00
bench perf bench: Fix two warnings 2013-11-01 10:41:54 -03:00
config perf tools: Fix traceevent plugin path definitions 2014-01-23 15:48:12 -03:00
Documentation perf record: Rename --initial-delay to --delay 2014-01-14 17:58:12 -03:00
python perf python: Remove duplicate TID bit from mask 2013-08-07 17:35:25 -03:00
scripts perf tools: Finish the removal of 'self' arguments 2013-11-05 15:32:36 -03:00
tests perf tests: No need to set up ref_reloc_sym 2014-01-31 17:21:52 -03:00
ui perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
util perf probe: Do not add offset twice to uprobe address 2014-02-10 11:34:30 -03:00
.gitignore perf tools: Ignore 'perf timechart' output file 2013-10-11 12:17:37 -03:00
builtin-annotate.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-bench.c perf bench: Change the procps visible command-name of invididual benchmark tests plus cleanups 2013-10-23 09:57:34 -03:00
builtin-buildid-cache.c perf buildid-cache: Check relocation when checking for existing kcore 2014-01-31 17:21:54 -03:00
builtin-buildid-list.c perf session: Separating data file properties from session 2013-10-21 17:33:25 -03:00
builtin-diff.c perf diff: Color the Weighted Diff column 2014-01-13 11:38:25 -03:00
builtin-evlist.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-help.c perf help: Fix --help for builtins 2012-10-22 12:35:49 -02:00
builtin-inject.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-kmem.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-kvm.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-list.c perf list: Add usage 2013-11-05 14:26:41 -03:00
builtin-lock.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-mem.c perf mem: Remove unused parameter from dump_raw_samples() 2013-12-19 17:03:39 -03:00
builtin-probe.c perf probe: Release all dynamically allocated parameters 2014-01-16 16:29:02 -03:00
builtin-record.c perf record: Get ref_reloc_sym from kernel map 2014-01-31 17:21:50 -03:00
builtin-report.c perf tools: Factor out sample__resolve_callchain() 2014-01-15 15:32:43 -03:00
builtin-sched.c perf tools: Use zfree to help detect use after free bugs 2013-12-27 17:08:19 -03:00
builtin-script.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-stat.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-timechart.c perf timechart: Fix wrong SVG height 2014-01-20 16:19:08 -03:00
builtin-top.c perf tools: Factor out sample__resolve_callchain() 2014-01-15 15:32:43 -03:00
builtin-trace.c perf record: Rename --no-delay to --no-buffering 2014-01-14 17:57:04 -03:00
builtin.h perf tools: Add new mem command for memory access profiling 2013-04-01 12:21:44 -03:00
command-list.txt perf tools: Add new mem command for memory access profiling 2013-04-01 12:21:44 -03:00
CREDITS
design.txt perf/doc: Remove mention of non-existent set_perf_event_pending() from design.txt 2014-01-26 09:37:48 +01:00
Makefile perf tools: Add 'build-test' make target 2014-01-16 16:26:26 -03:00
Makefile.perf perf: tools: Fix cross building 2014-01-15 15:15:05 -03:00
MANIFEST perf tools: Include tools/lib/api/ in MANIFEST 2014-01-13 10:06:26 -03:00
perf-archive.sh perf archive: Make 'f' the last parameter for tar 2012-09-17 13:10:42 -03:00
perf-completion.sh perf completion: Complete 'perf kvm' 2013-12-13 10:30:21 -03:00
perf.c tools/: Convert to new topic libraries 2013-12-16 16:03:27 -03:00
perf.h perf tools: Fix AAAAARGH64 memory barriers 2014-01-29 15:50:57 -03:00