kernel-ark/tools/perf
Stephane Eranian ac5e7f84c0 perf symbols: Fix bug in usage of the basename() function
The basename() implementation varies a lot between systems.

The Linux man page says: "basename may modify the content of the path,
so it may be desirable to pass a copy when calling the function".

On some other systems, the returned address may come from an internal
buffer which can be reused in subsequent calls, thus the results should
also be copied.

The dso__set_basename() function was not doing this causing problems
on some systems with wrong library names being shown by perf report,
such as on Android systems.

This patch fixes the problem.
The patch is relative to tip.git.

In v2, we clean up the comments based on Ingo's feedback.

Reported-by: Ben Cheng <bccheng@google.com>
Signed-off-by: Stephane Eranian <eranian@google.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ben Cheng <bccheng@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131205182642.GA14614@quad
[ v3: Fixed up wrt allocated flag now being set in dso__set_short_name ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10 16:51:11 -03:00
..
arch Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
bench perf bench: Fix two warnings 2013-11-01 10:41:54 -03:00
config perf tools: Add build and install plugins targets 2013-12-04 15:19:35 -03:00
Documentation perf script: Add --header/--header-only options 2013-12-10 16:51:07 -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 record: Make per-cpu mmaps the default. 2013-11-27 14:58:36 -03:00
ui perf ui browser: Fix segfault caused by off by one handling END key 2013-11-14 16:00:31 -03:00
util perf symbols: Fix bug in usage of the basename() function 2013-12-10 16:51:11 -03:00
.gitignore perf tools: Ignore 'perf timechart' output file 2013-10-11 12:17:37 -03:00
builtin-annotate.c perf annotate: Fix typo 2013-12-09 15:22:21 -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 tools: Add data object to handle perf data file 2013-10-21 17:33:24 -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 kvm: Make perf kvm diff support --guestmount. 2013-12-09 15:24:25 -03:00
builtin-evlist.c perf tools: Add data object to handle perf data file 2013-10-21 17:33:24 -03:00
builtin-help.c perf help: Fix --help for builtins 2012-10-22 12:35:49 -02:00
builtin-inject.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-kmem.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-kvm.c perf kvm: Move code to generate filename for perf-kvm to function. 2013-12-09 15:23:56 -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 tools: Add data object to handle perf data file 2013-10-21 17:33:24 -03:00
builtin-probe.c perf probe: Add '--demangle'/'--no-demangle' 2013-11-14 16:06:28 -03:00
builtin-record.c perf record: Fix display of incorrect mmap pages 2013-12-09 15:17:23 -03:00
builtin-report.c perf report: Add --header/--header-only options 2013-12-10 16:49:02 -03:00
builtin-sched.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-script.c perf script: Add --header/--header-only options 2013-12-10 16:51:07 -03:00
builtin-stat.c tools/perf/stat: Add event unit and scale support 2013-11-27 11:16:39 +01:00
builtin-timechart.c perf timechart: Move wake_events list to 'struct timechart' 2013-12-02 09:22:47 -03:00
builtin-top.c perf symbols: Move idle syms check from top to generic function 2013-11-27 14:58:37 -03:00
builtin-trace.c perf trace: Fix summary percentage when processing files 2013-12-05 10:09:58 -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 tools: Update ioctl documentation for PERF_IOC_FLAG_GROUP 2012-05-31 11:38:42 -03:00
Makefile perf tools: Fix tags/TAGS targets rebuilding 2013-11-27 16:47:14 -03:00
Makefile.perf perf tools: Add trace-event object 2013-12-04 15:20:52 -03:00
MANIFEST perf tools: Introduce tools/lib/lk library 2013-03-15 13:06:00 -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: Rename file to reflect zsh support 2013-11-27 14:58:35 -03:00
perf.c perf trace: Add 'trace' alias to 'perf trace' 2013-10-11 12:17:10 -03:00
perf.h perf record: Default -t option to no inheritance 2013-11-27 14:58:36 -03:00